mayurpise/draft/init

Claude Code and agent skill by mayurpise/draft

Trust tier 2
  • community
LLM review pending
Source check pending

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/init

SKILL.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 using refresh mode
  • 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.
text
## 1. Executive Summary + Graph Health Dashboard
## 2. Critical Invariants & Safety Rules (with provenance)
## 3. Primary Control & Data Flows (Graph + Synthesis)
## 4. Module & Dependency Map (Primarily Graph-Derived)
## 5. Concurrency, Ownership & Isolation Model
## 6. Error Handling & Failure Mode Catalog
## 7. State & Data Truth Sources + Reconciliation
## 8. Extension Points & Safe Mutation Patterns
## 9. Graph Coverage Gaps & Known Limitations (MANDATORY)
## 10. Relationship to Other Authoritative Documentation (MANDATORY on high/medium Context Audit)

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:

bash
# Project name (from manifest or directory)
basename "$(pwd)"
# Check if inside a git repository
if git rev-parse --is-inside-work-tree 2>/dev/null; then
# Git branch
git branch --show-current
# Git remote tracking branch
git rev-parse --abbrev-ref --symbolic-full-name @{upstream} 2>/dev/null || echo "none"
# Git commit SHA (full) — fails on repos with zero commits
git rev-parse HEAD 2>/dev/null || echo "none"
# Git commit SHA (short)
git rev-parse --short HEAD 2>/dev/null || echo "none"
# Git commit date
git log -1 --format="%ci" 2>/dev/null || echo "none"
# Git commit message (first line)
git log -1 --format="%s" 2>/dev/null || echo "none"
# Check for uncommitted changes
git status --porcelain | head -1
else
# Non-git project: use fallback values
echo "none" # branch
echo "none" # remote
echo "none" # commit
echo "none" # commit_short
echo "none" # commit_date
echo "none" # commit_message
# dirty: N/A for non-git projects
fi
Non-git projects: If the project is not a git repository, all git metadata fields will be set to "none" and git.dirty to false. 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:

yaml
---
project: "{PROJECT_NAME}"
module: "{MODULE_NAME or 'root'}"
generated_by: "draft:{COMMAND_NAME}"
generated_at: "{ISO_TIMESTAMP}"
git:
branch: "{LOCAL_BRANCH}"
remote: "{REMOTE/BRANCH or 'none'}"
commit: "{FULL_SHA}"
commit_short: "{SHORT_SHA}"
commit_date: "{COMMIT_DATE}"
commit_message: "{FIRST_LINE_OF_COMMIT_MESSAGE}"
dirty: {true|false}
synced_to_commit: "{FULL_SHA}"
---
Note: generated_by uses draft:command format (not /draft:command) for cross-platform compatibility.
Field Definitions
FieldDescriptionExample
projectProject name from package.json/go.mod/Cargo.toml or directory namemy-api-service
moduleModule name if in monorepo, otherwise rootauth-service
generated_byThe Draft command that created/updated this filedraft:init
generated_atISO 8601 timestamp when file was generated2024-01-15T14:30:00Z
git.branchCurrent local branch namemain
git.remoteUpstream tracking branchorigin/main
git.commitFull SHA of HEAD when generateda1b2c3d4e5f6...
git.commit_shortShort SHA (7 chars)a1b2c3d
git.commit_dateCommit timestamp2024-01-15 10:00:00 -0500
git.commit_messageFirst line of commit messagefeat: add user auth
git.dirtyWere there uncommitted changes?true or false
synced_to_commitThe commit SHA this doc is synchronized toa1b2c3d4e5f6...
Usage in Refresh

The synced_to_commit field is critical for incremental refresh:

  • /draft:init refresh reads 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_commit to current HEAD
Example Header
yaml
---
project: "payment-gateway"
module: "root"
generated_by: "draft:init"
generated_at: "2024-01-15T14:30:00Z"
git:
branch: "main"
remote: "origin/main"
commit: "a1b2c3d4e5f6789012345678901234567890abcd"
commit_short: "a1b2c3d"
commit_date: "2024-01-15 10:00:00 -0500"
commit_message: "feat: add stripe integration"
dirty: false
synced_to_commit: "a1b2c3d4e5f6789012345678901234567890abcd"
---

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 marked pending)
  • discover: Route to /draft:discover
/draft:init is the single entry point for building context — there is no separate index command. 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:

bash
DRAFT_INIT_MODE="${DRAFT_INIT_MODE:-auto}"
# auto → resolved AFTER tier is known (Step 1.4.5):
# tier 1–2 (micro/small) → monolith
# tier 3–5 (medium/large/XL) → okf
# monolith / okf → explicit override; honored as-is.
  • `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.md as the index root and architecture.md demoted to a generated rendered view. The default for tier 3+ repos, where navigation + maintainability pay off. When active, follow references/okf-emitter.md for 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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/mayurpise/draft/init/badge)](https://verified-skill.com/skills/mayurpise/draft/init)

Something wrong with this skill or its page? Tell us.