codebase-audit

Performs comprehensive codebase audit checking architecture, tech debt, security, test coverage, documentation, dependencies, and maintainability. Use when auditing a project, assessing codebase health, or asked to audit/analyze the entire codebase.

16 stars

Best use case

codebase-audit is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Performs comprehensive codebase audit checking architecture, tech debt, security, test coverage, documentation, dependencies, and maintainability. Use when auditing a project, assessing codebase health, or asked to audit/analyze the entire codebase.

Teams using codebase-audit should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/codebase-audit/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/testing-security/codebase-audit/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/codebase-audit/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How codebase-audit Compares

Feature / Agentcodebase-auditStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Performs comprehensive codebase audit checking architecture, tech debt, security, test coverage, documentation, dependencies, and maintainability. Use when auditing a project, assessing codebase health, or asked to audit/analyze the entire codebase.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Codebase Audit

Audit the codebase like you're inheriting someone else's mess - be thorough and honest. No diplomacy, no softening. Focus on what actually matters: security holes, bugs, maintainability problems, and tech debt. If something is broken or badly done, say it.

## Audit Process

### 1. Check Available Tools

Start by checking what tools you have available:
```bash
command -v trufflehog
command -v npm # or pnpm, yarn, pip, cargo, etc.
```

If any expected tools are missing, list them in your output and ask the user if they want to continue without them. Don't let missing tools block the entire audit.

### 2. Detect Project Type and Run Audits

**Figure out the package manager and run the right audit:**
- `package-lock.json` → `npm audit --json`
- `pnpm-lock.yaml` → `pnpm audit --json`
- `yarn.lock` → `yarn audit --json`
- `requirements.txt` / `poetry.lock` → `pip-audit --format json` or `safety check --json`
- `Cargo.toml` → `cargo audit --json`
- `go.mod` → `go list -json -m all | nancy sleuth`

**Secret scanning:** Need help with TruffleHog? Check [references/secret-scanning.md](references/secret-scanning.md) for scanning both current files and git history.

Parse the JSON output from these tools and integrate what you find into the audit report.

