Skip to content

analyze-codebase API Reference

Quick Reference

  • File: skills/analyze-codebase.md (181 lines)
  • Input: Project root directory
  • Output: docs/analysis.md
  • Dependencies: None (first in pipeline)
ParameterTypeRequiredDescription
PROJECT_PATHpathYesAbsolute path to project root
SCOPEenumYesfull (all dirs) or focused (specific dir)
FOCUS_TARGETstringNoDirectory name when scope is focused

The skill generates docs/analysis.md with these sections:

SectionContent
Quick ReferenceProject name, type, languages, frameworks, LOC
ArchitectureMermaid graph TB diagram of layers
Directory StructureAnnotated tree of important directories
DependenciesTable: category, package, version, purpose
Route MapTable: method, path, handler, auth
Database SchemaTable: table, columns, relationships
Key FilesTable: file, role, lines
Test CoverageTable: framework, test files, coverage
  1. Read README.md, package.json, Makefile
  2. Detect tech stack from config files (20+ patterns)
  3. Map 6 architecture layers (presentation → data)
  4. Identify entry points (server, routes, CLI)
  5. Extract route map from controllers
  6. Extract database schema from models/migrations
  7. Analyze dependency graph
  8. Detect test framework and coverage
  • Trace actual code — never guess from filenames
  • Cite every finding: (file_path:line_number)
  • Output file must be named analysis.md (not _analysis.md)
  • Use Mermaid dark-mode colors
  • Include Quick Reference card at top