/be:access-control-audit [phase] [path]from Backend Skills
Manually 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.
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 access-control 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/access-control-audit.md.
Self-contained — this checklist is comprehensive on its own and needs no other skill installed. Where
access-control,auth,api-architectureandbackend-securityare installed, apply their house rules too; rule internals go tofirebase-security-rules-auditor(the official Firebase skill, where installed).
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/access-control-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/access-control-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/access-control-audit.md, with one Overall row in the score change:
# Access control 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 A01 / API1 / NIST SP 800-63B>
- **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 |
| --- | --- | --- |
| Guards and coverage | <X>/10 | <one-line justification> |
| Verbs and the policy | <X>/10 | <one-line justification> |
| Roles to verbs | <X>/10 | <one-line justification> |
| Object and property level | <X>/10 | <one-line justification> |
| Escalation and revocation | <X>/10 | <one-line justification> |
| Sessions and sign-in | <X>/10 | <one-line justification> |
| Keys and links | <X>/10 | <one-line justification> |
| Plans, flags and UI | <X>/10 | <one-line justification> |
| Data rules | <X>/10 | <one-line justification> |
| Audit and tests | <X>/10 | <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/access-control-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.Report-only — this audit recommends fixes in the report; it never modifies code.
The frame is broken access control (OWASP A01; API1, API3 and API5): object level (BOLA) — a forged id reaches another actor's resource; function level (BFLA) — an operation runs without the verb it requires; property level (BOPLA) — a request sets or reads fields the actor may not. Check every route, Server Action, guard, the verb registry, the role maps, keys, links, the UI gates and the data rules. The fix target for each finding is access-control (sessions and keys: auth).
token.uid): flag the caller's own uid, role or ownership taken from a body, query or header. Ids of the record acted on (/admin/users/[uid], the member being invited) are input like any other, authorised by the guard. An unverified email is refused outside a tested allowlist.ForbiddenError, NotFoundError) mapped centrally; flag a guard returning a boolean a route can ignore.role ===, isAdmin, roles.includes(, hasRole(; each hit gating an action is a finding. Not findings: the role-to-verb map, the rank check for who may manage whom, the last-top-role guard, and role labels shown in the UI.scope.resource.action, a fixed action vocabulary, each reverse action its own verb); flag inline strings and unregistered verbs. A registered verb no route uses is cleanup in production, a note in development.can(actor, verb) is pure — no reads or side effects — with canAll/canAny, and denies by default: an unknown role, a missing membership or a pending invite holds nothing..pick() allowlist — flag a body spread into a write or a write schema built with .omit(); responses return the projection for that caller, never a raw document across a trust boundary.auth)auth_time), else 401. The client SDK uses inMemoryPersistence and signs out once the cookie is set; password sign-in and account creation go through the API (lockout, Identity Toolkit, a custom token), never the browser SDK.checkRevoked: true; sign-out ends the session on the server (deletes its record, or revokes refresh tokens) and sends Clear-Site-Data: "cache", "storage", never "cookies". Other sessions are revoked on a password change, an account recovery or a role removal.generate…Link, never the client SDK or Firebase's templates. A password or email change needs the current password and emails the owner. Providers are linked with linkWithCredential, and an unverified account never gains one.<Suspense>, never the root layout; the proxy checks only that the cookie exists; the current-user helper never imports firebase-admin. Cookie attributes, session caps and password rules are security-audit's.Bearer, separate per tier, rate-limited by key, rotatable with old and new working side by side; issuing and revoking are audited and emailed to the owners.GET on one never triggers an action, and its page loads no third-party scripts. Passcodes are stored hashed or encrypted, compared in constant time, rate-limited with a lockout, and set a short-lived cookie for that resource only. The page sends Referrer-Policy: no-referrer and noindex (meta and X-Robots-Tag), never a robots.txt disallow. Access bought or earned is a relationship, not a link.FEATURE_NOT_IN_PLAN, PLAN_LIMIT_REACHED); flag a plan-name check.can() through a hook and a gate component; it hides what can't be done (rather than disabling it without saying why) and protects nothing. Flag a control whose action has no server guard.rules_version = '2'; every file firebase.json names exists; no server code imports the client SDK; rules have unit tests. Rule internals → firebase-security-rules-auditor (official).audit-log).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 be22 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./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./api-auditManually 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.Other plugins' skills for the same job