From codebase-audit
Explores an existing codebase, produces a structured source code audit, and writes functional documentation for the application. Trigger with "audit this codebase", "review the source code", "document this app", "give me an audit of the project", or when a client needs to understand an existing application they've inherited or are evaluating. Optional PDF export (Phase 4) needs Python and reportlab—run scripts/check_audit_env.py --require-pdf before Phases 1–3 if PDF is required.
How this skill is triggered — by the user, by Claude, or both
Slash command
/codebase-audit:codebase-auditThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
End-to-end workflow to onboard a user (developer/product owner) onto an existing codebase: map the source code, produce a structured audit, write functional documentation, and **optionally** export a PDF.
End-to-end workflow to onboard a user (developer/product owner) onto an existing codebase: map the source code, produce a structured audit, write functional documentation, and optionally export a PDF.
Bundled references/ define how to review and document (Phases 2–3). scripts/ supports environment checks, repo sizing, and PDF generation (Phase 4).
Do this first so users are not surprised after a long run.
Clarify deliverables — Confirm whether the client wants markdown only or markdown + PDF. There is no native skill-to-skill chaining in Claude Code: Phases 2–3 are driven only by this skill’s references/ files, not by other installed skills. If the user has extra skills (e.g. a personal code-review skill), they may influence style, but reproducibility comes from following the references below.
PDF (Phase 4) — fail fast — If a PDF is required, run from this skill’s scripts/ directory:
python check_audit_env.py --require-pdf
If this exits non-zero, stop and tell the user to run pip install reportlab (Python 3.9+) before continuing. Do not rely on YAML compatibility metadata (it is not part of the official skill frontmatter schema and may be ignored).
Repository size — From the repository root of the project under audit, run:
python repo_scope_hint.py
Map the printed count to a tier and sampling plan in references/large-repository-strategy.md. Record the tier and scope in the Codebase Map before deep reading.
Map the repository before drawing any conclusions.
references/large-repository-strategy.md using the count from scripts/repo_scope_hint.py (or equivalent). Do not claim a full line-by-line review of every file on large repositories; state what was reviewed deeply vs sampled.Output a Codebase Map section with a directory tree and a one-line description per folder, plus a short Audit scope note (tier + sampling approach).
Perform the audit using only references/effective-code-review.md for methodology (plus references/large-repository-strategy.md for scope on medium/large repos). Do not assume separate code-review or documentation skills exist; they are not bundled with this plugin.
Review breadth must match the scope from Phase 1 (full where small; sampled where medium/large). Focus on:
Output an Audit Report section structured as:
Rate overall health as: Good / Needs Improvement / Requires Significant Work.
Produce documentation for a non-technical or semi-technical audience (product owners, new team members, evaluating clients). Follow references/functional-documentation.md only—there is no dependency on an external documentation skill.
Application Overview
Data & Integrations
User Journeys
Operational Overview
Deliver results in this order:
## Codebase Map
[directory tree + descriptions]
## Audit Report
[summary, findings by severity, positive observations]
## Functional Documentation
[overview, data & integrations, user journeys, operational overview]
Keep each section self-contained so the client can share individual sections with different stakeholders.
Requires Python 3.9+ and pip install reportlab. Re-check any time before generating:
python check_audit_env.py --require-pdf
Once all three markdown sections are complete, save the full report (in delivery order: Codebase Map, Audit Report, Functional Documentation) to a .md file and run:
python /path/to/codebase-audit/scripts/generate_audit_pdf.py \
--input path/to/audit-report.md \
--title "Application Name" \
--author "Author or team" \
--date YYYY-MM-DD \
--output path/to/application-name-audit-YYYY-MM-DD.pdf
--output is optional; default is <slug(title)>-audit-<date>.pdf next to the input file.
The script lives at scripts/generate_audit_pdf.py. It produces:
## Codebase Map, ## Audit Report, and ## Functional Documentation blockStyling (colors, typography, markdown subset, and ReportLab implementation details) is defined in the script so exports stay consistent—adjust there if the palette or rules change.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Applies a firm's KYC/AML rules grid to parsed onboarding records: assigns risk rating, checks required documents, outputs rule outcomes with citations, and routes for escalation.
Generates daily or weekly digests of activity from connected sources (chat, email, docs, tasks, CRM), highlighting action items, decisions, mentions, and project updates.
npx claudepluginhub thetribeio/agent-codebase-audit --plugin codebase-audit