Skip to content

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 implementation
    • cli/ - Command line interface definitions
    • browse/ - Playwright browser automation & hybrid bridge
    • indexer/ - Code and skill indexing logic
    • execution/, executor/ - Agent execution pipelines
    • storage/ - Database and persistence logic
  • scripts/ - CI/CD quality gates, install scripts, and tooling
  • skills/ - CodyMaster AI agent skills library
  • docs/ - Documentation (VitePress)
  • test/ - Vitest test suites

Architecture Layers & Key Modules

  1. CLI Layer (src/cli/): Built with Commander, registers all cm commands (sprint, engineering, browse).
  2. 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.
  3. Execution Pipeline (src/agent-dispatch.ts, src/sprint-pipeline.ts): Orchestrates sub-agent tasks, parallel execution (src/parallel-dispatch.ts), and skill chaining.
  4. Browse Hybrid Bridge (src/browse-server.ts, src/browse/): Headless/Headful browser automation using Playwright for visual QA and smoke testing.
  5. Context & Tools (src/mcp-context-server.ts): Exposes MCP (Model Context Protocol) tools for AI agents.
  6. Skill Evolution (src/skill-evolver.ts, src/indexer/): Handles indexing, validation, and dynamic updates of .md skill files.

Entry Points

  • src/index.ts -> Compiled to dist/index.js -> Maps to cm and codymaster bin 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 in vitest.config.ts, tests in test/).

CodyMaster — AI-assisted engineering toolkit