draft
CLAUDE.md40 starsChanged 4 months agoMITView on GitHub
Draft is a Claude Code plugin that implements Context-Driven Development methodology. It provides a two-tier command surface: 4 primary workflow commands (/draft:init, /draft:new-track, /draft:implement, /draft:review) plus 5 routers (/draft:plan, /draft:ops, /draft:docs, /draft:discover, /draft:jira) as the recommended public interface. 24 specialist commands are dispatched underneath the routers. The unified /draft:jira router supports preview, create, and the advanced review <JIRA-ID> qualification pipeline (deep-review + bughunt + coverage + test-gap analysis). Run /draft for the full intent map. Total surface: 33 skills. Draft…
- Commits and pushes
In this repository35 other files it gives its agents.
- web/llms-full.txtllms.txt
- web/llms.txtllms.txt
- adrSkill
- assist-reviewSkill
- bughuntSkill
- changeSkill
- coverageSkill
- debugSkill
- decomposeSkill
- deep-reviewSkill
- deploy-checklistSkill
- discoverSkill
- docsSkill
- documentationSkill
- draftSkill
- graphSkill
- impactSkill
- implementSkill
- incident-responseSkill
- initSkill
- integrationsSkill
- jiraSkill
- learnSkill
- new-trackSkill
- opsSkill
- planSkill
- quick-reviewSkill
- revertSkill
- reviewSkill
- standupSkill
- statusSkill
- tech-debtSkill
- testing-strategySkill
- tourSkill
- uploadSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
14 rules. About 0 are common, 3 are distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 105
After the closing ---, the body must be: (1) blank line, (2) # Title heading, (3) blank line, (4) content.
- Very specific: line 126
Run ./scripts/build-integrations.sh to regenerate integrations
- Distinctive: line 127
Update this CLAUDE.md only if core concepts change
- Very specific: line 131
Create skills/<skill-name>/SKILL.md with frontmatter (kebab-case name, no path traversal chars)
- Very specific: line 132
Add skill name to SKILL_ORDER in scripts/lib.sh
- Very specific: line 133
Add a <name>|<header>|<trigger> row to SKILL_META in scripts/lib.sh (coverage-checked by tests/test-trigger-functions.sh)
- Very specific: line 134
Run make build && make test (plugin.json auto-discovers skills via directory convention)
- Distinctive: line 135
Document in README.md and CHANGELOG.md
- Very specific: line 139
Create scripts/tools/<tool-name>.sh (kebab-case, lowercase)
- Very specific: line 140
Add to TOOLS array in scripts/lib.sh (tests/test-tools-registered.sh reads this array dynamically and validates the new entry — no separate …
- Very specific: line 141
Create a test at tests/test-tools-<tool-name>.sh and add it to TEST_SCRIPTS in Makefile
- Very specific: line 157
Do not run npm publish by hand: release.yml publishes from a clean checkout of the tag, so the tarball matches the tag and carries no …
- Very specific: line 163
When users run /draft:init, it creates a draft/ directory in their project.
- Distinctive: line 183
Verification Before Completion: No completion claims without fresh verification evidence
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Repository Overview
Draft is a Claude Code plugin that implements Context-Driven Development methodology. It provides a two-tier command surface: 4 primary workflow commands (/draft:init, /draft:new-track, /draft:implement, /draft:review) plus 5 routers (/draft:plan, /draft:ops, /draft:docs, /draft:discover, /draft:jira) as the recommended public interface. 24 specialist commands are dispatched underneath the routers. The unified /draft:jira router supports preview, create, and the advanced review <JIRA-ID> qualification pipeline (deep-review + bughunt + coverage + test-gap analysis). Run /draft for the full intent map. Total surface: 33 skills.
Draft also ships a knowledge graph engine — codebase-memory-mcp, fetched on install to ~/.cache/draft/bin/ (not vendored; see bin/README.md) — driven by scripts/tools/ (53 deterministic shell helpers). Skills are markdown (source of truth, processed by a bash build script into platform-specific integration files for Copilot and Gemini); the graph engine and shell helpers handle mechanical work that markdown can't.
Build & Test Commands
make build # Generate integration files from skills
make build-integrations # Same as above (explicit target)
make test # Run all 83 test suites (skills, build, tools)
make lint # Run shellcheck + markdownlint
make clean # Remove generated integrations
# Run a single test
./tests/test-skill-frontmatter.sh
./tests/test-build-integrations.sh
./tests/test-tools-classify-files.sh
# etc. — any test in tests/ is independently executable
# Graph engine (codebase-memory-mcp — fetched on install, not vendored)
scripts/fetch-memory-engine.sh # install engine to ~/.cache/draft/bin/
scripts/tools/graph-snapshot.sh --repo . # index repo + write draft/graph/schema.yaml gate
scripts/tools/hotspot-rank.sh --repo . # fan-in-ranked hotspots (live query)
scripts/tools/graph-impact.sh --repo . --symbol <name> # blast radius for a symbol (live query)
# Prerequisites: Bash 4.0+, jq (graph tools), Node 18+ (draft CLI), python3 (OKF mode:
# okf-fix-links.sh / okf-render-views.sh), shellcheck, markdownlint-cli (lint only)Tests use a custom bash framework (tests/test-helpers.sh) with assert(), pass(), fail() helpers. No external test runner.
Architecture
Build Pipeline (the critical path)
skills/<name>/SKILL.md ──┐
core/methodology.md ├──→ scripts/build-integrations.sh ──→ integrations/copilot/.github/copilot-instructions.md
core/shared/*.md │ (~25,300 lines, auto-generated)
core/templates/*.md ├──→ (Gemini uses bootstrap .gemini.md — no longer generated)
core/agents/*.md ──┘The build script (scripts/build-integrations.sh) reads SKILL_ORDER, CORE_FILES, and TOOLS from scripts/lib.sh (sourced) and:
- Iterates
SKILL_ORDER(33 skills in current two-tier model, order matters) - Validates YAML frontmatter (
name:anddescription:required) - Validates body format: blank,
# Title, blank, then content - Extracts body via
extract_body(), skipping frontmatter - Applies syntax transforms (
/draft:command→draft command;@architect,@debugger, etc. →@workspacefor Copilot) - Inlines 66 core reference files (methodology, shared procedures, templates, agents, guardrails)
- Writes atomically to a temp file then renames into place
- Runs
verify_output()— line count, completeness, syntax
Source of Truth Hierarchy
core/methodology.md— Master methodology (update first)skills/<name>/SKILL.md— Skill implementations (derive from methodology)integrations/copilot/.github/copilot-instructions.md— GENERATED, never edit directly
Key Directories
core/shared/— Shared procedures loaded by skills (context loading, git metadata, pattern learning, cross-skill dispatch, Jira sync, graph queries, parallel analysis, VCS commands)core/agents/— Behavioral protocols for specialized agents (architect, debugger, planner, rca, reviewer, ops, writer)core/templates/— 28 templates for files that/draft:initgenerates in user projects (24 top-level + 4okf/bundle templates forDRAFT_INIT_MODE=okf)bin/— Holds onlyREADME.md. The graph engine (codebase-memory-mcp) is not vendored — it is fetched on install (scripts/fetch-memory-engine.sh) to~/.cache/draft/bin/and resolved byscripts/tools/_lib.sh:find_memory_bin()(DRAFT_MEMORY_BIN→$PATH→ cache). Output gate marker underdraft/graph/schema.yaml; all structural data is queried live. CLI and schema documented inbin/README.md.scripts/tools/— 53 deterministic shell helpers (git-metadata, classify-files, hotspot-rank, cycle-detect, graph-* capability wrappers,resolve-tools.sh, etc.). Skills call these for mechanical work. All knowledge-graph Cypher lives in the sourced_graph_queries.shmodule (single source of query truth); thegraph-*.shwrappers are thin arg-parse → builder → fail-loud JSON.scripts/lib.sh— Shared definitions sourced by build script:SKILL_ORDER,SKILL_META,CORE_FILES,TOOLS.scripts/benchmark/— Efficacy-benchmark harness (bench-checkout.sh,bench-grade.sh,bench-report.sh). Protocol indocs/benchmark/README.md— public by design: a pre-registered protocol is what makes the published numbers credible. Not part of the shipped plugin. Notedocs/internal/is gitignored; nothing under it ships.web/— Static website deployed to GitHub Pages (getdraft.dev), deployed via.github/workflows/pages.yml. Includes the Draft Book (22 chapters + 2 appendices) underweb/book/.docs/tracker/— Sharded work tracker:INDEX.mdrollup + one file per major work. Read the index, open only the tracker you act on.draft/— Dogfooding: Draft's own context files, generated by running/draft:initon this repo
CI
.github/workflows/ holds three workflows:
| Workflow | Trigger | Does |
ci.yml | push to main, PRs | Install path (repo-size gate + clean-clone smoke test), make test + integrations-freshness, graph smoke test against the real pinned engine, lint (shellcheck and markdownlint, both blocking) |
release.yml | vX.Y.Z tag push | Verifies tag matches package.json, extracts notes via scripts/release-notes.sh, publishes the GitHub Release, then publishes to npm (tag pushes only; needs the NPM_TOKEN secret) |
pages.yml | push touching web/ | Deploys the site |
The repo-size gate exists because plugin marketplace add git-clones this repo — anything in HEAD is downloaded before install can proceed. Never commit large assets; attach them to a Release.
Skill File Format (strict)
---
name: skill-name
description: Brief description
---
# Skill Title
Execution instructions below...After the closing ---, the body must be: (1) blank line, (2) # Title heading, (3) blank line, (4) content. The build script skips the first 3 body lines (tail -n +4) when inlining into integrations. Violating this format produces silent corruption in the generated output.
Progressive Disclosure: skills/<skill>/references/*.md
A skill may ship supplementary content under skills/<skill>/references/*.md (top-level .md files only). The build script inlines these into the Copilot integration immediately after the SKILL body, sorted alphabetically, with the same syntax transforms applied. Use this for detail that bloats SKILL.md beyond the 1,500–2,000-word target (advanced patterns, schemas, exhaustive examples).
Coverage in tests: tests/test-skill-references.sh.
Syntax Transformation Rules
The build script transforms skill content for platform compatibility:
/draft:command→draft command(Copilot uses bare syntax, no slash prefix)@architect,@debugger, etc. →@workspace(Copilot agent references)
Maintaining the Plugin
Updating Methodology
- Update
core/methodology.mdfirst - Apply changes to relevant
skills/SKILL.md files - Run
./scripts/build-integrations.shto regenerate integrations - Update this CLAUDE.md only if core concepts change
Adding a New Skill
- Create
skills/<skill-name>/SKILL.mdwith frontmatter (kebab-case name, no path traversal chars) - Add skill name to
SKILL_ORDERinscripts/lib.sh - Add a
<name>|<header>|<trigger>row toSKILL_METAinscripts/lib.sh(coverage-checked bytests/test-trigger-functions.sh) - Run
make build && make test(plugin.json auto-discovers skills via directory convention) - Document in README.md and CHANGELOG.md
Adding a New Tool
- Create
scripts/tools/<tool-name>.sh(kebab-case, lowercase) - Add to
TOOLSarray inscripts/lib.sh(tests/test-tools-registered.shreads this array dynamically and validates the new entry — no separate allowlist to update) - Create a test at
tests/test-tools-<tool-name>.shand add it toTEST_SCRIPTSinMakefile - Run
make test
Plugin Manifest
.claude-plugin/plugin.json — registers skills with Claude Code. The skills field uses a directory path ("./skills/") for auto-discovery; SKILL_ORDER in the build script controls integration generation order (these are independent).
Releasing / Bumping the Version
package.json is the single source of truth for the version. Never hand-edit the version anywhere else. Bump with:
npm version <patch|minor|major|x.y.z> # writes package.json, runs the `version` hook
git push --follow-tags origin main # the tag push publishes the GitHub Release and npmDo not run npm publish by hand: release.yml publishes from a clean checkout of the tag, so the tarball matches the tag and carries no untracked build leftovers.
The npm version lifecycle hook runs scripts/sync-version.sh --stage, which propagates the new version into .claude-plugin/plugin.json, .claude-plugin/marketplace.json, .cursor-plugin/plugin.json, and the website's version labels (the nav version pill on every page, the landing hero's REV, the book landing's REV), then git adds exactly those files — so they all land in the bump commit atomically. Release copy (headlines, dates, changelog prose, the site changelog's Latest entry) stays hand-written. tests/test-version-sync.sh (in make test) fails CI if any consumer drifts from package.json; run bash scripts/sync-version.sh to fix.
End-User Context
When users run /draft:init, it creates a draft/ directory in their project. Output mode is tier-gated (DRAFT_INIT_MODE unset → tier 1–2 monolith, tier 3–5 okf; explicit DRAFT_INIT_MODE=monolith|okf overrides). Mode changes only the architecture.md / .ai-context.md packaging; all other files below are produced in both modes.
Always produced (mode-independent):
index.md— Plain docs index listing the prose context files and tracks.md; notes the graph is engine-only.product.md,tech-stack.md,workflow.md,guardrails.md— Project config files.ai-profile.md— Ultra-compact 20-50 line always-injected profile (derived from .ai-context.md)tracks/+tracks.md— Individual feature/fix tracks withspec.md,plan.md,metadata.json(includesimpactblock: files_touched, modules_touched, downstream_files, by_category).state/— Freshness hashes, signal classification, run memory for incremental refreshgraph/— Holds onlyschema.yaml(gate marker: engine metadata, point-of-index counts;access: engine-live). All structural graph data is queried live from thecodebase-memory-mcpengine via thescripts/tools/graph-*.shwrappers.
Packaging differs by mode:
monolith(tier 1–2 default) —architecture.mdis the source of truth (10-section graph-primary reference with Mermaid);.ai-context.mdis the token-optimized AI context derived from it, sized by repo tier (100–900 lines).okf(tier 3+ default) —wiki/is the source of truth (OKF concept taxonomy, one concept per file);.ai-context.mdis the index root (Synopsis + Concept Map);architecture.mdis a generated rendered view of the bundle;wiki/web/index.htmlis an optional offline viewer. Seeskills/init/references/okf-emitter.md.
Status markers in tracks: [ ] Pending, [~] In Progress, [x] Completed, [!] Blocked
Quality Disciplines
- Verification Before Completion: No completion claims without fresh verification evidence
- Systematic Debugging: Investigate → Analyze → Hypothesize → Implement (see
core/agents/debugger.md) - Root Cause Analysis: Reproduce → Trace → Hypothesize → Fix with blast radius scoping (see
core/agents/rca.md) - Three-Stage Review: (1) Automated Validation, (2) Spec Compliance, (3) Code Quality (see
core/agents/reviewer.md)
Communication Style
Lead with conclusions. Be concise. Direct, professional tone. Code over explanation.
<!-- graphwiki:wiki-ref -->Code wiki (graphwiki)
Graph-grounded wiki at /tmp/draft-wiki-cmp/. Start at /tmp/draft-wiki-cmp/.ai-context.md for the concept index, or /tmp/draft-wiki-cmp/architecture.md for the system map. Refresh with graphwiki update.
<!-- /graphwiki:wiki-ref -->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.

