Simple. Efficient. Deliberate. Never twice.
Engineering philosophy for AI coding agents.
6 modules Β· 7 commands Β· 6 agents Β· 7 hooks Β· 1 MCP server
matcha is a productivity layer for AI coding agents. It makes agents think before they code β checking purpose, reusing existing code, auditing the stack, and reviewing before shipping.
Without matcha: Agent jumps in, writes code, realizes mid-way something was wrong.
With matcha: Agent stops, asks "why?", searches for existing solutions, then implements deliberately.
Every implementation passes through:
π― Purpose β π Reuse β π Stack β π οΈ Implementation β π§Ή Cleanup β β
Verify β π Review
| # | Check | What it prevents |
|---|---|---|
| π― | Purpose + Reuse | Building the wrong thing, duplicating existing code |
| π | Stack | Adding overlapping dependencies |
| π οΈ | Implementation | Over-engineering, hardcoding |
| π§Ή | Cleanup | Shipping debug code, temp files |
| β | Verify | Shipping broken code |
| π | Review | Shipping bad patterns, security issues |
curl -fsSL https://raw.githubusercontent.com/plumpslabs/matcha/main/install.sh | bashAuto-detects your platform and installs the right files.
/plugin marketplace add https://github.com/plumpslabs/matcha
/plugin install matcha@plumpslabs-matchagit clone https://github.com/plumpslabs/matcha.git
cd matcha
node bin/matcha.js initnode bin/matcha.js statusmatcha now supports project-specific rules β things the agent must know that can't be inferred from reading code.
Create MATCHA_PROJECT.md in your project root:
# Project Constraints
### Example `MATCHA_PROJECT.md` (Auto-generated per project)
```markdown
# π΅ MATCHA_PROJECT.md β Project Constraints
## 1. Stack & Architecture
- **Language / Ecosystem:** Polyglot (Rust / Go / Python / Java / JS)
- **Architecture Pattern:** Pure Core Logic, High Cohesion, Low Coupling
## 2. Verification Commands
- **Typecheck / Lint:** [native project check command]
- **Test Suite:** [native project test command]
- **Build Target:** [native project build command]Keep it under 80 lines. Only rules that surprise new developers.
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Phase 1: PLAN β β β Phase 2: SEARCH β β β Phase 3: CODE β β β Phase 4: SHIP β
β @matcha-plannerβ β @matcha-finder β β @matcha-debuggerβ β /matcha:review β
β (/matcha:why) β β (Reuse Check) β β (Systematic Fix)β β @matcha-cleaner β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
- Phase 1: Plan & Intent β
@matcha-planneror/matcha:why(Intent Discovery) - Phase 2: Search & Reuse β
@matcha-finder(hunt existing codefile:line) - Phase 3: Code & Debug β Follow 8-Pillar Directives +
@matcha-debuggerif stuck - Phase 4: Review & Ship β
/matcha:review(blocking L0-L3 gate) +@matcha-cleaner
Minimal cheat-sheet: plan β reuse β implement β review. Everything else is automatic or optional. Full step-by-step guide with example prompts lives in the Workflow Guide.
| Command | Purpose |
|---|---|
/matcha:toggle |
Toggle governance on/off instantly ( |
/matcha:on |
Enable matcha governance & safety checks |
/matcha:off |
Pause governance & planning gate (free mode) |
/matcha:why |
Intent Discovery β answer before coding |
/matcha:review |
Blocking review gate β 9 categories |
/matcha:audit |
Stack health β overlaps, waste, security |
/matcha:intensity |
Set level: observe / enforce / audit |
/matcha:status |
Session dashboard |
/matcha:debt |
Technical debt from // matcha: markers |
/matcha:markers |
Scan markers by severity |
| Agent | Role |
|---|---|
@matcha-planner |
Plan through checkpoints (read-only) |
@matcha-finder |
Hunt existing code before writing |
@matcha-auditor |
Stack audit for overlaps |
@matcha-reviewer |
Review gate β blocks bad code |
@matcha-cleaner |
Remove temp/debug/unused |
@matcha-debugger |
Systematic debugging |
π Enforced permissions (OpenCode
permission:+ Claude CodedisallowedTools:): planner/finder/reviewer/auditor are read-only βeditis denied for all source code. Only plan/report files are writable (.agents/plan/current.md,.agents/reports/**). debugger/cleaner may modify code. Other providers: prompt-level + hooks.
| Level | Behavior |
|---|---|
| observe | Tips only. No blocking. |
| enforce | Full filter + review gate. Default. |
| audit | Enforce + mandatory cleanup. |
Filesystem is durable memory; the context window is volatile. matcha persists gate artifacts so a compacted or fresh session resumes in <500 tokens:
| File | Write | Read |
|---|---|---|
.agents/plan/current.md |
Planning gate β overwrite (living plan) | Start of every task |
.agents/reports/<agent>-<YYYY-MM>.md |
Review/Audit output β append | Resuming or auditing history |
.agents/plan/decisions.log |
matcha decision <type> <reason> |
matcha markers / /matcha:debt |
- Lazy-load only β memory files are never auto-injected into context; read on demand.
- Lifecycle (anti-stale) β
current.mdholds one active task: intent mismatch at start β overwrite; done (review PASS) β reviewer archives toreports/planner-<YYYY-MM>.md+ resets to empty template. Only PASS resets β BLOCK / PASS_WITH_FIXES keeps the plan for fix iteration. - Living over archive β
current.mdoverwrites, never appends. Reports append monthly; keep latest 5 per agent. - Format: YAML frontmatter (
title,date,type,agent,status,tags) β grep-able, git-friendly.
matcha ships an MCP server for cross-platform use. It exposes matcha's checks as tools any MCP-capable agent can call (Claude, Cursor, Windsurf, AGY, OpenCode, Cline, Roo). Optional β the rules files work without it; MCP adds deterministic, programmatic enforcement.
Add to your MCP client config (Claude/Cursor/Windsurf/AGY format):
{
"mcpServers": {
"matcha": {
"command": "node",
"args": ["hooks/matcha-mcp-server.js"]
}
}
}OpenCode uses a different schema β command must be an array:
{
"mcp": {
"matcha": {
"type": "local",
"command": ["node", "hooks/matcha-mcp-server.js"],
"enabled": true
}
}
}Install the CLI once, then reference it β works from any project:
npm install -g @plumpslabs/matcha
# Claude/Cursor/Windsurf/AGY:
# "mcpServers": { "matcha": { "command": "matcha", "args": ["mcp"] } }
# OpenCode:
# "mcp": { "matcha": { "type": "local", "command": ["matcha", "mcp"], "enabled": true } }| Tool | Purpose |
|---|---|
matcha_shield_check |
Check command for dangerous patterns |
matcha_post_write_scan |
Scan file for cleanup issues (13+ languages) |
matcha_stop_tips |
Generate tips from git diff |
matcha_plan_validate |
Validate Intent Discovery plan |
node hooks/matcha-mcp-server.js
# or
npm run mcp| Hook | When | What it does |
|---|---|---|
planning-gate.js |
Before first edit | Blocks code until an Intent Discovery plan exists |
matcha-shield.js |
Before tool use | Blocks dangerous commands + mode detection |
audit-log.js |
Override / Toggle | Tamper-evident governance & override logging |
blast-radius.js |
Pre/Post edit | Dynamic risk scoring (L0-L3) based on git diff |
evidence-collector.js |
Verification | Captures empirical test exit codes (anti-theater) |
matcha-post-write.js |
After file write | Scans for debug code, secrets, empty catches |
matcha-stop.js |
Task complete | Generates tips from git diff |
matcha-metrics.js |
Session | Tracks session metrics |
matcha-agy-hooks.js |
Antigravity tool use | Routes agy tool names to gate decisions |
matcha-instructions.js |
Session start | Injects matcha rules into agent context |
| Platform | Integration |
|---|---|
| Claude Code | .claude/settings.json hooks |
| OpenCode | .opencode/plugins/matcha.js |
| Any MCP client | MCP server (see above) |
| Any platform | .agents/ universal format |
matcha checks work across 13+ languages:
JS Β· TypeScript Β· Go Β· Python Β· Rust Β· Java Β· C# Β· C/C++ Β· Ruby Β· Swift Β· PHP Β· Kotlin Β· Dart
Plus SQL queries and prose (markdown) writing quality.
Source of Truth:
βββ AGENTS.md β Primary cross-tool file
βββ skills/matcha/
β βββ SKILL.md β Router (references modules)
β βββ modules/
β βββ core.md β 6-checkpoint filter + modes
β βββ project.md β Project constraints (fill in once)
β βββ modes.md β Context-aware mode switching
β βββ risk.md β Risk-based review routing (L0-L3)
β βββ engineering.md β Universal engineering bar (errors, logging, validation, API, state)
β βββ legacy.md β Legacy code protocol
βββ hooks/
β βββ patterns.json β Multi-language pattern registry (13+)
β βββ matcha-trigger-packs.json β Domain-specific risk signals
β βββ planning-gate.js β Planning gate enforcement (blocks edits before plan)
β βββ danger-checks.js β Danger pattern detection (shield/planning support)
β βββ mode-detect.js β Context-aware mode detection
β βββ matcha-agy-hooks.js β Antigravity (agy) hook adapter
β βββ matcha-mcp-server.js β MCP server (4 tools)
β βββ matcha-shield.js β Safety gate + mode detection
β βββ matcha-post-write.js β Cleanup enforcement
β βββ matcha-stop.js β End-of-task tips
β βββ matcha-metrics.js β Session metrics tracking
βββ commands/ β 7 slash commands
βββ .agents/agents/ β 6 agent definitions
βββ agents/ Β· rules/ Β· mcp_config.json β AGY plugin package (agy plugin install)
βββ plugin.json Β· .claude-plugin/ Β· gemini-extension.json β plugin manifests
npm run build # Generate all platform adapters from source
npm run build:check # Build + verify copies in sync- π» Kuma β Runtime safety enforcement (MCP server)
- π¦ Fennec β AI-native developer observability (MCP server)
The stack: matcha π΅ (philosophy) + kuma π» (safety) + fennec π¦ (observability)
npm run benchmark # Compliance score
npm run benchmark:agentic # A/B/C comparison (baseline vs terse vs matcha)
npm run benchmark:agentic-live # Live Claude Code sessionsSee CONTRIBUTING.md for guidelines.
npm test # Run tests
npm run build # Rebuild adapters
npm run build:check # Verify everything in syncMIT Β© plumpslabs
Simple. Efficient. Deliberate. Never twice.
