matcha AGENTS.md

An AGENTS.md instruction file for Matcha, an engineering approach for AI coding agents.

In plain words
What is it for?
Guiding coding work in the Matcha project and deciding when to stop, test, fix failures, or record deliberate shortcuts.
Why use it?
It gives the agent checkpoints for understanding the purpose, reusing code, implementing, cleaning up, verifying, and reviewing changes.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/plumpslabs/matcha/agents-md
Clone the repo
git clone --depth 1 https://github.com/plumpslabs/matcha

Made for: Codex, OpenCode.

Per session 1,870 This file is loaded in full into every session.
When invoked 1,870 The same file β€” it is already loaded in full.
Security scan C 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01870 $0.01870
Opus 5 $0.00935 $0.00935
Sonnet 5 $0.00374 $0.00374
Haiku 4.5 $0.00187 $0.00187

Measured yesterday against content hash 32d9a0bfcb1b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

matcha AGENTS.md scanned grade C with 1 finding against 26 rules in 11 categories β€” prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency β€” measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- **Shield Protection Active:** Command execution is guarded by `matcha-shield.js` and MCP tools (`matcha_shield_check`, `matcha_post_write_scan`). Destructive commands (`rm -rf /`, `git push --force`, `git reset --hard`
AGENTS.md Β· 88 lines

How it starts

The opening of the file, as written. The whole thing β€” 88 lines β€” stays where its author put it; the contents beside it link to each section on GitHub.

🍡 matcha β€” Core AI Directives

Simple. Efficient. Deliberate. Never twice.

Engineering philosophy for AI coding agents. Enforces deliberate thinking before, during, and after implementation.

<execution_filter>

The 6-Checkpoint Filter

🎯 Purpose β†’ πŸ”Ž Reuse β†’ πŸ” Stack β†’ πŸ› οΈ Implementation β†’ 🧹 Cleanup β†’ βœ… Verify β†’ πŸ”’ Review

# Checkpoint Rule
🎯 Purpose + Reuse Intent Discovery with evidence (file:line, metrics). Can't answer Why/How? β†’ STOP unless trivial (≀5 LOC, 1 file, no logic) β€” then proceed on a recorded assumption. Search codebase first (src/, lib/, pkg/, app/). Never duplicate.
πŸ” Stack Scan manifests (package.json, Cargo.toml, go.mod, etc.) for service overlap.
πŸ› οΈ Implementation No hardcode. Explicit errors. One function = one responsibility. Simpler path? β†’ Use it. Deliberate-choice comments β†’ // matcha: marker at write time (not cleanup).
🧹 Cleanup Done = working AND clean. Mark deliberate shortcuts with // matcha: [reason] β€” standard format + English only.
βœ… Verify Run empirical test/build command. Fail? β†’ STOP and fix immediately.
πŸ”’ Review Blocking gate. Catch bugs, performance, security, architecture. Nothing ships without PASS.
</execution_filter>

<core_principles>

Core Principles

  1. Proportionality (effort ↔ risk) β€” Match ceremony to task size: trivial (≀5 LOC, 1 file, no logic) β†’ no plan, fast pass; small (1-3 files) β†’ short plan + lint review; large (cross-cutting/prod risk) β†’ full gate. Planning > implementation = over-planning. Exit conditions beat STOP: proceed on a recorded assumption rather than blocking on trivia.
  2. Simple AND Efficient (Never Twice) β€” Choose the path that is BOTH simple to read AND optimal in runtime. Naive code causing future refactoring is a failure.
  3. DRY & Reuse First β€” Search codebase before writing new code (file:line evidence required). Never duplicate existing functions.
  4. Type-Safe & Boundary Guard β€” Strict types (no any). Validate schemas and inputs at entry points (fail fast).
  5. Pure Core & Clean Architecture β€” High cohesion, low coupling, deterministic pure logic. Isolate side effects.
  6. Performance & Resource Awareness β€” Zero N+1 queries or unbatched I/O, avoid O(nΒ²+) time/space complexity, prevent memory leaks, limit payload sizes.
  7. Security & Data Safety β€” Parameterize queries (no SQLi/XSS), isolate credentials to env vars ([APPNAME]_VAR_NAME), restrict least-privilege state access.
  8. Resilience & Explicit Errors β€” Idempotent mutations (safe to retry), explicit error paths, no silent catches or dummy fallbacks.
  9. Zero Tech Debt Leakage β€” Mark deliberate shortcuts with // matcha: [reason] β€” standard format + English only (// matcha:explain <reason>, // matcha:todo <task>, // matcha:debt <reason>, <fix when>, // matcha:adr <ref>). Do it at write time, not as a cleanup pass β€” if a comment documents a deliberate choice (skip, workaround, intentional hardcode), prefix it while writing. Plain "what this does" comments need no marker.
  10. Loop Guardrail (Self-Termination) β€” Halt and ask for guidance if 2 consecutive attempts fail or yield identical results.
  11. Empirical Verification Anchor β€” Never declare completion without fresh test/build execution logs confirming success. </core_principles>

Read the full file on GitHub Β· 88 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen Β· 88 lines Β· 1,870 tokens per session scan C 32d9a0bfcb1b

Subscribe to this mod's changes

matcha AGENTS.md is an instructions file published in the GitHub repository plumpslabs/matcha (1 stars, last pushed 22d ago), licensed MIT. It adds 1,870 tokens to every session, about $0.0093 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.