Context-Driven Development REV 3.3.1 · MIT

Draft it before
your agent builds it.

Draft maps your repo into a local knowledge graph and turns your ideas into reviewable specs — so your AI agent ships from a plan, not a guess. Spec-first planning, a three-stage review, and a 14-dimension bug hunt, in one plugin. Free forever.

Works in Claude Code · Cursor · Codex · opencode · Copilot · Gemini

Commands 4/33
Languages 159
Graph modes 6
Platforms 6
License MIT

Graph engine: codebase-memory-mcp by DeusData — tree-sitter + LSP, 159 languages, 100% local

Explore

AI ships fast.
Without a plan, it ships chaos.

Hand an agent a vague prompt and it guesses. It invents requirements, picks approaches that don't match your stack, and calls it done without proof. Here's what that looks like — flagged like defects on a draft.

Guesses requirements

Assumes what you meant instead of asking the questions a teammate would.

Picks at random

Reaches for whatever it saw most, not what fits your architecture and conventions.

Breaks the patterns

Writes code that ignores the structures your codebase already relies on.

Claims it's done

Skips verification and reports success with no test, no diff, no evidence.

Without Draft

  • Context in ephemeral chat
  • No version history for decisions
  • Loads entire project every session
  • Unsearchable conversations
  • Invisible to teammates

With Draft

  • File-based persistent memory
  • Git-tracked specs with diffs and blame
  • Scoped context per track
  • Grep-able specs and plans
  • PR-reviewable planning artifacts

Your repo, queryable.

Draft installs a local knowledge-graph engine that maps every module, call, dependency, and hotspot in your codebase. No daemon. No external service. No code leaves your machine. Try the queries below — illustrative results from a typical codebase, in the engine's real output schema.

$ graph-impact --file core/methodology.md

                

Tree-sitter + LSP across 159 languages · 100% local, no API key · Incremental, git-aware indexing

How the engine works →

The only one with all three.

Most tools cover one corner of AI-assisted development. Draft brings methodology, codebase intelligence, and verification together in one plugin.

  Draft Cursor / Copilot / Aider Sourcegraph / GitNexus ChatPRD / specStory
Spec-driven planning Specs & phased plans before code Copilot Plan Mode · ad-hoc No PRD docs (ChatPRD)
Knowledge graph engine Built-in · 159 languages · 100% local Indexes only Yes (separate service) No
Three-stage code review Validation · spec compliance · quality PR bug review (BugBot) · not spec-aware No No
Bug discovery 14-dimension sweep + taint tracking Cross-repo PR scan (BugBot) No No
ACID-style audits Module lifecycle deep-review No No No
Multi-IDE Claude, Cursor, Codex, opencode, Copilot, Gemini Copilot multi-IDE · rest single Editor extensions Web-only mostly
Persistent context Git-tracked spec/plan/architecture Session-bound Index, not artifacts ChatPRD app · specStory repo files
Price Free, MIT, no telemetry Subscription Sourcegraph paid · GitNexus free OSS Subscription

Comparison reflects Draft 3.3 vs. publicly-documented features of named alternatives as of June 2026. Draft is the open-source plugin you install once and own forever.

Three jobs. One plugin.

/draft:init — your codebase, fully mapped

One command performs a 5-phase deep analysis of your entire codebase. Every future interaction is grounded in this understanding.

0

Graph Build

Builds a tree-sitter knowledge graph mapping module boundaries, dependencies, call paths, and hotspots. This powers precise impact analysis and accelerates subsequent phases.

1

Discovery

Directory structure, build files, API definitions, interface/type files. Signal classification categorizes every source file into 11 categories (routes, services, auth, models, state, jobs, persistence, tests, config...) to drive adaptive analysis depth.

2

Wiring

Entry points, orchestrator initialization, registry/registration code, dependency injection, module system, import graph. Maps how components find and connect to each other.

3

Depth

End-to-end data flows, core module implementations, concurrency model, safety checks. Traces invariants, validation, auth gates. Identifies state machines and consistency boundaries.

4

Periphery

