MetaCoder Documentation

Command reference for MetaCoder's Harness Engineering pipeline (/harness) and the four automation tools. Syntax, flags and defaults on this page are verified against the MetaCoder source code.

Every command runs inside MetaCoder (Desktop or the agent prompt). Slash commands are typed as shown, e.g. /harness status.

Overview

MetaCoder is a graph-first AI development tool for large-scale systems. It turns a codebase into a Semantic Knowledge Graph and drives AI development through Harness Engineering — a disciplined 10-phase pipeline with machine-verified quality gates. Two command families:

Install & first run

Download the free Desktop app for Windows or macOS from the download page. A typical first session:

/harness init --template react-nextjs-frontend /harness spec --advance "user dashboard with auth and i18n" /harness implement /harness phase advance

Harness Engineering — concept & pipeline

Harness Engineering gives AI-driven development a fixed order and quality standards verified by machine, not by optimistic self-report. Humans and AI travel the same rails.

The 10-phase pipeline

Each phase advances only when its gate passes; rollback steps back one phase at a time.

requirements → design → test-spec → implementation → code-review → integration-test → performance → security → deploy-plan → confirm ✅

4 roles (auto-assumed per phase)

RolePhases
pmrequirements / design / deploy-plan / confirm
testertest-spec / integration-test
developerimplementation / performance
reviewercode-review / security
Gate contents are project-defined. The specific checks each gate runs come from your harness/workflow/gates.yaml. Lists in this doc reflect the standard template that /harness init generates.

spec-kit — design first, build exactly to the design

spec-kit is the key innovation: the AI first produces an industry-standard design (a project constitution plus a spec.md → plan.md → tasks.md chain), then implements strictly to it — no more, no less. This prevents AI hallucination from adding imagined, out-of-scope features. spec-kit is active when METACODER_HARNESS_SPEC_MODE is not off; it powers /harness spec, auto-generates tasks.md on the design → test-spec advance, and promotes cross-cutting features (auth, i18n, AI assistant) to first-class tasks so nothing is buried.

/harness — command reference

18 subcommands in three groups. Flags and defaults below are taken from the source (src/skills/bundled/harness.ts and the _exec registry).

Setup & inspect

/harness init

/harness init [--template TYPE] [--force]

Purpose: Scaffold a harness/ discipline directory in the workspace. Prereq: none (warns if harness/ exists unless --force).

Effect: creates harness/{rules,skills,agents,workflow,context}/ plus workflow/phases.yaml and gates.yaml. With spec-kit on, also writes harness/constitution.md (3 articles) and harness/specs/.gitkeep.

FlagDefaultMeaning
--template TYPEminimalminimal, java-spring-enterprise, node-fastapi, python-django, go-microservice, react-nextjs-frontend, cobol-modernization
--forcefalseOverwrite existing harness/ files without confirmation

/harness spec

/harness spec [--feature <name>] [--inputs <paths>] [--advance] [--db <dir>] <brief>

Purpose: Kick off the requirements/design phase — make the AI author the design documents from declared inputs and write no product code (the symmetric counterpart to /harness implement). Status: implemented.

Prereq: current phase must be requirements or design (auto-initializes to requirements if phase state was never set). <brief> is required in requirements.

Effect: resolves the active feature (scaffolds one if needed), loads design inputs from harness/inputs.yaml + --inputs, writes docs/SPEC_PLAN.md (the authoring SOP), the AI authors spec.md (then plan.md + data-model.md in design), runs a self-check (template placeholders, empty cross-cutting section, unresolved [NEEDS CLARIFICATION]). With --advance and a clean self-check, runs the gate and continues to the next phase.

FlagDefaultMeaning
--feature <name>derived from briefFeature display name
--inputs <p1,p2,…>harness/inputs.yamlCSV of design-input paths appended to the inputs registry
--advanceoffAfter a clean self-check, run the gate and continue into the next phase
--db <dir>emptyDesign-docs directory. The live DB URL recorded as a spec assumption comes from DATABASE_URL, not this flag.

/harness validate

/harness validate

Purpose: Check harness/ layout integrity. Prereq: init done.

Effect: reports ok, errors () and warnings (). With spec-kit on, also shows a Constitution section and a cross-artifact consistency section. No flags.

/harness lint

/harness lint

