client-methods
Installation
SKILL.md
Client Methods
Rule
Browser/client code imports named methods, hooks, or client modules instead of hand-writing REST calls to framework or app routes.
Why
Route shapes are transport details. If components and docs call
fetch("/_agent-native/...") or template /api/* routes directly, every caller
has to rediscover auth, base paths, request-source headers, JSON parsing, error
handling, optimistic updates, sync invalidation, and route quirks. A named client
method gives the UI, docs, and future agents one stable contract.
How
- Look for an existing client API first.