Study-Agent-Matrix
CLAUDE.md1 starsChanged 4 days agoMITView on GitHub
Guidance for anyone (human or agent) editing this plugin. The user-facing document is README.md; this one is about how the thing is built and how to keep it coherent. The separation is the point. Routing logic that leaks into an agent makes the agent unusable on its own. Teaching knowledge that leaks into the orchestrator gets loaded on every single request. Which layer does a change belong in? 1. SKILL.md stays under 500 lines. It loads on every invocation. Anything…
In this repositoryOne other file it gives its agents.
- orchestratorSkill
The file
We split this CLAUDE.md into the rules it gives an agent
11 rules. About 0 are common, 4 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 51
3. Nothing about a learner, school or course is hardcoded: No person's name, no institution, no program, no term dates, no credit rules, no …
- Very specific: line 64
6. Agent frontmatter: Every file in agents/ opens with:
- Very specific: line 80
7. Python scripts output JSON and degrade gracefully: Every script in execution/:
- Very specific: line 100
Create agents/<agent-name>.md with name: <agent-name> matching the filename stem.
- Very specific: line 101
Write the description for routing: what it owns, then when to use it.
- Very specific: line 110
Add its files to the file-ownership table in SKILL.md.
- Distinctive: line 111
If it can change a plan, it sits behind the PLAN CHANGE gate.
- Distinctive: line 117
Every study deliverable ships twice, and the distinction is load-bearing:
- Very specific: line 129
The converter is the only writer of a
.pdfor.docx: No agent writes document code. - Distinctive: line 139
Every build that ships is published as a GitHub release, following semantic versioning.
- Very specific: line 147
Commit with a message that opens Release vX.Y.Z: <one-line summary>, followed by what changed — this body becomes the release notes.
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.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.md — Maintainer Guide
Guidance for anyone (human or agent) editing this plugin. The user-facing document is
README.md; this one is about how the thing is built and how to keep it coherent.
Architecture: three layers
Layer 1 skills/orchestrator/SKILL.md
Routing, startup sequence, settings, state, gates, delegation contract.
Holds no domain knowledge and writes no deliverable.
│ delegates with an explicit prompt
▼
Layer 2 agents/*.md
One agent per deliverable. Agents do not call each other; the
orchestrator runs them and collects results.
│ loads, on demand, only what it needs
▼
Layer 3 references/*.md + templates/outputs/*
Knowledge and shape. Inert: nothing here decides anything.
execution/*.py sits beside this layer as optional tooling.The separation is the point. Routing logic that leaks into an agent makes the agent unusable on its own. Teaching knowledge that leaks into the orchestrator gets loaded on every single request.
Which layer does a change belong in?
| The change is… | It goes in |
| When something runs, in what order, who approves | skills/orchestrator/SKILL.md |
| How one deliverable is produced and what it must contain | agents/<agent>.md |
| A study technique, a framework, a rule of good question design | references/<topic>.md |
| The shape of a written deliverable | templates/outputs/ |
| Rendering files, talking to an API | execution/ |
| Anything about one learner, one school or one course | nowhere in the repo — it belongs in that learner's workspace/ |
Hard authoring rules
1. SKILL.md stays under 500 lines. It loads on every invocation. Anything that is not
routing, settings, state or gates belongs in a reference or a template. If it is growing,
something has leaked down from Layer 3 or up from Layer 2.
2. Reference files stay under ~260 lines. They are loaded selectively and read in full when loaded. Past that, split by topic.
3. Nothing about a learner, school or course is hardcoded. No person's name, no institution, no program, no term dates, no credit rules, no grading scale. Registration rules, transfer requirements and academic calendars come from the learner's config or from research done at run time for that learner. A school-specific detail in an agent or template is a bug — it will be wrong for every other user. Examples use placeholders.
4. Settings are never decided by an agent. Languages (planning, content, glossary) and
the four study_style axes come from workspace/config.json through the orchestrator's prompt.
An agent that picks a language or a depth on its own is broken, even when it guesses right.
5. Kebab-case filenames throughout. teacher-agent.md, first-run-setup.md. Python files
stay snake_case.py — a module name has to be importable.
6. Agent frontmatter. Every file in agents/ opens with:
---
name: agent-name # MUST equal the filename stem: agents/agent-name.md
description: One sentence on what it owns, then one on when to use it. This is
what the orchestrator matches against — write it for routing, not for a
catalogue entry.
tools: Read, Write, Edit, Glob, Grep # only what it needs
model: sonnet # or opus for the planning agents
---name mismatching the filename is the most common breakage: the orchestrator delegates by name
and the agent silently does not exist.
7. Python scripts output JSON and degrade gracefully. Every script in execution/:
- has a module docstring covering purpose, dependencies and usage examples;
- exposes
--helpviaargparse; - prints JSON to stdout on success (
{"ok": true, ...}) and on failure ({"ok": false, "error": {"code", "message", "fix"}}), exiting non-zero on failure; - never emits a stack trace;
- names the install command or the manual fallback in the error, so the workflow continues;
- treats every non-standard-library dependency as optional: its absence degrades the output (Markdown instead of PDF), never blocks the task.
8. Everything in the repository is written in English. Source files, comments, docstrings, agent prompts, templates. The learner's languages govern deliverables at runtime, never the repo.
Adding a new agent
- Check it earns a slot. Does it own a deliverable no existing agent owns? Overlapping agents make routing ambiguous, and ambiguous routing is worse than a missing agent.
- Create
agents/<agent-name>.mdwithname: <agent-name>matching the filename stem. - Write the
descriptionfor routing: what it owns, then when to use it. - Grant the minimum
tools. Only agents that runexecution/needBash. Only agents that research needWebSearch/WebFetch. - Name the reference files it should load, specifically.
- State its output contract: exact filenames, exact sections, which folder it writes in.
- Register it in three places, or it is invisible:
- the agents table in
skills/orchestrator/SKILL.md(change planned to its phase) - the routing tables in
skills/orchestrator/SKILL.md - the agents table in
README.md
- the agents table in
- Add its files to the file-ownership table in
SKILL.md. One writer per file, always. - If it can change a plan, it sits behind the PLAN CHANGE gate. No exceptions.
Source and rendered copies
Every study deliverable ships twice, and the distinction is load-bearing:
| Source of truth (agents read this) | Rendered copy (the learner reads this) |
explanation.md | explanation.<pdf|docx> |
quiz.md | quiz.<pdf|docx> |
quiz-answer-key.md | quiz-answer-key.<pdf|docx> |
- Only the source is ever read by an agent. Nothing may depend on a rendered copy.
- Same agent, same run. The agent that writes the source renders the copy. Never split the pair across agents — that is how they drift.
- Rendered copies originate nothing. A fact that exists only in the PDF is a gap in the source.
- The converter is the only writer of a
.pdfor.docx. No agent writes document code. - Never clobber the learner's annotations. The converter records each output's hash; a
rendered copy whose hash changed was edited by hand, so the new version is written as
-v2. - The converter is optional. Without its dependencies the Markdown stays as the deliverable and the agent passes on the install command.
Releasing
Every build that ships is published as a GitHub release, following semantic versioning.
- Bump
versionin.claude-plugin/plugin.json—MAJOR.MINOR.PATCH, nov.- PATCH (
0.1.0 → 0.1.1): a fix that changes no behaviour a user relies on. - MINOR (
0.1.x → 0.2.0): a new agent, command, setting or deliverable. - MAJOR (
0.x → 1.0.0, then1.x → 2.0.0):1.0.0is the first release where the MVP (orchestrator +teacher-agent+quiz-agent) works end to end; after that, any change that breaks an existingworkspace/config.jsonor folder layout.
- PATCH (
- Commit with a message that opens
Release vX.Y.Z: <one-line summary>, followed by what changed — this body becomes the release notes. - Tag the commit
vX.Y.Z— with thev, and equal toplugin.json. A tag and a manifest that disagree is a broken release. - Publish the GitHub release: title
vX.Y.Z, notes from the commit body.
Maintenance
Before any release:
python3 -m py_compile execution/*.py # scripts compile (once execution/ exists)
wc -l skills/orchestrator/SKILL.md # under 500
wc -l references/*.md # each around 260 or less
grep -L '^name:' agents/*.md # every agent has frontmatter
python3 -m json.tool .claude-plugin/plugin.json > /dev/nullThen confirm each agent's name still equals its filename stem, and that any agent added or
renamed appears in the orchestrator's tables and in README.md.
Grep for anything personal before every commit — a learner's name, a school, a course code:
git diff --cached | grep -niE '<your name>|<your school>|<your course codes>'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.

