/be:api-audit [phase] [path]from Backend Skills
Manually invoked. API-layer audit — the six-step route, thin routes over services, validation at every boundary, the envelope, typed errors and no-store, concurrent edits and long-running work, a named rate limit on every route, cursor lists, versions and transitions, the audit log, each route's reference entry and test, cron, webhook and proxy rules, and where present maintenance mode, flags, plan entitlements, outgoing webhooks and email sending. Verifies each finding and writes a prioritised report.
Ships in Backend Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Run this only when the user asks for it by name. It writes a report and changes no code; fixing a finding is a separate request.
A manually-invoked, red-team API audit of an app or a specific diff/PR. It is self-contained — every check is spelled out inline, so it runs a full review with zero other skills installed — and each finding is verified against the real code before it lands in a phase-aware, scored report at _reports/api-audit.md.
Self-contained — this checklist is comprehensive on its own and needs no other skill installed. Where
api-architecture,rate-limiting,audit-log,openapi-registry,access-control,schemas-and-contracts,image-handling,maintenance-mode,feature-flags,plan-entitlements,webhook-deliveryandtransactional-emailare installed, apply their house rules too.
Before applying this skill, read the project's root AGENTS.md, the AGENTS.md closest to the files in question, and any doc they link for this skill's topic. Names, values and choices — budgets, tiers, tokens, voice, paths — come from those files, never from this skill.
[phase] — development | production; sets the action-item tiers. Omitted → the audit phase the project's AGENTS.md records, else production (assume the app is live until told otherwise — the safer default).[path] — a file, directory, or PR/diff to scope the audit to; omitted → the whole repo.Mindset — reviewer/attacker first. Don't assume code is fine because it looks careful; find the sequence that breaks it. Report only findings you can justify as real, each verified before it lands.
development | production) if given; else the audit phase the project's AGENTS.md records; else production — assume the app is live with real users until told otherwise, so a CRITICAL finding gets Fix-Now urgency instead of a pre-launch discount. Phase sets the action-item tiers._reports/api-audit.md exists, read it, but still run every check against the source. Use it only to keep the ID of each finding still present (status UNRESOLVED), carry its WON'T FIX findings forward unchanged — never re-raised as new findings — drop its FIXED findings and any no longer present, continue ID numbering from its highest ID, and take its scores for the score-change row. First run → mark all NEW.file:line evidence.AGENTS.md or a doc it links._reports/api-audit.md — overwriting the whole file, so no resolved history accumulates — and post the chat summary (see Output). Recommend fixes in the report; never modify code. Never commit or push without explicit approval.Findings are ordered worst-first in the report.
Write to _reports/api-audit.md, with one Overall row in the score change:
# API audit — <app/scope>
**Date:** <YYYY-MM-DD> · **Phase:** <phase> · **Mode:** Report-only · **Branch:** `<branch>` · **Scope:** <what was audited> · **Overall:** <X>/10
## Score change (previous → current)
| Metric | Previous | Current | Δ | Trend |
| --- | --- | --- | --- | --- |
| Overall | <prev/10 or N/A> | <cur/10> | <+N / -N / 0> | <▲ / ▼ / ■ / N/A> |
## Findings
| ID | Severity | Category | Status | Issue | Location |
| --- | --- | --- | --- | --- | --- |
| 1 | HIGH | <category> | NEW | <one-line issue> | `file/path:line` |
**Status:** `NEW` — found this run for the first time · `UNRESOLVED` — still present from an earlier run · `FIXED` — fixed after the audit; the note names the commit · `WON'T FIX` — the owner ruled it not a defect, intended, or accepted as it is; the note gives their reason
### F1 — <title>
- **What:** <the defect, and the concrete evidence that proves it real>
- **Why it matters:** <impact / who it affects> <· optional standard ref, e.g. OWASP API4 / RFC 9110 §15.5.10>
- **Fix:** <the specific remediation>
- **Note:** <only once `FIXED` (the commit and what changed) or `WON'T FIX` (the owner's reason)>
## Scorecard
| Category | Score | Notes |
| --- | --- | --- |
| The route | <X>/10 | <one-line justification> |
| Validation | <X>/10 | <one-line justification> |
| Responses and errors | <X>/10 | <one-line justification> |
| Guards | <X>/10 | <one-line justification> |
| Rate limiting | <X>/10 | <one-line justification> |
| Lists | <X>/10 | <one-line justification> |
| Paths and transitions | <X>/10 | <one-line justification> |
| Audit log | <X>/10 | <one-line justification> |
| Routes complete | <X>/10 | <one-line justification> |
| Cron, webhooks and proxy | <X>/10 | <one-line justification> |
| Maintenance mode | <X>/10 or N/A | <one-line justification> |
| Feature flags | <X>/10 or N/A | <one-line justification> |
| Plan entitlements | <X>/10 or N/A | <one-line justification> |
| Outgoing webhooks | <X>/10 or N/A | <one-line justification> |
| Email sending | <X>/10 or N/A | <one-line justification> |
## Action items
Tiers by phase — `development` → **Fix Now / Before Launch / Post-Launch**; `production` → **Fix Now / Next Release / Backlog**. Each task references a finding ID.
### <Tier>
| # | Priority | Task (finding ID) | Effort |
| --- | --- | --- | --- |
Every run produces two things:
_reports/api-audit.md, in the format above, overwriting the prior run.<X>/10 (with Δ vs last run), a severity count (Critical / High / Medium / Low, i.e. C / H / M / L), the top findings worst-first (id · severity · one-line · file:line), and the report path. Note any "needs confirmation" items.Scope it first: a dedicated API app, route handlers in a frontend (webhooks, a backend-for-frontend), or Server Actions calling services — the last drops the HTTP-envelope checks but keeps services, validation, guards and the audit log. Judge every handler against the standard, not its neighbours: a shape every sibling shares can still be wrong, and consistent-but-wrong is one systemic finding with a count. The fix targets are api-architecture, rate-limiting, audit-log and openapi-registry (write schemas: schemas-and-contracts; upload bytes: image-handling), and the last section names its own. A category the app doesn't have scores N/A and leaves the overall score.
POST, a scheduler tick and a queue worker gated by signature or OIDC token instead of a user guard.data/ or clients/ around it.ctx.params is awaited, then validated. Flag raw request.json(), searchParams or ctx.params, and an inline schema duplicating a shared one..pick() allowlists; a partial update strips defaults so omitted fields keep their values. Flag .omit() write schemas and bodies spread into writes. Uploads are checked by their bytes, not their label.{ success, data, message?, metadata? } or { success: false, error: { code, message, details? } }, typed in the shared contracts — built only by ok, created, noContent, paginated and errorResponse; flag a hand-rolled Response. Every handler's catch delegates to errorResponse.Retry-After, 503; an unexpected error is a 500 whose message is hidden outside local. A missing composite index is a 503 with its own code; a held lock is a 409.Cache-Control: no-store from the builders; a public, non-personal read opts into shared caching deliberately. Flag a cacheable personal response.If-Match → 412, or a version field → 409); flag a blind overwrite.Bearer or the session cookie, revocation checked). Depth → access-control-audit.GET ping take a generous public tier of their own. A scheduler tick and a queue worker behind their OIDC token, and a webhook POST behind its signature, skip the user layers. @upstash/ratelimit's own timeout is set short, never left at its 5-second default.domain:action name (flag two routes sharing one) on a named tier carrying a comment. The per-account layer runs in the session guard; keys have their own tier.rate), heavy routes cap concurrent jobs with an expiring lock, and a plan raises a budget from the account, never the request. Sign-up has its own tier; challenge tokens (Turnstile, reCAPTCHA, App Check) are verified on the server; nothing that costs money works before the email is verified.Retry-After, through the error envelope; a public API sends RateLimit-Policy and RateLimit; an optional-session read rethrows the 429 rather than serving a guest. Credential and secret tiers fail closed, the rest open; sign-in locks per (IP, email) and per account; auth email has a per-recipient budget. Depth → redis-audit.metadata (limit, total, totalPages, nextCursor, prevCursor, hasNext, hasPrevious), the total from a stored counter.v2; a retiring version sends Deprecation and Sunset with a link to migration notes. Paths group by resource: <resource>/route.ts lists and creates, <resource>/[id]/route.ts reads, updates and deletes.POST sub-route with its own verb and audit action; DELETE removes, never switches off. Repeating a transition returns the current state with no second side effect, or a 409.after()), or in the change's transaction where both must exist — and a failed write never fails the request. Flag an unawaited promise a serverless instance can freeze.required body, the paginated flag, uploads as binary, a tag from the closed typed list, a verb-first summary, .meta({ id, examples }), a stable operationId, deprecated: true on a retiring version), a colocated route.test.ts calling the exported handler with a real Request, and the path in each consumer's endpoints file. A coverage test fails when a route has no entry or an entry has no route, local-only routes excluded by an explicit prefix list; outgoing webhooks are registered too. CI lints the spec (Spectral or Redocly) and runs oasdiff breaking --fail-on ERR; the docs routes take a public rate limit.{ results, errors }, so one failure never stops the rest; the guard verifies the OIDC token's exact audience, the scheduler's service account and email_verified; a local bypass needs both a flag and the local tier; ?task= rejects an unknown name; a heartbeat records only scheduled ticks, never by-name runs, and its GET answers 503 after missed ticks; tasks are idempotent and fit the attempt deadline, or chunk.* with credentials), the CSRF check on mutations (Origin, and Sec-Fetch-Site not cross-site) and the maintenance gate. It is never the authorisation layer.Each runs only where the app has it; the full checks, with the standard behind each, are in references/switches-plans-webhooks-email.md.
robots.txt or the bypass; a 503 with Retry-After and no-store, never a 200; a bad bypass token is a 404; both gates fail open.access-control-audit's.access-control-audit's.Fixing is a separate request, after the report is written, and covers only the findings the owner chose. Then update the report in place — never re-run the audit to update it: a re-run re-checks the whole codebase, costs a full audit and raises new findings mid-fix. Mark each fixed finding FIXED with its commit and a one-line note of what changed, mark a finding the owner rules out WON'T FIX with their reason, and leave everything else as it stands. Recompute the scorecard categories the fixes touched and the Overall, and rewrite the one score-change row (previous → current) — never add a second row.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub timonwa/engineering-skills --plugin beOther plugins' skills for the same job
22 skills in this plugin
/access-controlAccess control for a Next.js API on Firebase — roles, relationships and attributes (RBAC, ReBAC, ABAC) behind permission verbs and one pure can(); guards as the only gate, 404 before 403; tenant scoping; invitations; escalation limits; two-person approval and access reviews; stale claims; API-key scopes; share links and passcodes; where plan and flag checks sit; UI gates that only hide; and tests. Use when adding a permission, role, guarded route, API key, share link, or a control only some people see./access-control-auditManually invoked. Access-control audit — guards on every route and Server Action (BFLA), 404 before 403 and tenant scoping (BOLA), allowlisted writes and projected reads (BOPLA), verbs never role names, roles that add up, escalation and invitations, claims and revocation, sessions and sign-in, API keys and share links, the plan and flag order, UI gates, data rules and the tests. Verifies each finding and writes a prioritised report./api-architectureHow an API route is built in a Next.js API — the fixed order of rate limit, authorise, validate, delegate, audit, respond; thin routes over services; the response envelope and typed errors; caching headers; concurrent edits; long-running work; cursor pagination and allowlisted sorts; resource paths, versions, deprecation and state-transition sub-routes; and what every new route ships with. Cron, webhooks and audit logs are references. Use when adding, changing or reviewing a route handler or the API layer's structure.