agentleFS
fonderiejsfonderiejs/fonderie/.claude/skills/endpoint-to-clients/SKILL.md

endpoint-to-clients

Skill5 starsChanged 18 days agoMITView on GitHub

Use whenever you add, rename, or change a backend HTTP route in a @fonderie/* package — especially a public/unauthenticated one a login or marketing screen would call. Covers propagating it to @fonderie/client and the React, React Native, and Vue hook packages, and the pre-built screens. Triggers on "add a route", "new endpoint", "expose this to the frontend", "app.addRoute", "buildXRoutes", or when check:hook-coverage / check:routes fails.

  • Installs packages

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Every step needs its export added to the package's index.ts.

    line 26
  2. Very specific:

    Check the package's index.ts before assuming it inherits.

    line 56

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

A route is not shipped until every client can call it

Adding a route to a package is the first of four or five steps. Stop after the first and you have written something no application can reach — and this repo's gates will say so, but only for part of it.

The propagation path

packages/<brick>/src/routes.ts        ← the route
        ↓
packages/client/src/modules/<brick>.ts    ← typed method  (+ result type in types.ts)
        ↓
packages/react-<brick>/src/hooks/          ← hook
packages/react-native-<brick>/             ← hook OR a wholesale re-export
packages/vue-<brick>/src/composables/      ← composable
        ↓
packages/react-<brick>-screens/            ← only if a shipped screen should use it

Every step needs its export added to the package's index.ts. Adding the file is not enough — several of these packages export from an explicit list.

The two gates, and the hole between them

  • check:routes — every client method resolves to a real server route. Catches a client calling something that does not exist.
  • check:hook-coverage — two legs: every route is client-reachable, and every client method has a hook.
  • check:hook-parity — every React hook is reachable from its React Native and Vue siblings, either through a wholesale re-export or its own copy.

The third gate exists because the second had a hole: hook-coverage searches all hook files concatenated and asks whether the name appears anywhere, so a hook in react-auth alone satisfied it. useAuthProviders shipped to react-auth and vue-auth and was absent from react-native-auth — whose version still bumped through a dependency change, so it looked current and was missing the API. check:hook-parity now fails on exactly that.

Re-export vs. own implementation

Which one a package does is per-package, and assuming is how the above happened:

  • react-native-billing, -workspaces, -audit, -webhooks, -customers re-export their React sibling wholesale — nothing to do, they inherit.
  • react-native-auth defines its own hooks (they persist tokens to AsyncStorage) and exports them from an explicit list — a new react-auth hook does not appear automatically.

Check the package's index.ts before assuming it inherits.

Public routes deserve extra care

A public, unauthenticated route is one a login screen calls before anyone has signed in. Two things follow:

  • Return the minimum. Assert it in a test: configure the module with secrets and confirm the response body contains none of them.
  • Decide the failure posture. A hook that answers "unknown" should degrade to the safe option, not the optimistic one. useAuthProviders starts EMPTY and falls back to empty on error: a moment with no social buttons is invisible, a button that appears and then dead-ends is not.

Verify the published artifact, not the version

A version bump can come from a dependency change, so a current version number is not evidence the API is present:

npm install @fonderie/<pkg>@<version>
grep -rl "<theSymbol>" node_modules/@fonderie/<pkg>/dist

Empty output means the symbol is not there, whatever the version says. See verify-honestly.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.