agentleFS
real-casereal-case/marvin-toolkit/CLAUDE.md

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
  1. Very specific:

    npm 11: put -- after npx --no (npx --no -- prettier --write <file>), or the flag goes to npm.

    line 162
  2. Very specific:

    Create plugins/marvin/skills/<command>/SKILL.md with YAML frontmatter (name matching the directory, description).

    line 170
  3. Very specific:

    Create plugins/marvin/commands/<command>.md with frontmatter description and a body that instructs Claude to read skills/<command>/SKILL.md …

    line 171
  4. Very specific:

    Add an entry to plugins/marvin/mcp/server/src/prompts/index.ts:

    line 172
  5. Very specific:

    Run npm run build inside plugins/marvin/mcp/server to refresh dist/server.js.

    line 180
  6. Very specific:

    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 …

    line 181
  7. Very specific:

    Create plugins/marvin/mcp/server/src/tools/<name>.ts with a defineTool({...}) export.

    line 188
  8. Very specific:

    Create plugins/marvin/agents/<agent-name>.md with YAML frontmatter containing description.

    line 195

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

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. See docs/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:

PageRead it when you touch
working-directory.mdanything under .marvin/ — every subdirectory, its writer, contents and git status, plus spec-location resolution (resolveSpecDir, ADR-0037)
instruments.mda 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.mdpackages/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.mdbuilds, 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.mdfinding 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:

GroupSourceExamples
(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>.md and the MCP prompt all lead to the same skill prose, so edit the SKILL.md, never a copy. A SKILL.md edit needs no rebuild; anything under mcp/server/src/ does.
  • track-* has no skills/ or commands/ entries. Its 7 prompts are inline body: wrappers over the task/task-detail/tracker tools; scripts/lint-skills.mjs fails the build if one is added.
  • Agents pin tools: and model:. A subagent without tools: inherits every tool, so the read-only agents carry an allowlist; only marvin-tm-executor, marvin-tm-review-fixer and marvin-researcher omit it. model: is opus where the agent's judgment is the last check, sonnet otherwise, never inherit; a new agent that fits neither rule gets opus (ADR-0057).
  • The server stays ext-apps/React free. A tool binds its widget with a plain meta.ui.resourceUri literal; never import the browser SDK into mcp/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's marvin copy, so the widget renders. The ten widget-bound tools are audit, 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

PluginServer keySlash prefix
marvinmarvin/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-dist and verify-widgets compare against git show HEAD:<path>, so a correct rebuild you have not committed is reported out of sync. Run them after committing; they are not verify gates.
  • Build only in a checkout with its own node_modules. Without one (a fresh git worktree add), dist/server.js is functionally identical but byte-different and not committable; tsup.config.ts warns. Run npm install there or build in the main checkout.
  • Verify with execution: "sequential". In parallel the test and build gates both rewrite mcp/server/dist/ while e2e tests spawn it.
  • The test gate is npm run test:fast, which skips the slow server files listed in plugins/marvin/mcp/server/scripts/test-fast.mjs; CI runs the full npm test. Add a file to SLOW when it measures above about 15 s alone.
  • One test file: node scripts/test-one.mjs <file> (this repo's gates.test_one).
  • Drive a tool by hand: node scripts/mcp-call.mjs <tool> '<json>' after npm run build.
  • Local plugin dev: npm run dev:plugin rebuilds once, npm run dev:watch keeps rebuilding; a new dist/server.js needs a session restart, a rebuilt widget does not.
  • npm 11: put -- after npx --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:

  1. Create plugins/marvin/skills/<command>/SKILL.md with YAML frontmatter (name matching the directory, description). The description is the auto-discovery trigger Claude Code matches in chat. Follow the <group>-<command> naming scheme.
  2. Create plugins/marvin/commands/<command>.md with frontmatter description and a body that instructs Claude to read skills/<command>/SKILL.md and pass $ARGUMENTS. Use existing commit.md / sec-scan.md as templates. Every prompt outside the track-* group ships a wrapper — scripts/lint-skills.mjs fails the build without one.
  3. 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
    }
  4. Run npm run build inside plugins/marvin/mcp/server to refresh dist/server.js.
  5. 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 frontmatter.
  6. 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

  1. Create plugins/marvin/mcp/server/src/tools/<name>.ts with a defineTool({...}) export.
  2. Wire it into src/server.ts (the build factory returns it under tools).
  3. Tool input schemas use zod. Use elicit(server, message, schema) for interactive forms inside handlers.
  4. Rebuild and commit dist/.

Adding a new agent

  1. Create plugins/marvin/agents/<agent-name>.md with YAML frontmatter containing description.
  2. Specify available tools and domain constraints in the body.
  3. 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 version

sync-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).

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.