External dependencies, test infrastructure, configuration mechanisms, existing documentation. Maps the full operational envelope of your system.

5

Synthesis

Graph-first synthesis with explicit fidelity declarations and provenance. Tier-gated output (DRAFT_INIT_MODE): small repos get the graph-primary architecture.md (focused high-signal sections + Graph Health Dashboard); larger repos get an OKF concept taxonomy under draft/wiki/ (one concept per file, cross-links form the graph) with architecture.md as a generated view. Either way, .ai-context.md (200-400 lines, token-optimized) is the AI index root.

State Persistence — Pay the cost once

freshness.json

SHA-256 hashes of every analyzed file. /draft:init refresh only re-analyzes files with changed hashes — no full re-scan.

signals.json

11-category signal classification. Detects structural drift on refresh (e.g., auth files added for the first time).

run-memory.json

Phases completed, unresolved questions, resumable checkpoints. Interrupted runs resume where they left off.

Then: Spec → Implement → Verify

02

Spec & Plan

/draft:new-track

Collaborative intake — AI asks one question at a time, contributes expertise, surfaces risks. Builds spec progressively with citations from DDD, Clean Architecture, OWASP.

03

Implement

/draft:implement

RED → GREEN → REFACTOR. Production robustness patterns enforced (atomicity, isolation, durability, idempotency, fail-closed, resilience). Property-based testing, observability prompts, contract testing at service boundaries.

04

Review

/draft:review

3-stage review with STRIDE threat modeling, SAST tool integration, breaking change detection, context-specific checks (crypto, DB, API, config, UI).

Bug Hunt anytime

/draft:bughunt

Not a step in the line — an on-demand audit /draft:review escalates to. 14-dimension sweep with taint tracking, supply-chain checks, and complexity analysis. Only HIGH/CONFIRMED confidence reported.

Each layer narrows the solution space. By the time AI writes code, most decisions are already made. product.md → tech-stack.md → .ai-context.md → spec.md → plan.md. 7 specialized agents (Planner, Architect, Reviewer, Debugger, RCA, Ops, Writer) enforce this at every step.

Enterprise-grade methodology,
zero cost

5-Phase Analysis

Architecture Discovery

Graph-primary deep analysis producing a focused, high-signal engineering reference (Graph Health Dashboard + 9 other critical sections with provenance and fidelity tags). Derives the 200-400 line .ai-context.md. Strong emphasis on honest coverage gaps and relationship to any pre-existing high-quality agent documentation.

Graph-primaryFidelity + provenanceIncremental refresh

TDD Enforcement

RED → GREEN → REFACTOR cycle. Production robustness patterns enforced: atomicity, isolation, durability, idempotency, fail-closed, resilience. Property-based testing, observability prompts, contract testing at service boundaries.

95%+ target7 robustness patterns

3-Stage Code Review

Automated validation + spec compliance + code quality. STRIDE threat modeling for new endpoints. Context-specific checks (crypto, DB, API, config, UI). SAST tool integration. Adversarial pass on zero findings.

3 stagesSTRIDESAST

Collaborative Intake

AI as expert partner — asks one question at a time, contributes patterns, risks, trade-offs. Builds spec progressively with citations from DDD, Clean Architecture, OWASP.

AI as partner
Exhaustive Sweep

14-Dimension Bug Hunt

Systematic defect discovery across 14 dimensions: correctness, reliability, security, performance, UI responsiveness, concurrency, state management, API contracts, accessibility, configuration, tests, dependency/supply chain security, algorithmic complexity, and i18n/l10n. Severity-ranked with file:line locations. Only HIGH/CONFIRMED confidence — false-positive elimination and taint tracking built in.

14 dimensionsTaint trackingConfidence filteringRegression tests

ACID Deep Review

Module lifecycle audit evaluating atomicity, isolation, durability, fail-closed behavior, and idempotency. Enterprise-grade production pattern enforcement.

ACID compliant

Pattern Learning

Scans your codebase for recurring patterns (3+ occurrences). Discovers conventions to skip and anti-patterns to always flag. Every quality command updates guardrails.md after each run — your codebase teaches Draft what to enforce, and false positives disappear over time.

