Codebase Analysis
Project Overview
- Name: CodyMaster
- Type: Node.js CLI & MCP Server (Agent Infrastructure)
- Languages: TypeScript, JavaScript
- Frameworks/Libraries: Express, Commander, Better-SQLite3, Playwright, Vitest, VitePress
- Architecture: CommonJS, CLI entry point + local HTTP/WebSocket/MCP servers
Directory Structure
src/- Core TypeScript implementationcli/- Command line interface definitionsbrowse/- Playwright browser automation & hybrid bridgeindexer/- Code and skill indexing logicexecution/,executor/- Agent execution pipelinesstorage/- Database and persistence logic
scripts/- CI/CD quality gates, install scripts, and toolingskills/- CodyMaster AI agent skills librarydocs/- Documentation (VitePress)test/- Vitest test suites
Architecture Layers & Key Modules
- CLI Layer (
src/cli/): Built with Commander, registers allcmcommands (sprint, engineering, browse). - Persistence Layer (
src/storage-backend.ts,src/context-db.ts): Uses SQLite (better-sqlite3) for project working memory, tracking task history, continuity, and agent state. - Execution Pipeline (
src/agent-dispatch.ts,src/sprint-pipeline.ts): Orchestrates sub-agent tasks, parallel execution (src/parallel-dispatch.ts), and skill chaining. - Browse Hybrid Bridge (
src/browse-server.ts,src/browse/): Headless/Headful browser automation using Playwright for visual QA and smoke testing. - Context & Tools (
src/mcp-context-server.ts): Exposes MCP (Model Context Protocol) tools for AI agents. - Skill Evolution (
src/skill-evolver.ts,src/indexer/): Handles indexing, validation, and dynamic updates of.mdskill files.
Entry Points
src/index.ts-> Compiled todist/index.js-> Maps tocmandcodymasterbin commands.src/browse-server.ts-> Background API server for Playwright browser tasks.
Dependencies Overview
- Core:
better-sqlite3,commander,yaml - Server:
express,ws,pino - Agent/UX:
@clack/prompts,prompts,chalk - Dev/Test:
typescript,vitest,playwright,jsdom,vitepress
Test Coverage
- Quality gates exist for syntax, secrets, repo hygiene, smoke, and dist-verify (all in
scripts/). - Extensive unit and integration tests run via
vitest(configured invitest.config.ts, tests intest/).