| name | analyze |
| description | Analyze codebase for bugs, debt, documentation, security, or style issues Use when this capability is needed. |
| metadata | {"author":"e-stpierre"} |
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:
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:
-
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
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.