Purpose: Run rules from harness/rules/*.md against your source. Prereq: init done.

Effect: returns a 0–100 score and a violations table (severity / file / line / rule / message). With spec-kit on, constitution-conformance and no-unresolved-clarification always run. No flags.

/harness status

/harness status

Purpose: Show current harness state. Prereq: none (prints "not initialized" if absent).

Effect: detected template, required/optional files present/missing. With spec-kit on, also constitution version, active feature, unresolved-clarification count. Bare /harness defaults to status. No flags.

/harness phase init

/harness phase init [--phase <id>] [--feature <name>]

Purpose: Initialize the phase state machine. Prereq: init done.

FlagDefaultMeaning
--phase <id>requirementsPhase to initialize at
--feature <name>nonespec-kit only: scaffold specs/<NNN-name>/{spec,plan,tasks}.md and set the active feature
Pipeline control

/harness phase status

/harness phase status

Purpose: Print current phase, role, rollback count and last gate result. Prereq: phase state initialized.

Effect: with spec-kit on, also shows the active feature, task progress (done/total %) and, in requirements, unresolved clarifications. No flags.

/harness phase advance

/harness phase advance [--reason "…"] [--no-interactive]

Purpose: Run the current phase's gate and, on pass, advance to the next phase with automatic role re-assume. The most-used command.

Effect: (spec-kit, requirements) resolves [NEEDS CLARIFICATION] interactively; runs the gate; advances + re-assumes the phase-default role; on design → test-spec auto-generates tasks.md; on entering implementation, prompts you to use /harness implement first.

FlagDefaultMeaning
--reason "…"emptyAudit reason
--no-interactiveoffspec-kit only: in requirements, block instead of prompting when clarifications are unresolved

/harness phase rollback

/harness phase rollback [--reason "…"]

Purpose: Roll back one phase. Prereq: rollback-attempt limit not exceeded (else "Human approval required").

Effect: returns to the previous phase and increments the attempt counter. Flag: --reason (audit reason).

/harness gate

/harness gate <gateId>

Purpose: Run a single named gate from gates.yaml (verify only; no phase change). Prereq: <gateId> defined (omit to list gate ids).

Effect: returns a per-check pass/fail table. gate-integration-test is special: it runs the /systest pipeline in-session (inheriting the Claude-in-Chrome MCP) rather than as a programmatic check.

/harness assume

/harness assume <role> [--reason "…"]

Purpose: Manually set the active role (suppresses phase auto-assume). Role: pm | developer | reviewer | tester.

Effect: sets the manual role, writes the persona block to CLAUDE.md, appends a role-assume audit entry.

/harness role

/harness role

Purpose: Show the active role, whether it is manually overridden, and the phase-default role. No flags.

Implement & advanced

/harness implement

/harness implement

Purpose: Implement the next not-done task from tasks.md, gated by test-plan.md acceptance criteria. Prereq: current phase must be implementation; an active feature with tasks.md must exist.

Effect: aggregates the next task(s) + acceptance criteria into docs/IMPLEMENT_PLAN.md; the AI implements with a mandatory per-task self-check (AC coverage + design re-read for omitted cross-cutting features), then marks tasks done. Mode is driven by permission mode: auto / bypassPermissions → continuous (implements all tasks in order); otherwise single-task then stop. No flags.

/harness context

/harness context <show | refresh | query <text>>

Purpose: Manage the 3-layer context (session / phase / on-demand). Prereq: init done.

/harness approve

/harness approve <gateId> [--reason "…"]

Purpose: Record human approval for a pending human-approval gate check. Effect: writes a YAML approval record (consumed on the next gate run) and an audit entry.

/harness drill

/harness drill [--skip-gates] [--from <phaseId>] [--to <phaseId>]

Purpose: Virtual dry-run of the whole pipeline without persisting state. Prereq: init done.

FlagDefaultMeaning
--skip-gatesfalseWalk all phases, structure check only (skip gate execution)
--from <phaseId>default phaseStart phase (inclusive)
--to <phaseId>terminal phaseEnd phase (inclusive)

/harness ai-rate

/harness ai-rate [--since <days>]

Purpose: Measure AI adoption (% of code authored/accepted by AI) from git history. Prereq: a git repo.

Effect: detects AI commits (author/email matches claude|anthropic, or a Co-Authored-By: Claude trailer) and reports commit-level + line-level rates and a per-author table. Flag: --since <days> (default 30).

/harness ci-init

/harness ci-init [--target github|gitlab|both] [--force]

Purpose: Emit CI scaffold files (idempotent). Effect: github.github/workflows/harness.yml; gitlab.gitlab-ci.yml; both → both. Existing files skipped unless --force.

FlagDefaultMeaning
--targetgithubgithub | gitlab | both
--forcefalseOverwrite existing CI files

Automation tools

/modernize and /newproject share the same argument parser; /systest has its own; /env is prompt-driven (subcommands). All flags below are verified against the source.

/modernize

Modernize a legacy codebase — analyze legacy source (and screenshots) via a knowledge graph, decompose into PRP modules, then multi-agent TDD-develop, test and document a new web app, without touching the legacy tree.

/modernize --workspace <legacy> --database <conn> [--output <dir>] [--design-style <name>] [--backend-lang] [--frontend-lang] [--language ja|en|zh] [--team] [-v] [--env <name>]
Flag (long / short)DefaultMeaning
--workspace / -wrequiredLegacy code path (read-only reference)
--output / -o= workspaceOutput dir for modernized code
--database / --dbunsetDatabase connection URL
--design-docs / -dunsetRequirements/design docs directory
--design-styleunsetBrand design language for the generated UI — see Design styles (70+ presets, e.g. stripe, linear.app, notion)
--backend-lang / --frontend-langunsetTarget backend / frontend framework
--reference / -runsetReference project path
--language / -ljaDocumentation language
--teamfalseEnable experimental Agent Teams
-v / --verifyfalsePause at end of Phase 3 for review
--envunsetActivate a named infra env (URLs auto-filled)

Phase flow

Phase 0 Graph Init (legacy + output graphs) → Phase 3 Module Decomposition (PRPs) → Phase 3.5 Contract Generation (openapi.yaml) → Phase 4 Multi-Agent TDD Development → Phase 4.5 Acceptance Cross-check → Phase 5 Automated Test → Phase 6 MODERNIZATION_REPORT.md

Design styles (--design-style)

Pass --design-style <name> to make the generated frontend follow a ready-made brand design language. MetaCoder reads the design spec (colors, typography, spacing, component patterns) from the open-source awesome-design-md library and applies the matching DESIGN.md during Phases 3–4 — so the modern UI looks intentional, not generic.

70+ brand presets are available, for example: apple, stripe, linear.app, notion, vercel, claude, figma, airbnb, spotify, tesla, shopify, supabase, raycast, nike, uber.

Browse the full catalogue (each preset is a folder with a DESIGN.md): github.com/VoltAgent/awesome-design-md. Use the folder name as the --design-style value, e.g. --design-style stripe.

/newproject

Build a greenfield project from requirement documents — confirm decisions via a Socratic Q&A, decompose into PRPs, then multi-agent TDD-develop, test and document a full-stack web app.

/newproject --workspace <dir> --design-docs <reqs> [--database <conn>] [--reference <proj>] [--design-style] [--backend-lang] [--frontend-lang] [-v] [--env]

Uses the same shared parser as /modernize, so the full flag set is identical. Notable differences below.

FlagDefaultMeaning
--workspace / -wrequiredOutput workspace for the new code
--design-docs / -dunsetRequirements docs (enumerated only, not regex-parsed)
--reference / -rautoReference/PoC project; auto-detected from common folders if omitted
--database / --dbresolvedIf omitted: session TiDB (DATABASE_URL) → else local SQLite
-v / --verifyfalsePause at end of Phase 3 (the Socratic phase is itself interactive)

Phase flow

Phase 0 Graph Init (empty) → Phase 1.5 Socratic Requirements Confirmation (7–15 Q) → Phase 3 Module Decomposition → Phase 3.5 OpenAPI 3.1 Contract → Phase 4 Code Generation → Phase 4.5 Acceptance Cross-check → Phase 5 Automated Test → Phase 6 Docs

/systest

Automated system QA of a running app — builds a knowledge graph, generates two-layer test cases, then runs API + Chrome-MCP frontend E2E tests with an auto-fix loop and an evidence-backed self-audit.

/systest run --workspace <path> [--backend-url <url>] [--frontend-url <url>] [--database <conn>] [--env <name>] [--design-docs <path>]
Flag (long / aliases / short)DefaultMeaning
--workspace / -wrequiredProject workspace to test
--backend-url / --backend / -bunset / from envBackend base URL → enables Phase 5B (API testing)
--frontend-url / --frontend / -funset / from envFrontend URL → enables Phase 5C (E2E). Absent ⇒ 5C skipped
--database / --database-url / --dbunset / from envDatabase URL (user creation, admin promotion)
--envunsetNamed env; fills missing URL slots (explicit flags win)
--design-docs / -dunsetDesign documents directory

Phase flow

Step 0 Env Discovery (production ⇒ hard refuse) → Phase 1–3 Init / Graph → Phase 4 Test-case Generation (Layer1 CRUD / Layer2 scenario) → Phase 5A Seed + Quality Gate → Phase 5B Backend API → Phase 5C Frontend E2E (Chrome MCP) → Phase 6 TEST_REPORT.md → Phase 6.5 Evidence Self-audit

/env

Prompt-driven infrastructure-environment manager — list, switch, import/export, edit, health-check and diff environments defined in .metacoder/environments.yaml, with secret-safety and a preview → /apply guard.

/env <list | use | reset | add | edit | remove | clone | set | import | export | doctor | diff>
SubcommandMeaning
/env list [--tag TAG]List envs + active (bare /env = list)
/env use NAME [Reason: …]Switch active env
/env resetReturn to the default env
/env import PATH --as NAMEImport a .env; auto-classify keys var/secret
/env export NAME [--include-secrets]Export as .env; secrets masked unless flag
/env add NAME [extends PARENT] [field=VALUE …]Add env (requires cloud.provider, cloud.region, safety.destructive_ops)
/env edit NAME [field=VALUE …]Shallow-merge field updates
/env remove NAMERemove env (warns about dependents)
/env clone SRC DST [field=VALUE …]Copy with overrides
/env set NAME.PATH VALUEDot-path single-field set
/env doctor [--level basic|standard|full] [--env NAME] [--force] [--offline]Health check (full blocked on production unless --force)
/env diff A BSide-by-side diff after extends resolution
Accuracy note: a 60-rule CLI allowlist, a SQL classifier and two-phase-commit belong to the separate /deploy skill, not /env. /env only surfaces safety.writes_two_phase_commit as a flagged field in /env diff.

Documentation reflects MetaCoder Desktop v3.6.22. Command syntax is verified against the source code; gate contents are defined per project in harness/workflow/gates.yaml.