Map the codebase once. Every command after this starts with full context.
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
Graph engine: codebase-memory-mcp by DeusData — tree-sitter + LSP, 159 languages, 100% local
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.
Assumes what you meant instead of asking the questions a teammate would.
Reaches for whatever it saw most, not what fits your architecture and conventions.
Writes code that ignores the structures your codebase already relies on.
Skips verification and reports success with no test, no diff, no evidence.
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 →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.
Stop re-explaining your codebase to AI.
/draft:init generates an architecture reference once. Every subsequent agent interaction starts with full context. New tracks load only what's relevant.
Spec-driven planning + ACID-grade audits.
Every track ships with a reviewable spec, a phased plan, and three-stage code review. Module audits enforce atomicity, consistency, isolation, and durability.
Knowledge graph + 45 deterministic helpers.
Tree-sitter + LSP across 159 languages. Incremental, git-aware indexing. 100% local — no API key, no code leaves your machine. Track-level impact memory. Skills delegate mechanical work to JSON-emitting shell tools.
/draft:init — your codebase, fully mappedOne command performs a 5-phase deep analysis of your entire codebase. Every future interaction is grounded in this understanding.
Builds a tree-sitter knowledge graph mapping module boundaries, dependencies, call paths, and hotspots. This powers precise impact analysis and accelerates subsequent phases.
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.
Entry points, orchestrator initialization, registry/registration code, dependency injection, module system, import graph. Maps how components find and connect to each other.
End-to-end data flows, core module implementations, concurrency model, safety checks. Traces invariants, validation, auth gates. Identifies state machines and consistency boundaries.
External dependencies, test infrastructure, configuration mechanisms, existing documentation. Maps the full operational envelope of your system.
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.
SHA-256 hashes of every analyzed file. /draft:init refresh only re-analyzes files with changed hashes — no full re-scan.
11-category signal classification. Detects structural drift on refresh (e.g., auth files added for the first time).
Phases completed, unresolved questions, resumable checkpoints. Interrupted runs resume where they left off.
/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.
/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.
/draft:review
3-stage review with STRIDE threat modeling, SAST tool integration, breaking change detection, context-specific checks (crypto, DB, API, config, UI).
/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.
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.
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.
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.
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.
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.
Module lifecycle audit evaluating atomicity, isolation, durability, fail-closed behavior, and idempotency. Enterprise-grade production pattern enforcement.
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.
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
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.
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.
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.
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.
Map the codebase once. Every command after this starts with full context.
Turn an idea into a reviewable spec and a phased plan before any code.
Build the plan task by task, test-first, with verification gates between steps.
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.
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.
Tech lead runs /draft:init. Team reviews architecture, tech stack, and workflow via PR.
Lead runs /draft:plan. Team reviews requirements and task breakdown via PR.
Lead runs /draft:decompose. Team reviews module boundaries and API surfaces via PR.
/draft:jira create (or the unified /draft:jira router) pushes the work to Jira with full track context.
Every developer has spec.md, plan.md, and .ai-context.md. Quality tools verify completeness.
Works with your existing tools. Zero switching cost.
# 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.
# 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.
# Install Draft into Codex
npx @drafthq/draft install codex
Writes AGENTS.md to your repo root — Codex reads it automatically.
# Install Draft into opencode
npx @drafthq/draft install opencode
Writes AGENTS.md + bundles skills under ~/.agents/skills/draft.
# 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.
/draft:init performs a 5-phase codebase analysis — not a diagram of intent, a map of reality.
Directory structure, entry points, request/response flows with actual file:line references.
State machines per domain object. Storage topology across cache, DB, event log, archive.
End-to-end write/read paths with consistency boundaries and failure recovery matrix.
Critical invariants: data safety, security, concurrency, ordering, idempotency.
Step-by-step guides: "Add a new endpoint", "Add a new model" — file-by-file instructions.
SHA-256 freshness hashes, 11-category signal classification, resumable run memory. Incremental refresh only re-analyzes what changed.
Dense tables, YAML frontmatter, flat sections. Token-efficient — minimal prose, maximum signal. Consumed by all Draft commands and external AI tools.
Prose paragraphs, annotated Mermaid diagrams, onboarding framing. Source of truth — all mutations happen here. For engineers, leads, and PR reviewers.
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.
Draft speaks different languages to different roles — but the value compounds across your entire organization.
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.
EM / Director
Review specs before code exists. PR-reviewable planning artifacts. Team alignment through documents, not meetings. Quality gates at every phase boundary.
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.
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.
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 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 |
Free forever. Open source, MIT licensed.
Host tool costs apply (Claude Code, Copilot, etc.)
Free preview, then paid tiers
Free tier, then Pro/Business
Free tier, then paid
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.
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.).
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).
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.
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.
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.
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.
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.
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.
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.