**TypeScript projects (if tsconfig.json exists):**
- Check if `strict` mode is enabled (critical issue if it's false or missing)
- Count how many times `any` is used explicitly (this defeats type safety)
- Count type assertions using `as` or `<Type>` (suggest using type narrowing instead)

**OWASP Top 10 checks:** See [references/owasp-top-10.md](references/owasp-top-10.md) for vulnerability patterns and detection commands. Report findings as **critical** with file:line, what the risk is, and how to fix it.

**Accessibility checks:** Check [references/accessibility-checklist.md](references/accessibility-checklist.md) for a11y detection commands and testing procedures. Report these as **important** because they exclude real users from using the app.

**Monitoring/Observability:**
Look for error tracking tools (Sentry, DataDog, NewRelic), structured logging libraries (winston, pino), health check endpoints, and watch out for console.logs making it to production. Report missing observability as **important** for production systems.

### 3. Detect Tech Stack and Understand Project

**Figure out the tech stack:** Need help identifying package managers, frameworks, cloud platforms, or IaC tools? See [references/tech-stack-detection.md](references/tech-stack-detection.md) for the complete detection guide.

Build a summary that covers: language(s), framework, build tools, testing framework, cloud platform, IaC tools, and CI/CD platform.

**Framework best practices:**

Once you know what framework they're using, check the relevant patterns guide:
- **Next.js/React** → [references/framework-patterns-nextjs.md](references/framework-patterns-nextjs.md)
- **Nuxt/Vue** → [references/framework-patterns-nuxt.md](references/framework-patterns-nuxt.md)
- **Other frameworks** → Use WebSearch to look up current best practices and common mistakes

**Performance testing (if Chrome MCP is available):**

If this is a web app and you have access to chrome-devtools MCP:
- Ask the user: "Want me to run performance tests? Provide a URL or say skip."
- If they give you a URL, use Chrome MCP to run a Lighthouse-style audit
- Report Core Web Vitals (LCP, FID, CLS), bundle size, unoptimized images, and render-blocking resources

Don't forget to also check the project structure, documentation quality, and CI/CD setup.

### 4. Critical Issues (Show Details Immediately)

Surface these issues with full context right away - don't bury them:

**Security (from tools + manual review)**
- Secrets found by trufflehog - show file:line, what type of secret, and severity
- Vulnerable dependencies from npm/pip/cargo audit - package name, CVE, severity
- Hardcoded credentials or API keys sitting in the code
- Missing authentication or authorization checks
- Unsafe ways of handling data
- Sensitive endpoints that are exposed

**TypeScript Configuration (if it's a TypeScript project)**
- strict mode is disabled or missing from tsconfig.json
- explicit `any` types being used (this defeats the whole point of TypeScript)
- type casting/assertions (suggest type narrowing instead)

**Breaking Problems**
- Build failures or broken configuration
- Missing dependencies that are critical
- Incompatible version requirements
- Database migrations that can't be rolled back

**Data Loss Risks**
- Operations running without validation
- Missing error handling in paths that matter
- Race conditions in how data is handled

### 5. High-Level Findings (Summary Only)

Organize what you found into categories with counts and brief summaries. Need help with the full category breakdown? Check [references/report-template.md](references/report-template.md).

**Categories to cover:**
- Architecture & Structure
- Tech Debt
- Testing
- Documentation
- Dependencies
- Performance
- Developer Experience
- Best Practices

For each one: give a brief assessment, count the major issues, and summarize the patterns you're seeing. Don't list every single detail here - that's what "Areas to Investigate" is for.

## Output Format

Structure your audit report like this (see [references/report-template.md](references/report-template.md) for examples):

1. **Tool Check** - What tools are available, what's missing
2. **Tech Stack** - Languages, frameworks, cloud platform, CI/CD
3. **Security Scan Results** - What trufflehog, npm audit, and OWASP checks found
4. **TypeScript Check** - Strict mode status, any usage, type casting
5. **Accessibility Check** - Missing alt text, ARIA labels, keyboard support
6. **Monitoring/Observability** - Error tracking, logging, health endpoints
7. **Performance** - If Chrome MCP is available and user provided a URL
8. **Critical Issues 🚨** - Detailed breakdown with file:line, what the risk is, how to fix it
9. **Audit Summary** - Overall health rating plus brief assessment for each category
10. **Areas to Investigate** - Offer to dive deeper into specific areas with file:line details

## Investigation Process

When the user asks you to investigate a specific area:
- Search for relevant patterns in the code
- Give them file:line references so they can jump right to it
- Show specific examples of what you found
- Suggest concrete fixes they can implement
- Prioritize by what will have the most impact

## Tool Output Handling

Parse the JSON output from security tools and work the findings into your report:
- Group them by severity (critical → low)
- Show which package or file, what the vulnerability is, and how to fix it
- Link to the CVE or advisory when you can
- For trufflehog results, make it clear if the secret is in git history vs current files

If a tool fails to run, note it and keep going - don't let one tool failure block the entire audit.

## Guidelines

**Be brutally honest:**
- Call out bad code. Don't soften it.
- If something is a mess, say it's a mess
- No hedging with "might", "could", or "possibly"
- Don't say "consider fixing" - say "fix this" or "this is wrong"
- If strict mode is off in TypeScript, that's a critical issue, not a suggestion
- Explicit `any` defeats the whole point of TypeScript - call it out as breaking type safety
- Tech debt is tech debt, not "areas for improvement"

**Focus and priority:**
- Only report findings they can actually act on, not theoretical problems
- Prioritize by real impact on security, stability, and maintainability
- Skip nitpicks that linters should catch
- Tool findings are facts - just report them straight

**Context matters:**
- Startup MVPs can have some shortcuts, but still call them out
- Enterprise systems need to meet higher standards
- Personal projects can be looser, but point out what's missing
- Don't excuse bad practices just because "it works right now"

**Tone:**
- Be direct and clear, not diplomatic
- If tests are missing, say "no tests" not "test coverage could be improved"
- If docs are bad, say "documentation is inadequate" not "could benefit from more documentation"
- Be specific about what's wrong and why it matters
- Acknowledge what's good, but keep it brief - don't pad with praise

## References

Need more detailed guidance? Check these references:

- **[Tech Stack Detection](references/tech-stack-detection.md)** - How to figure out what package managers, frameworks, cloud platforms, and IaC tools they're using
- **[Secret Scanning Reference](references/secret-scanning.md)** - Complete guide to running TruffleHog on both current files and git history, plus common patterns and how to fix them
- **[OWASP Top 10 Reference](references/owasp-top-10.md)** - Detection patterns and grep commands for finding all OWASP Top 10 vulnerabilities, with severity guidelines
- **[Accessibility Checklist](references/accessibility-checklist.md)** - Practical commands for finding a11y issues and testing for WCAG compliance
- **[Report Template](references/report-template.md)** - What the final report should look like, with example critical issues

**Framework-specific patterns:**
- **[Next.js / React Patterns](references/framework-patterns-nextjs.md)** - Best practices, common anti-patterns, and what to check in Next.js/React projects
- **[Nuxt / Vue Patterns](references/framework-patterns-nuxt.md)** - Best practices, common anti-patterns, and what to check in Nuxt/Vue projects

Related Skills

ln-634-test-coverage-auditor

16
from diegosouzapw/awesome-omni-skill

Coverage Gaps audit worker (L3). Identifies missing tests for critical paths (Money 20+, Security 20+, Data Integrity 15+, Core Flows 15+). Returns list of untested critical business logic with priority justification.

laravel-security-audit

16
from diegosouzapw/awesome-omni-skill

Security auditor for Laravel applications. Analyzes code for vulnerabilities, misconfigurations, and insecure practices using OWASP standards and Laravel security best practices.

kube-audit-kit

16
from diegosouzapw/awesome-omni-skill

Performs read-only Kubernetes security audits by exporting resources, sanitizing metadata, grouping applications by topology, and generating PSS/NSA-compliant audit reports. Use when the user requests auditing Kubernetes clusters, Namespaces, security reviews, or configuration analysis.

jules-audit-request

16
from diegosouzapw/awesome-omni-skill

Protocol for escalation to Jules when stuck.

hypeauditor-automation

16
from diegosouzapw/awesome-omni-skill

Automate Hypeauditor tasks via Rube MCP (Composio). Always search tools first for current schemas.

hlab-auditor

16
from diegosouzapw/awesome-omni-skill

No description provided.

gtse-ecommerce-seo-audit

16
from diegosouzapw/awesome-omni-skill

Comprehensive BigCommerce SEO audit for product pages, collection pages, technical SEO, and B2B considerations. Use when GTSE needs SEO audits for their cable ties, safety equipment, and industrial supplies categories. Adapted for B2B ecommerce with trade customer focus.

gdpr-auditor

16
from diegosouzapw/awesome-omni-skill

This skill should be used when analyzing codebases, applications, databases, or systems for GDPR (General Data Protection Regulation) compliance. Use this skill when users need to audit data protection practices, identify potential compliance issues, assess data handling procedures, review privacy policies, or ensure adherence to EU data protection requirements.

five-s-auditor

16
from diegosouzapw/awesome-omni-skill

5S workplace organization audit skill with scoring, photo documentation, and sustainability tracking.

divek-bi-visual-audit

16
from diegosouzapw/awesome-omni-skill

Visual compliance auditing for DiveK brand identity. Use when reviewing UI screens, component libraries, landing pages, design handoff specs, CSS tokens, or visual QA reports for alignment with DiveK color palette, typography, and cinematic-minimal style direction.

dependency-management-deps-audit

16
from diegosouzapw/awesome-omni-skill

You are a dependency security expert specializing in vulnerability scanning, license compliance, and supply chain security. Analyze project dependencies for known vulnerabilities, licensing issues,...

Cookbook Audit

16
from diegosouzapw/awesome-omni-skill

Audit an Anthropic Cookbook notebook based on a rubric. Use whenever a notebook review or audit is requested.