Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/theclaymethod/artifacture/diff-reviewgit clone --depth 1 https://github.com/theclaymethod/artifactureWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00016 | $0.02119 |
| Opus 5 | $0.00008 | $0.01059 |
| Sonnet 5 | $0.00003 | $0.00424 |
| Haiku 4.5 | $0.00002 | $0.00212 |
Grade A, and why
diff-review scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 79 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Load the visual-explainer skill, then generate a comprehensive visual diff review as a self-contained HTML page.
Which diff command to use. Use /diff-review when the reader needs reviewer-risk findings; use /explain-diff when the reader needs a teaching walkthrough.
Authoring contract. Prefer the MDX/React pipeline after the fact-gathering checkpoint. Write the editable review as .mdx by default, or .tsx when the report needs custom interaction, generated SVG logic, or local state. Use shared components from visual-explainer-mdx/components.tsx, then export the generated standalone HTML with:
npm run ve:export -- <source.mdx> --out ~/.agent/diagrams/<slug>-diff-review.html
The generated HTML is the artifact, not the source of truth. Revise the MDX/TSX source when facts change or point-and-click feedback arrives, then re-export.
Clarify. This is a Tier 1 command per ./references/clarify.md. Diff scope is usually clear from $1 (branch / commit / PR). If the target is ambiguous or the audience / depth is unclear from the user's request, ask 1–2 questions via AskUserQuestion. Bypass with --no-ask.
Follow the visual-explainer skill workflow. Read the reference template, CSS patterns, and mermaid theming references before generating. Use a GitHub-diff-inspired aesthetic with red/green before/after panels, but vary fonts and palette from previous diagrams.
Scope detection — determine what to diff based on $1:
- Branch name (e.g.
main,develop): working tree vs that branch - Commit hash: that specific commit's diff (
git show <hash>) HEAD: uncommitted changes only (git diffandgit diff --staged)- PR number (e.g.
#42):gh pr diff 42 - Range (e.g.
abc123..def456): diff between two commits - No argument: default to
main
Data gathering phase — run these first to understand the full scope:
git diff --stat <ref>for file-level overviewgit diff --name-status <ref> --for new/modified/deleted files (separate src from tests)- Line counts: compare key files between
<ref>and working tree (git show <ref>:file | wc -lvswc -l) - New public API surface: grep added lines for exported symbols, public functions, classes, interfaces (adapt the pattern to the project's language —
export/function/class/interfacefor TS/JS,def/classfor Python,func/typefor Go, etc.) - Feature inventory: grep for new actions, keybindings, config fields, event types on both sides
- Read all changed files in full — include surrounding code paths needed to validate behavior
- Check whether
CHANGELOG.mdhas an entry for these changes - Check whether
README.mdordocs/*.mdneed updates given any new or changed features - Reconstruct decision rationale: if this work was done in the current session, mine the conversation for approaches discussed, alternatives rejected, and trade-offs made. Check for progress docs (
~/.agent/memory/{project}/progress.md,~/.pi/agent/memory/{project}/progress.md) or plan files that may contain reasoning. For committed changes, read commit messages and PR descriptions.
Verification checkpoint — before generating HTML, produce a structured fact sheet of every claim you will present in the review:
- Every quantitative figure: line counts, file counts, function counts, test counts
- Every function, type, and module name you will reference
- Every behavior description: what code does, what changed, before vs. after
- For each, cite the source: the git command output that produced it, or the file:line where you read it Verify each claim against the code. If something cannot be verified, mark it as uncertain rather than stating it as fact. This fact sheet is your source of truth during HTML generation — do not deviate from it.
Diagram structure — the page should include:
- Executive summary — not just a dry before/after. Lead with the intuition: why do these changes exist? What problem were they solving, what was the core insight? Then the factual scope (X files, Y lines, Z new modules). Aim for "aha moment" clarity — a reader who only sees this section should understand the essence of the change. Visual treatment: this is the visual anchor — use hero depth (larger type 20-24px, subtle accent-tinted background, more padding than other sections).
- KPI dashboard — lines added/removed, files changed, new modules, test counts. Include a housekeeping indicator: whether CHANGELOG.md was updated (green/red badge) and whether docs need changes (green/yellow/red).
- Module architecture — how the file structure changed, with a Mermaid dependency graph of the current state. Wrap in
.mermaid-wrapwith zoom controls (+/−/reset/expand buttons), Ctrl/Cmd+scroll zoom, click-and-drag panning, and click-to-expand (opens diagram full-size in new tab). See css-patterns.md "Mermaid Zoom Controls" for the full pattern including theopenMermaidInNewTab()function. - Major feature comparisons — side-by-side before/after panels for each significant area of change (UI, data flow, API surface, config, etc.). Overflow prevention: apply
min-width: 0on all grid/flex children andoverflow-wrap: break-wordon panels. Never usedisplay: flexon<li>for marker characters — use absolute positioning instead (see css-patterns.md Overflow Protection). - Flow diagrams — Mermaid flowchart, sequence, or state diagrams for any new lifecycle/pipeline/interaction patterns. Same zoom controls and click-to-expand as section 3.
- File map — full tree with color-coded new/modified/deleted indicators. Visual treatment: compact — consider
<details>collapsed by default for pages with many sections. - Test coverage — before/after test file counts and what's covered
- Code review — structured Good/Bad/Ugly analysis of the changes:
- Good: Solid choices, improvements, clean patterns worth calling out
- Bad: Concrete issues — bugs, regressions, missing error handling, logic errors
- Ugly: Subtle problems — tech debt introduced, maintainability concerns, things that work now but will bite later
- Questions: Anything unclear or that needs the author's clarification
- Use styled cards with green/red/amber/blue left-border accents matching the diff color language. Each item should reference specific files and line ranges. If nothing to flag in a category, say "None found" rather than omitting the section.
- Decision log — for each significant design choice in the diff, a styled card with:
- Decision: one-line summary of what was decided (e.g., "Promise-based deferred resolution instead of event emitters for cleanup signaling")
- Rationale: why this approach — constraints, trade-offs, what it enables. Pull from conversation context if available, infer from code structure if not.
- Alternatives considered: what was rejected and why, if recoverable
- Confidence: whether this rationale was explicitly discussed (high — sourced from conversation/docs) or inferred from the code (medium — flagged as inference). Low confidence means the rationale couldn't be recovered at all.
- Visual treatment by confidence level — use left-border accent colors consistent with the diff color language: High (sourced from conversation/docs): green left border. Medium (inferred from code): blue left border, labeled "inferred." Low (not recoverable): amber left border, "rationale not recoverable — document before committing" warning. Low-confidence cards are cognitive debt hotspots — tell the user to document the reasoning before committing.
- Re-entry context — a concise "note from present-you to future-you" covering the following. Visual treatment: compact — consider
<details>collapsed by default for pages with many sections.
- Key invariants: assumptions the changed code relies on that aren't enforced by types or tests (e.g., "cleanup must be called before session switch or artifacts leak")
- Non-obvious coupling: files or behaviors that are connected in ways that aren't visible from imports alone (e.g., "the feed renderer reads events written by the overlay — changing the event schema requires updating both")
- Gotchas: things that would surprise someone modifying this code in two weeks. Edge cases, ordering dependencies, implicit contracts.
- Don't forget: if the changes require follow-up work (migration, config update, docs), list it here.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 79 lines · 16 tokens per session scan A 9f4d33e4606f
diff-review is a command published in the GitHub repository theclaymethod/artifacture (2 stars, last pushed 9d ago), licensed MIT. It adds 16 tokens to every session and 2,119 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other commands, from other repositories
editor
You are my personal writing editor for MDX/Markdown content. Improve clarity, flow, grammar, and style while preserving the author's voice, meaning, and factual details. Infer the content type and appropriate tone from the context.
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.