Auto-learningTemporal analysisguardrails.md
Built-in

Knowledge Graph Engine

Tree-sitter + LSP-grade resolution across 159 languages, 100% local. Query tools — callers, callees, impact, cycles, hotspots, mermaid. Incremental, git-aware indexing. Impact queries break results down by code/test/doc/config. Powers /draft:impact, enriches /draft:bughunt and /draft:review.

Built on codebase-memory-mcp — 159 languages, 100% local, no API key

159 languagesQuery toolsIncremental100% local
Track memory

Track Impact Memory

Each completed track records its blast radius in metadata.json — files touched, modules affected, downstream count, by-category breakdown. /draft:plan reads recent tracks' impact during context load and surfaces overlap warnings before you even write a spec.

Auto-recordedOverlap detection
45 helpers

Deterministic Helpers

Skills delegate mechanical work to 45 shell tools under scripts/tools/ — git metadata, file classification, hotspot ranking, cycle detection, freshness checks, ADR indexing, test-framework detection, and more. Uniform JSON output and exit-code contract; graceful degradation when input is missing.

JSON contractReproducible
Enterprise

Enterprise Ready

Monorepo federation with service discovery and dependency graphs. Unified Jira router — preview, create (Track → Epic, Phase → Story, Task → Sub-task), and review <JIRA-ID> that qualifies a ticket with deep-review + bug hunt + coverage + test-gap analysis. Architecture Decision Records with full lifecycle. Git-aware task/phase/track-level revert. Mid-track change management with impact analysis.

MonorepoJira preview / create / reviewADRsRevertChange mgmt

Four you run. Twenty-nine that route themselves.

The whole workflow comes down to four commands. Everything else — bug hunts, coverage, debugging, ADRs, deploy checklists, Jira — is a specialist the routers reach for on their own. Each one is still there to call by name the moment you want it.

draft-terminal
$ |
01 /draft:init

Map the codebase once. Every command after this starts with full context.

02 /draft:new-track

Turn an idea into a reviewable spec and a phased plan before any code.

03 /draft:implement

Build the plan task by task, test-first, with verification gates between steps.

04 /draft:review

Three stages on your branch — and escalates to bug hunt, deep-review, or quick-review when the change warrants it.

You don't pick the specialist. Draft routes intent to it — and you can still call it by name.

draft "fix the flaky login test"
intent router reads what you mean
/draft:debug /draft:testing-strategy /draft:bughunt /draft:coverage
29 specialists routed for you — or call any of them by name

Review specs, not surprises

Every markdown file goes through commit → review → merge before a single line of code is written. By the time implementation starts, the entire team has already agreed on what to build.

1

Initialize

Tech lead runs /draft:init. Team reviews architecture, tech stack, and workflow via PR.

2

Spec & Plan

Lead runs /draft:plan. Team reviews requirements and task breakdown via PR.

3

Decompose

Lead runs /draft:decompose. Team reviews module boundaries and API surfaces via PR.

4

Distribute

/draft:jira create (or the unified /draft:jira router) pushes the work to Jira with full track context.

5

Implement

Every developer has spec.md, plan.md, and .ai-context.md. Quality tools verify completeness.

Changing a sentence in spec.md takes seconds. Changing an architectural decision after 2,000 lines of code takes days.

Install in 30 seconds

Works with your existing tools. Zero switching cost.

Claude Code CLI
# Install Draft with one command
npx @drafthq/draft install claude-code

# Then start using
/draft:init

Runs claude plugin marketplace add + install for you, then restart Claude Code and run /draft:init. Requires the claude CLI on your PATH. Using the Claude Code app without the CLI? Run /plugin marketplace add drafthq/draft then /plugin install draft inside a session instead.

Cursor
# Install Draft into Cursor
npx @drafthq/draft install cursor

Installs to ~/.cursor/plugins/local/draft, writes .cursor-plugin/plugin.json, and registers + enables draft@draft-plugins in Cursor's plugin registry. Restart Cursor (or Developer: Reload Window) to load /draft:* commands.

