mayurpise/draft/init
Claude Code and agent skill by mayurpise/draft
- community
Checking that the SKILL.md file is still in the repository.
Initialize Draft project context for Context-Driven Development — the single, scope-aware entry point (works at the repo root or inside any sub-module; no separate index command). Builds the root-first code-graph knowledge memory (draft/graph/, with a module→root link) and creates product.md, tech-stack.md, workflow.md, tracks.md, architecture.md (brownfield), .ai-context.md (derived), and .ai-profile.md. Supports --graph-only (graph memory only, no markdown) and --module-only. Use when the user asks to 'init draft', 'set up Draft for this project', 'bootstrap context', 'build the code graph', or says 'start using Draft', 'I want to use Draft here'.
Install
npx vskill@latest install mayurpise/draft/initSKILL.md
The same SKILL.md was published earlier as mayurpise/draft/init.
Draft Init
Initialize a Draft project for Context-Driven Development.
Red Flags - STOP if you're
- Re-initializing a project that already has
draft/without usingrefreshmode - Skipping brownfield analysis for an existing codebase
- Rushing through product definition questions without probing for detail
- Auto-generating tech-stack.md without verifying detected dependencies
- Not presenting .ai-context.md for developer review before proceeding
- Overwriting existing tracks.md (this destroys track history)
- Producing copy-paste module descriptions — if 3+ modules share identical Responsibilities or description text, you have NOT analyzed the source files
- Writing sequence diagrams under 15 lines of Mermaid code — shallow diagrams without alt/opt blocks, payloads, and error paths are useless
- Writing module deep-dives that ignore the graph or lack a workflow/state diagram — the graph is ground truth; every significant module must have at least one synthesized diagram showing its primary flow or lifecycle. Prose volume without diagram fidelity is a failure.
- Using "See X/" or "follow BUILD patterns" as a substitute for reading actual source files and documenting real content
- Ignoring detected high-quality existing agent context (e.g. CLAUDE.md + docs/INVARIANTS.md written explicitly for AI agents) and regenerating large volumes of duplicative prose instead of a graph-primary overlay with strong cross-references and explicit Relationship section — this creates documentation debt and divergence risk in mature brownfield systems
- Retaining any legacy 28-section or volume-oriented language in generated architecture.md or in the reasoning process — the modern 10-section graph-primary template is the only accepted format.
Initialize once, refresh to update. Never overwrite without confirmation.
MANDATORY SECTION CHECKLIST — architecture.md (Graph-Primary)
READ THIS BEFORE WRITING A SINGLE LINE OF architecture.md.The document MUST use the EXACT modern graph-primary structure below. Freeform sections, renamed headings, or missing mandatory sections are FAILURES. This is the single forward-looking format — no legacy 28-section or volume-oriented material is accepted.
Self-check before finalizing: Confirm every one of the 10 sections above exists with the required fidelity declarations, provenance tags on claims, and (where applicable) Mermaid diagrams grounded in the graph. The Graph Health Dashboard + §9 Gaps + §10 Relationship are the highest-leverage sections for future agents.
If you are a subagent: your prompt is a summary. The 10-section graph-primary structure above is authoritative. Use the exact headings. No legacy 28-section material is permitted.
Graph Fidelity & Diagram-First Priority (MANDATORY)
The knowledge graph — served live by the local codebase-memory-mcp engine (packages, languages, routes, fan-in/out, hotspots) and queried via the graph-*.sh wrappers — is the deterministic structural ground truth for the system's actual architecture. Draft is engine-only: draft/graph/ holds only the schema.yaml gate marker; all graph data comes from live queries.
You are running inside a powerful agentic coding environment (Cursor, Claude Code, Copilot, Windsurf, etc.) that maintains its own rich, continuously updated index of the entire codebase. Use that indexed knowledge aggressively in addition to the explicit graph data and direct source reads. Your environment's index often captures higher-level intent, naming patterns, cross-file workflows, and architectural signals that the static graph may not fully express yet. Combine both sources:
- Graph = authoritative modules, edges, public surfaces, hotspots, call relationships.
- Your IDE/Agent index + full project understanding = semantic layer, workflow discovery, intent, and validation of the graph.
Cross-validate: if your index suggests a workflow, lifecycle, or design pattern that the graph does not yet surface, read the relevant source to confirm and then synthesize an accurate diagram that reflects reality.
LLM role is faithful, high-fidelity synthesis — not invention.
- Every structural claim must be consistent with the graph records. Contradiction = failure.
- Diagrams are first-class deliverables. For each major module or pipeline, produce at least one accurate Mermaid workflow, state, or sequence diagram.
- Accuracy and correctness > document length. Short, precise synthesis + good diagrams is superior to long prose or file lists.
- Workflow and state focus. Prioritize understanding primary control flows and state transitions so you can draw accurate diagrams.
This rule takes precedence over older volume-oriented language in this file.
Standard File Metadata
ALL files in `draft/` MUST include this metadata header. This enables refresh tracking, sync verification, and traceability.
Gathering Git Information
Before generating any file, run these commands to gather metadata:
Non-git projects: If the project is not a git repository, all git metadata fields will be set to"none"andgit.dirtytofalse. Refresh mode's incremental sync (synced_to_commit) will not function — full re-analysis is required on each refresh.
Metadata Template
Insert this YAML frontmatter block at the top of every draft/ file:
Note:generated_byusesdraft:commandformat (not/draft:command) for cross-platform compatibility.
Field Definitions
| Field | Description | Example | |
|---|---|---|---|
project | Project name from package.json/go.mod/Cargo.toml or directory name | my-api-service | |
module | Module name if in monorepo, otherwise root | auth-service | |
generated_by | The Draft command that created/updated this file | draft:init | |
generated_at | ISO 8601 timestamp when file was generated | 2024-01-15T14:30:00Z | |
git.branch | Current local branch name | main | |
git.remote | Upstream tracking branch | origin/main | |
git.commit | Full SHA of HEAD when generated | a1b2c3d4e5f6... | |
git.commit_short | Short SHA (7 chars) | a1b2c3d | |
git.commit_date | Commit timestamp | 2024-01-15 10:00:00 -0500 | |
git.commit_message | First line of commit message | feat: add user auth | |
git.dirty | Were there uncommitted changes? | true or false | |
synced_to_commit | The commit SHA this doc is synchronized to | a1b2c3d4e5f6... |
Usage in Refresh
The synced_to_commit field is critical for incremental refresh:
/draft:init refreshreads this field to find changed files since last sync- If
git.dirty: true, warn user that docs may not reflect committed state - After refresh, update
synced_to_committo current HEAD
Example Header
Pre-Check
Check for arguments:
refresh: Update existing context without full re-init--graph-only: Build/refresh only the code-graph knowledge memory (no markdown) — see the fast path below--module-only: When run in a sub-module, do not touch the root graph (the module→root link is markedpending)discover: Route to/draft:discover
/draft:initis the single entry point for building context — there is no separateindexcommand. Init is scope-aware (root vs sub-module); see Scope Detection below.
Output Mode (DRAFT_INIT_MODE)
Init has two output modes. The default is tier-gated (`auto`) — resolved from the codebase tier computed in Step 1.4.5 — and the DRAFT_INIT_MODE environment variable overrides it:
- `monolith` — the standard path documented in this skill: a single
architecture.md(10-section graph-primary) + derived.ai-context.md/.ai-profile.md. The default for small repos (tier 1–2), where one linear document beats a taxonomy with little to navigate. Also the A/B baseline and the over-fetch fallback. - `okf` — emit an OKF-conformant concept taxonomy bundle (
draft/wiki/) with.ai-context.mdas the index root andarchitecture.mddemoted to a generated rendered view. The default for tier 3+ repos, where navigation + maintainability pay off. When active, followreferences/okf-emitter.mdfor the decomposition + serialization + validation stage; all shared phases (5-phase analysis, graph snapshot,.state/hashing, scope detection, atomic staging) are reused unchanged.
The tier-gated default rests on maintainability/readability (one navigable concept per file, cleaner PRs, a generated architecture.md preserved for linear onboarding) — not on the A/B benchmark, which was accuracy-parity (docs/audit/okf-benchmark.md). monolith is retained, not retired: it is the tier-1/2 default, the A/B baseline, and the fallback. If DRAFT_INIT_MODE is unset, do not commit to a mode until Step 1.4.5 has computed the tier.
OKF Completeness Verification (blocking — tier 3+ `okf` mode). Completeness is enforced by tooling, not honor system, so the wiki is generated completely for every module/sub-module/component on every run. Before promoting draft.tmp/ → draft/, ALL must hold (see references/okf-emitter.md for the pipeline):
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/init/SKILL.md
Popularity
- Repository stars
- 39
- Repository forks
- 5
- 7-day trend score
- 18
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/mayurpise/draft/init)