agentleFS
fonderiejsfonderiejs/fonderie/.claude/skills/client-wiring-audit/SKILL.md

client-wiring-audit

Skill5 starsChanged 18 days agoMITView on GitHub

Use when auditing, building or fixing a React or React Native screen that reads or writes Fonderie data — members, invitations, roles/permissions, workspace profile, customers, billing, or any app resource behind a @fonderie hook. Covers whether the screen uses the package hook (not a hand-rolled fetch or a Redux copy), whether every action the UI offers is one the server allows, and whether loading / empty / error / confirmation / i18n / accessibility / workspace-switch states are handled. Triggers on "audit this screen", "is X properly wired", "why does this button 403", "screen shows stale data", "wire this screen to fonderie", or before declaring a client screen done.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

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

    Write down the guard: requireAuth, withWorkspace, requireManager, requirePermission(op, resource), or none.

    line 21
  2. Distinctive:

    Ask: who sees this control, and would the server accept it from them?

    line 23
  3. Very specific:

    Every mutation either shows its error or deliberately ignores it with a comment saying why.

    line 49
  4. Distinctive:

    Every visible string comes from the app's dictionary, in every locale the app ships, including alerts, chip values, enum labels and plurals.

    line 68
  5. Very specific:

    When the right fix is in a package (a missing guard, hook, field, route, or a screen in *-screens), report it as a package finding with the …

    line 75

≈ “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

Client wiring audit

A screen is wired when three things agree: what the server enforces, what the hook exposes, and what the UI offers. Most real defects are a disagreement between two of them — a button the server refuses, a capability the hook has that no screen reaches, a field the UI shows that is never saved.

Audit by reading the three layers side by side, never the UI alone.

1. Trace every action to its route

For each button, switch, swipe and form on the screen:

  1. Find the hook method it calls, then the client method, then the route (packages/<brick>/src/routes.ts) and its middleware chain.
  2. Write down the guard: requireAuth, withWorkspace, requireManager, requirePermission(op, resource), or none.
  3. Ask: who sees this control, and would the server accept it from them?

Record each mismatch:

UI offers it toServer allowsDefect
everyonemanagers onlybutton that 403s — gate it (useCan / manager check)
everyoneeveryone, but should notmissing server guard — fix the brick, not the UI
nobody (no UI)route + hook existunreachable capability — note it, decide if the app needs it

A UI gate is a courtesy; the server guard is the security. Never fix a missing server guard by hiding a button.

2. One source of truth for reads

  • Reads come from the package hook (useScopedQuery-backed), keyed by workspace. A Redux/Zustand copy of hook data, a useEffect + fetch, or an app-side re-declaration of the package's DTO types is drift waiting to happen — list each one with the hook that replaces it.
  • Workspace switch: data from workspace A must never render in B. Check that every read is scoped and that in-memory form state (pickers, drafts) is reset or keyed by workspace.
  • A detail screen should not mount a list query just to reach an action.

3. Writes: no silent outcomes

  • Every mutation either shows its error or deliberately ignores it with a comment saying why. catch {} with nothing else is a finding.
  • Destructive actions (delete, remove member, revoke, blacklist, cancel) confirm first and name the thing being destroyed.
  • Multi-request writes (create parent then children) report which part failed, or the brick needs a single endpoint.
  • Saving while the screen's data is still loading must be impossible (a form that shows defaults before the read lands can overwrite real data).

4. States

For the screen and each section: loading (skeleton or spinner, never null — a blank screen reads as broken), empty (says what to do next), error (retry), not found / no access (a removed member, a deleted record, a wrong workspace must not spin forever), offline (cached data shown with its age, writes blocked or queued — never silently lost).

5. Text and access

  • Every visible string comes from the app's dictionary, in every locale the app ships, including alerts, chip values, enum labels and plurals.
  • Icon-only controls have an accessibility label and role.
  • Colors come from the theme; hard-coded hex breaks dark mode.

6. Package gaps

When the right fix is in a package (a missing guard, hook, field, route, or a screen in *-screens), report it as a package finding with the file and line, and check the same gap in the React, React Native and Vue packages — parity is part of the fix. Then use endpoint-to-clients for route changes and shipping-fonderie to release.

Report format

One table per area, most severe first:

#SeverityFindingEvidence (path:line)Owner

Severity: blocker (a core flow fails or data is lost / exposed), should-fix (wrong but survivable), nice. Owner: package / app / app API. State what you did not check (e.g. "read the code, did not run it").

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.