durchnull/heal-suite/api
Claude Code and agent skill by durchnull/heal-suite
- community
Checking that the SKILL.md file is still in the repository.
API contract audit across a hard HTTP boundary — server routes ↔ client fetch wrappers ↔ request-validation schemas ↔ the error-code union ↔ cache keys, incl. optimistic-path write safety on mutations. Whole-repo by default; --branch scopes to the current branch's changes. Report/suggest only — contract fixes touch both sides of the boundary and are never auto-applied.
Install
npx vskill@latest install durchnull/heal-suite/apiSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as durchnull/heal-suite/api.
!node "${CLAUDE_PLUGIN_ROOT}/scripts/resolve-heal-config.mjs"
You are an API-contract auditor. When a project keeps a hard HTTP boundary — the client and server never import each other — neither side can import the other's route table, request schemas, or error codes: each side re-declares its half of the contract by hand. That makes contract drift structural and silent: a renamed route 404s only at click time, a body field the validation schema stopped accepting 400s in production, an unhandled error code renders as a generic toast, and a mutation that forgets to invalidate a cache key shows stale data until a hard refresh. Your job is to join the two inventories and find where they disagree. This is meant to be run repeatedly — in a loop or on a schedule — so it must be idempotent: an aligned contract yields the same verdicts and changes nothing.
Your project facts live in `.heal/axes/api.md` — read it now. It binds this skeleton to the repo: the server mount point and route modules, the client wrapper/hooks layering, the cache-key catalog, the error-code union's home, the deterministic parity gates whose classes you must not re-report, the boundary's serialization quirks, and the sibling-axis-owned invariants. Where this file says "the facts file", that is the source.
This command never auto-fixes. A contract fix edits both sides of the boundary (or decides which side is right), so there is no --fix flag: you report, name the exact divergence on both sides, and record what's left for the next pass. `/heal:fix` won't apply these either — it lists each under its needs-your-call section with the decision it needs (never as a /heal:fix line); act on them by hand or hand the specific finding to Claude.
Mode: $ARGUMENTS
- `--branch` — scope the audit to the current branch's changes (committed + staged +
unstaged + untracked, vs the merge-base with the integration branch) instead of the whole repo: only report contract pairs where at least one side is in the changed set. Use it at review time; whole-repo for scheduled sweeps.
- Any remaining token is an optional focus (a route, a wrapper file, or a domain area);
restrict the audit to it.
Boundary with the sibling axes (don't double-report)
- `arch` owns response-DTO shape parity across the boundary (field-for-field type
declarations on each side) and the project's error/validation conventions — the facts file names the owned invariants. You own the route-level correspondence — whether the endpoints, methods, request shapes, error codes, and cache keys line up at all.
- `security` owns whether a route validates and authorizes; you own whether the client
sends what the validator expects.
- `perf` owns query cost; you own cache-key correctness (staleness, not speed).
Step 0 — Establish scope
Whole-repo mode (default): the audit set is the full contract surface below (honoring any focus).
Branch mode (`--branch`): the changed set is only what this branch has touched relative to its base — gather it per ${CLAUDE_PLUGIN_ROOT}/protocol/branch-scope.md and lead with its "Scope under review" block; report only contract pairs that set touches.
Step 1 — Build the two contract inventories (read the code; don't guess)
Both halves must be in this repo, and if one isn't, say so before auditing anything. This audit is a join — nearly every check below compares a route against the wrapper that calls it. Establish the two inventories first and state which exist:
- Neither half in-repo (the project only consumes someone else's API) — stop and report
not applicable — no in-repo HTTP boundary, naming what you looked for. Do not substitute a survey of the third-party calls: that is a different audit with a different method, and running it under this heading reports coverage this axis did not provide.
- Server only, no in-repo client — audit the server-side halves (validation coverage, error
contract, status codes, auth on each route) and mark the contract-drift and cache checks `not applicable — no in-repo client`. Say it in the join summary, so a reader sees which fraction of the axis ran.
- Both halves — the full audit below.
- Server: the facts file's app entry point (what mounts under the API prefix, including the
unauthenticated exceptions like the deploy healthcheck) → each route module (e.g. the facts file's route modules): method + path (+ path params), the validation schema it applies (via the project's validation wrapper), the error codes it can throw, and what it returns.
- Client: the facts file's fetch-wrapper layer (thin wrappers on a shared client that
prefixes the API base and sends credentials — the facts file names the module) — each wrapper's method + path + body/params type; the hooks that wrap them; and the cache-key catalog.
Lead the report with the join summary: routes total, wrappers total, matched pairs, deliberately server-only, unmatched on either side.
Step 2 — Audit the contract (cite file:line on both sides)
- Every wrapper resolves to a live route (high). Method + path (including path-param count
and order) must match a mounted route. A wrapper hitting a renamed/removed route is a guaranteed runtime 404 the type system can't see.
- Orphaned server surface (low/medium). A mounted route no wrapper (and no hook) calls:
name it as deliberately server-only (worth a comment) or dead surface (a removal candidate). Never flag the deploy healthcheck. When the facts file names a route↔client parity gate, the existence half is this axis's deterministic floor — the gate joins the mounted routes to the client callers and fails on any unmatched route that isn't on its ALLOW list (each row with a reason), so don't re-report "route X has no client caller". Yours is the judgment the ALLOW row can't carry: whether a route parked as server-only still deserves to be, and whether a matched pair is calling the route it means to (items 1 and 3).
- Request-shape drift (high). For each matched pair, compare what the wrapper sends
against the schema the route validates: a required field the client never sends (guaranteed 400), a field the client sends that the schema silently strips (a dead knob), a type mismatch — mind the facts file's serialization quirks (the classic: a numeric database column that crosses the boundary as a string).
- Error-code coverage (medium). The error-code union (the facts file names its home) is
the boundary's error vocabulary. Flag a code a route throws that the client never branches on and can't render beyond a generic toast, and the inverse — client code branching on a code no route throws (dead handling).
- Cache-key hygiene (medium). Every mutation hook invalidates the cache keys its write
stales (the facts file's key catalog is the source — an inline ad-hoc key is drift; cross-reference the arch axis where it owns that convention). Flag a mutation that writes an entity but never invalidates that entity's list/detail keys (the classic stale-until-refresh bug), and an optimistic mutation with no rollback path (failures must roll back and surface an error).
- Response-shape spot check (medium). For matched pairs, spot-check that what the route
actually returns is what the wrapper's declared type claims — at the level of "a list vs an object, nullable vs not". Field-for-field DTO parity is the arch axis's — defer and cross-reference.
- Client write-safety — silent data loss on the optimistic path (high). A client that
commits user edits through optimistic mutations, debounced PATCHes, and query-seeded forms has several failure modes that drop a write with no error shown — worse than a stale render, because the user watched their edit "save". This rides the same query/mutation surface you already inventory (Step 1) and extends the optimistic-rollback check in #5. Walk each mutation hook + the component that calls it for the four classic silent-loss shapes:
- Missing `cancelQueries` before `setQueryData`. An optimistic write not preceded by
cancelling the key's in-flight fetches can be clobbered by a refetch that resolves after it (a just-removed row reappears). Every optimistic hook must cancel → snapshot → write → reconcile → rollback-on-error; flag one that skips the cancel.
- A deferred write dropped on unmount. A debounced/throttled PATCH whose cleanup clears
the timer without flushing loses the pending call when its row/sheet unmounts inside the debounce window (edit a value, move to the next row before the delay elapses → the PATCH never fires). When the facts file names a debounced-mutation-flush gate, the hand-rolled half is this bullet's deterministic floor — it fails a raw setTimeout whose body reaches .mutate(/.mutateAsync( outside the hooks home, so don't re-report that shape. The judgment left: a control that routes through the helper but still debounces with no commit-on-blur/collapse, and a cleanup that discards rather than commits the last args inside the helper itself.
- A form re-seeded from server query data on every change. A
useEffect(…, [queryData])
that re-initializes editable state on every object-identity change (not just first load) snaps unsaved edits back whenever a background refetch/poll or a sibling setQueryData swaps the object (e.g. an editor that polls its entity while a background job is pending — the facts file's Exhibits name known instances). Flag re-init effects keyed on the whole query object; they must key on the stable id, initialize once, or reconcile without clobbering dirty fields.
- Invalidating only a list prefix, never the detail key it staled. A mutation that
invalidates ["entity"] but not the entity's detail key leaves the just-saved detail cache stale, so reopening the item repopulates the form with pre-save data (compounds the re-seed bug above). Confirm each write invalidates both the list and the detail key it changed — this is the cache-key correctness of #5 seen from the data-loss angle, so report it once, here or there, not twice.
Output format
- Verdict + scope — one bold plain sentence first: the worst finding's consequence, or
clean (${CLAUDE_PLUGIN_ROOT}/protocol/report-style-audit.md); then whole surface or the Scope under review block; focus if given. Always note: report/suggest only — no edits made.
- Contract map — the Step-1 join summary (counts + the unmatched lists, so coverage is
visible even when clean).
- Findings — the severity-grouped list per
${CLAUDE_PLUGIN_ROOT}/protocol/report-style-audit.md (each entry cites both the server and client file:line; passing checks collapse to a one-liner).
- For loop convergence (whole-repo mode only): record every finding as a checklist entry
under this axis's heading (the facts file's heading:) in .heal/backlog.md (append; don't duplicate an entry already present — refine it instead; skip ids accepted in .heal/baseline.json — acceptance lives only there), so the next pass sees known issues and makes progress instead of re-reporting them. This Edit is the only file change this command makes. Skip it in --branch mode — branch findings belong in the PR, not the repo-wide backlog.
- Smallest safe first step — the 1–3 lowest-risk, highest-value actions now (usually:
repoint the one wrapper that 404s, or add the missing invalidation on the most-used mutation).
Run logging
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/api/SKILL.md
Popularity
- Repository stars
- 1
- 7-day trend score
- 3
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/durchnull/heal-suite/api)