Codebase Analysis โ
Quick Reference
- Project: Cody Master v3.2.0
- Type: CLI Tool + Express Dashboard + Skills Framework
- Languages: TypeScript, HTML, CSS, JavaScript
- Frameworks: Commander.js (CLI), Express.js (Dashboard)
- Lines of Code: ~4,500+ (core TypeScript)
Architecture Overview โ
Three-layer architecture: Presentation (landing page + dashboard), Business Logic (CLI + REST API + Judge), Data (JSON file store + skills library).
Directory Structure โ
cody-master/
โโโ src/ # Core TypeScript source
โ โโโ index.ts # CLI entry point (1536 lines)
โ โโโ dashboard.ts # Express REST server (710 lines)
โ โโโ continuity.ts # Working memory system
โ โโโ judge.ts # Judge Agent evaluation
โ โโโ skill-chain.ts # Multi-skill pipeline engine
โ โโโ agent-dispatch.ts # Task โ AI Agent dispatch
โ โโโ data.ts # JSON data store
โ โโโ chains/ # Chain definitions
โโโ public/ # Landing page website
โ โโโ index.html # Main landing page
โ โโโ skills.html # Skills catalog
โ โโโ story.html # Origin story
โ โโโ demo.html # Demo page
โ โโโ start.html # Getting started
โ โโโ persona.html # Persona detail pages
โ โโโ dashboard/ # Dashboard SPA
โ โโโ css/ # Stylesheets
โ โโโ js/ # Client-side JavaScript
โ โโโ i18n/ # Translation files (6 languages)
โ โโโ img/ # Assets
โโโ skills/ # 30+ AI Agent Skills
โ โโโ cm-tdd/ # Test-Driven Development
โ โโโ cm-debugging/ # Root cause investigation
โ โโโ cm-planning/ # Implementation planning
โ โโโ cm-execution/ # Autonomous execution
โ โโโ ... # 25+ more skills
โโโ adapters/ # Platform-specific configs
โ โโโ antigravity.js # Google Antigravity adapter
โ โโโ claude-code.js # Claude Code adapter
โ โโโ cursor.js # Cursor adapter
โโโ docs/ # This documentation
โโโ test/ # Test suite
โโโ dist/ # Compiled output
โโโ package.json # Project manifest v3.2.0
โโโ tsconfig.json # TypeScript config
โโโ vitest.config.ts # Test framework config
โโโ wrangler.toml # Cloudflare Pages configDependencies โ
| Category | Package | Version | Purpose |
|---|---|---|---|
| Core | commander | ^14.0.3 | CLI framework |
| Core | express | ^5.2.1 | HTTP server for dashboard |
| Core | chalk | ^5.6.2 | Terminal coloring |
| Core | prompts | ^2.4.2 | Interactive CLI prompts |
| Build | typescript | ^5.9.3 | TypeScript compiler |
| Build | ts-node | ^10.9.2 | TypeScript runtime |
| Test | vitest | ^4.1.0 | Test framework |
| Test | jsdom | ^29.0.1 | DOM testing |
| Test | acorn | ^8.16.0 | JS parser for testing |
Key Files โ
| File | Role | Lines |
|---|---|---|
src/index.ts | CLI entry โ all commands | ~1,536 |
src/dashboard.ts | Express REST API server | ~710 |
src/continuity.ts | Working memory (CONTINUITY.md) | ~500+ |
src/judge.ts | Task health evaluation | ~400+ |
src/skill-chain.ts | Multi-skill pipeline engine | ~350+ |
src/agent-dispatch.ts | Task dispatch to AI agents | ~250+ |
src/data.ts | JSON data store + types | ~200+ |
Route Map (Dashboard REST API) โ
| Method | Path | Handler | Description |
|---|---|---|---|
| GET | /api/projects | Dashboard | List all projects |
| POST | /api/projects | Dashboard | Create project |
| GET | /api/tasks | Dashboard | List tasks |
| POST | /api/tasks | Dashboard | Create task |
| PUT | /api/tasks/:id/move | Dashboard | Move task (kanban) |
| POST | /api/tasks/:id/transition | Dashboard | Transition task state |
| POST | /api/tasks/:id/dispatch | Dashboard | Dispatch task to AI agent |
| GET | /api/judge | Judge | Evaluate all tasks |
| GET | /api/judge/:taskId | Judge | Evaluate single task |
| GET | /api/agents/suggest | Judge | Suggest best agent |
| GET | /api/continuity | Continuity | All projects' memory |
| POST | /api/continuity/:projectId | Continuity | Update working memory |
| GET | /api/deployments | Dashboard | Deploy history |
| POST | /api/deployments | Dashboard | Record deployment |
| POST | /api/deployments/:id/rollback | Dashboard | Rollback a deploy |
| GET | /api/changelog | Dashboard | Changelog entries |
| GET | /api/chains | Chain | List skill chains |
| POST | /api/chain-executions | Chain | Start chain execution |
Test Coverage โ
| Framework | Test Files | Description |
|---|---|---|
| Vitest | test/frontend-safety.test.ts | Frontend safety HTML checks |
WARNING
Current test coverage is low โ only 1 test file exists. Recommended: add unit tests for judge.ts, continuity.ts, and skill-chain.ts.