mtk-agent-toolkit
AGENTS.md9 starsChanged 29 days agoMITView on GitHub
Canonical instructions for every AI coding agent working in this repo — Claude Code, Codex CLI, Cursor, Copilot, Windsurf, OpenCode and anything else that reads AGENTS.md. CLAUDE.md is a shim that imports this file; the tool-specific mirrors under .github/ and .windsurf/ point here. Version history and per-release notes: see CHANGELOG.md. (Kept out of this file so the always-loaded prefix stays prompt-cache-stable across releases.) This file + .claude/rules/ are the source of truth for AI agents. Detailed standards live in .claude/rules/.…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,542 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository34 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- batch-fixSkill
- brainstormingSkill
- code-review-and-qualitySkill
- code-simplificationSkill
- context-engineeringSkill
- fixSkill
- handoffSkill
- implementSkill
- incremental-implementationSkill
- instructionsSkill
- lessonsSkill
- mtk-doctorSkill
- mtk-setupSkill
- mtkSkill
- planning-and-task-breakdownSkill
- pre-commit-reviewSkill
- prior-work-checkSkill
- promote-lessonSkill
- repo-healthSkill
- research-contextSkill
- security-and-hardeningSkill
- setup-auditSkill
- setup-bootstrapSkill
- setup-refreshSkill
- spec-drift-detectionSkill
- spec-driven-developmentSkill
- subagent-implementationSkill
- tech-stack-dotnetSkill
- tech-stack-pythonSkill
- tech-stack-typescriptSkill
- verification-before-completionSkill
- workflow-artifactsSkill
- writing-skillsSkill
The file
We split this AGENTS.md into the rules it gives an agent
8 rules. About 1 is common, 3 are distinctive, and 4 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 67
C0.2: Every repo file must have a manifest.json files entry, except the short allow-list of non-shipped files in validate-toolkit.sh …
- Common: line 71
C0.6: Never hardcode secrets, API keys, or user-specific paths in committed files.
- Very specific: line 73
C0.8: Run bash scripts/validate-toolkit.sh and confirm "Toolkit validation passed" before reporting any change as complete.
- Distinctive: line 111
Read this file first — it is the project-specific source of truth.
- Very specific: line 112
Start a task with context-engineering.
- Distinctive: line 113
If an entry-point skill exists for the task, prefer it — it orchestrates the underlying workflow skills.
- Distinctive: line 114
Do not skip planning, testing, review, or verification when the chosen skill requires them.
- Very specific: line 119
All agents may report BLOCKED or NEEDS_CONTEXT instead of producing uncertain output.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
claude-helpers — MTK Standards
Canonical instructions for every AI coding agent working in this repo — Claude Code, Codex CLI, Cursor, Copilot, Windsurf, OpenCode and anything else that reads
AGENTS.md.CLAUDE.mdis a shim that imports this file; the tool-specific mirrors under.github/and.windsurf/point here.Version history and per-release notes: see CHANGELOG.md. (Kept out of this file so the always-loaded prefix stays prompt-cache-stable across releases.)
This file +
.claude/rules/are the source of truth for AI agents. Detailed standards live in.claude/rules/. Reference docs live in.claude/references/(shared) and per-stack subdirectories of it.
Skill Routing
| What you need | Command | When |
| First-time repo setup | /mtk-setup | Bootstrap — detects tech stack, pulls guidelines, generates AGENTS.md (plus the CLAUDE.md shim) and the architecture-principles reference |
| Re-run audit | /mtk-setup --audit | Refresh the generated architecture-principles reference after architectural change |
| Merge multi-repo audits | /mtk-setup --merge | Unify per-repo audits in .claude/references/audits/ into a team-wide doc |
| Everything else | /mtk <description> | Natural language — routes to fix / batch-fix / implement / pre-commit-review / repo-health / instructions / mtk-doctor |
| Run a known workflow directly | /mtk:implement, /mtk:fix or /mtk:batch-fix | Skip the router when you already know the workflow — same skill the router would load |
| Periodic readiness check | /mtk repo-health or bash scripts/repo-health-score.sh | 9-asset action checklist + PR review mining (last 10 merged PRs) |
| Validate toolkit | bash scripts/validate-toolkit.sh | Before every commit — structural check of manifest, plugin.json, and skill anatomy |
| Install health check | /mtk-doctor | PASS/WARN/FAIL diagnostics across core files, components, hooks, active config and environment fit; --json for CI, --fix for safe auto-repairs, --usage for raw usage counts |
| Promote a lesson | /lessons promote | Promote a rule from Claude Code native memory to team-wide tasks/lessons.md; optionally open a validated contribute-back PR to the toolkit (/promote-lesson is a one-release alias) |
| Mine lessons from past sessions | /lessons mine | Sweep recent session transcripts for durable lesson/memory candidates (reject-by-default rubric, suggest-only) |
| Tune MTK behaviour (hooks, rigor, budgets, thresholds) | MTK_* environment variables | Full table of every knob, its default and effect: .claude/references/env-knobs.md |
Decision rule for /mtk: Say what you want in plain English. The router picks the right workflow skill — fix / batch-fix / implement / pre-commit-review / repo-health / research-context / instructions / lessons / mtk-doctor / handoff.
Updates: MTK is a Claude Code plugin — use the plugin manager to upgrade. There is no in-repo update command.
Build & Test
bash scripts/validate-toolkit.sh # structure + manifest (before every commit)
bash scripts/run-fixtures.sh # router + workflow fixtures
claude plugin eval . --tag smoke --scaffold --allow-tools Bash Write Edit --trust-plugin # behavioural evals (model calls; see evals/README.md)
bash scripts/mtk-doctor.sh # install health check (--json, --fix)No dotnet build — this is a markdown/bash/JSON toolkit. Pressure tests are manual: read
tests/pressure-tests/*.md and verify skill behaviour.
Releases regenerate checksums.sha256 via bash scripts/generate-checksums.sh as the last change in the release commit (S4.11).
Project Profile
- Type: Claude Code plugin / shared toolkit
- Languages: Markdown (skills, agents, references), Bash (hooks, scripts), JSON (manifest, settings, plugin)
- Distribution: Claude Code plugin marketplace via
.claude-plugin/plugin.json - Version tracking:
.claude/manifest.json+.claude-plugin/plugin.json(must stay in sync) - Test approach:
scripts/validate-toolkit.sh(structural) +tests/pressure-tests/(adversarial behavioral) - Target audience: Engineering teams building serious software (.NET first-class, Python supported, more stacks pluggable; finance domain supplement included)
- Tech stack architecture: Workflow skills are language-agnostic; per-stack context lives in
tech-stack-{name}skills loaded via.claude/tech-stack
Critical Rules (Always Apply)
- C0.1 Manifest versions must match:
.claude/manifest.jsonversion ==.claude-plugin/plugin.jsonversion ==.claude-plugin/marketplace.jsonplugin entry version, plus a## [X.Y.Z]CHANGELOG heading and thechecksums.sha256header. Bump them together when releasing (S4.6);validate-toolkit.shFAILs on a miss. The moberg-plugins marketplace entry carries no version. - C0.2 Every repo file must have a manifest.json
filesentry, except the short allow-list of non-shipped files invalidate-toolkit.sh(manifest_allowed_unlisted). Every manifest path must exist on disk. - C0.3 Skills follow the anatomy in
.claude/rules/skill-authoring.mdS2.2 (Overview / When To Use / Workflow / Verification for workflow skills; phase-structured and entry-point skills are exempt as listed there). Entry-point skills useallowed-toolsandargument-hintin frontmatter. Skill directory name must match frontmattername:. - C0.4 Agents and skills must have
---frontmatter blocks. - C0.5 Hooks must be executable (
chmod +x) and useset -euo pipefail. - C0.6 Never hardcode secrets, API keys, or user-specific paths in committed files. The local settings override file is gitignored.
- C0.7
AGENTS.mdis protected —setup-bootstrapgenerates it (together with theCLAUDE.mdshim that imports it), but subsequent edits are project-specific. Don't overwrite during update. - C0.8 Run
bash scripts/validate-toolkit.shand confirm "Toolkit validation passed" before reporting any change as complete.
Standards Reference
Detailed rules live in .claude/rules/: toolkit-structure.md (S1.x, manifest/organization/naming),
skill-authoring.md (S2.x), hooks-and-scripts.md (S3.x), git-workflow.md (S4.x), verification-and-proof.md
(S5.x). Rules are path-scoped by their paths: frontmatter; Claude Code loads one when a matching file is touched.
Reference docs are read on demand: shared ones in .claude/references/ (domain-finance.md,
implement-review-lanes.md, env-knobs.md), and
per-stack ones under .claude/references/{stack}/, listed canonically in the active tech stack
skill's ## Reference Files.
Agent Routing
This repository uses skills as both user-facing entry points and reusable workflow blocks, and
agents as specialist reviewers. The routing decision tree, per-workflow composition, the
model-invoked skill list, the two-stage review graph, the review-output schema, the eval pipeline,
tech-stack loading and progressive/path-scoped reference loading all live in
docs/agent-routing-guide.md — read it whenever routing is not obvious.
Eight skills are user-invocable: /mtk-setup (--audit, --merge, --refresh, --check), /mtk <description> (the natural-language router),
/mtk-doctor, /lessons, /promote-lesson (alias), and /mtk:implement, /mtk:fix, /mtk:batch-fix as direct shortcuts for engineers who already know the workflow.
Everything else is a routed workflow skill reached through /mtk, or a model-invoked skill loaded automatically when its trigger fires.
The canonical route list is the /mtk decision rule above.
The active tech stack is recorded in .claude/tech-stack; every entry-point skill and agent reads
it in Phase 0 and loads the matching tech-stack-{stack} skill. No such file ⇒ run /mtk-setup.
Review is two-stage: Stage 1 (compliance-reviewer, plus silent-failure-hunter on
error-handling diffs) gates Stage 2 (test-reviewer, architecture-reviewer).
Routing Rules
- Read this file first — it is the project-specific source of truth.
CLAUDE.mdonly imports it. - Start a task with
context-engineering; it loads the phase-appropriate references. - If an entry-point skill exists for the task, prefer it — it orchestrates the underlying workflow skills.
- Do not skip planning, testing, review, or verification when the chosen skill requires them.
- For toolkit structural health (toolkit maintainers only), run
bash scripts/validate-toolkit.sh. For onboarding a new repo, install the MTK plugin from the marketplace then run/mtk-setup.
Agent Self-Escalation
All agents may report BLOCKED or NEEDS_CONTEXT instead of producing uncertain output. A clear
escalation is always more valuable than a low-confidence review.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

