MARVIN
AGENTS.md6 starsChanged 5 months agoMITView on GitHub
This is MARVIN, the pair-programming AI assistant. For the current state of the project (in flight / shipped / deferred / not planned) see docs/roadmap.md. For chronological history with the diagnostic trail per change, see docs/history/CHANGELOG.md. 1. Single assistant, not an agent team. MARVIN is one Claude session in a user-MARVIN loop. Do not reintroduce multi-agent dispatch, role catalogs, pipeline rules, or Kanban-as-source-of-truth — that pattern degrades up to 70 % on sequential code work and amplifies errors 17× in…
- Reads credentials
- Deletes or force-pushes
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 35,040 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 repository6 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- pr-reviewSkill
- security-auditSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- verification-before-completionSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
17 rules. About 0 are common, 4 are distinctive, and 13 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.
13
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 23
All of them share one enforced invariant: a subagent cannot mutate the main working tree — the permission gate hard-denies …
- Very specific: line 59
Every .marvin/-scoped service keys on workDir (the project root), never on a session's cwd.
- Very specific: line 175
BEFORE reading files. From a MARVIN session: the marvin-graph MCP tools (graph_summary, graph_search, graph_neighbors, graph_path).
- Distinctive: line 217
MUST / MUST-NOT trigger lists it used to hold were retired: current Claude models over-fire on emphatic triggers and follow a short …
- Distinctive: line 284
The rule: after ONE failed fix for a layout or timing bug, stop reasoning about the code and instrument it.
- Very specific: line 346
NOT Edit/Write on memory.md.
- Very specific: line 349
MUST/MUST-NOT firm surface.
- Very specific: line 433
Only the five MARVIN-adopted skills (ports with no upstream source — pr-review, security-audit, systematic-debugging, …
- Very specific: line 516
Update. Superseded cache versions are pruned.
- Very specific: line 593
When MARVIN needs a browser (visual verification after UI work, end-to-end checks, "doesn't work on my machine" debugging), it shells out …
- Very specific: line 613
When it lands, move the roadmap entry from ## In flight to the appropriate ## Shipped block (date-stamped) with a one-line summary.
- Distinctive: line 623
If you discover a follow-up while building, capture it — as a roadmap entry, an ADR, or a GitHub issue — don't let it live only in your …
- Very specific: line 672
Who builds them (ADR-0041): When the running IDE has a project open, it auto-refreshes that project's *code AND knowledge* graphs per turn …
- Very specific: line 772
Use the gitignore-syntax .graphifyignore at any project's root to scope graphify the same way — graphify honours the file relative to where …
- Distinctive: line 782
MANDATORY: Do this before Read / Grep / Glob on any source file:
- Very specific: line 791
Only read files after the graph has pointed at specific source_file + source_locations.
- Very specific: line 811
After the 2026-10-01 rebuild: requireMarvinClient() (126 edges), runAgent() (113), checkFsPath() (106), ChatPreviewModel (103), …
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 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
MARVIN — project instructions
This is MARVIN, the pair-programming AI assistant. For the current state of
the project (in flight / shipped / deferred / not planned) see
docs/roadmap.md. For chronological history with the
diagnostic trail per change, see docs/history/CHANGELOG.md.
Golden rules for working in this repo
- Single assistant, not an agent team. MARVIN is one Claude session in a
user-MARVIN loop. Do not reintroduce multi-agent dispatch, role catalogs,
pipeline rules, or Kanban-as-source-of-truth — that pattern degrades up to
70 % on sequential code work and amplifies errors 17× in flat-topology
"bag of agents" setups (2026 multi-agent coding literature). The
sanctioned exceptions are bounded, read-only subagents spawned by the
main session for a parenthetical task: the advisor (second opinion on
hard decisions — ADR-0007),
the scout (breadth-first read-only research — ADR-0014),
dynamic workflows (read-only audit / research / discovery fan-out
at
effort: xhigh, opt-in — ADR-0030), and plugin-shipped agents (opt-in per project, dispatch confirm-gated, analyse-and-report only — ADR-0054). All of them share one enforced invariant: a subagent cannot mutate the main working tree — the permission gate hard-denies Write/Edit/NotebookEdit and unsafe Bash from any call that carries an SDKagentID. The single amendment (ADR-0081, 2026-08-29): an implementer bound to a git worktree MARVIN created may mutate that tree — its own checkout, its own branch, the user merges. Parallel implementation on shared state remains forbidden; that's the failure this rule exists to prevent, and a worktree is what removes the sharing. What this rule does NOT forbid (ADR-0077): the banned shape is model dispatching model on shared state — a flat swarm with no human between the agents. It is not "more than one session exists". A human running several MARVIN sessions in parallel, each on its own project or worktree and each steered by them, is N independent single-assistant loops — this topology multiplied, not violated. Two sessions MAY share one working tree (ADR-0102, 2026-09-01) — this line previously forbade it outright. A shared tree has one HEAD, so agit checkoutorrebasein one session rewrites every file the other is working on; that happened, and the user read it as the two sessions having merged. The remedy is not isolation (the user requires the shared tree) but visibility: a HEAD-moving or history-rewriting git command raises a confirm naming the other live session, inautomode as well asgated. Anthropic's own agent teams run several sessions in one directory on the same basis — partitioned file ownership, not separate checkouts. A model never opens a session on its own initiative; since ADR-0127 a supervisor may steer the sessions the user opened, within limits the user set, and may open a new tab — always in a fresh worktree, only when the user asks for it or approves its proposal, and only after the user confirms the first message, tree and posture (below). Since ADR-0107 (2026-09-09) a new chat tab runs in its own git worktree by default —marvin/tab/<slug>under.marvin/worktrees/tab-<slug>, cut from the current HEAD, contained at the gate (a write into the main checkout is denied, shell that names it confirms) — and a per-tab chip switches it to the shared checkout, where ADR-0102's confirm and optional lanes apply. Every.marvin/-scoped service keys onworkDir(the project root), never on a session'scwd. The Sessions left-pane tab and the tab dots show every session's state from one project-wide feed; the brain still describes the selected session only. A worktree isolates the filesystem, not the machine (ADR-0110, 2026-09-10). Three tabs, three checkouts, three branches — and one Docker daemon between them: reusable Testcontainers are keyed by config hash and shared across sessions, so a sibling's cleanup removed a container mid-run and two suitesDROP TABLEd each other's schema. Neither the isolation nor the user was wrong; nothing said what isolation does not cover. Host ports, databases, global caches and anything reached through$HOMEare shared by every tab..marvin/worktree.jsongains anenvmap applied to every turn in a worktree tab (and so to every subprocess it spawns) — a generic map, never a Testcontainers rule (Golden Rule 6), read at a validating boundary because a file inside the user's repo is attacker- controlled input. Two symptoms to recognise: tests that pass alone and fail when tabs overlap, and failures that move between tabs. Posture is per session (ADR-0108) — permission strategy, personality, effort and the rest belong to the tab that set them; the app-wide values are only the defaults a new tab starts from. Integration is batched (ADR-0109):mergeAllWorktreesfolds everyreadybranch into the current branch in one local pass, oldest first, stopping at the first conflict and reporting everything it skipped with the reason — asessiontree belongs to an open tab and is decided at tab close, never behind the user's back. Spending CI minutes asks first, in every permission mode. Any new subagent type requires a new ADR; these carve-outs are not a precedent for general multi-agent dispatch. A supervisor session may oversee a project's tabs (ADR-0127, 2026-10-30) — superseding the 2026-07-24 rejection of a standing supervisor and the line "no model ever commands another model". Decided, and being built milestone by milestone (plan); until a milestone ships, its guarantee below is a design, not a check. Models and Anthropic's own tooling (agent view, agent teams, cross-session messaging) moved on, and the supervision was already happening from an external session with no policy and no ledger. The user starts it per project and sets each tab's delegation (off/observe/answer-questions/answer-confirms); the runtime wakes it from the session feed — it never polls or schedules itself; it has no write tools and acts only through the policy-checkedmarvin-superviseverbs; it ships off, then shadow (proposes only), then autonomy per category by the user's switch. It is runtime-dispatched, never executor-spawned — a supervisor spawned or briefed by what it supervises is still theater. What still holds, enforced in code rather than in its prompt: no parallel writers on shared state (it writes nothing, and never starts a turn in a shared checkout another live session is using); every tab behind the same gates, and a turn the supervisor started or answered into behind stricter ones; a supervisor message is never the user's consent — merging, pushing, merge requests and metered CI (ADR-0109), the containment confirms (ADR-0102 / ADR-0107), discarding work, auth / credential / CI /.env/ migration paths, widening a posture, approving a plan and changing scope stay human-only and reach the user as escalations showing the raw act. It cannot spawn agents or supervise a supervisor; it opens a tab only through a confirmed escalation — fresh worktree, at most the approved posture, one request one tab, never split into several on its own — and a tab cannot reach its routes or data. The mechanical supervisor (gate + ADR-0055/0057 guards) still screens every tab, the supervisor's turns included. Every supervisor act lands in an append-only ledger the session auditor (ADR-0059) reviews for the user; the auditor itself stays runtime-dispatched, read-only, with zero enforcement authority. Widening the supervisor's authority beyond ADR-0127 requires a new ADR. The user can talk to it (ADR-0128, 2026-10-31) in one Supervisor workspace per project (a pinned tab until the workspace replaced it the same day). It is an input channel, not new authority: the same runtime-dispatched, read-only wakes, the same verbs and policy, delegation, switches, budget and ledger. The user's words there are the user's and may ground a request in the wake they trigger, but no text is ever consent. Whatever the conversation leads to that the supervisor may not do on its own — every human-only act, and anything in shadow or above a tab's delegation — appears in the chat as a card that is the inbox item, and the user's click on its raw act is the consent. Messages it sends into tabs stay the supervisor's. - Plan-first, execute-second, verify-third. For non-trivial work,
sketch the approach before writing code, then verify it after. This is a
practice, not an artifact rule — write things down where they help (chat,
a
Plan, a roadmap entry, an ADR), not because a doc requires it. The repo's roadmap lives atdocs/roadmap.md; keep its## In flightsection current as work moves through. - Auto-mode by default — full bypass. MARVIN runs every tool without a
confirm prompt, matching
claude --dangerously-skip-permissions. The headerpermstoggle flips togatedwhen you want the pre-flight confirm card back (Edit / Write / unsafe Bash render a card; reads + whitelisted commands auto-allow; destructive regexes hard-deny). Auto mode is stored inlocalStorage.marvin.permissionStrategyso it persists across reloads. - The user's project is a separate workspace. MARVIN's own code lives
here in
~/marvin/. The user's active project (the thing MARVIN is helping build) lives in its own directory chosen by the user at session start. MARVIN holds no persistent knowledge of past projects between sessions — starting a new project means starting from zero. Never cross- contaminate one project's context with another. - No truncation of project documents; indexes load on demand. Context
documents (
CLAUDE.md,PROJECT_STATUS.md,BUSINESS_OVERVIEW.md,README.md) are injected whole — no hardcoded 6 KB cap, a lesson learned the hard way. The three indexes — ADR titles, the memory index, the backlog — load as their most recent slice plus the tool that fetches the rest (graph_search scope:"knowledge",recall,backlog_list). Nothing is cut off; it is fetched when needed (amended 2026-09-21, ADR-0118: the full indexes cost 20K tokens of every agri-saas-platform session). A project's instruction files are read the way other agents write them (ADR-0119):CLAUDE.mdand/orAGENTS.mdwith@pathimports expanded inside the project, near-copies skipped and reported, and a subdirectory's files surfaced when work reaches it. - No hardcoded project knowledge. MARVIN must not ship assumptions about any specific project (service names, realm ids, stack choices, workflow). Every such assumption goes into the user's project repository, not into MARVIN's source.
- Graphify FIRST — always, before any structural file read. For any
"how does X work", "who calls Y", "where is Z implemented", or
blast-radius question about this codebase, query the knowledge graph
BEFORE reading files. From a MARVIN session: the
marvin-graphMCP tools (graph_summary,graph_search,graph_neighbors,graph_path). From a coding-agent session (Claude Code, Codex, …): the graphify CLI —graphify query "…",graphify path "A" "B",graphify explain "Node". Files are read only after the graph has pointed at specific source locations. Grep and Read are second-line tools — used when the graph doesn't cover what you need. "Grep and pray" is the failure mode this rule exists to eliminate. Exceptions: trivial content reads (version checks, named-file requests) and files you're actively editing. Every other unsolicited file read on a codebase question is a rule violation. - Define done before doing — match-not-improve. For any
non-trivial work, state a falsifiable Definition of Done (3-5
bullets, each something an observer could mark "yes that happened"
or "no, not yet") BEFORE writing code. Phase 7 verifies against
that DoD, not against an evolving sense of quality. If you spot
adjacent improvements while implementing, list them as "noticed
while in flight, not in scope" and ask the user — never silently
land them. End real-work turns with
**Scope met:** <DoD as past tense>. Anything else, or should I stop?The "helpful spiral" (six commits past the small ask, each step seemed worth doing) is the failure mode this rule exists to prevent. ADRs carry their own## Scope of Doneblock per the template in themarvin:adrskill. Gate on the SCOPE boundary, not the turn boundary (ADR-0067). An approved plan is standing authorization for every step in it: while steps remain and the last one passed its checks, CONTINUE in the same turn — don't stop, don't emit the scope-met block, and don't ask permission the plan already granted. Stop at the plan's end, when the next action would leave the plan, on a judgement gap, or on a real trade-off. Measured on a real 2-day session: 33.1 h of 49 h was spent waiting on the user and only ~10 % of that wait was legitimate — 17.8 h was MARVIN ending turns mid-plan having asked nothing. This doesn't weaken the rule, it aims it: the rule exists to stop you wandering OUT of scope, never to stop you finishing what was approved. Re-measure withscripts/session-time-breakdown.py --latest <projectId>.
The firm surfaces
MARVIN's prompt (sidecar/packages/runtime/src/personality.ts) carries the
rules every turn needs; since ADR-0118
Milestone 3 (2026-09-21) it is ~4K tokens, down from 29.4K. The enumerated
MUST / MUST-NOT trigger lists it used to hold were retired: current Claude
models over-fire on emphatic triggers and follow a short instruction as well
as a list, and the rules that matter most are enforced by gates, not prose.
Occasional procedures load on demand as MARVIN's own skills (core-skills.ts,
invoked marvin:<name>), and memory / backlog content rules live in the tool
descriptions that enforce them. personality-surfaces.test.ts guards the
parsed formats, the moved rules' new homes, and an 8K-token budget. When the
prompt and a human doc disagree, the prompt wins — it's what MARVIN actually
reads at turn time.
| Rule | Location | Purpose | ||||
| Graphify first | Ground-truth rule 1 in personality.ts; Golden Rule 7 above; the graphify-first design hooks (enforcement); the marvin:graph-tools skill (per-tool reference) | When to consult the graph before reading source files. The 2026-05-27 audit found ~7:1 file-ops to graph-ops drift and that graph_search was overused as a glorified grep while graph_summary / graph_query / graph_save_result were near-zero. The per-tool triggers that fixed it now live in marvin:graph-tools; the design hooks deny file searches until a graph call has happened; AppStatusBar surfaces the live ratio. | ||||
| Simplicity + surgical edits | "Writing code" in personality.ts | What MARVIN MUST NOT ship (features beyond the ask, single-call-site abstractions, unrequested configurability, handling for impossible states) and how it MUST edit (no drive-by improvements to adjacent code, match the file's existing style, delete only the orphans its own change created). Adapted from the Karpathy coding guidelines (multica-ai/andrej-karpathy-skills, MIT); its other two principles were rejected — "ask when unclear" contradicts ADR-0067's measured anti-stall rules, and "goal-driven execution" is already Phase 5a's Definition of Done. Before this, the only coverage of overcomplication was one soft line ("Don't over-engineer") — the shape the 2026-05-22 audit found fires ~0×. | ||||
| Advisor triggers | Ground-truth rule 2 + "Subagents" in personality.ts | When to run a Task-based advisor consult (user-directed + 7 deterministic triggers + anti-triggers). See ADR-0007 for why it's a Task subagent, not an SDK tool. A consult MUST run in the foreground (run_in_background: false) — a background second opinion cannot gate the work it exists to gate, and the gate enforces it. A go-with-caveats caveat is a condition on the open scope, not deferred work (ADR-0100): conditions attach to the turn, are stated as met/waived at the scope-met handoff, and become backlog items only if the scope closes without them being met. | ||||
| Scout triggers | "Subagents" in personality.ts | When to dispatch a read-only research subagent via Task { subagent_type: "scout" } (3 deterministic triggers + MUST-NOT list). See ADR-0014 for the SDK-level read-only enforcement. | ||||
| Dynamic workflows | "Subagents" in personality.ts | When effort: xhigh may fan out parallel subagents — read-only audit / research / discovery ONLY, opt-in, never parallel implementation. Enforced by the subagent read-only invariant in classifyToolCall (any agentID call that mutates is hard-denied). See ADR-0030. | ||||
| Supervisor | "Subagents" in personality.ts (the tab-side rule); ADR-0127 + docs/plans/supervisor.md (the engine, milestones 1–6 shipped in v0.1.119); ADR-0128 (the conversation, milestone 7, shipped in v1.0.0) | A user-started supervisor session may watch a project's tabs, answer their questions and steer them within a per-tab delegation the user sets. The rule every tab turn needs: a message or answer marked as the supervisor's is never the user's consent — merge, push, merge requests, metered CI, the containment confirms, discarding work, boundary paths, widening a posture, plan approval and scope stay human-only. Enforcement lands milestone by milestone: the policy-checked marvin-supervise verbs, a stricter gate on supervisor-touched turns (even in full), a capability token plus a gate deny that keeps tabs off MARVIN's own control routes, and the append-only ledger the session auditor reviews. Supersedes the 2026-07-24 rejection of a standing supervisor. ADR-0128 adds a way to talk to it (since v1.0.0 the Supervisor workspace, opened from its rail item): the user's words there may ground a request but are never consent — every act the conversation leads to that the supervisor may not perform on its own is a card that is the inbox item, consented by the user's click on the raw act. The tab-side rule in personality.ts is unchanged by it. | ||||
| ADR triggers | The marvin:adr skill (triggers, anti-triggers, template); "How you work" step 4 points at it | When a decision requires an ADR (9 categories + anti-triggers + re-derivation test) | ||||
| Definition of Done | "How you work" steps 5 and 7 in personality.ts + the ADR template's ## Scope of Done (marvin:adr) | Bound scope before coding; verify against the DoD; end real-work turns with explicit handoff. See Golden Rule 8 above. | ||||
| Negative claims | "Honesty" in personality.ts; ADR-0068 | What MARVIN must establish before saying something doesn't exist, was never done, or was fabricated. On 2026-08-17 it scanned 303 plan files, missed the active plan, and reported that genuine merged work was "fabricated" — the user was one step from discarding it. MUST resolve by identity (the active-plan block now names id + source: path), search ≥2 ways, and state where it looked; MUST-NOT call the user's project history fabricated without positively establishing the negative. | ||||
| Scope-boundary gating | "Scope boundaries" and "Questions" in personality.ts; ADR-0067 | When to CONTINUE inside an approved plan vs STOP and hand off, and which questions are stalls rather than questions. The 2026-08-17 transcript analysis found 33.1 h of a 49 h session spent waiting on the user, ~90 % of it avoidable — 65 turns ended mid-plan with no question asked, 20 asked permission the plan had already granted, and the user typed a "resume the ACTIVE plan" macro 8× to restart a stalled system. Transport errors now auto-continue via the ADR-0031 wakeup rails instead of leaving the session dead (5.1 h across 4 incidents). | ||||
| Skill triggers | "Skills" in personality.ts (one line per skill) + the ship-review gate below | When to invoke test-driven-development, systematic-debugging, pr-review, security-audit, frontend-design via the Skill tool (per-skill MUST + MUST-NOT). The 2026-05-22 audit found 5 of 6 skills had soft-nudge language and fired ~0× across thousands of qualifying contexts; the per-skill MUST blocks that fixed it were retired with ADR-0118, because the ship-review gate below now enforces the two that matter at commit. | ||||
| Practice rules | checkPracticeRules in design-hooks.ts + practicePromptBlock in the prompt builder; practice.ts / practice-extractors.ts; ADR-0105 | Rules the user accepted from the practice loop — a nightly, read-only pass over a project's own transcripts that mines repeat failures (and the same acts done right) with deterministic extractors, scores them, and proposes a rule at three sessions. Accepted rules enforce at prompt / nudge / deny tier from a data table, with ADR-0104's brakes (a deny needs a discharge path, measure mode, two-per-turn cap, bypass logged), and are verified: a recurrence after acceptance is regressed, a quiet window is confirmed. Managed end to end from the Practice pane. Since v0.1.103 the four hand-written gates are themselves rows (builtin:*) — tier, on/off and message editable there, native when no row exists — and the pane can fit the score weights from outcomes and ask a read-only model to draft a rule's message from aggregates. Since v0.1.104 a project with fewer than three sessions shows a calibration counter and can Adopt rules confirmed in the user's other projects. Nothing is written without approval. User guide: docs/guides/practice.md. | ||||
| Ship-review gate | checkShipReview in design-hooks.ts; ADR-0104 | pr-review / security-audit enforced at git commit. The 2026-09-02 audit of a real session found the MUST triggers above fired 0× across eight pushes of CI, sudoers and credential changes. The gate reads the diff the commit seals: a boundary path (auth / creds / CI / sudoers / .env / *.sh / migrations …) requires both skills, >3 files or >50 lines requires pr-review, docs-only and lockfile-only pass. A review this turn covers the turn; an earlier one holds until the next commit. Two denies per skill per turn, then allow + log. Fails open on git errors. | ||||
| Shell reads + graph pointers | classifyBashSourceAccess in bash-search.ts; checkGraphPointer / noteGraphResult in design-hooks.ts; ADR-0124 | A cat / sed / head / grep / rg of source through Bash is a structural read: it trips graphify-first, charges the drift budget and counts in the ratio (2026-09-30: four agri-saas tabs ran ~3 shell reads per graph call, all invisible). After a graph call, builtin:graph-pointer refuses a whole-file read of a >200-line source file and a search over the repo or a directory no graph result pointed into; a line range, a named-file search and your own new files always pass. Ships at nudge (measure first); promote to deny in the Practice pane. Each tab also queries its own worktree's graph (<worktree>/graphify-out/, seeded from the project's, AST-updated per turn), with a note when it falls back; /api/sessions/watch rows carry graphUsage. | ||||
| Seeded plan spine | plan-seed.ts; checkPlanSpine in design-hooks.ts; decideSeededClose in turn-close-hook.ts; ADR-0124 | A user message carrying a checklist (Steps / Definition of Done / Done when / Scope of Done heading, or a numbered list) gets a [1]…[N] spine from the sidecar, before the model's first tool call — no prompt text involved. builtin:plan-spine (native deny, ADR-0104 brake) refuses a second git commit with no TodoWrite since the first, and the Stop hook refuses a scope-met close while a seeded step is pending. A green test / fast-band / Playwright job or a merged tab branch ticks the ONE step that names it, never a guess. Watch rows carry plan.{open,lastTodoAt,seeded}; the Sessions pane flags a stale list. | ||||
| Skills a brief names | skill-brief.ts; hasSkillRunInTree / recordAllowedTool in design-hooks.ts; trigger.paths + createSkillRule in practice.ts; decideSkillClose in turn-close-hook.ts; ADR-0138 | One real project: 95 tabs named skills in their brief, 3 ran every one; only the two skills ADR-0104 enforces cleared 60 %. Every Skill call is now recorded (last : segment, lower case, persisted on the session meta); a practice rule row takes any skill and commit paths globs. A Skills: line in a session's first message is recorded by the sidecar, and builtin:skills-named (native deny, ADR-0104 brake: two blocks a session) refuses a scope-met close while a named skill never ran, unless the final message says Skill not used: <name> — <reason> (logged) or the skill is not installed. Machine turns are never touched. Watch rows carry skills.{required,used,missing}; the practice loop measures skill.named.unused. No skill name is in MARVIN: the list is the brief's. Addendum, same day: the per-turn <system-reminder> names the seeded skills not yet run (skillsReminder, never the system prompt append); a brief marks start skills with (first) in a note or a Skills first: line (or the project lists first in .marvin/skills.json, applying only to skills the brief names), and builtin:skills-first (native deny, two refusals a session counted on the meta) refuses the first Edit / Write / NotebookEdit in the checkout and the first git commit until they ran. Reads, graph, TodoWrite and a subagent's calls are never refused; a meta without skills.first is never gated. Strict mode, 2026-11-27 (ADR-0138 addendum): "strict": true in the project's .marvin/skills.json (read at a validating boundary, literal true only) removes both brakes — the two gates refuse every time, wakeup turns included — and Skill not used: discharges only skills listed in "optional": [...]; the discharge path is the user's (lower or retire the Practice row, or unset strict); watch rows carry skills.strict. Ships off. 2026-11-28 (ADR-0138 addendum): a Skills first: line may carry bare (un-backticked) names, kept only when the brief also lists them under Skills:, and the seeded first is the union with the project's first; "after_last_edit": [...] in .marvin/skills.json (validated like first) makes a listed skill count at the scope-met close only when its last run (skillsRunAt on the meta) is after the session's last in-tree Edit / Write / NotebookEdit (lastEditAt, not .marvin/), the refusal naming it as ran before your last edit at HH:MM; run it again. Default empty. | ||||
| Parallel-tab guards | checkNumberedCollision in design-hooks.ts + numbered-file-collision.ts; the pattern-kill deny in @marvin/tools/policy; PlanDecision in MARVINLogic; ADR-0123 | What one tab can break for the others. A commit adding a numbered file (0491-…, V2026…__…) whose number a live sibling worktree or HEAD already holds is refused with a free number — one night of parallel tabs produced eight duplicate ADR/migration numbers, each found only at merge. pkill / killall / kill $(pgrep …) are refused in every mode (a tab kills only PIDs it started). A scope-met turn never reads as a pending decision. | ||||
| Project-controlled config | "Always check" in REVIEW.md; ADR-0110 | A file inside the user's repository is written by whoever wrote the repository. A reader whose values reach a subprocess environment, an argv, an executed path or an interpreter option must validate at the read boundary, refuse the names that select code (PATH, DYLD_*/LD_*, NODE_OPTIONS, PYTHONPATH, GIT_SSH_COMMAND) and MARVIN's own CLAUDE_*/MARVIN_*/ANTHROPIC_* prefixes, and be applied so MARVIN-owned values still win. Caught on the env map's own pre-landing review, 2026-09-10 — cloning a hostile repo would otherwise have been arbitrary code execution. The same review rule covers declared records nothing writes (confirm.decision had 0 writers across every transcript of a real project) and isolation claims that don't state their boundary (a worktree isolates the tree and the branch, never the machine). | ||||
| Plan spine | PlanModel.swift + plan-spine.ts; ADR-0046 / ADR-0049 / ADR-0052 / ADR-0068 / ADR-0106 / ADR-0116 | The tracked plan: TodoWrite snapshots reconciled by [N]/[N.M] tag, the file under .marvin/plans/ is the app's projection (a direct model write is denied at the gate). A criteria block (Definition of Done / Scope of Done / Acceptance criteria) is excluded from step parsing and passed through verbatim, and stepText strips a leading checkbox so a step's id is identical whether it came from the chat or the rendered file (v0.1.106 — an agri-saas plan read 0/13 on 8 steps with the work done). What is NOT a step is now four rules, all in PlanParser (ADR-0068 addendum 5): a citation, a criteria bullet (the block survives the blank line under its heading, and numbered criteria count — the scanner and the step matcher share isListItemLine), anything outside an explicit ## Steps / ## Implementation section when the plan names one (Milestone headings are step groups, not the section; an empty section falls back to the whole document), and a bold ordinal IS a step (**1. …** — both matchers and render's markerRE accept leading emphasis, or parse and render drift). Since ADR-0106: TodoWrite is a full-list rewrite, so a sub-task dropped by the batch that closes its parent is marked superseded ([-]) — never completed (a tick would be a false claim), never deleted (the file keeps the evidence). Since ADR-0116 the spine has two writers: the sidecar projects every turn's TodoWrite into it by the deterministic [N] join alone, so a turn nobody is watching still advances the plan, and refuses what it cannot join rather than guessing; the fuzzy half stays in Swift. The scope-met guard reads the spine AND the batch, either saying "open" makes it open, and lastTodoAt orders a replayed batch against what the server has already seen. | ||||
/refine | ADR-0101 | Reviews the session's trajectory and proposes durable updates; it writes nothing. Every proposal is routed through an existing enforced write path (remember for a fact, backlog_add for work), so the ADR-0042 / ADR-0044 caps and content-class rejections still apply — /refine adds no new write channel. One new content class, practice: "we tried X, it was wrong, do Y instead" about how to work in this repo, and a proposal that cannot cite what happened in the session is rejected at the boundary. Consent is a keep/dismiss review (ADR-0047 shape), never model confidence. The base prompt (personality.ts) is immutable to it. | ||||
| Worktree lifecycle | worktrees.ts; ADR-0103 (amended by ADR-0107) | reconcileWorktrees derives state from git on every read — ref gone → dropped, bound task inside the grace window → running, rev-list --count base..branch == 0 → empty, git branch --all --contains names another ref → merged, else ready; plus session while a chat tab holds it (never swept, no staleness timer). Load-bearing because the user merges in a terminal, in another session, or by hand, and MARVIN is not there to see it — a recorded state would be wrong the instant it did. What is provably spent is reclaimed automatically; what holds work is never touched without an explicit choice. | ||||
| Project memory | "Memory, backlog and vault" in personality.ts + the remember tool description; ADR-0042 | What may be written to .marvin/memory.md and how. Durable facts only (invariants / gotchas / constraints / external facts), via the remember MCP tool — MUST-NOT Edit/Write memory.md directly or log activity/decisions/status. The 2026-06-14 audit found a project's memory.md at 419 KB / ~99 % redundant with ADRs/git/changelog; the tool enforces brevity + content-class at the write boundary where prose guidance failed. Since 2026-07-02 the gate also hard-denies direct model writes to .marvin/memory.md / .marvin/memory/ (ADR-0042 enforcement addendum — same mechanism as the .marvin/plans/ deny). | ||||
| Project backlog | "Memory, backlog and vault" in personality.ts + the backlog_* tool descriptions; ADR-0044 | What may be parked to .marvin/backlog/ and how. Actionable deferred work only ("noticed in flight, not in scope" follow-ups / out-of-scope improvements / blockers), via the backlog_add MCP tool — MUST-NOT park facts (→remember), status (→git), or decisions (→ADR). Anti-Kanban (Golden Rule 1): a parking lot read by MARVIN + the user — no subagent pull, never auto-executed, never overrides plan-first. Capture is un-gated at discovery (provisional: true, ADR-0047); consent moves to the keep/dismiss review at the scope-met handoff; open items surface in the next session's context. Since 2026-11-27: item files never move — .marvin/backlog.md indexes the open ones and a git-ignored .marvin/backlog-closed.idx the closed ones (paged on request); a commit trailer Fixes-Backlog: <slug> reachable from the tabs' base branch resolves the item from git (backlog-derive.ts); severity is `low | medium | high (type/waitsOn/priorityare input aliases, not fields); a full note cap refuses with advice to file arelatesTo` follow-up. | medium | high; a full note cap refuses with advice to file a relatesTo` follow-up. |
Since ADR-0118 the pattern is: one plain rule in the prompt, the procedure in a skill or tool description, and a gate wherever a rule must hold regardless of what the model does.
Measure before theorising — for UI and layout bugs especially
Established the hard way on 2026-09-01. Four bugs in a row were diagnosed by reading source, four diagnoses were wrong, and each was settled in one attempt once something was actually measured:
| Bug | Wrong from reading | What a measurement said |
| File tree drawn over the title bar | ScrollView ideal height; VStack centring; missing .clipped() — three fixes, three misses | paneContainer origin=(45,52) vs tree origin=(45,0). Not too tall — 52pt too high, exactly the title bar: VSplitView does not inherit the safe area. |
| App frozen, two sessions open | — | ps: 100 % CPU, STAT R. sample: a closed loop through SystemSplitView.updateNSViewController → formCurrentItems → NSHostingView.setRootView → setNeedsUpdate. |
| Two sessions "interconnected" | — | Distinct SDK session ids per transcript — conversations WERE separate. The collision was the shared working tree. |
| Turn killed with no cause | — | The string was the SDK's, not cancelLiveTurn's: endLiveTurn's ended guard was suppressing MARVIN's own message. |
The tools, in order of preference. sample <pid> for a spin (STAT R +
100 % CPU is a spin, not a deadlock). ~/Library/Logs/MARVIN/exceptions.log
for constraint storms — it already records trigger view, frame, ancestry and
stack (ADR-0062).
MARVIN_SNAPSHOT_MD=/tmp/x.png <binary> renders MarkdownView to a PNG with
no window and no session, for anything chat-rendering. And for frames,
onGeometryChange — it reports geometry without inserting a view.
That last point is not a style preference. The background(GeometryReader)
shape adds subviews, and AppKit's runaway-pass breaker counts update passes
against the number of views in the window — which is how v0.1.93's
WidthReporter eliminated a constraint storm (proved by stack diff) and
crashed the app anyway. Same diagnosis, same fix, no extra views.
The rule: after ONE failed fix for a layout or timing bug, stop reasoning about the code and instrument it. A probe costs one launch. Three wrong guesses cost three releases, and one of them shipped a crash to the user.
Repo layout
macos/ # SwiftUI macOS app (Xcode / SPM)
MARVIN/ # Swift sources
project.yml # xcodegen manifest
Package.swift # SPM manifest (swift build fallback)
sidecar/ # Next.js 16 sidecar, port 3030 — API-ONLY
src/ # Next.js app (app/api/** route handlers only;
# the browser UI was removed, ADR-0075 — the
# native macOS app is the only client)
packages/
runtime/ # Claude CLI wrapper + auth + session + personality
tools/ # Tool policy — auto / confirm / deny
project-context/ # spec + infra-probes injection
graphify-bridge/ # knowledge-graph read + refresh
git-watch/ # commit stream
ui/ # shadcn primitives — orphaned since ADR-0075,
# pending removal (nothing left imports it)
.claude/ # Claude Code project surface (shared)
commands/ # repo-specific slash commands
# /graph-refresh — rebuild code + knowledge
# /rebuild-app — bundle + install MARVIN.app
hooks/validate-bash.sh # PreToolUse: deny --no-verify, force-push to
# main, reset --hard origin/*, gpgsign bypass
settings.json # shared permissions + hook wiring
settings.local.json # personal overrides (gitignored)
skills/ # pinned Anthropic skill bundle (see Skills section)
data/.marvin/ # transcripts, cost tracker, graph cache (gitignored)Key packages
| Path | Responsibility |
sidecar/ | Next.js 16 API-only backend for the native macOS app (ADR-0075) — no browser UI. |
sidecar/packages/runtime/ | Claude Agent SDK (0.3.286, ADR-0073) runner, auth, session persistence, cost tracker, project registry, personality. Confirm gate lives here (sdk-runner.ts → canUseTool). |
sidecar/packages/tools/ | Tool policy — which calls auto-allow, confirm, hard-deny. |
sidecar/packages/project-context/ | First-message context injection: project docs + ADRs + .marvin/memory.md + graphify summary + opt-in infra probes. |
sidecar/packages/graphify-bridge/ | Read-side of the knowledge graph + the in-process MCP server MARVIN queries per turn. |
sidecar/packages/git-watch/ | Commit detector — surfaces new commits inline, per workDir. |
sidecar/packages/ui/ | shadcn primitives shared by the sidecar. |
Cross-session continuity — .marvin/memory.md
MARVIN holds no persistent in-memory state between sessions (Golden
rule 4). The bridge across sessions lives in <workDir>/.marvin/ and is
re-read by buildProjectContext on the first turn of every new session.
memory is a curated durable-facts layer, not an activity log (ADR-0042).
.marvin/memory.md is a one-line-per-fact index; each fact is a small file
under .marvin/memory/<slug>.md. It holds ONLY what the next session can't
re-derive from ADRs, git, or the changelog — invariants, gotchas, hard
constraints, external facts. Per-turn activity belongs in git/changelog;
decisions belong in ADRs; verification/commit status is ephemeral and goes
nowhere.
- Write path is the
rememberMCP tool (marvin-memory,memory-mcp.ts), NOT Edit/Write on memory.md.rememberwrites the fact file + rebuilds the index, supersedes by name, caps the hook/body, and rejects activity/status payloads.recallsearches the facts.personality.tscarries the MUST/MUST-NOT firm surface;/memory-compactdistills a bloated log. (This replaces the old "append a line on Ship" model, which let memory.md bloat to 419 KB / ~99 % redundant on a real project — the cause of the ADR-0041 context overflow.) - AppStatusBar context indicator hover tooltip notes the memory layer is
active. The Scope-met chip now writes a one-liner to
.marvin/session-notes.md("Save session note") — a lightweight activity sink, NOT the durable-facts index (it would otherwise be clobbered by the nextremember). Originally ADR-0022; retargeted by ADR-0042. - Project backlog (ADR-0044) is the adjacent cross-session layer:
.marvin/backlog/<slug>.md+ a.marvin/backlog.mdindex of open actionable deferred work — the "noticed in flight, not in scope" follow-ups that would otherwise evaporate. Distinct content class from memory: memory holds facts, the backlog holds work. Write path is thebacklog_addMCP tool (marvin-backlog,backlog-mcp.ts) — capture is un-gated at discovery (provisional: true, ADR-0047), consent lands at the keep/dismiss review at the scope-met handoff; caps + rejects fact/status/decision payloads;backlog_list/backlog_resolveread and close; open items are re-injected bybuildProjectContext. A parking lot, never a queue agents pull from (Golden Rule 1) — surfaced in the macOS backlog panel + a tray chip. - Practice loop (ADR-0105) is the fourth cross-session layer, for
behaviour: memory holds facts, the backlog holds work, ADRs hold
decisions, and
~/.marvin/practice/holds what MARVIN keeps getting wrong (and right) across a project's sessions, the rules the user accepted about it, and whether they held. It lives under the data dir, not the project's.marvin/, because it is about MARVIN. Read-only over transcripts, no model in the loop, proposals only — the Practice pane is the write path.
.marvin/memory.md + .marvin/memory/ is the only sanctioned cross-session
durable-facts persistence. Don't shadow it with a parallel sidecar cache, a
remote KV, or hidden state in ~/.marvin/ — keeping it in the project
directory makes it the user's thing, not MARVIN's.
Data directory
MARVIN_DATA_DIR env var, default ~/.marvin/. Stores:
sessions/<projectId>/<sessionId>.jsonl— conversation transcriptssessions/<projectId>/<sessionId>.meta.json— the session's tree (worktree or shared + lane), the posture its turns run with, last turn outcome,closedAt(ADR-0107). Written by the chat route on every turn; a server-initiated resume rebuilds the turn from it, plussetup(what was symlinked / copied into the tab's worktree). Project-local:<workDir>/.marvin/worktree.json(symlinkDirectories,copyIgnored,env,sparseExclude,minFreeGb) makes a fresh session worktree usable; when the project has none, MARVIN detects one from git-ignored dependency dirs and env files and writes it ("detected": true) for the user to edit. A tab gets its worktree or is refused (ADR-0122): creation is atomic (disk floor — 10 GB default,MARVIN_WORKTREE_MIN_FREE_GB— thengit worktree add, optional non-cone sparse checkout, setup; any failure rolls everything back and answers409 worktree-failedbefore a meta or transcript line is written). There is no fallback to the shared checkout — a shared tab exists only because the user chose it.sparseExcludeandminFreeGbare project-controlled input, validated where read. User guide:docs/guides/worktrees.md.sessions/<projectId>/.summaries.json— picker cache for the session list (ADR-0072): per-sessionfirstUserMessage+turnCount, keyed on(mtime, size). Listing 347 sessions used toJSON.parse2.6 GB per request (23 s — long enough for the client to cancel and restart it forever, which read as "all my sessions are gone"). Now a marker scan + this cache: 36 ms warm. Safe to delete; it rebuilds on the next list.cost-tracker.json— daily/weekly/lifetime spendprojects.json— registered projects (id, name, workDir)- Graph caches per project live next to the project (
<workDir>/graphify-out/).
Personality
MARVIN's persona is a style layer, not a refusal layer. Dry wit ("A login page.
How thrilling."), always delivers. Toggle lives in user settings:
personality: "marvin" | "neutral".
Skills MARVIN expects
MARVIN's SDK sessions inherit the user's Claude Code skills from
~/.claude/skills/. Install them once with:
bash scripts/install-skills.shOnly the five MARVIN-adopted skills (ports with no upstream source —
pr-review, security-audit, systematic-debugging,
test-driven-development, verification-before-completion) are vendored at
.claude/skills/. The upstream
Anthropic skills are not committed (they're ~10 MB; open-source tidy
2026-06-15) — install-skills.sh shallow-clones them from anthropics/skills
on demand and copies all of them into ~/.claude/skills/ (idempotent — existing
user-level skills are left alone):
install-skills.shnever updates. It skips anything already present, so a skill installed once stays at that version forever. Pulling a newer version is the Skills pane's job (ADR-0071) — and it needs a recorded source, which skills installed by this script don't have. Use "Set source" on the row once to bind the upstream URL.
| Category | Skill |
| Design | frontend-design, canvas-design, theme-factory, brand-guidelines |
| Productivity — docs | doc-coauthoring, docx, pdf, pptx |
| Data | xlsx |
| Engineering | claude-api, mcp-builder, webapp-testing, web-artifacts-builder, skill-creator |
| Engineering — MARVIN-adopted | test-driven-development, systematic-debugging, verification-before-completion, pr-review, security-audit (ports from Superpowers v7.0.2 + gstack; honour REVIEW.md at repo root) |
| Operations / PM | internal-comms |
| Knowledge graph | graphify (install separately — see ~/.claude/skills/graphify/SKILL.md) |
| Observability | Honeycomb skills ship as a Claude Code plugin — /plugin install honeycomb |
| Built-in Claude Code | /review (reviews a PR), /security-review (security pass on pending changes), /init (scaffolds CLAUDE.md) — no install step |
sidecar/packages/runtime/src/personality.ts ▸ "Skills" gives most of them a
one-line trigger. If you add a skill MARVIN should reach for, add its line
there. verification-before-completion deliberately has none (2026-11-25):
the prompt has an 8K-token budget, and a brief's Skills: verification-before-completion
line is recorded and checked at the scope-met close by
ADR-0138
at no prompt cost. The three Superpowers ports (test-driven-development,
systematic-debugging, verification-before-completion) were refreshed
against Superpowers v7.0.2 on the same day; the rest of Superpowers
(subagent-driven-development, executing-plans, dispatching-parallel-agents,
using-git-worktrees, finishing-a-development-branch, requesting-code-review,
brainstorming, the session-start bootstrap) is not adopted: each collides
with Golden Rule 1 or duplicates a MARVIN gate.
MARVIN's own skills (marvin:adr, marvin:graph-tools, marvin:browser,
marvin:skill-audit, marvin:workflow-audit, marvin:greenfield,
marvin:instruction-files) are not
installed by this script and are not in .claude/skills/: their text lives in
sidecar/packages/runtime/src/core-skills.ts, and every turn writes them to
<MARVIN_DATA_DIR>/core-skills/ as a local plugin named marvin
(ADR-0118).
They always match the running version — which install-skills.sh, which never
updates, could not guarantee. Edit them in core-skills.ts; a test checks that
every marvin: pointer resolves and every core skill is pointed at.
Claude Code plugins — opt-in per project (ADR-0053)
Plugins installed through the Claude Code /plugin UI must not load into
MARVIN turns by themselves. Until 2026-09-21 this section said MARVIN ran "in
isolation mode (no settingSources)"; omitting settingSources loads every
source, and real turns carried the user's Claude Code plugins, the project's
CLAUDE.md and Claude Code's auto memory. Since
ADR-0118
MARVIN loads settingSources: ["user"] (for ~/.claude/skills/), turns every
user-enabled Claude Code plugin off in the flag layer, and disables auto memory.
ADR-0053 is the only
way a plugin reaches a turn:
- Discovery is from
~/.claude/plugins/— the same registry the Claude Code UI writes — so a plugin installed there is immediately available to MARVIN. - Activation is opt-in, per project. A plugin loads into a turn only when
listed in
<workDir>/.marvin/plugins.json({ "enabled": ["honeycomb", …] }, mirroringskills.json). Empty/absent → nothing loads. Managed from the macOS Plugins pane (PluginsPane.swift, aLeftPanetab) over the/api/pluginsroute (plugin-loader.ts:listInstalledPlugins/setEnabledPlugins). - Install from inside MARVIN (Phase 3): the Plugins pane "Install" sheet →
/api/plugins/install→plugin-installer.tsclones a marketplace/plugin repo, copies the plugin into~/.claude/plugins/cache/…, and registers it ininstalled_plugins.json(same registry the Claude Code UI uses — installs are bidirectionally visible). Clone+copy only; nothing runs at install. - Update an installed plugin (ADR-0071):
every install now records where it came from, so "pull the latest" works.
Provenance lives in
~/.marvin/plugin-sources.json— deliberately NOT a new key in the co-ownedinstalled_plugins.json.POST /api/plugins/update(checkOnly/ single /all); the pane gets Check-for-updates + per-row Update. Superseded cache versions are pruned. Plugins installed through the Claude Code/pluginUI have no MARVIN provenance and are skipped — not ours to update. Skills work the same way (POST /api/skills/update), with provenance in.marvin-source.jsoninside each skill folder; a skill with no record gets a one-time "Set source" in the Skills pane. - Loaded via the SDK
plugins:[{type:'local',path}]array (a sanitised staged copy under.marvin/plugins-stage/). Loads skills + slash commands + MCP servers + agents — plugin agents run read-only (ADR-0054): dispatch confirm-gates (unknownsubagent_type) and the ADR-0030agentIDinvariant hard-denies mutations, so they analyse/report while the main loop applies changes. Plugin hooks are never loaded (no read-only containment exists for "interpose on every tool call" — ADR-0054 §2). - Gate change:
mcpToolPolicy(@marvin/tools/policy) now allowlists MARVIN's own in-process servers and routes every othermcp__*tool throughconfirm— closing the prior blanket-allow of unknown MCP tools. Plugin MCP tools are therefore confirm-gated, and the subagent read-only invariant applies.
Agent SDK contract — the pins that keep MARVIN's behaviour stable (ADR-0073)
MARVIN is on Agent SDK 0.3.286. These SDK defaults would silently change
what MARVIN does, and each is pinned back in sdk-runner.ts with the reason
at the pin (ADR-0073):
CLAUDE_CODE_ENABLE_TODO_TOOLS=1+CLAUDE_CODE_ENABLE_TASKS=0inturnEnv. From 0.3.142, Sonnet 5 / Opus 4.8+ sessions get no task-tracking tool unless opted in, and the opt-in family defaults to the id-basedTaskCreate/TaskUpdate. The entire plan spine (ADR-0046 / 0049 / 0052 / 0068 / 0106) reconcilesTodoWritesnapshots by[N]/[N.M]tag. Remove either flag and every plan freezes atpendingwith no error.alwaysLoad: trueonmarvin-graphandmarvin-controlonly. 0.3 defers MCP tools behindToolSearchby default; the graphify-first design hooks hard-deny Read/Grep/Glob until agraph_*call has happened, so a turn-1 prompt with no graph tools would deadlock, and the ADR-0055 checkback guard needsschedule_wakeupwithout a discovery step.alwaysLoadalso blocks startup until the server is connected (the 0.2.142 background-connect race).-memory,-backlogand-obsidianare deferred since ADR-0118 (3.3K tokens); verified live:ToolSearch → recallworks.- One system prompt per session (
turnSystemPrompt,snapshot: true, ADR-0118). 0.3.286 records turn 1's system prompt and replays it until compaction, so the append must be identical every turn —buildTurnSystemPromptalways builds the full context, and everything per-turn (mode, orientation, session tree, plan) rides the<system-reminder>suffix (turnReminders). Putting a per-turn value back into the append freezes it at turn 1's value, and rewritingsystemmid-session breaks the prompt cache and, on Fable 5.1, invalidates earlier thinking blocks. settingSources: ["user"]+ user plugins off +CLAUDE_CODE_DISABLE_AUTO_MEMORY=1(ADR-0118). OmittingsettingSourcesloads every source. Measure any change here withcd sidecar && npx tsx scripts/context-baseline.ts <workDir>.
Verified live: a 0.3.245 system/init on claude-sonnet-5 with the flags
reports the todo family as TodoWrite only.
The same check got the subagent tool wrong (ADR-0079).
system/initsaysTask; thetool_useblocks the gate actually sees sayAgent— Claude Code renamed it in v2.1.63, and 200 of 200 dispatches in real transcripts used the new name. Five guards matched the literal"Task"and went dead, including the one that keptAgentout ofKNOWN_TOOL_NAMES, which left subagent dispatch ungated entirely. The gate now matches both viaisSubagentDispatch(). Verify a tool-name contract against atool_useblock from a real transcript, never againstsystem/init. Migrating the spine to Task ids — which is what retires the ADR-0068 bug class — is a separate, non-neutral ADR, deliberately not bundled with the upgrade.
Browser automation — Playwright CLI (default) + opt-in MCP (ADR-0045)
Two paths. Default: the Playwright CLI via Bash — one-shot captures and
full playwright test suites (below). Opt-in: the Playwright MCP server
(ADR-0045) — first-class,
stateful mcp__playwright__browser_* tools for interactive navigate→snapshot→
click→assert flows. It's off by default (a browser subprocess per turn is
heavy); toggle it in the header Setup popover (web) / Settings ▸ Browser (macOS).
It's gated — observation auto-runs, interaction/navigation confirm in gated
mode, and browser_run_code_unsafe is denied; the subagent read-only
invariant gives scouts only the observational tools.
When MARVIN needs a browser (visual verification after UI work, end-to-end checks, "doesn't work on my machine" debugging), it shells out via Bash to the Playwright CLI directly. npx playwright is on PATH after the one-time setup:
npx playwright install chromiumCommon shapes MARVIN reaches for (documented in the marvin:browser skill):
- One-shot screenshot:
npx -y playwright screenshot --browser=chromium <url> /tmp/out.png - Scripted check: write
/tmp/check.mjsusing the Playwright Node API, run withnode /tmp/check.mjs - Full e2e:
npx playwright testagainst the project's config
Adding a new feature
- Sketch the approach. For anything non-trivial, add a one-line entry under
## In flightindocs/roadmap.mdso the work is visible. Material design decisions get an ADR underdocs/decisions/— themarvin:adrskill (core-skills.ts) lists when one is required. - Implement.
- When it lands, move the roadmap entry from
## In flightto the appropriate## Shippedblock (date-stamped) with a one-line summary. For meaningful releases, also add a long-form entry todocs/history/CHANGELOG.mdwith the diagnostic / decision / verification trail. A release also updates the README's "What makes MARVIN different" / Features / Status, the white paper and the Technical Reference as content, not just the version string — then regenerate the PDFs withnode scripts/whitepaper-pdf.mjs docs/whitepaper/<NAME>.md docs/whitepaper/<NAME>.pdf(they were two months stale by v0.1.104). - If you discover a follow-up while building, capture it — as a roadmap entry, an ADR, or a GitHub issue — don't let it live only in your head.
Definition of Done. Audit and task DoD live at
docs/reviews/DEFINITION_OF_DONE.md.
Apply it before claiming anything is shipped.
graphify
Two graphs per project (ADR-0028, development branch). MARVIN's own repo:
- Code graph at
graphify-out/graph.json— AST extraction of source files. 10673 nodes · 24868 edges · 457 communities (2026-10-06 rebuild on graphify 0.9.73; honours.graphifyignore). For a full rebuild usegraphify . --code-only— without--code-onlythe run aborts on the docs, which need an LLM backend and belong to the knowledge graph anyway. (graphify update .is the incremental path and needs no such flag.) - Knowledge graph at
graphify-out/knowledge/graph.json— heading structure + cross-doc links fromdocs/, ADRs,README.md,AGENTS.md,CLAUDE.md,.marvin/memory.md. 2071 nodes · 2839 edges · 184 communities (built 2026-10-06; labelled 2026-10-01 — re-rungraphify label).
Community names. Both graphs were 100 % Community N placeholders until
2026-08-15, which made graph_summary's community section unreadable. They
are now named via graphify label . --backend=claude-cli — the claude-cli
backend drives the OAuth'd Claude CLI, so this needs no API key (this
machine has none).
Labels are not durable across a structural rebuild. When the community set shifts, graphify does not keep the saved LLM labels — it silently renames every community after its hub node, so "Git Write Policy Gate" becomes
git/src/index.ts. Observed 2026-08-15 when agraphify update .moved the code graph 318 → 392 communities. The fallback is still readable, but it is filenames, not concepts. Re-rungraphify labelafter any rebuild that changes the community count. Do NOT wire this into the per-turn watchdog — it is an LLM pass, and the watchdog runs on every turn. Since graphify 0.9.66 the clustering is deterministic (PYTHONHASHSEEDpinned): two full rebuilds of this repo on 0.9.73 gave identical community assignments, so labels now shift only when the code does, not run to run.
Gotcha:
graphify labelhas no--graphflag, andcluster-only --graph <path>reads that path but writes the default one — pointing it at the knowledge graph very nearly overwrote the code graph with it (the node-count guard refused, 2026-08-15). To label the knowledge graph, stage a copy asgraphify-out/graph.jsonin a scratch directory, runlabelthere, and copy the result back.
Who builds them (ADR-0041). When the running IDE has a project open, it
auto-refreshes that project's code AND knowledge graphs per turn — fire-and-
forget from /api/chat, debounced, AST-only (no LLM cost), scoped to the
active project's workDir (never MARVIN's own repo). Every refresh passes one
machine-wide gate (ADR-0041 addendum 2026-11-28): MARVIN_GRAPH_REFRESH_MAX
(1..4, default 1) run at once, the rest queue FIFO / coalesce / drop after
10 min, and a refresh is skipped below MARVIN_GRAPH_REFRESH_MIN_FREE_PCT
(5..90, default 30) available memory — nine at once (~36 GB) once took a Mac
down. The richer semantic
/graphify pass (LLM, GRAPH_REPORT.md + cost.json) stays manual/opt-in.
For a coding-agent session working on MARVIN's own source (no running IDE in
the loop), rebuild manually: graphify update . (code) and
bin/marvin knowledge-graph . (knowledge) — both free. Every graphify MARVIN spawns runs
with GRAPHIFY_NO_AUTO_REFRESH=1 (graphifyEnv): since 0.9.72 graphify
rewrites its installed skill files on any command when they are stale, and a
per-turn background rebuild must not update the user's skills — that is the
Skills pane's job (ADR-0071). Your own terminal graphify still refreshes. (Before ADR-0041 the
code-graph watchdog existed but was dormant — never wired to a trigger.)
Which graphify (ADR-0073 addendum, 2026-11-24). The graph tools are
validated on graphify 0.9.73 and 0.9.118; 0.9.68 stays the floor the
watchdog warns below. Install it as uv tool install "graphifyy[mcp]": since
0.9.118 query, explain, path, affected and benchmark import anyio,
which only the mcp extra installs, and a plain install answers graph_query
with a Python traceback. Add the sql and terraform extras on a project with
.sql / .hcl files: a file whose grammar is missing never gets a manifest
row, so the tool counts it as changed on every run and its own no-change exit
(~14 s, 150 MB) never fires (~42 s, 2.5 GB instead; measured on 1,075 .sql
files). graphifyEnv also sets GRAPHIFY_MAX_WORKERS (half the cores, between
2 and 6; a value already in the sidecar's environment wins). graphify's own
default is one worker per core, which held ~14 of 18 cores per refresh, per tab.
Since 0.9.101 a graph built with --code-only stays code-only across update;
a graph built on 0.9.73 keeps its Markdown document nodes until it is rebuilt.
Each MCP tool (graph_summary, graph_search, graph_neighbors,
graph_path, graph_query, graph_save_result) takes a scope parameter
of "code" (default), "knowledge", or "all". Default preserves
backwards-compatible behaviour — every existing call site queries the
code graph as before. Two further tools landed with
ADR-0066:
graph_affected({symbol, depth?})— the blast-radius tool: who calls this symbol, with exact file and line. Use it before modifying, renaming or deleting anything.graph_neighborsis not a blast-radius tool — the built graph is undirected (directed: false), so its→/←arrows are networkx adjacency-iteration order, not call direction.graph_affectedreads thecallsedges ofgraph.json, oriented by each edge's call-site file (graphify ≥ 0.9.5x: the source was the caller in 4,633 of 4,633 edges), falling back to the AST cache'sraw_callsfor older graphs. The cache alone no longer works for TypeScript: 0.9.65 does not cache JS/TS at all, andgraph_affectedhad been answering from entries frozen on 2026-08-13. Code scope only.graph_reflect({scope?})— aggregates the outcomes recorded bygraph_save_resultintographify-out/reflections/LESSONS.md. Deterministic, no LLM.graph_change_impact({files?, base?, limit?})— blast radius of a whole branch / diff (2026-08-29): symbols and communities the changed files define, god nodes among them, and every caller outside the branch with file and line. No args = current branch vs its base, working tree and untracked included. Forge-agnostic by construction — graphify's own PR tools (get_pr_impact/triage_prs) shell out toghand are GitHub-only, and the project MARVIN works on is on GitLab. Aggregate counterpart ofgraph_affected; wired into thepr-reviewskill and the Phase 3 MUST list.graph_community({community, limit?, scope?})— members of one community by id or labelled name, the one lookupgraph_summarynames but couldn't open.graph_queryalso gainedcontext: [...](the CLI's--contextedge filter) for questions drowning inreferencesnoise.graph_path({from, to, relations?})(2026-09-07) — passrelations: ["calls", "imports", "imports_from", "method", "contains"]for a structural path; every hop prints its file. This is Phase 5's tracer-bullet tool: entry symbol → persistence symbol = milestone 1's touchpoints, so the first milestone is a thin slice through every layer rather than one layer. The practice loop measures plan shape asplan.horizontal/plan.vertical, with the layers discovered from the project's own graph (discoverAreasin graphify-bridge) — MARVIN ships no layer vocabulary.
graph_save_result now takes outcome: useful | dead_end | corrected
(plus correction). Send it every time: without an outcome the save is a
cache entry and graph_reflect has nothing to learn from. A wrong graph
answer recorded as corrected is the highest-value signal there is.
See Golden rule 7 — this is a
non-negotiable rule, not a nice-to-have. Measured 2026-08-15 with
graphify benchmark: 27.5× fewer tokens per query than naive full-corpus
reads (268,066 naive tokens → ~9,763 per query), and the graph catches
structural couplings grep would miss. (The previously-quoted "~36×" was never
measured on this repo; re-run graphify benchmark graphify-out/graph.json
when the number drifts.)
What the graph excludes
.graphifyignore extends graphify's built-in skip list
with MARVIN-specific noise — graphify-out/ itself, .turbo/, .next/,
.build/, .marvin/, data/, vendor/, *.xcodeproj/, macos/Vendored/
(tree-sitter grammars), test outputs (coverage/, playwright-report/,
*.snap), *.log, *.icns, binary distribution artefacts (*.zip,
*.tar.gz, *.dmg). Test code (*.test.ts, *.spec.ts) stays in
the graph — that's contract-by-example signal worth keeping.
Use the gitignore-syntax .graphifyignore at any project's root to scope
graphify the same way — graphify honours the file relative to where it
runs. Inline # comments after a pattern are supported as of 0.9.48
(_parse_gitignore_line follows the gitignore spec: # must be preceded by
whitespace, so path#with#hash.py survives). They were NOT supported on
v0.4.23, which is why existing entries keep comments on their own line —
that still works and needs no migration.
Before any structural exploration or codebase question
MANDATORY. Do this before Read / Grep / Glob on any source file:
- Orient.
graphify query "<the question>"— returns BFS-ranked relevant nodes with source citations. - Trace couplings.
graphify path "A" "B"— shortest path between two concepts. - Explain a single thing.
graphify explain "NodeName"— full neighborhood of one node.
Only read files after the graph has pointed at specific
source_file + source_locations. Cite those locations in the
answer. Never synthesize a structural explanation from imagination.
After changes
In a coding-agent session on MARVIN's own source, rebuild manually (the ADR-0041 per-turn auto-refresh only runs inside the running IDE on an open project):
- Code changes (
*.ts,*.swift, etc.):graphify update .(AST-only, no LLM cost). - Doc changes (
docs/, ADRs, README, memory.md): the code graph doesn't include these; rebuild the knowledge graph withbin/marvin knowledge-graph .(AST-only, no LLM cost). personality.tschanges (which influences MARVIN's behaviour but is a TS file):graphify update .picks it up via the code graph.
God nodes (most-connected abstractions)
After the 2026-10-01 rebuild: requireMarvinClient() (126 edges),
runAgent() (113), checkFsPath() (106), ChatPreviewModel (103),
MarvinBridge (102), cn() (100) are the real
architectural anchors — the shared client guard and the fs-path check are
the widest coupling points in the repo, and MarvinBridge entering the top
ten is worth noticing: it is the app-global state store, so a field on it is
reachable from nearly anywhere, which is exactly how a dead property
(activeMarvinSessionId) kept readers long after its only writer was
deleted.
(Before graphify 0.9.68 an incremental update dropped a re-extracted
file's cross-file edges into unchanged files, which knocked hot nodes out of
the top 10 — and under-fed graph_affected. 0.9.68 fixed it; the watchdog
now warns once when the installed graphify is older, GRAPHIFY_MIN_VERSION
in graphify-bin.ts.) This list moves a lot — it
changed twice in one afternoon across two rebuilds — so read it with
graphify god-nodes --top 8 rather than trusting the transcription here,
which had drifted badly by the time ADR-0066 checked it.
Language primitives also bubble to the top —
string, text, font, View, data, image, Kind, Codable —
those are AST-noise from the tree-sitter pass, not concepts; treat them as
background. The .graphifyignore filters files, not node kinds; a follow-up
to filter language primitives from the AST extractor would need to live in
graphify itself.
Refresh this list with graphify update . when it drifts.
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.

