Analyze Codebase
Overview
Analyze codebase for issues across multiple domains: bugs, technical debt, documentation, security vulnerabilities, or style inconsistencies. Categorizes findings by severity with specific file locations and actionable fix suggestions. Returns structured JSON for workflow integration and generates a markdown report.
Arguments
Definitions
<type> (required): Analysis type to perform. Must be one of:
bug - Logic errors, runtime errors, and edge cases
debt - Technical debt, architecture, and performance issues
doc - Documentation accuracy and completeness
security - Vulnerabilities, unsafe patterns, and dependency issues
style - Code style, consistency, and best practices
[context] (optional): Specific areas or concerns to focus on, or directories/files to analyze. When provided, only these paths are analyzed. Otherwise, the entire codebase is analyzed.
Values
Arguments: $ARGUMENTS
Additional Resources
Load ONE of these based on the <type> argument:
- For bug analysis, see references/bug.md
- For debt analysis, see references/debt.md
- For doc analysis, see references/doc.md
- For security analysis, see references/security.md
- For style analysis, see references/style.md
Core Principles
- Only report REAL issues - quality over quantity
- Only report UNFIXED issues - if resolved, do not include it
- Be specific with exact file and line numbers
- Understand project patterns before flagging issues
- Consider framework conventions and intentional design choices
- Check if apparent issues are handled elsewhere before flagging
- Recognize test-specific patterns and legitimate edge cases
- If no issues found, return success with zero counts
Instructions
Validate Type Argument
Check that <type> argument is provided
Verify it is one of: bug, debt, doc, security, style
If missing or invalid, stop execution and report the error:
Error: Invalid or missing type argument. Must be one of: bug, debt, doc, security, style
Load Type-Specific Guidelines
Based on the <type> argument, load the corresponding reference file:
bug -> Read references/bug.md
debt -> Read references/debt.md
doc -> Read references/doc.md
security -> Read references/security.md
style -> Read references/style.md
Determine Scope
- If
[context] specifies files/directories, focus on those
- Otherwise, analyze the entire codebase
- Exclude test files, node_modules, build outputs, and vendor directories
- For
doc type: find all documentation files (README, docs/, *.md)
Understand Project Context
- Check for linter configs (ESLint, Prettier, Ruff)
- Read CLAUDE.md for project-specific guidelines
- Analyze existing code patterns to understand conventions
Analyze for Issues
- Apply type-specific analysis criteria from the loaded reference file
- Verify each finding is a real issue, not a false positive
- Check if apparent issues are handled elsewhere
Categorize Findings
- Apply severity ratings as defined in the type-specific reference file
- Use consistent severity levels across all types
Generate Report
- Save to
analysis/{type}.md
- Include date in report header
- Group findings by severity
- Use the template from the type-specific reference file
Present Results
- Display summary counts by severity
- Inform user of report file location
Output Guidance
Save a detailed markdown report and present a user-friendly summary:
{Type} analysis complete. Report saved to analysis/{type}.md
## Summary
- Critical: X issues
- High: Y issues
- Medium: Z issues
- Low: W issues
[If no issues found:]
No issues identified - codebase appears healthy.
[If issues found:]
Review the report and prioritize fixes by severity.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: analyze-43description: Analyze codebase for bugs, debt, documentation, security, or style issues Use when this capability is needed.4---56# Analyze Codebase78## Overview910Analyze codebase for issues across multiple domains: bugs, technical debt, documentation, security vulnerabilities, or style inconsistencies. Categorizes findings by severity with specific file locations and actionable fix suggestions. Returns structured JSON for workflow integration and generates a markdown report.1112## Arguments1314### Definitions1516- **`<type>`** (required): Analysis type to perform. Must be one of:17 - `bug` - Logic errors, runtime errors, and edge cases18 - `debt` - Technical debt, architecture, and performance issues19 - `doc` - Documentation accuracy and completeness20 - `security` - Vulnerabilities, unsafe patterns, and dependency issues21 - `style` - Code style, consistency, and best practices22- **`[context]`** (optional): Specific areas or concerns to focus on, or directories/files to analyze. When provided, only these paths are analyzed. Otherwise, the entire codebase is analyzed.2324### Values2526Arguments: $ARGUMENTS2728## Additional Resources2930Load ONE of these based on the `<type>` argument:3132- For bug analysis, see [references/bug.md](references/bug.md)33- For debt analysis, see [references/debt.md](references/debt.md)34- For doc analysis, see [references/doc.md](references/doc.md)35- For security analysis, see [references/security.md](references/security.md)36- For style analysis, see [references/style.md](references/style.md)3738## Core Principles3940- Only report REAL issues - quality over quantity41- Only report UNFIXED issues - if resolved, do not include it42- Be specific with exact file and line numbers43- Understand project patterns before flagging issues44- Consider framework conventions and intentional design choices45- Check if apparent issues are handled elsewhere before flagging46- Recognize test-specific patterns and legitimate edge cases47- If no issues found, return success with zero counts4849## Instructions50511. **Validate Type Argument**52 - Check that `<type>` argument is provided53 - Verify it is one of: `bug`, `debt`, `doc`, `security`, `style`54 - If missing or invalid, stop execution and report the error:5556 ```text57 Error: Invalid or missing type argument. Must be one of: bug, debt, doc, security, style58 ```59602. **Load Type-Specific Guidelines**61 Based on the `<type>` argument, load the corresponding reference file:62 - `bug` -> Read [references/bug.md](references/bug.md)63 - `debt` -> Read [references/debt.md](references/debt.md)64 - `doc` -> Read [references/doc.md](references/doc.md)65 - `security` -> Read [references/security.md](references/security.md)66 - `style` -> Read [references/style.md](references/style.md)67683. **Determine Scope**69 - If `[context]` specifies files/directories, focus on those70 - Otherwise, analyze the entire codebase71 - Exclude test files, node_modules, build outputs, and vendor directories72 - For `doc` type: find all documentation files (README, docs/, \*.md)73744. **Understand Project Context**75 - Check for linter configs (ESLint, Prettier, Ruff)76 - Read CLAUDE.md for project-specific guidelines77 - Analyze existing code patterns to understand conventions78795. **Analyze for Issues**80 - Apply type-specific analysis criteria from the loaded reference file81 - Verify each finding is a real issue, not a false positive82 - Check if apparent issues are handled elsewhere83846. **Categorize Findings**85 - Apply severity ratings as defined in the type-specific reference file86 - Use consistent severity levels across all types87887. **Generate Report**89 - Save to `analysis/{type}.md`90 - Include date in report header91 - Group findings by severity92 - Use the template from the type-specific reference file93948. **Present Results**95 - Display summary counts by severity96 - Inform user of report file location9798## Output Guidance99100Save a detailed markdown report and present a user-friendly summary:101102```text103{Type} analysis complete. Report saved to analysis/{type}.md104105## Summary106- Critical: X issues107- High: Y issues108- Medium: Z issues109- Low: W issues110111[If no issues found:]112No issues identified - codebase appears healthy.113114[If issues found:]115Review the report and prioritize fixes by severity.116```117118---119> Converted and distributed by [TomeVault](https://tomevault.io/claim/e-stpierre) — claim your Tome and manage your conversions.120<!-- tomevault:4.0:skill_md:2026-04-14 -->