Production Audit Skill
Audit Workflow
This audit produces a read-only assessment report with evidence (file paths, line numbers, severity). It does not auto-fix anything.
If $ARGUMENTS specifies a scope (e.g., "security only", "skip dead code", "focus on scalability"), narrow the audit to those dimensions only. Otherwise, audit all six dimensions.
Step 1: Discover Project Structure
Map the project layout before spawning audit agents:
- Identify the directory structure (frontend, backend/API, shared packages, monorepo layout)
- Find the database layer (ORM schema, migrations, raw SQL, database config)
- Locate auth configuration (middleware, session management, OAuth providers, API key validation)
- Find payment or billing integration files (webhook handlers, checkout flows)
- Identify environment and deployment config (.env.example, Docker, CI/CD, cloud configs)
- Detect the primary framework and language (Next.js, Django, Rails, Express, Go, etc.)
Store this map as a numbered list of directories and key files. Pass it verbatim to every audit agent.
CHECKPOINT: Verify the project map covers all major directories. If the project lacks a category (e.g., no payment integration), note it as "not applicable" rather than skipping it silently.
Step 2: Determine Scope and Spawn Audit Team
Scope narrowing: Users can narrow the audit via $ARGUMENTS or natural language:
- "audit security only" -- spawn only the security agent
- "audit everything except dead code" -- skip Agent 4
- "focus on API completeness" -- spawn only Agent 1
When the user specifies a target user count (e.g., "10k users"), pass that to the scalability agent as a sizing constraint.
Agent assignment: Spawn up to 4 agents in parallel. Each agent handles one or two audit dimensions and writes findings to a structured section.
| Agent |
Dimensions |
Reference |
| Agent 1: API & Sync |
API endpoint mapping + frontend-backend sync |
references/api-audit.md |
| Agent 2: Security |
Auth coverage, validation, CORS, secrets, injection, CSRF, CSP, dependency vulnerabilities, cookie security, password hashing. If Semgrep MCP is available, run semgrep_scan alongside manual checks. |
references/security-audit.md |
| Agent 3: Scalability & Infra |
Query performance, indexes, caching, CI/CD, monitoring |
references/scalability-audit.md + references/infrastructure-audit.md |
| Agent 4: Dead Code & Architecture |
Unused files, orphaned components, duplicate utilities, patchwork, stale config, architectural quality, code complexity |
references/dead-code-audit.md + references/architecture-audit.md |
If the project does not have a frontend (e.g., API-only service, CLI tool), merge Agent 1's scope into Agent 3 and spawn 3 agents instead.
Use this template for each agent spawn prompt:
Goal: Audit [dimension(s)] for production readiness.
Context: [Paste project structure map from Step 1, including framework/language detected]
Scope: Read `references/[dimension]-audit.md` for the full checklist.
Adapt checks to the project's framework -- the reference uses web app examples but the patterns apply to any stack.
Produce findings only -- do not fix anything.
Output: One markdown section per sub-dimension using the finding format from Step 3.
Step 3: Finding Format
Every finding must follow this structure:
### [BLOCKER|WARNING|IMPROVEMENT] Short title
**Dimension**: API Mapping | Frontend-Backend Sync | Security | Scalability | Infrastructure | Dead Code & Architecture
**File**: `path/to/file.ts:42`
**Evidence**: What was found and why it matters
**Impact**: What breaks or degrades if this is not addressed
Severity definitions:
- BLOCKER: Must fix before launch. Security vulnerabilities, broken core flows, data loss risks, missing auth on sensitive routes.
- WARNING: Fix within first sprint post-launch. Performance issues under load, missing monitoring, incomplete error handling, partial implementations.
- IMPROVEMENT: Fix when convenient. Code quality, dead code removal, test coverage gaps, documentation.
Step 4: Verify and Synthesise Report
After all agents complete, the lead verifies and assembles the final report:
- Collect all findings from agents
- CHECKPOINT: Verify every finding has all five required fields (severity in heading, dimension, file path with line number, evidence, impact). Reject malformed findings back to the agent for correction.
- Deduplicate (different agents may flag the same file)
- Sort by severity: blockers first, then warnings, then improvements
- Add an executive summary with counts per severity and dimension
- Add a recommended fix order (blockers grouped by dependency -- fix auth middleware before individual route fixes)
Report Output
Save the report to PRODUCTION-AUDIT.md in the project root. Follow the full template in references/report-template.md (executive summary, findings by severity, findings by dimension, recommended fix order).
Task Checklist
- [ ] 1. Map project structure (directories, framework, database, auth, payments, config)
- [ ] 2. CHECKPOINT: Verify project map is complete. Note any N/A categories.
- [ ] 3. Determine scope (full audit or narrowed via $ARGUMENTS)
- [ ] 4. Read reference files for each audit dimension in scope
- [ ] 5. Spawn audit agents in parallel with project map + checklists
- [ ] 6. Collect findings from all agents
- [ ] 7. CHECKPOINT: Verify every finding has severity, dimension, file path, evidence, and impact
- [ ] 8. Deduplicate findings (different agents may flag the same file)
- [ ] 9. Write executive summary with counts and recommended fix order
- [ ] 10. Save report to `PRODUCTION-AUDIT.md` in project root
Claude:
- Reads project structure: Next.js 15 monorepo,
app/api/ for routes, Prisma in prisma/, Firebase config in lib/auth/
- Reads all four reference files for audit checklists
- Spawns 4 agents in parallel, each with the project map and their dimension checklist
- Collects 47 findings: 8 blockers, 15 warnings, 24 improvements
- Verifies all findings have severity, dimension, file path, evidence, and impact
- Writes
PRODUCTION-AUDIT.md with executive summary and prioritised fix order
Report excerpt:
## Executive Summary
- Blockers: 8 (3 security, 2 API, 2 infra, 1 scalability)
- Warnings: 15
- Improvements: 24
- Readiness: 62% -- not launch-ready until blockers resolved
### Top 5 Blockers
1. `/app/api/payments/webhook/route.ts:1` -- No Stripe signature verification
2. `/middleware.ts:15` -- Auth middleware skips /api/admin/* routes
3. `/app/api/users/[id]/route.ts:23` -- No ownership check, any user can edit any profile
4. No health check endpoint for load balancer
5. DATABASE_URL exposed in committed .env file
Claude:
- Parses
$ARGUMENTS = "security only"
- Maps project structure
- Spawns only the security agent with
references/security-audit.md
- Produces a focused report covering only security findings
Claude:
- Maps project structure
- Spawns all 4 agents but gives Agent 3 (Scalability & Infra) extra context about the 10k concurrency target
- Agent 3 checks connection pool sizing against 10k users, evaluates caching strategy, checks for WebSocket/SSE scaling limits
- Report highlights scalability blockers prominently in the executive summary
Claude:
- Maps project structure: Django 5 with DRF, PostgreSQL, Celery workers, Redis cache, deployed on AWS ECS
- Skips frontend-backend sync (no frontend). Merges API audit into scalability agent.
- Spawns 3 agents: Security, Scalability & Infra (including API completeness), Dead Code & Architecture
- Security agent adapts checks to Django middleware, DRF permissions, and Celery task auth
- Produces report with Django-specific findings (e.g., missing
DEFAULT_PERMISSION_CLASSES, unprotected Celery tasks)
Claude:
- Maps project structure: Rust binary crate,
src/main.rs + src/lib.rs, no web framework, no database, no frontend
- Marks API Mapping, Frontend-Backend Sync, and Scalability as "not applicable"
- Spawns 3 agents: Security (input validation, dependency audit, command injection), Infrastructure (CI/CD, release binaries, environment config), Dead Code & Architecture
- Report is shorter but still follows the standard template, with N/A dimensions clearly marked
Tips
- Run early. Catches architectural issues before they compound. The audit is read-only and works at any stage.
- Commit the report.
PRODUCTION-AUDIT.md is designed for team review. Finding IDs (B-001, W-001) work as ticket references.
- Re-audit after fixes. Run the audit again after resolving blockers to verify they are fixed and no new issues were introduced.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: costa-marcello-skillkit-production-audit3description: Production Audit Skill4---56# Production Audit Skill78<instructions>910## Audit Workflow1112This audit produces a **read-only assessment report** with evidence (file paths, line numbers, severity). It does not auto-fix anything.1314If `$ARGUMENTS` specifies a scope (e.g., "security only", "skip dead code", "focus on scalability"), narrow the audit to those dimensions only. Otherwise, audit all six dimensions.1516### Step 1: Discover Project Structure1718Map the project layout before spawning audit agents:19201. Identify the directory structure (frontend, backend/API, shared packages, monorepo layout)212. Find the database layer (ORM schema, migrations, raw SQL, database config)223. Locate auth configuration (middleware, session management, OAuth providers, API key validation)234. Find payment or billing integration files (webhook handlers, checkout flows)245. Identify environment and deployment config (.env.example, Docker, CI/CD, cloud configs)256. Detect the primary framework and language (Next.js, Django, Rails, Express, Go, etc.)2627Store this map as a numbered list of directories and key files. Pass it verbatim to every audit agent.2829**CHECKPOINT**: Verify the project map covers all major directories. If the project lacks a category (e.g., no payment integration), note it as "not applicable" rather than skipping it silently.3031### Step 2: Determine Scope and Spawn Audit Team3233**Scope narrowing**: Users can narrow the audit via `$ARGUMENTS` or natural language:34- "audit security only" -- spawn only the security agent35- "audit everything except dead code" -- skip Agent 436- "focus on API completeness" -- spawn only Agent 13738When the user specifies a target user count (e.g., "10k users"), pass that to the scalability agent as a sizing constraint.3940**Agent assignment**: Spawn up to 4 agents in parallel. Each agent handles one or two audit dimensions and writes findings to a structured section.4142| Agent | Dimensions | Reference |43| --- | --- | --- |44| Agent 1: API & Sync | API endpoint mapping + frontend-backend sync | `references/api-audit.md` |45| Agent 2: Security | Auth coverage, validation, CORS, secrets, injection, CSRF, CSP, dependency vulnerabilities, cookie security, password hashing. If Semgrep MCP is available, run `semgrep_scan` alongside manual checks. | `references/security-audit.md` |46| Agent 3: Scalability & Infra | Query performance, indexes, caching, CI/CD, monitoring | `references/scalability-audit.md` + `references/infrastructure-audit.md` |47| Agent 4: Dead Code & Architecture | Unused files, orphaned components, duplicate utilities, patchwork, stale config, architectural quality, code complexity | `references/dead-code-audit.md` + `references/architecture-audit.md` |4849If the project does not have a frontend (e.g., API-only service, CLI tool), merge Agent 1's scope into Agent 3 and spawn 3 agents instead.5051Use this template for each agent spawn prompt:5253```54Goal: Audit [dimension(s)] for production readiness.55Context: [Paste project structure map from Step 1, including framework/language detected]56Scope: Read `references/[dimension]-audit.md` for the full checklist.57 Adapt checks to the project's framework -- the reference uses web app examples but the patterns apply to any stack.58 Produce findings only -- do not fix anything.59Output: One markdown section per sub-dimension using the finding format from Step 3.60```6162### Step 3: Finding Format6364Every finding must follow this structure:6566```markdown67### [BLOCKER|WARNING|IMPROVEMENT] Short title6869**Dimension**: API Mapping | Frontend-Backend Sync | Security | Scalability | Infrastructure | Dead Code & Architecture70**File**: `path/to/file.ts:42`71**Evidence**: What was found and why it matters72**Impact**: What breaks or degrades if this is not addressed73```7475Severity definitions:76- **BLOCKER**: Must fix before launch. Security vulnerabilities, broken core flows, data loss risks, missing auth on sensitive routes.77- **WARNING**: Fix within first sprint post-launch. Performance issues under load, missing monitoring, incomplete error handling, partial implementations.78- **IMPROVEMENT**: Fix when convenient. Code quality, dead code removal, test coverage gaps, documentation.7980### Step 4: Verify and Synthesise Report8182After all agents complete, the lead verifies and assembles the final report:83841. Collect all findings from agents852. **CHECKPOINT**: Verify every finding has all five required fields (severity in heading, dimension, file path with line number, evidence, impact). Reject malformed findings back to the agent for correction.863. Deduplicate (different agents may flag the same file)874. Sort by severity: blockers first, then warnings, then improvements885. Add an executive summary with counts per severity and dimension896. Add a recommended fix order (blockers grouped by dependency -- fix auth middleware before individual route fixes)9091### Report Output9293Save the report to `PRODUCTION-AUDIT.md` in the project root. Follow the full template in `references/report-template.md` (executive summary, findings by severity, findings by dimension, recommended fix order).9495### Task Checklist9697```98- [ ] 1. Map project structure (directories, framework, database, auth, payments, config)99- [ ] 2. CHECKPOINT: Verify project map is complete. Note any N/A categories.100- [ ] 3. Determine scope (full audit or narrowed via $ARGUMENTS)101- [ ] 4. Read reference files for each audit dimension in scope102- [ ] 5. Spawn audit agents in parallel with project map + checklists103- [ ] 6. Collect findings from all agents104- [ ] 7. CHECKPOINT: Verify every finding has severity, dimension, file path, evidence, and impact105- [ ] 8. Deduplicate findings (different agents may flag the same file)106- [ ] 9. Write executive summary with counts and recommended fix order107- [ ] 10. Save report to `PRODUCTION-AUDIT.md` in project root108```109110</instructions>111112<examples>113114<example>115**User**: "Audit this project for production readiness"116117**Claude**:1181. Reads project structure: Next.js 15 monorepo, `app/api/` for routes, Prisma in `prisma/`, Firebase config in `lib/auth/`1192. Reads all four reference files for audit checklists1203. Spawns 4 agents in parallel, each with the project map and their dimension checklist1214. Collects 47 findings: 8 blockers, 15 warnings, 24 improvements1225. Verifies all findings have severity, dimension, file path, evidence, and impact1236. Writes `PRODUCTION-AUDIT.md` with executive summary and prioritised fix order124125**Report excerpt**:126```markdown127## Executive Summary128- Blockers: 8 (3 security, 2 API, 2 infra, 1 scalability)129- Warnings: 15130- Improvements: 24131- Readiness: 62% -- not launch-ready until blockers resolved132133### Top 5 Blockers1341. `/app/api/payments/webhook/route.ts:1` -- No Stripe signature verification1352. `/middleware.ts:15` -- Auth middleware skips /api/admin/* routes1363. `/app/api/users/[id]/route.ts:23` -- No ownership check, any user can edit any profile1374. No health check endpoint for load balancer1385. DATABASE_URL exposed in committed .env file139```140</example>141142<example>143**User**: "/production-audit security only"144145**Claude**:1461. Parses `$ARGUMENTS` = "security only"1472. Maps project structure1483. Spawns only the security agent with `references/security-audit.md`1494. Produces a focused report covering only security findings150</example>151152<example>153**User**: "Run a production audit but focus on scalability -- we expect 10k concurrent users"154155**Claude**:1561. Maps project structure1572. Spawns all 4 agents but gives Agent 3 (Scalability & Infra) extra context about the 10k concurrency target1583. Agent 3 checks connection pool sizing against 10k users, evaluates caching strategy, checks for WebSocket/SSE scaling limits1594. Report highlights scalability blockers prominently in the executive summary160</example>161162<example>163**User**: "Audit this Django REST API -- it's a backend-only service, no frontend"164165**Claude**:1661. Maps project structure: Django 5 with DRF, PostgreSQL, Celery workers, Redis cache, deployed on AWS ECS1672. Skips frontend-backend sync (no frontend). Merges API audit into scalability agent.1683. Spawns 3 agents: Security, Scalability & Infra (including API completeness), Dead Code & Architecture1694. Security agent adapts checks to Django middleware, DRF permissions, and Celery task auth1705. Produces report with Django-specific findings (e.g., missing `DEFAULT_PERMISSION_CLASSES`, unprotected Celery tasks)171</example>172173<example>174**User**: "Audit this project" (but the project is a Rust CLI tool with no web server, no database, no frontend)175176**Claude**:1771. Maps project structure: Rust binary crate, `src/main.rs` + `src/lib.rs`, no web framework, no database, no frontend1782. Marks API Mapping, Frontend-Backend Sync, and Scalability as "not applicable"1793. Spawns 3 agents: Security (input validation, dependency audit, command injection), Infrastructure (CI/CD, release binaries, environment config), Dead Code & Architecture1804. Report is shorter but still follows the standard template, with N/A dimensions clearly marked181</example>182183</examples>184185<context>186187## Tips1881891. **Run early.** Catches architectural issues before they compound. The audit is read-only and works at any stage.1902. **Commit the report.** `PRODUCTION-AUDIT.md` is designed for team review. Finding IDs (B-001, W-001) work as ticket references.1913. **Re-audit after fixes.** Run the audit again after resolving blockers to verify they are fixed and no new issues were introduced.192193</context>194195---196> Converted and distributed by [TomeVault](https://tomevault.io/claim/costa-marcello) — claim your Tome and manage your conversions.197<!-- tomevault:4.0:skill_md:2026-04-13 -->