marvin-toolkit
CLAUDE.md0 starsChanged 5 months agoMITView on GitHub
Marvin is a Claude Code plugin marketplace that ships one plugin (marvin) backed by a single MCP server (per ADR-0001). The plugin exposes the whole development lifecycle — core dev tools, a spec-driven task pipeline, security scanners, and a lightweight task board tracker — under one slash prefix /marvin:. There is no eject/scaffold step; the plugin works as installed by /plugin install. Until 2026-06 the toolkit was four independently-installable packs each with its own server (/marvin-core:*, /marvin-sec:*, /marvin-tm:*, /marvin-tasks:*). ADR-0001…
The file
We split this CLAUDE.md into the rules it gives an agent
8 rules. About 0 are common, 0 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 162
npm 11: put -- after npx --no (npx --no -- prettier --write <file>), or the flag goes to npm.
- Very specific: line 170
Create plugins/marvin/skills/<command>/SKILL.md with YAML frontmatter (name matching the directory, description).
- Very specific: line 171
Create plugins/marvin/commands/<command>.md with frontmatter description and a body that instructs Claude to read skills/<command>/SKILL.md …
- Very specific: line 172
Add an entry to plugins/marvin/mcp/server/src/prompts/index.ts:
- Very specific: line 180
Run npm run build inside plugins/marvin/mcp/server to refresh dist/server.js.
- Very specific: line 181
Commit src/, dist/, the new SKILL.md and the command file together — CI verifies dist is in sync and that SKILL.md / commands have valid …
- Very specific: line 188
Create plugins/marvin/mcp/server/src/tools/<name>.ts with a defineTool({...}) export.
- Very specific: line 195
Create plugins/marvin/agents/<agent-name>.md with YAML frontmatter containing description.
≈ “Common” is an estimate: at least 1 in 5 of the 29,248 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
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
What is this
Marvin is a Claude Code plugin marketplace that ships one plugin (marvin) backed by a
single MCP server (per ADR-0001). The plugin exposes the whole development lifecycle —
core dev tools, a spec-driven task pipeline, security scanners, and a lightweight task
board tracker — under one slash prefix /marvin:. There is no eject/scaffold step; the plugin
works as installed by /plugin install.
Until 2026-06 the toolkit was four independently-installable packs each with its own server (
/marvin-core:*,/marvin-sec:*,/marvin-tm:*,/marvin-tasks:*). ADR-0001 consolidated them into one plugin/one server so every command shares the/marvin:prefix. Seedocs/adr/0001-single-plugin-consolidation.md.
Where the detail lives
This file holds the rules and commands a session needs every time. The reference material
it used to carry lives under docs/reference/; read the page when the task
touches its subject, not before:
| Page | Read it when you touch |
working-directory.md | anything under .marvin/ — every subdirectory, its writer, contents and git status, plus spec-location resolution (resolveSpecDir, ADR-0037) |
instruments.md | a skill, command, prompt, tool, hook or agent — the annotated plugin tree, the three entry points, the per-tool contracts (verify, spec, metrics, report, pipeline, hunt, …), the audit family, the shared library |
widgets.md | packages/marvin-widgets/, a ui:// resource, or a widget-bound tool — the MCP Apps layer (ADR-0024), visual baselines, rendering in the desktop app |
dev-loop.md | builds, gates and local testing — why the drift guards read HEAD, worktree builds, this repo's verify gates and test-one, dev:plugin / dev:watch, scripts/mcp-call.mjs |
key-files.md | finding a manifest, linter or the ADRs behind a subsystem |
Conceptual tour: docs/architecture.md. Config schema and env vars:
docs/configuration.md. Decisions: docs/adr/.
Architecture
plugins/marvin/
├── .claude-plugin/plugin.json # name: "marvin"
├── .mcp.json # server key "marvin" (+ context7, gitmcp)
├── skills/<command>/SKILL.md # source of truth for prompt bodies (dir name == command)
├── commands/<command>.md # thin slash wrappers that read the matching SKILL.md
├── agents/*.md # Claude Code subagents
├── hooks/hooks.json + *.mjs # blocking PreToolUse guards on Bash (ADR-0040); plugin.json declares no `hooks` key
├── widgets/*.html # COMMITTED self-contained MCP Apps widgets (ADR-0024)
├── pipeline/ # autopilot assets read by marvin-pipe (roles, schemas, per-child hooks)
└── mcp/server/
├── src/server.ts # entry: registers prompts + tools + widget resources
├── src/prompts/index.ts # 64 prompt entries
├── src/tools/ # 17 MCP tools
├── src/pipeline/ # autopilot engine
└── dist/server.js, dist/marvin-pipe.js # COMMITTED build artefacts (verify-dist checks both)Shared code lives in packages/marvin-mcp-shared/ (bundled into dist/server.js by tsup); the
widget workspace is packages/marvin-widgets/. Every service file marvin generates lives under
one hidden .marvin/ directory, one subdirectory per command group (ADR-0007). The five report
groups the report tool scans are security, refactor, task, handoff and critique; the
rest of the tree is in working-directory.md. Project
deliverables stay outside it — ADRs under docs/adr/, CHANGELOG.md and README.md at the root.
Command naming scheme
Commands are /marvin:<group>-<command>; singletons stay bare. Groups:
| Group | Source | Examples |
| (bare) | core dev tools | /marvin:onboard, /marvin:commit, /marvin:debug, /marvin:adr, /marvin:changelog, /marvin:readme, /marvin:migration-plan, /marvin:explain, /marvin:docs-search, /marvin:handoff, /marvin:dashboard, /marvin:reports, /marvin:report-export, /marvin:widget-preview, /marvin:autopilot |
adr-* | ADR lifecycle around the bare /marvin:adr create (ADR-0027; accept/supersede/sync are human-run via disable-model-invocation) | /marvin:adr-review, /marvin:adr-accept, /marvin:adr-audit, /marvin:adr-coverage, /marvin:adr-supersede, /marvin:adr-sync |
pr-* | core PR ops (full PR lifecycle) | /marvin:pr-create, /marvin:pr-review, /marvin:pr-resolve, /marvin:pr-merge |
task-* | spec pipeline (taskmaster) | /marvin:task-start, /marvin:task-implement, /marvin:task-verify, /marvin:task-deliver, /marvin:task-summary, /marvin:task-metrics, /marvin:task-audit |
sec-* | security scanners | /marvin:sec-scan, /marvin:sec-secrets, /marvin:sec-deps, /marvin:sec-gate, /marvin:sec-threat-model, /marvin:sec-iac, /marvin:sec-ci, /marvin:sec-fix, /marvin:sec-compliance, /marvin:sec-pentest, /marvin:sec-report |
refactor-* | code-health family, read → plan → apply (ADR-0029) | /marvin:refactor-audit, /marvin:refactor-smells, /marvin:refactor-plan, /marvin:refactor-apply |
audit-* | the formal A-01…A-22 project-audit programme — plan, run one, consolidate | /marvin:audit-plan, /marvin:audit-run, /marvin:audit-summary |
hunt-* | bug hunter, detect-only (ADR-0053): find, challenge and prove defects, triage the ledger | /marvin:hunt-init, /marvin:hunt-code, /marvin:hunt-triage, /marvin:hunt-status |
track-* | lightweight task tracker (board-only, ADR-0025; seven-command surface, ADR-0032) | /marvin:track-menu, /marvin:track-new, /marvin:track-list, /marvin:track-show, /marvin:track-start, /marvin:track-move, /marvin:track-config |
task-* (heavyweight spec pipeline) and track-* (quick tracker) are intentionally
distinct domains — keep them separate.
Rules that are easy to break
- One
SKILL.md, three doors. Chat auto-discovery,commands/<command>.mdand the MCP prompt all lead to the same skill prose, so edit theSKILL.md, never a copy. ASKILL.mdedit needs no rebuild; anything undermcp/server/src/does. track-*has noskills/orcommands/entries. Its 7 prompts are inlinebody:wrappers over thetask/task-detail/trackertools;scripts/lint-skills.mjsfails the build if one is added.- Agents pin
tools:andmodel:. A subagent withouttools:inherits every tool, so the read-only agents carry an allowlist; onlymarvin-tm-executor,marvin-tm-review-fixerandmarvin-researcheromit it.model:isopuswhere the agent's judgment is the last check,sonnetotherwise, neverinherit; a new agent that fits neither rule getsopus(ADR-0057). - The server stays ext-apps/React free. A tool binds its widget with a plain
meta.ui.resourceUriliteral; never import the browser SDK intomcp/server/src/. - Hooks exit 2 only on a confirmed match and 0 on every other path, including a throw.
- In the desktop app, call a widget-bound tool on
marvin-dev, not on the plugin'smarvincopy, so the widget renders. The ten widget-bound tools areaudit,autopilot-report,dashboard,handoff,help,report,summary,task,task-detail,tracker. In the terminal only the plugin's copy exists. See widgets.md.
Server key and slash prefix
| Plugin | Server key | Slash prefix |
| marvin | marvin | /marvin:* |
Validation
# Lint manifests + structure
node scripts/lint-manifests.mjs
# Lint the authored surfaces — frontmatter allowlists, skills/… references, wrapper coverage
node scripts/lint-skills.mjs
# Trigger-eval harness — guard it, then sweep every dataset with the mock decider
npm run eval:self-test
npm run eval:trigger
# Build the server
npm run build
# Test
npm run test
# Verify committed dist/ is in sync with source
node scripts/verify-dist.mjs
# Verify committed widget HTML is in sync + self-contained (ADR-0024)
node scripts/verify-widgets.mjs
# Storybook interaction + visual tests (widgets; CI runs the same trio)
npm run build-storybook -w @marvin-toolkit/widgets
npx http-server packages/marvin-widgets/storybook-static --port 6006 --silent &
npm run test-storybook -w @marvin-toolkit/widgets
# Local plugin validation
claude plugin validate .CI (.github/workflows/validate-plugins.yml) runs the same checks plus ESLint, Prettier, and a stdio smoke-test that sends initialize to the server and verifies a valid response (serverInfo.name == "marvin").
Working rules for builds and gates
- Drift guards judge what is committed.
verify-distandverify-widgetscompare againstgit show HEAD:<path>, so a correct rebuild you have not committed is reported out of sync. Run them after committing; they are notverifygates. - Build only in a checkout with its own
node_modules. Without one (a freshgit worktree add),dist/server.jsis functionally identical but byte-different and not committable;tsup.config.tswarns. Runnpm installthere or build in the main checkout. - Verify with
execution: "sequential". In parallel thetestandbuildgates both rewritemcp/server/dist/while e2e tests spawn it. - The
testgate isnpm run test:fast, which skips the slow server files listed inplugins/marvin/mcp/server/scripts/test-fast.mjs; CI runs the fullnpm test. Add a file toSLOWwhen it measures above about 15 s alone. - One test file:
node scripts/test-one.mjs <file>(this repo'sgates.test_one). - Drive a tool by hand:
node scripts/mcp-call.mjs <tool> '<json>'afternpm run build. - Local plugin dev:
npm run dev:pluginrebuilds once,npm run dev:watchkeeps rebuilding; a newdist/server.jsneeds a session restart, a rebuilt widget does not. - npm 11: put
--afternpx --no(npx --no -- prettier --write <file>), or the flag goes to npm.
The reasons behind each of these are in dev-loop.md.
Adding a new prompt
The canonical path is skill-backed — same content, three entry points:
- Create
plugins/marvin/skills/<command>/SKILL.mdwith YAML frontmatter (namematching the directory,description). Thedescriptionis the auto-discovery trigger Claude Code matches in chat. Follow the<group>-<command>naming scheme. - Create
plugins/marvin/commands/<command>.mdwith frontmatterdescriptionand a body that instructs Claude to readskills/<command>/SKILL.mdand pass$ARGUMENTS. Use existingcommit.md/sec-scan.mdas templates. Every prompt outside thetrack-*group ships a wrapper —scripts/lint-skills.mjsfails the build without one. - Add an entry to
plugins/marvin/mcp/server/src/prompts/index.ts:{ name: "<command>", // becomes /marvin:<command> description: "...", // short, slash-menu blurb skill: "<command>", // points to skills/<command>/SKILL.md } - Run
npm run buildinsideplugins/marvin/mcp/serverto refreshdist/server.js. - Commit
src/,dist/, the newSKILL.mdand the command file together — CI verifies dist is in sync and that SKILL.md / commands have valid frontmatter. - Bump the version with
npm run sync-version <x.y.z>(see Version bumping).
For prompts with no skill (thin tool wrappers), use body: "..." inline and skip step 1. Step 2 applies to every group except track-*: a skill-less prompt is still a command a user types, so it ships a commands/ wrapper. track-* is the one group the pin exempts, and the exemption is enforced in both directions — a track-* prompt gets no commands/ entry, and scripts/lint-skills.mjs fails the build if one is added, because those prompts route between tools and have no prose to duplicate. Either way, a skill-less prompt gets no skill directory and no trigger dataset (a dataset with no matching skill directory is reported as an orphan).
Adding a new MCP tool
- Create
plugins/marvin/mcp/server/src/tools/<name>.tswith adefineTool({...})export. - Wire it into
src/server.ts(thebuildfactory returns it undertools). - Tool input schemas use
zod. Useelicit(server, message, schema)for interactive forms inside handlers. - Rebuild and commit
dist/.
Adding a new agent
- Create
plugins/marvin/agents/<agent-name>.mdwith YAML frontmatter containingdescription. - Specify available tools and domain constraints in the body.
- Bump the version with
npm run sync-version <x.y.z>(see Version bumping).
Version bumping
The whole repo shares one version, sourced from plugins/marvin/.claude-plugin/plugin.json. Bump everything with a single command:
npm run sync-version 0.2.0 # set the version everywhere, then rebuild
npm run sync-version # re-propagate the current plugin.json version
npm run build # rebuild dist/ so the server reports the new versionsync-version propagates the version to every workspace package.json and the marketplace plugin entry. The server's runtime VERSION is injected from its package.json at build time (tsup.config.ts), never hand-edited. npm run lint:manifests fails the build when any of them drift, so a partial bump can never ship. The marketplace's top-level metadata.version is deliberately independent — bump it by hand only when the manifest schema or plugin list changes.
- Patch — prompt body tweaks, bug fixes
- Minor — new prompts, tools, or agents
- Major — breaking changes (server key rename, prompt name removal/rename, schema break)
Branching & releases
Two long-lived branches (ADR-0019): dev is the integration branch and the base for all
work; main is release-only. Cut topic branches (feat/*, fix/*, chore/*, docs/*,
sec/*) off dev and open every PR into dev — never commit directly to dev or main.
A release is a dev → main promotion PR followed by a vX.Y.Z tag on main, which
.github/workflows/release.yml turns into a GitHub Release (ADR-0014).
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.

