Skip to content

Commit 42cc0cf

Browse files
mayurpiseclaude
andcommitted
docs: sync website, book, and blog with engine-only graph + 33-command surface
Bring every documentation surface up to date with the post-3.0.0 state (/draft:index removed, OKF removed, engine-only graph). The engine-fetch and tooling changes already landed in 1f09de0; this commit covers the remaining documentation/website drift. Website: - index.html, what-is-draft, llms.txt/llms-full.txt, feed.xml, podcast.xml: command count 34->33, specialists 25->24, shell tools 34->32; drop OKF copy; remove /draft:index (card, FAQ, tables); version labels v2.8->v3.0; install leads with `npx @drafthq/draft install <host>`; de-dup command grid (+graph, +upload). Regenerated topic pages + sitemap via build-book.sh. - llms-full.txt: graph section rewritten to engine-only (schema.yaml only). Book (chapters + notebook sources): - Rewrite ch.18 monorepo-federation to scope-aware /draft:init + root-link.json. - Fill ch.22 command-reference and ch.23 file-reference stubs. - architecture.md "25-section"->"10-section"; appendix table lists all 33 skills. Blog: - Rewrite local-graph-engine to engine-only (live query, nothing committed). - Fix hotspots.jsonl / architecture.json references in 3 more posts. Root: - README: drop /draft:index row. CONTRIBUTING: SKILL_ORDER lives in lib.sh. - Add docs/audit/DOC_DRIFT_AUDIT.md drift tracker. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 1f09de0 commit 42cc0cf

45 files changed