OpenAI Codex
# Install Draft into Codex
npx @drafthq/draft install codex

Writes AGENTS.md to your repo root — Codex reads it automatically.

opencode
# Install Draft into opencode
npx @drafthq/draft install opencode

Writes AGENTS.md + bundles skills under ~/.agents/skills/draft.

GitHub Copilot / Gemini
# GitHub Copilot — copy the instructions file
curl -o .github/copilot-instructions.md \
  https://raw.githubusercontent.com/drafthq/draft/main/integrations/copilot/.github/copilot-instructions.md

# Gemini
curl -o .gemini.md \
  https://raw.githubusercontent.com/drafthq/draft/main/integrations/gemini/.gemini.md

Copilot & Gemini read a committed instructions file — copy it directly (not a draft install host).

Prefer a persistent command? Install once with npm install -g @drafthq/draft, then run draft install <host>. Use draft list to see every host.

No vendor lock-in. Your specs, plans, and architecture docs are plain markdown files in your repo. Switch tools any time — your project knowledge stays with you.

Your codebase, fully understood

/draft:init performs a 5-phase codebase analysis — not a diagram of intent, a map of reality.

1

System Map

Directory structure, entry points, request/response flows with actual file:line references.

2

Data Lifecycle

State machines per domain object. Storage topology across cache, DB, event log, archive.

3

Critical Paths

End-to-end write/read paths with consistency boundaries and failure recovery matrix.

4

System Constraints

Critical invariants: data safety, security, concurrency, ordering, idempotency.

5

Extension Cookbooks

Step-by-step guides: "Add a new endpoint", "Add a new model" — file-by-file instructions.

S

State Persistence

SHA-256 freshness hashes, 11-category signal classification, resumable run memory. Incremental refresh only re-analyzes what changed.

.ai-context.md

Machine-optimized · 200-400 lines

Dense tables, YAML frontmatter, flat sections. Token-efficient — minimal prose, maximum signal. Consumed by all Draft commands and external AI tools.

architecture.md

Graph-primary · High-signal with explicit fidelity

Prose paragraphs, annotated Mermaid diagrams, onboarding framing. Source of truth — all mutations happen here. For engineers, leads, and PR reviewers.

guardrails.md

Auto-learning · Hard rules + discovered patterns

Human-defined constraints plus auto-discovered conventions and anti-patterns. Quality commands read this file, skip known patterns, and flag violations — then update it after every run. Your codebase teaches Draft what to enforce.

Pay the analysis cost once, benefit on every interaction. Reduces token cost, eliminates hallucinations, improves accuracy. The AI writes code that fits your system because it knows your system — and guardrails ensure it respects your rules.

Who it's for

Draft speaks different languages to different roles — but the value compounds across your entire organization.

Engineers

IC / Senior / Staff

TDD enforcement, 14-dimension bug hunting, architecture discovery with Mermaid diagrams, pattern learning. Write code that fits your system because Draft knows your system.

/draft:implement + /draft:bughunt

Engineering Managers

EM / Director

Review specs before code exists. PR-reviewable planning artifacts. Team alignment through documents, not meetings. Quality gates at every phase boundary.

Specs are 10x cheaper to change than code

Product Managers

PM / TPM

Readable specs anyone can review. Jira integration with auto story points. Status tracking across tracks. Know what's being built before it's built.

/draft:jira (preview/create) + /draft:status

CXOs & VPs

CTO / VP Eng / CISO

FAANG-level engineering practices at zero cost. ACID compliance audits, Architecture Decision Records, monorepo federation. Maturity Level 4/5. MIT licensed, no vendor lock-in.

Enterprise-grade methodology, free forever

Open Source & Enthusiasts

Hobbyist / Indie / Student

Architecture discovery turns any project into a documented system. Bug hunting catches what you'd never find manually. Free, open source, MIT license.

/draft:init + /draft:bughunt = instant quality

FAANG-level practices, free

Draft codifies the engineering culture of Google, Amazon, and Stripe into an AI-assisted workflow.

