Skip to content
analyzer logo

Kodo Analyzer Skill

analyzer

Comprehensive codebase analysis methodology for existing projects. Use when onboarding to a new codebase, doing periodic health checks, or before refactoring.

SKILL.md

Full skill instructions

Kodo Analyzer Skill

Comprehensive codebase analysis methodology for existing projects.

Purpose

The Kodo Analyzer system provides systematic codebase analysis to:

  • Infer and document existing features
  • Identify gaps, bugs, and security issues
  • Calculate health scores per category
  • Generate actionable recommendations
  • Track health trends over time

When to Use

  • New project onboarding (existing codebase)
  • Periodic health checks
  • Pre-refactoring assessment
  • Security audits
  • Documentation generation
  • Before major releases

Architecture

+-------------------------------------+
|     /​kodo analyze Command           |
+-----------------+-------------------+
                  |
+-----------------v-------------------+
|   kodo-codebase-analyzer (Main)     |
|   - Orchestrates sub-agents         |
|   - Aggregates results              |
|   - Calculates health scores        |
+-----------------+-------------------+
                  |
    +-------------+-------------+
    |             |             |
+---v---+   +----v----+   +---v---+
| Group |   |  Group  |   | Group |
|   1   |   |    2    |   |   3   |
+---+---+   +----+----+   +---+---+
    |            |            |
+---v-------+ +--v--------+ +v------------+
| database  | | deps      | | security    |
| api       | | analytics | | performance |
| frontend  | | docs      | |             |
+-----------+ +-----------+ +-------------+

Analysis Categories

1. Database Analysis

  • Schema quality and relationships
  • RLS policy coverage
  • Index optimization
  • Unused table/​column detection
  • Migration health

2. API Analysis

  • Endpoint inventory
  • Authentication coverage
  • Error handling patterns
  • Edge function candidates
  • Documentation gaps

3. Frontend Analysis

  • Component inventory
  • Accessibility compliance
  • State management patterns
  • Performance concerns
  • UI consistency

4. Dependencies Analysis

  • Outdated packages
  • Security vulnerabilities
  • Better alternatives
  • Unused dependencies
  • License compliance

5. Analytics Analysis

  • Event coverage
  • Naming consistency
  • Feature flag usage
  • Funnel completeness
  • User identification

6. Documentation Analysis

  • Coverage assessment
  • Code-doc accuracy
  • Staleness detection
  • Quality metrics

7. Security Analysis

  • Authentication flows
  • Authorization patterns
  • Input validation
  • Secrets management
  • CORS configuration

8. Performance Analysis

  • Database query optimization
  • Bundle size analysis
  • Caching strategies
  • Render performance
  • Asset optimization

Output Structure

./​docs/​analysis/
├── summary.md           # Executive summary
├── database/
│   └── report.md
├── api/
│   └── report.md
├── frontend/
│   └── report.md
├── dependencies/
│   └── report.md
├── analytics/
│   └── report.md
├── documentation/
│   └── report.md
├── security/
│   └── report.md
└── performance/
    └── report.md

Health Scoring

See references/​health-scoring.md for detailed methodology.

CategoryWeightScore Factors
Database15%RLS, indexes, unused detection
API15%Auth, errors, documentation
Frontend15%A11y, states, performance
Dependencies10%Freshness, security
Analytics10%Coverage, consistency
Documentation10%Coverage, accuracy
Security15%Auth, validation, secrets
Performance10%Queries, bundles, caching

Issue Classification

See references/​issue-categories.md for severity definitions.

  • Critical: Security vulnerabilities, data loss risks
  • High: Bugs, missing auth, accessibility failures
  • Medium: Performance issues, code quality
  • Low: Style inconsistencies, minor improvements

Workflow

Step 1: Initialize

kodo analyze              # Standard analysis
kodo analyze --deep       # Deep mode: extract full content + learnings from docs/
kodo analyze --deep --auto  # Auto-accept all findings

Deep Mode (--deep): In addition to standard analysis, extracts learnings from documentation:

  • Scans docs/ directory recursively
  • Extracts rules, decisions, tech-stack choices, workflows, domain terms, conventions
  • Creates context entries in .kodo/​context-tree/
  • Creates learnings in .kodo/​learnings/ (grouped by category)
  • Assigns HIGH confidence to your design docs (docs/​plans/), MEDIUM to inherited docs

Step 2: Review Summary

Check overall health score and critical issues.

Step 3: Drill Down

Review individual category reports in ./​docs/​analysis/.

Step 4: Prioritize

Use the prioritization matrix:

  • High Impact + Low Effort = Do First
  • Critical issues = Immediate attention

Step 5: Track Progress

# Store in context for trend tracking
kodo curate --category analysis --title "Health Report $(date)"

Step 6: Re-analyze

Run periodic analyses to track improvement:

kodo analyze --quick  # Weekly
kodo analyze          # Monthly

Integration

Kodo Context Storage

Analysis results are stored in .kodo/​context/​analysis/:

# Query previous analyses
kodo query "health score"
kodo query "security issues"
kodo query "performance bottlenecks"

Feature Documentation

Analysis can infer features and populate ./​docs/​features/:

kodo analyze  # Also generates feature docs

Configuration

Set analysis preferences in .kodo/​config.json:

{
  "analyzer": {
    "analyzers": {
      "database": { "enabled": true },
      "api": { "enabled": true },
      "frontend": { "enabled": true },
      "dependencies": { "enabled": true },
      "analytics": { "enabled": true },
      "documentation": { "enabled": true },
      "security": { "enabled": true },
      "performance": { "enabled": true }
    },
    "output": {
      "directory": "./​docs/​analysis",
      "populateFeatureDocs": true
    },
    "thresholds": {
      "critical": 50,
      "warning": 70
    }
  }
}

Best Practices

  1. Run full analysis on new projects - Establish baseline
  2. Run quick analysis weekly - Catch regressions
  3. Fix critical issues immediately - Security first
  4. Review recommendations - Not all apply
  5. Track health trends - Compare over time
  6. Focus on high-impact fixes - Use prioritization matrix

Agent Model Assignments

AgentModelReason
kodo-codebase-analyzersonnetOrchestration, complex decisions
kodo-security-analyzersonnetCritical security analysis
kodo-performance-analyzersonnetComplex performance patterns
kodo-database-analyzerhaikuStraightforward schema analysis
kodo-api-analyzerhaikuPattern-based endpoint analysis
kodo-frontend-analyzerhaikuComponent scanning
kodo-dependencies-analyzerhaikuPackage checking
kodo-posthog-analyzerhaikuEvent tracking analysis
kodo-documentation-analyzerhaikuDoc coverage checking

Related Commands

  • /​kodo analyze - Run analysis
  • /​kodo analyze --deep - Run analysis with full content extraction + learnings
  • /​kodo extract <file> - Extract learnings from a single file
  • /​kodo curate - Store analysis in context
  • /​kodo query - Search previous analyses
  • /​kodo reflect - Capture learnings from analysis

References

  • references/​health-scoring.md - Score calculation methodology
  • references/​issue-categories.md - Issue severity definitions
  • references/​analysis-templates.md - Output templates