Lines changed: 734 additions & 556 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Execution instructions...
8484
```
8585

8686
2. The body **must** start with `# Title` followed by a blank line (build script skips first 3 body lines via `tail -n +4`)
87-
3. Add the skill name to `SKILL_ORDER` array and add header/trigger case entries in `scripts/build-integrations.sh`
87+
3. Add the skill name to the `SKILL_ORDER` array in `scripts/lib.sh`, then add a case entry in `get_skill_header()` AND `get_copilot_trigger()` in `scripts/build-integrations.sh`
8888
4. Run `make build && make test`
8989
5. Add the command to `README.md`
9090
6. Add a test if the skill has validatable behavior

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ curl -o .gemini.md https://raw.githubusercontent.com/drafthq/draft/main/integrat
129129
| **`/draft:docs`** | Router for authoring and documentation workflows |
130130
| **`/draft:discover`** | Router for discovery, debugging, investigation, and quality |
131131
| **`/draft:init`** | Analyze codebase, create context files + state tracking |
132-
| **`/draft:index`** | Aggregate monorepo service contexts |
132+
| **`/draft:graph`** | Build / refresh the knowledge-graph snapshot |
133133
| **`/draft:new-track`** | Collaborative spec + plan with AI |
134134
| **`/draft:decompose`** | Module decomposition with dependency mapping |
135135
| **`/draft:implement`** | TDD workflow with checkpoints |
@@ -234,7 +234,7 @@ AI tools are fast but unstructured. Draft applies Context-Driven Development to
234234
```
235235
product.md → "Build a task manager"
236236
tech-stack.md → "React, TypeScript, Tailwind"
237-
architecture.md → Comprehensive: 28 sections + 5 appendices, Mermaid diagrams (source of truth). Mature brownfield projects with strong existing agent docs (CLAUDE.md, INVARIANTS.md, etc.) receive early Context Quality Audit, graph fidelity dashboard, and explicit Relationship + Gaps sections (no blind duplication).
237+
architecture.md → Comprehensive: 10-section graph-primary engineering reference, Mermaid diagrams (source of truth). Mature brownfield projects with strong existing agent docs (CLAUDE.md, INVARIANTS.md, etc.) receive early Context Quality Audit, graph fidelity dashboard, and explicit Relationship + Gaps sections (no blind duplication).
238238
.ai-context.md → 200-400 lines: condensed from architecture.md (token-optimized AI context)
239239
.state/ → freshness hashes, signal classification, run memory (incremental refresh)
240240
spec.md → "Add drag-and-drop reordering"

book/notebook-sources/00_what_is_draft.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ You installed an AI coding assistant. It writes code fast. But it also picks the
88

99
## What Draft Is
1010

11-
Draft is a free, open-source plugin that adds structured development methodology to AI coding agents. It provides 28 slash commands and 7 specialized agents that turn your AI assistant from an autonomous guessing machine into a disciplined executor of pre-approved work.
11+
Draft is a free, open-source plugin that adds structured development methodology to AI coding agents. It provides 33 slash commands and 7 specialized agents that turn your AI assistant from an autonomous guessing machine into a disciplined executor of pre-approved work.
1212

1313
The core idea: before AI writes a single line of code, it analyzes your codebase, generates a specification, builds a phased plan, and waits for your approval. Only then does implementation begin — constrained by your architecture, your conventions, and your acceptance criteria.
1414

@@ -26,7 +26,7 @@ Draft is for developers and teams who use AI coding assistants and have experien
2626

2727
## What You Get
2828

29-
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. 22 specialist commands are dispatched by the routers for targeted work (debug, bughunt, deep-review, tech-debt, ADR, etc.).
29+
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 by the routers for targeted work (debug, bughunt, deep-review, tech-debt, ADR, etc.).
3030

3131
The router model reduces cognitive load: state your intent to a router and it dispatches to the right specialist with context.
3232

@@ -36,7 +36,7 @@ The router model reduces cognitive load: state your intent to a router and it di
3636

3737
Draft works with the AI coding tools you already use:
3838

39-
* Claude Code— Native plugin installation via/plugin install
39+
* Claude Code— Native plugin installation via`npx @drafthq/draft install claude-code`
4040
* Cursor— Native support for the.claude/plugin structure
4141
* GitHub Copilot— Via.github/copilot-instructions.md
4242
* Gemini— Via.gemini.mdbootstrap file

book/notebook-sources/02_context_driven_development.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ What it locks in:technology choices, dependency constraints, accepted patterns.
3232

3333
### architecture.md — How (Structure)
3434

35-
The source of truth. A comprehensive 25-section engineering reference generated from exhaustive codebase analysis. It includes module boundaries, dependency graphs, data flows, API definitions, concurrency models, security architecture, and testing infrastructure — all with real Mermaid diagrams and actual code snippets from your codebase.
35+
The source of truth. A comprehensive 10-section engineering reference generated from exhaustive codebase analysis. It includes module boundaries, dependency graphs, data flows, API definitions, concurrency models, security architecture, and testing infrastructure — all with real Mermaid diagrams and actual code snippets from your codebase.
3636

3737
What it locks in:module boundaries, interaction contracts, data flow patterns, invariants. The AI cannot violate your architecture because the architecture is explicitly documented with every component, every interface, and every constraint.
3838

@@ -68,7 +68,7 @@ This is where the AI gets enough context to make correct decisions without the f
6868

6969
### Tier 2: Long-Term Storage
7070

71-
architecture.mdis the full, comprehensive reference — 25 sections plus appendices, with Mermaid diagrams and code snippets. It is loaded for deep reviews, architecture refreshes, and complex analysis tasks. Most day-to-day development never touches this tier directly.
71+
architecture.mdis the full, comprehensive reference — 10 sections with Mermaid diagrams and code snippets. It is loaded for deep reviews, architecture refreshes, and complex analysis tasks. Most day-to-day development never touches this tier directly.
7272

7373
Smaller context windows produce better AI decisions. By loading only what's needed, Draft reduces token consumption, decreases hallucination risk, and keeps the AI focused on the relevant subset of your architecture. The right context for the task — not all the context, all the time.
7474

book/notebook-sources/03_getting_started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Draft installs with a single command. No API keys, no accounts, no hosted servic
1212

1313
### Claude Code (Recommended)
1414

15-
That's it. You now have all 28 commands available as/draft:*slash commands.
15+
That's it. You now have all 33 commands available as/draft:*slash commands.
1616

1717
### Cursor
1818

@@ -85,7 +85,7 @@ After the five-phase analysis, Draft creates thedraft/directory with these files
8585

8686
### architecture.md (Source of Truth)
8787

88-
A comprehensive 25-section engineering reference with appendices. This is the primary artifact — designed for both human engineers and AI agents. It includes:
88+
A comprehensive 10-section engineering reference. This is the primary artifact — designed for both human engineers and AI agents. It includes:
8989

9090
* Executive summary and system identity
9191
* Component map and module documentation

book/notebook-sources/10_context_tiering.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This file isderivedfromarchitecture.md, not written directly. Draft's condensati
3434

3535
## Tier 2: The Full Architecture
3636

37-
The filedraft/architecture.mdis the source of truth. It is a comprehensive, human-readable engineering reference with 25 sections and 4 appendices, complete with Mermaid diagrams, code snippets, interaction matrices, and state machine definitions. It exists for two audiences: AI agents performing deep analysis, and engineers who need to understand a module without reading source code.
37+
The filedraft/architecture.mdis the source of truth. It is a comprehensive, human-readable 10-section engineering reference, complete with Mermaid diagrams, code snippets, interaction matrices, and state machine definitions. It exists for two audiences: AI agents performing deep analysis, and engineers who need to understand a module without reading source code.
3838

3939
Tier 2 is loaded only for deep analysis:/draft:initrefresh,/draft:deep-review,/draft:decompose, and full architecture refreshes. Most day-to-day development never touches it. When it is loaded, it provides exhaustive context that Tier 1 intentionally omits: per-module state machines, thread safety annotations, the full implementation catalog, concurrency model details, and configuration reference tables.
4040

@@ -76,7 +76,7 @@ Evening: you run/draft:deep-reviewon the auth module after a security concern. D
7676

7777
## Why Not Just Load Everything?
7878

79-
Token budgets are finite. A 400-line.ai-context.mdplus a 2000-linearchitecture.mdplus 150 facts consumes significant context window space — space that competes with the actual code being analyzed, the spec being checked, and the plan being followed. Tiering is not an optimization. It is a necessity. Without it, large projects would hit context limits before the AI could even begin working.
79+
Token budgets are finite. A 400-line.ai-context.mdplus a comprehensive 10-sectionarchitecture.mdplus 150 facts consumes significant context window space — space that competes with the actual code being analyzed, the spec being checked, and the plan being followed. Tiering is not an optimization. It is a necessity. Without it, large projects would hit context limits before the AI could even begin working.
8080

8181
The three-tier system also reflects a truth about information relevance: most of your project's architectural knowledge is irrelevant to any single task. Loading it anyway does not make the AI smarter. It makes it noisier. Focused context produces focused output.
8282

book/notebook-sources/18_monorepo_federation.md

Lines changed: 31 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,69 +4,59 @@ Part VI: Enterprise· Chapter 18
44

55
4 min read
66

7-
A monorepo with twelve services has twelvedraft/directories after initialization. Each service has its own architecture documentation, its own tech stack, its own context files. But nobody has a unified view of the whole system — which services depend on which, what technologies are used where, or how the pieces fit together./draft:indexbuilds that view.
7+
Draft has no separate index command. Monorepo support is built directly into `/draft:init`, which is scope-aware and root-first. Run it at the repo root to build the whole-repo knowledge graph; run it inside a sub-module and it resolves the repo root automatically, builds that module's snapshot, and writes `draft/graph/root-link.json` pointing up to the root graph — so every module has full cross-module understanding without an extra step. Federation is the root-link mechanism, not a separate command.
88

99
## The Monorepo Context Problem
1010

11-
Running/draft:initon each service in a monorepo produces excellent per-service context. The auth service has a detailed.ai-context.mdexplaining its JWT validation flow. The billing service documents its Stripe integration. But cross-service questions remain unanswered: what happens when auth goes down? Which services share PostgreSQL? Is anyone still using the deprecated notification API?
11+
A monorepo with twelve services raises a cross-module question that per-service context cannot answer: what happens when the auth service changes? Which services share PostgreSQL? Which team owns the notification API? Per-service `/draft:init` runs produce excellent local context — detailed `.ai-context.md` files for each service — but answering cross-service questions requires connecting those views.
1212

13-
/draft:indexanswers these questions by aggregating service-level context into root-level knowledge files, without deep code analysis. It reads what/draft:initalready produced and synthesizes a system-of-systems view.
13+
Draft solves this through the root-link mechanism built into `/draft:init`. There is no separate aggregation step. Running `/draft:init` anywhere in the monorepo is enough.
1414

15-
## Auto-Detection
15+
## How Scope-Aware Init Works
1616

17-
Draft detects services by scanning immediate child directories (depth=1 only, never recursive) for standard project markers:
17+
`/draft:init` is root-first. When invoked at the repo root, it builds the whole-repo knowledge graph in `draft/graph/`. When invoked inside a sub-module (for example, `services/billing/`), it:
1818

19-
* package.json— Node.js services
20-
* go.mod— Go services
21-
* Cargo.toml— Rust services
22-
* pom.xml/build.gradle— Java services
23-
* pyproject.toml/requirements.txt— Python services
24-
* Dockerfile— Containerized services
25-
* src/directory with code files
26-
It excludesnode_modules/,vendor/,.git/, and hidden directories. Each detected directory is categorized as initialized (has adraft/subdirectory) or uninitialized. Only initialized services contribute to the index.
19+
1. **Resolves the repo root** — walks ancestor directories looking for an existing `draft/` directory, then falls back to `git rev-parse --show-toplevel`, then falls back to cwd.
20+
2. **Builds the module snapshot** — runs full analysis for the sub-module and writes its graph under the module's own `draft/graph/`.
21+
3. **Writes `draft/graph/root-link.json`** — a pointer from the module's graph to the root graph. This file tells any Draft command running inside the module where the whole-repo graph lives.
2722

28-
## What Gets Generated
23+
The result: a Draft command running inside `services/billing/` can answer cross-module questions by following the root link to the root graph, without re-running any analysis at the root level.
2924

30-
/draft:indexproduces six root-level files that together form a complete system map:
25+
## The root-link.json File
3126

32-
### service-index.md
27+
`draft/graph/root-link.json` is a small JSON file written by `/draft:init` when it detects it is running inside a sub-module. It contains the absolute path to the root `draft/graph/` directory and metadata about when the link was established. Commands that need cross-module context read this file and query the root graph directly.
3328

34-
A directory of all detected services with their status, tech stack, dependencies, team ownership, and links to their individual context files. This is the entry point — the table of contents for the entire monorepo.
29+
If no root graph exists yet, the root link points to a pending state and falls back gracefully to module-local context. Running `/draft:init` at the repo root later fills the gap — no re-initialization of sub-modules required.
3530

36-
### dependency-graph.md
31+
## The Committed Graph: Only schema.yaml
3732

38-
Cross-service dependency mapping with a Mermaid topology diagram, a dependency matrix (depends-on and depended-by for every service), and a topological implementation order. This file answers "what breaks if this service changes?" and "what must exist before this service can function?"
33+
The knowledge graph itself is engine-only. The `codebase-memory-mcp` engine (by DeusData, 159 languages, 100% local) maintains the structural graph in-process. No `architecture.json`, `hotspots.jsonl`, or `*.mermaid` files are committed to the repository.
3934

40-
### tech-matrix.md
35+
The only committed file in `draft/graph/` is `schema.yaml` — a gate marker containing engine metadata, project identity, and point-of-index counts. Its `access: engine-live` field signals that structural data is queried live from the engine, not read from committed files.
4136

42-
A technology distribution report showing which languages, databases, frameworks, and infrastructure components are used across which services. It identifies organizational standards (technologies used by the majority of services) and variances (services that deviate, with documented justifications).
37+
## Flags
4338

44-
### Synthesized Root Context
39+
`/draft:init` supports two flags relevant to monorepo workflows:
4540

46-
If the root-leveldraft/product.md,draft/architecture.md, anddraft/tech-stack.mdare missing or are placeholders,/draft:indexsynthesizes them from service-level data:
41+
* `--module-only` — Analyzes only the current sub-module; skips root-level synthesis. Use when you want to refresh a single service without touching the root graph.
42+
* `--graph-only` — Builds or refreshes the graph without regenerating prose context files (architecture.md, .ai-context.md, etc.). Use for fast graph updates after code changes.
4743

48-
* product.md— Aggregated product vision from all service visions, deduplicated target users, capability matrix mapping features to services
49-
* architecture.md— System-of-systems view with topology diagram, service directory, shared infrastructure, and cross-cutting patterns
50-
* tech-stack.md— Organizational standards derived from majority usage, approved variances, shared libraries
51-
After generatingarchitecture.md, the Condensation Subroutine runs to produce a root-level.ai-context.md— a token-optimized aggregate of all service knowledge.
44+
## The Workflow
5245

53-
## Root-Level vs. Service-Level Context
46+
A typical monorepo onboarding sequence:
5447

55-
After indexing, the monorepo has two layers of context:
48+
1. Run `/draft:init` at the repo root — builds the whole-repo graph and generates root-level context files.
49+
2. Run `/draft:init` inside each sub-module that needs its own spec/plan context — each one generates module-local context and writes a `draft/graph/root-link.json` pointing to the root.
50+
3. Work inside any sub-module — Draft automatically loads module-local context for implementation tasks and follows the root link for cross-module analysis (impact, deep-review, bughunt across services).
5651

57-
When working within a single service, the AI loads that service's context. When making cross-service decisions — adding a new API dependency, changing a shared schema, planning a migration — the AI loads root-level context.
52+
Re-run `/draft:init` (or `/draft:init --graph-only`) after significant architecture changes to any service, before major cross-service planning, or as part of documentation hygiene. The graph engine handles incremental updates; unchanged modules are not re-analyzed.
5853

59-
## Service Manifests
54+
## Cross-Module Analysis
6055

61-
For each initialized service,/draft:indexcreates or updates amanifest.jsoninside the service'sdraft/directory. This manifest contains the service name, type, summary, primary technology, dependencies on other services, dependents (reverse lookup), team ownership, and indexing timestamps. Manifests enable fast re-indexing without re-reading all markdown files.
56+
Once root links are in place, any graph-aware Draft command can scope across modules:
6257

63-
## Initializing Missing Services
64-
65-
Running/draft:index --init-missingoffers to initialize uninitialized services. For each one, Draft prompts with four options:y(initialize this service),n(skip),all(initialize all remaining), orskip-rest(skip all remaining). This makes it practical to bring an entire monorepo under Draft management incrementally.
66-
67-
## Bughunt Mode
68-
69-
/draft:indexalso supports a bughunt aggregation mode. Running/draft:index bughuntexecutes/draft:bughuntsequentially across all initialized services (or a specified subset), then generatesdraft/bughunt-summary.md— an aggregate report showing bug counts by severity across all services, directories requiring immediate attention, and links to individual service reports.
70-
71-
Re-run/draft:indexafter initializing a new service, after significant architecture changes to any service, before major cross-service planning, or as part of weekly documentation hygiene. The command preserves manual edits in sections marked with<!-- MANUAL START -->and<!-- MANUAL END -->comments.
58+
* `/draft:impact` — follows the root link to find downstream dependencies across service boundaries.
59+
* `/draft:deep-review` — loads cross-module invariants from the root graph when reviewing a service that calls others.
60+
* `/draft:bughunt` — can be scoped to a single service or run against the root graph for a system-wide sweep.
7261

62+
The federation is transparent: commands do not need to know whether they are running in a mono-module repo or a large monorepo. The root-link mechanism handles the routing.

0 commit comments

Comments
 (0)