Rank Practice Draft Implementation Industry Equivalent Companies
1 Design-First Engineering spec.md & plan.md per track Amazon PR/FAQ, Google Design Docs Google, Amazon, Stripe, Uber
1 Monorepo / Shared Context /draft:init (scope-aware, run per module root) Unified codebase, dependency graphing Google, Meta, Twitter
2 Test-Driven Development /draft:implement RED-GREEN-REFACTOR TDD / CI Gates Netflix, Pivotal
3 Structured Code Review /draft:review 3-stage Google Critique system Google, Meta
3 Architecture Decision Records /draft:adr + architecture.md Immutable ADRs Spotify, AWS, GitHub
4 Bug Bashes /draft:bughunt 14 dimensions Scheduled team testing sessions Microsoft, Game Studios
5 Service Catalog product.md + tech-stack.md Internal Developer Platform Spotify, Lyft

Draft

$0

Free forever. Open source, MIT licensed.

Host tool costs apply (Claude Code, Copilot, etc.)

Kiro (AWS)

$19-39/mo

Free preview, then paid tiers

Cursor

$20-40/mo

Free tier, then Pro/Business

Windsurf

$15+/mo

Free tier, then paid

Maturity Level 4/5 (High). Adopting Draft puts your workflow on par with Staff Engineer practices at FAANG companies: proposing implementations of specs, performing systematic bughunts, and maintaining architectural documents.

Frequently asked questions

What is Draft?

Draft is a free, open-source plugin that adds Context-Driven Development to AI coding agents. It provides 33 commands covering spec-driven planning, TDD enforcement, 3-stage code review, 14-dimension bug hunting, and architecture discovery for Claude Code, Cursor, Codex, opencode, GitHub Copilot, and Gemini.

Is Draft free?

Yes, Draft is completely free and open source under the MIT license. There are no paid tiers, no usage limits, and no vendor lock-in. The only costs are from the host AI tools you use (Claude Code, Copilot, etc.).

What AI coding agents does Draft support?

Draft supports Claude Code, Cursor, Codex, opencode, GitHub Copilot, and Gemini. It integrates natively with each platform using their respective configuration formats — slash commands for Claude Code and Cursor, an AGENTS.md file for Codex and opencode, copilot-instructions.md for Copilot, and .gemini.md for Gemini (including the Antigravity IDE).

How do I install Draft?

Run npx @drafthq/draft install claude-code to install for Claude Code. Alternatively: /plugin marketplace add drafthq/draft then /plugin install draft. For Cursor, run npx @drafthq/draft install cursor. For Copilot, download copilot-instructions.md into your .github directory. Each platform takes under 30 seconds to set up.

What is Context-Driven Development?

Context-Driven Development is a methodology where AI coding agents operate from persistent, file-based project context rather than ephemeral chat. Draft analyzes your codebase to generate architecture docs, then enforces a spec-first workflow: specifications and plans are written and reviewed before any code is generated.

Does Draft work with my existing project?

Yes. Running /draft:init performs a 5-phase analysis of your existing codebase, generating architecture documentation, AI context files, and signal classifications. It works with any language, framework, or project structure — brownfield or greenfield.

How is Draft different from other AI coding tools?

Draft is not an AI coding tool — it is a methodology layer that runs on top of existing AI agents. While tools like Cursor or Copilot generate code, Draft ensures that code follows approved specifications, passes TDD gates, and fits your architecture. It adds structure and quality gates, not another AI model.

Does Draft require any configuration?

Minimal. After installation, run /draft:init and it automatically analyzes your codebase and generates all necessary configuration files (product.md, tech-stack.md, architecture.md, etc.). You can customize these files afterward, but the defaults work out of the box.

Can Draft work with monorepos?

Yes. Run /draft:init at each module root — it is scope-aware and links each module graph to the root graph for full cross-module understanding.

Does Draft support Jira integration?

Yes. Use /draft:jira preview to generate the export and /draft:jira create (or the unified router) to push issues. The modern entry point is /draft:jira.