Skip to content

System Architecture

Quick Reference

  • Pattern: Modular Monolith (CLI + REST API in single process)
  • Runtime: Node.js with TypeScript
  • Storage: File-based JSON (zero external DB)
  • API: Express REST API (dashboard)
  • CLI: Commander.js

High-Level Architecture

Developers interact via CLI or Dashboard. AI agents read skills directly from filesystem and interact with the REST API. All data persists to JSON files.

Component Overview

CLI (src/index.ts)

The primary interface for developers. Built with Commander.js, it provides commands for:

  • Task management — add, list, move, done, dispatch
  • Project management — add, list, remove
  • Deploy tracking — staging, production, rollback
  • Working memory — init, status, reset, learnings
  • Skill chain — list, start, advance, auto
  • Judge — evaluate task health, suggest agents

Dashboard Server (src/dashboard.ts)

Express.js REST API that powers the browser-based Kanban dashboard.

  • SPA architecture — static files served from public/dashboard/
  • Full CRUD for projects, tasks, deployments, changelog
  • Real-time features — transition validation, stuck task detection
  • Judge API — task health evaluation, agent suggestions
  • Chain API — start/advance/abort skill chain executions

Judge Agent (src/judge.ts)

Autonomous task health evaluator:

  • Detects stuck tasks (no updates for 30+ minutes)
  • Evaluates task complexity and suggests priority changes
  • Recommends best agents for specific skills
  • Maps skills to domains (engineering, operations, product, etc.)
  • Suggests valid state transitions

Working Memory (src/continuity.ts)

Persistent context system — inspired by Loki Mode:

  • CONTINUITY.md — current session state, active goal, next actions
  • learnings.json — captured error patterns (persists across sessions)
  • decisions.json — architecture decisions (persists across projects)
  • config.yaml — RARV cycle settings

Skill Chain (src/skill-chain.ts)

Multi-skill pipeline engine:

  • Predefined chains — e.g., "feature" chain: planning → tdd → execution → review → deploy
  • Chain execution — tracks progress through steps
  • Auto-matching — matches task titles to appropriate chains
  • Skip/abort — allows skipping steps or aborting chains

Agent Dispatch (src/agent-dispatch.ts)

Dispatches tasks to AI agents with platform-specific adapters:

  • Generates dispatch files for each AI platform
  • Validates dispatch preconditions (agent assigned, project path exists)
  • Supports force re-dispatch for retries

Design Decisions

Why File-based JSON Storage?

DecisionRationale
JSON files over databaseZero setup overhead. cm init works immediately. No Docker, no PostgreSQL, no SQLite drivers.
Single data fileAtomic read/write. No migration scripts. Easy backup (just copy the file).
.cm/ directory per projectKeeps working memory alongside code. Version-controllable context.

Why Modular Monolith?

DecisionRationale
Single processCLI and dashboard share the same data layer. No IPC overhead.
Module separationEach concern (judge, continuity, chain) is a separate TypeScript module. Easy to test and refactor independently.
No microservicesFor a developer tool, operational simplicity trumps scalability. One npm install and you're done.

Why Universal Skills Format?

DecisionRationale
Plain markdownEvery AI agent can read markdown. No proprietary format required.
YAML frontmatterStandard metadata format with name and description fields.
Platform adaptersSmall adapter files translate the universal format to each platform's conventions (Antigravity, Claude, Cursor, etc.)

Technology Stack

LayerTechnologyRationale
LanguageTypeScript 5.9Type safety + Node.js ecosystem
CLICommander.js 14Industry standard CLI framework
HTTPExpress 5Lightweight REST API server
TestingVitest 4Fast, TypeScript-native test runner
Buildtsc + ts-nodeSimple compilation, no bundler needed
HostingCloudflare PagesEdge deployment for landing page
Terminal UXChalk 5Cross-platform colored terminal output

Open Source AI Agent Skills Framework