draht-claude 2026.4.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/.claude-plugin/plugin.json +21 -0
  2. package/CHANGELOG.md +8 -0
  3. package/LICENSE +22 -0
  4. package/README.md +199 -0
  5. package/agents/architect.md +45 -0
  6. package/agents/debugger.md +57 -0
  7. package/agents/git-committer.md +52 -0
  8. package/agents/implementer.md +35 -0
  9. package/agents/reviewer.md +57 -0
  10. package/agents/security-auditor.md +109 -0
  11. package/agents/verifier.md +44 -0
  12. package/bin/draht-tools.cjs +1067 -0
  13. package/cli.mjs +348 -0
  14. package/commands/atomic-commit.md +61 -0
  15. package/commands/discuss-phase.md +54 -0
  16. package/commands/execute-phase.md +111 -0
  17. package/commands/fix.md +50 -0
  18. package/commands/init-project.md +65 -0
  19. package/commands/map-codebase.md +52 -0
  20. package/commands/new-project.md +73 -0
  21. package/commands/next-milestone.md +49 -0
  22. package/commands/orchestrate.md +58 -0
  23. package/commands/pause-work.md +38 -0
  24. package/commands/plan-phase.md +107 -0
  25. package/commands/progress.md +30 -0
  26. package/commands/quick.md +50 -0
  27. package/commands/resume-work.md +35 -0
  28. package/commands/review.md +55 -0
  29. package/commands/verify-work.md +72 -0
  30. package/hooks/hooks.json +26 -0
  31. package/package.json +50 -0
  32. package/scripts/gsd-post-phase.cjs +133 -0
  33. package/scripts/gsd-post-task.cjs +165 -0
  34. package/scripts/gsd-pre-execute.cjs +146 -0
  35. package/scripts/gsd-quality-gate.cjs +252 -0
  36. package/scripts/prompt-context.cjs +36 -0
  37. package/scripts/session-start.cjs +52 -0
  38. package/skills/ddd-workflow/SKILL.md +108 -0
  39. package/skills/gsd-workflow/SKILL.md +111 -0
  40. package/skills/tdd-workflow/SKILL.md +115 -0
@@ -0,0 +1,65 @@
1
+ ---
2
+ description: Initialize GSD planning for an existing project (codebase mapping → questioning → domain model → roadmap)
3
+ argument-hint: "[focus area]"
4
+ allowed-tools: Bash, Read, Write, Edit, Task
5
+ ---
6
+
7
+ # /init-project
8
+
9
+ Initialize planning framework for an existing project: codebase mapping → questioning → domain model → requirements → roadmap.
10
+
11
+ Focus: $ARGUMENTS
12
+
13
+ Use this when you have an existing codebase and want to add structured planning. For greenfield projects, use `/new-project` instead.
14
+
15
+ > **Tool note**: Invoke `draht-tools <subcommand>` as `node "${CLAUDE_PLUGIN_ROOT}/bin/draht-tools.cjs" <subcommand>` via the Bash tool.
16
+
17
+ ## Atomic Reasoning
18
+
19
+ Before initializing, decompose project understanding into atomic reasoning units:
20
+
21
+ **For each aspect of the existing project:**
22
+ 1. **State the logical component** — What does this project do? Who are the users? What problems does it solve?
23
+ 2. **Validate independence** — What bounded contexts exist in the code? What domain concepts are already present? Can they be separated cleanly?
24
+ 3. **Verify correctness** — What works well that we must preserve? What pain points exist? What constraints limit changes?
25
+
26
+ **Synthesize initialization strategy:**
27
+ - Map existing architecture and conventions
28
+ - Extract domain model from code (bounded contexts, aggregates, ubiquitous language)
29
+ - Identify test strategy and coverage
30
+ - Define requirements that align with existing structure
31
+ - Create roadmap that respects what already works
32
+
33
+ ## Steps
34
+ 1. Run `draht-tools init` to check preconditions (git repo, etc.)
35
+ 2. Run `draht-tools map-codebase` to build a structural map of the existing code
36
+ 3. Analyze the codebase map to understand architecture, tech stack, and conventions
37
+ 4. Deep questioning phase (3-7 rounds, 1-2 questions at a time):
38
+ - What is this project? Who uses it?
39
+ - What are the current pain points or goals?
40
+ - What is MVP vs aspirational scope?
41
+ - What constraints exist (infra, team size, deadlines)?
42
+ 5. Run `draht-tools create-project` with gathered info
43
+ 6. Run `draht-tools create-domain-model` to define bounded contexts, entities, and ubiquitous language
44
+ 7. Create `.planning/DOMAIN.md` with the same sections as `/new-project`:
45
+ Bounded Contexts, Ubiquitous Language, Context Map, Aggregates, Domain Events
46
+ 8. Create `.planning/TEST-STRATEGY.md` with: Test Framework, Directory Conventions, Coverage Goals, Testing Levels, Excluded
47
+ 9. Optional research phase via `draht-tools research`
48
+ 10. Run `draht-tools create-requirements` with v1/v2/out-of-scope (map requirements to bounded contexts)
49
+ 11. Run `draht-tools create-roadmap` with phases
50
+ 12. Run `draht-tools init-state`
51
+ 13. Git commit via `draht-tools commit-docs "initialize project planning"`
52
+
53
+ ## Workflow
54
+ After project initialization, phases are executed one at a time in fresh sessions:
55
+
56
+ ```
57
+ /init-project → /discuss-phase 1 → /plan-phase 1 → /execute-phase 1 → /verify-work 1
58
+ → ... (repeat for all phases in the milestone)
59
+ → /next-milestone (only after ALL phases are complete)
60
+ ```
61
+
62
+ ## Rules
63
+ - Ask 1-2 questions at a time, never dump 10 at once
64
+ - Respect what already exists — do not propose rewriting working code
65
+ - Stop when you have: current state, goals, MVP scope, constraints, success criteria
@@ -0,0 +1,52 @@
1
+ ---
2
+ description: Analyze existing codebase before planning — extract architecture, domain model, and test strategy
3
+ argument-hint: "[directory]"
4
+ allowed-tools: Bash, Read, Write, Edit, Task, Grep, Glob
5
+ ---
6
+
7
+ # /map-codebase
8
+
9
+ Analyze existing codebase before planning, using subagents for parallel analysis.
10
+
11
+ Directory: $1
12
+
13
+ > **Tool note**: Invoke `draht-tools <subcommand>` as `node "${CLAUDE_PLUGIN_ROOT}/bin/draht-tools.cjs" <subcommand>`. For subagents, use the **Task tool** with `subagent_type` matching the agent name (e.g. `architect`, `verifier`).
14
+
15
+ ## Atomic Reasoning
16
+
17
+ Before analyzing, decompose codebase understanding into atomic reasoning units:
18
+
19
+ **For each architectural layer:**
20
+ 1. **State the logical component** — What is this directory/module's responsibility? What concepts does it encapsulate?
21
+ 2. **Validate independence** — Is this a bounded context? What are its dependencies? Does it leak abstractions across boundaries?
22
+ 3. **Verify correctness** — What domain terms appear in code? What aggregates exist? What test infrastructure is present?
23
+
24
+ **Synthesize analysis strategy:**
25
+ - Map directory structure to bounded contexts
26
+ - Extract domain language from identifiers (classes, functions, types)
27
+ - Identify context relationships (upstream/downstream, shared kernel)
28
+ - Document test strategy and coverage
29
+ - Note architectural concerns and patterns
30
+
31
+ ## Steps
32
+ 1. Run `draht-tools map-codebase $1`
33
+ 2. Tool generates: STACK.md, ARCHITECTURE.md, CONVENTIONS.md, CONCERNS.md
34
+
35
+ 3. **Run parallel deep analysis via the Task tool**:
36
+ Dispatch these two subagents in parallel (single assistant turn, two Task tool calls):
37
+
38
+ - **Task tool** with `subagent_type: "architect"` and prompt:
39
+ "Analyze the codebase at $1. Identify bounded contexts from directory structure — look for top-level src/ subdirectories, packages, or modules that encapsulate coherent domain concepts. Note any cross-directory coupling suggesting blurred context boundaries. Extract domain language: collect PascalCase class/interface/type names, key function names, database table/collection names. Look for repeated nouns representing core domain concepts. Output a structured list of: bounded contexts (name + description), domain terms (glossary), aggregates per context, and context relationships (upstream/downstream, shared kernel, ACL)."
40
+
41
+ - **Task tool** with `subagent_type: "verifier"` and prompt:
42
+ "Analyze the test infrastructure at $1. Discover: test framework(s) in use (check package.json, config files), test directory conventions (co-located, __tests__/, test/), existing coverage configuration and goals, which layers have tests (unit, integration, e2e), gaps and recommendations. Output a structured test strategy report."
43
+
44
+ 4. Collect subagent results and merge with the draht-tools output
45
+ 5. Create `.planning/DOMAIN.md` (if it doesn't exist) with:
46
+ - `## Bounded Contexts` — one entry per discovered context with a brief description
47
+ - `## Ubiquitous Language` — glossary of extracted domain terms
48
+ - `## Context Map` — how bounded contexts relate (upstream/downstream, shared kernel, ACL)
49
+ - `## Aggregates` — aggregates and their root entities per context
50
+ - `## Domain Events` — any existing event names or patterns discovered
51
+ 6. Create `.planning/TEST-STRATEGY.md` with: Test Framework, Directory Conventions, Coverage Goals, Testing Levels, Excluded
52
+ 7. Commit: `draht-tools commit-docs "map existing codebase"`
@@ -0,0 +1,73 @@
1
+ ---
2
+ description: Initialize a new project with structured GSD planning (questioning → domain model → requirements → roadmap)
3
+ argument-hint: "[description]"
4
+ allowed-tools: Bash, Read, Write, Edit, Task
5
+ ---
6
+
7
+ # /new-project
8
+
9
+ Initialize a new project: questioning → research → requirements → roadmap.
10
+
11
+ Description: $ARGUMENTS
12
+
13
+ > **Tool note**: When this command says `draht-tools <subcommand>`, invoke it as `node "${CLAUDE_PLUGIN_ROOT}/bin/draht-tools.cjs" <subcommand>` via the Bash tool. `CLAUDE_PLUGIN_ROOT` is set by Claude Code to the plugin's install directory.
14
+
15
+ ## Atomic Reasoning
16
+
17
+ Before questioning, decompose project vision into atomic reasoning units:
18
+
19
+ **For each aspect of the new project:**
20
+ 1. **State the logical component** — What problem does this solve? Who are the users? What is core vs peripheral?
21
+ 2. **Validate independence** — What bounded contexts will exist? What domain concepts are central? Can features be built independently?
22
+ 3. **Verify correctness** — What defines MVP success? What constraints exist (time, tech, team)? What is explicitly out of scope?
23
+
24
+ **Synthesize project strategy:**
25
+ - Define bounded contexts and ubiquitous language upfront
26
+ - Establish test strategy before writing code
27
+ - Create requirements mapped to domain contexts
28
+ - Build roadmap with testable phase goals
29
+ - Ensure each phase delivers verifiable user value
30
+
31
+ ## Steps
32
+ 1. Run `draht-tools init` to check preconditions
33
+ 2. If existing code detected, run `draht-tools map-codebase` first
34
+ 3. Deep questioning phase (3-7 rounds, 1-2 questions at a time)
35
+ 4. Run `draht-tools create-project` with gathered info
36
+ 5. Run `draht-tools create-domain-model` to define bounded contexts, entities, and ubiquitous language
37
+ 6. Create `.planning/DOMAIN.md` with:
38
+ - `## Bounded Contexts` — each context with name, responsibility, and brief description
39
+ - `## Ubiquitous Language` — glossary of domain terms agreed with the user (term → definition)
40
+ - `## Context Map` — how bounded contexts relate to each other (upstream/downstream, shared kernel, ACL)
41
+ - `## Aggregates` — aggregates and their root entities per context
42
+ - `## Domain Events` — named events that cross context boundaries
43
+ 7. Create `.planning/TEST-STRATEGY.md` with:
44
+ - `## Test Framework` — chosen framework and rationale
45
+ - `## Directory Conventions` — where test files live relative to source
46
+ - `## Coverage Goals` — target coverage percentage and which paths are critical
47
+ - `## Testing Levels` — what is tested at unit level vs integration vs e2e, with examples
48
+ - `## Excluded` — what is explicitly not tested and why (config files, generated code, etc.)
49
+ 8. Optional research phase via `draht-tools research`
50
+ 9. Run `draht-tools create-requirements` with v1/v2/out-of-scope (map requirements to bounded contexts)
51
+ 10. Run `draht-tools create-roadmap` with phases
52
+ 11. Run `draht-tools init-state`
53
+ 12. Git commit via `draht-tools commit-docs "initialize project planning"`
54
+
55
+ ## Workflow
56
+ After project initialization, phases are executed one at a time in fresh sessions:
57
+
58
+ ```
59
+ /new-project → /discuss-phase 1 → /plan-phase 1 → /execute-phase 1 → /verify-work 1
60
+ → /discuss-phase 2 → /plan-phase 2 → /execute-phase 2 → /verify-work 2
61
+ → ... (repeat for all phases in the milestone)
62
+ → /next-milestone (only after ALL phases are complete)
63
+ ```
64
+
65
+ Start a fresh session (`/clear`) between steps. Do NOT suggest `/next-milestone` until every phase in the milestone is verified.
66
+
67
+ ## Rules
68
+ - Ask 1-2 questions at a time, never dump 10 at once
69
+ - Follow threads based on answers
70
+ - Use examples ("Like Stripe Checkout, or custom?")
71
+ - Confirm, don't assume
72
+ - 3-7 follow-up rounds typical
73
+ - Stop when you have: problem, audience, MVP scope, constraints, success criteria
@@ -0,0 +1,49 @@
1
+ ---
2
+ description: Plan the next milestone after ALL phases in the current one are complete
3
+ allowed-tools: Bash, Read, Write, Edit
4
+ ---
5
+
6
+ # /next-milestone
7
+
8
+ Plan the next milestone after ALL phases in the current one are complete.
9
+
10
+ > **Tool note**: Invoke `draht-tools <subcommand>` as `node "${CLAUDE_PLUGIN_ROOT}/bin/draht-tools.cjs" <subcommand>` via the Bash tool.
11
+
12
+ ## Atomic Reasoning
13
+
14
+ Before planning the next milestone, decompose progress into atomic reasoning units:
15
+
16
+ **For each completed phase:**
17
+ 1. **State the logical component** — What was built? What user value was delivered? What requirements were satisfied?
18
+ 2. **Validate independence** — What worked well? What had issues? What assumptions proved wrong?
19
+ 3. **Verify correctness** — Is every phase truly complete? Are there lingering fix plans? Is the codebase healthy?
20
+
21
+ **Synthesize milestone strategy:**
22
+ - Identify gaps from the current milestone
23
+ - Derive new requirements from lessons learned
24
+ - Group into a coherent next milestone with testable phase goals
25
+ - Ensure domain model and test strategy still reflect reality
26
+
27
+ ## Steps
28
+ 1. Run `draht-tools verify-milestone` to ensure every phase in the current milestone is `complete`
29
+ 2. If any phase is not complete, STOP and tell the user which phase needs attention
30
+ 3. Read all phase reports in `.planning/phase-N-report.md` to extract lessons learned
31
+ 4. Read the execution log `.planning/execution-log.jsonl` for failure patterns
32
+ 5. Review `.planning/DOMAIN.md` — is it still accurate? Any terms to add/revise?
33
+ 6. Review `.planning/TEST-STRATEGY.md` — any updates needed?
34
+ 7. Questioning phase (1-2 questions at a time):
35
+ - What is the next milestone's goal?
36
+ - What user-visible outcomes must be true by the end?
37
+ - What is in vs out of scope?
38
+ 8. Propose phases for the next milestone. Each phase must have:
39
+ - A clear goal (outcome, not activity)
40
+ - Mapped requirements
41
+ - Acceptance criteria
42
+ 9. Update `.planning/ROADMAP.md` with the new milestone header and phases (status: `pending`)
43
+ 10. Update `.planning/REQUIREMENTS.md` with any new requirements
44
+ 11. Commit: `draht-tools commit-docs "plan milestone <N>"`
45
+
46
+ ## Rules
47
+ - Do not start planning phase details — that happens in `/discuss-phase` + `/plan-phase`
48
+ - Respect lessons learned from the previous milestone — don't repeat mistakes
49
+ - Keep the next milestone focused — 3-6 phases is typical
@@ -0,0 +1,58 @@
1
+ ---
2
+ description: Decompose a task and orchestrate multiple specialist subagents in parallel and chain modes
3
+ argument-hint: "<task description>"
4
+ allowed-tools: Bash, Read, Write, Edit, Task
5
+ ---
6
+
7
+ # /orchestrate
8
+
9
+ Decompose a task and dispatch the right mix of specialist subagents.
10
+
11
+ Task: $ARGUMENTS
12
+
13
+ > **Tool note**: Use the **Task tool** with `subagent_type` set to one of: `architect`, `implementer`, `reviewer`, `debugger`, `verifier`, `git-committer`, `security-auditor`. Dispatch multiple tasks in the same assistant turn for parallel execution.
14
+
15
+ ## Atomic Reasoning
16
+
17
+ Before delegating, decompose the task into atomic work units:
18
+
19
+ 1. **State the logical components** — What sub-tasks make up this work? Which are independent?
20
+ 2. **Match agents to work** — Which specialist is right for each sub-task?
21
+ 3. **Determine order** — What can run in parallel vs what must be sequential?
22
+ 4. **Define success** — What does "done" look like for each sub-task, and for the whole?
23
+
24
+ ## Agent Selection Guide
25
+
26
+ | Need | Agent |
27
+ |---|---|
28
+ | Plan structure before coding | `architect` |
29
+ | Write or change code | `implementer` |
30
+ | Find what's broken | `debugger` |
31
+ | Review for correctness / conventions / domain | `reviewer` |
32
+ | Audit for security issues | `security-auditor` |
33
+ | Run lint / typecheck / tests | `verifier` |
34
+ | Create atomic commits | `git-committer` |
35
+
36
+ ## Orchestration Modes
37
+
38
+ ### Parallel
39
+ Dispatch several Task tool calls in a single assistant turn when the sub-tasks don't depend on each other. Example: review + security audit of the same change set.
40
+
41
+ ### Chain
42
+ Dispatch Task tool calls sequentially when later work depends on earlier output. Example: architect produces plan → implementer executes plan → verifier runs tests → reviewer audits the diff.
43
+
44
+ ### Fan-out / Fan-in
45
+ Architect decomposes into N independent plans → dispatch N implementers in parallel → collect all outputs → single verifier run → single reviewer audit. This is the standard pattern for `/execute-phase` work.
46
+
47
+ ## Steps
48
+ 1. Read the task description and identify sub-tasks
49
+ 2. Map each sub-task to the right agent from the table above
50
+ 3. Decide parallel vs chain vs fan-out based on dependencies
51
+ 4. Dispatch Task tool calls accordingly
52
+ 5. Collect results, handle failures, report the final outcome to the user
53
+
54
+ ## Rules
55
+ - Prefer parallel dispatch when possible — it's faster and each subagent has its own context
56
+ - Pass complete context to subagents — they cannot see the main conversation
57
+ - Do not nest delegations deeply — one level is usually enough
58
+ - If a subagent fails, report the failure and suggest next steps rather than retrying blindly
@@ -0,0 +1,38 @@
1
+ ---
2
+ description: Create a CONTINUE-HERE handoff document for session continuity
3
+ allowed-tools: Bash, Read, Write, Edit
4
+ ---
5
+
6
+ # /pause-work
7
+
8
+ Create a handoff document for session continuity.
9
+
10
+ > **Tool note**: Invoke `draht-tools <subcommand>` as `node "${CLAUDE_PLUGIN_ROOT}/bin/draht-tools.cjs" <subcommand>` via the Bash tool.
11
+
12
+ ## Atomic Reasoning
13
+
14
+ Before pausing, decompose session state into atomic reasoning units:
15
+
16
+ 1. **State the logical component** — What was accomplished this session? What is in-progress? What is the current phase/task?
17
+ 2. **Validate independence** — Are there uncommitted changes? Are there blockers? What decisions were made?
18
+ 3. **Verify correctness** — Is the current state stable? Can work resume cleanly? What context needs to be captured?
19
+
20
+ ## Steps
21
+ 1. Run `git status` and `git diff --stat` to see uncommitted changes
22
+ 2. Read `.planning/STATE.md` for current phase/status
23
+ 3. Write `.planning/CONTINUE-HERE.md` with:
24
+ - `## Current Phase` — which phase and plan is active
25
+ - `## Last Completed` — last task or milestone that finished cleanly
26
+ - `## In Progress` — what is partially done (be specific: file paths, failing tests)
27
+ - `## Uncommitted Changes` — list of modified files and why
28
+ - `## Decisions Made This Session` — any design decisions or context
29
+ - `## Next Steps` — exact commands to run when resuming
30
+ - `## Blockers` — anything waiting on external input or clarification
31
+ 4. Update `.planning/STATE.md` last activity timestamp via `draht-tools update-state`
32
+ 5. Commit: `draht-tools commit-docs "pause work — handoff"`
33
+ 6. Tell the user: "Resume with `/resume-work` in a fresh session."
34
+
35
+ ## Rules
36
+ - Be specific — "fix bug in auth" is useless; "null check in src/auth/session.ts:42, test reproducing in test/auth-null.test.ts" is useful
37
+ - Include exact commands, not vague directions
38
+ - Capture any in-flight decisions or trade-offs being weighed
@@ -0,0 +1,107 @@
1
+ ---
2
+ description: Create atomic execution plans for a roadmap phase (parallel via architect subagents)
3
+ argument-hint: "<phase-number>"
4
+ allowed-tools: Bash, Read, Write, Edit, Task
5
+ ---
6
+
7
+ # /plan-phase
8
+
9
+ Create atomic execution plans for a roadmap phase, using subagents for parallel plan creation.
10
+
11
+ Phase: $1
12
+
13
+ > **Tool note**: Invoke `draht-tools <subcommand>` as `node "${CLAUDE_PLUGIN_ROOT}/bin/draht-tools.cjs" <subcommand>`. For subagents, use the **Task tool** with `subagent_type: "architect"`. Dispatch multiple parallel tasks in a single assistant turn by making multiple Task tool calls at once.
14
+
15
+ ## Atomic Reasoning
16
+
17
+ Before creating plans, decompose this phase goal into atomic reasoning units:
18
+
19
+ **For each observable truth (user-visible outcome):**
20
+ 1. **State the logical component** — What must be true for the user? What can they do/see/verify?
21
+ 2. **Validate independence** — Which artifacts (files, endpoints, schemas) prove this truth exists? Can it be built independently?
22
+ 3. **Verify correctness** — What test scenarios would prove this observable truth? What are the specific inputs → expected outputs?
23
+
24
+ **Synthesize planning strategy:**
25
+ - Group related observable truths into cohesive plans (2-5 tasks each)
26
+ - Identify which plans can be created in parallel vs sequentially
27
+ - Map each plan to specific bounded contexts and domain concepts
28
+ - Ensure each plan produces testable, verifiable outcomes
29
+
30
+ ## Steps
31
+ 1. Run `draht-tools load-phase-context $1` to gather all context
32
+ 2. Optional: `draht-tools research-phase $1` for domain research
33
+ 3. Goal-backward planning:
34
+ a. State the goal (outcome, not activity)
35
+ b. Derive observable truths (3-7 from user perspective)
36
+ c. From each observable truth, derive the test scenarios that would prove it (specific inputs → expected outputs or state changes)
37
+ d. Map to required artifacts (files, endpoints, schemas)
38
+ e. Break into plan groups of 2-5 tasks each
39
+ 4. Identify which plans are independent (no shared files, no dependency edges)
40
+
41
+ 5. **Delegate plan creation to subagents via the Task tool:**
42
+ - For **independent plans**: dispatch multiple `Task` tool calls in parallel (single assistant turn), each with `subagent_type: "architect"`, one per plan.
43
+ - For **dependent plans**: dispatch sequentially — one `Task` call per plan, feeding predecessor outputs as context into the next.
44
+ - Each architect prompt must include:
45
+ - The phase context summary (paste it inline — subagents cannot run draht-tools)
46
+ - The specific observable truths this plan must satisfy
47
+ - The target files/artifacts
48
+ - The XML task format specification (below)
49
+ - Instruction to output the plan as XML text, which the main assistant will save via `draht-tools create-plan`
50
+
51
+ 6. Collect all plan outputs from subagents
52
+ 7. Save each plan by piping the subagent's output into `draht-tools create-plan`:
53
+ ```bash
54
+ echo 'plan content from subagent' | node "${CLAUDE_PLUGIN_ROOT}/bin/draht-tools.cjs" create-plan $1 P [title]
55
+ ```
56
+ The content must contain real task details (files, actions, tests) — NOT placeholder brackets. If `create-plan` is called without stdin, it writes a useless template.
57
+ 8. Validate: `draht-tools validate-plans $1`
58
+ 9. Commit: `draht-tools commit-docs "create phase $1 plans"`
59
+
60
+ ## Plan Format
61
+ Plans use XML task format:
62
+ ```xml
63
+ <task type="auto">
64
+ <n>Task name</n>
65
+ <context>Bounded context this task belongs to</context>
66
+ <domain>Aggregates, entities, value objects, or events touched</domain>
67
+ <files>affected files</files>
68
+ <test>
69
+ RED phase: Write failing tests FIRST.
70
+ - List specific test cases with expected behavior
71
+ - Test domain invariants and business rules
72
+ - Test at the right level: unit for domain logic, integration for context boundaries
73
+ - Tests MUST fail before implementation
74
+ </test>
75
+ <action>
76
+ GREEN phase: Minimal implementation to make tests pass.
77
+ - No gold-plating — just make the red tests green
78
+ - Respect aggregate boundaries
79
+ - Use domain language in code (class names, method names, variable names)
80
+ </action>
81
+ <refactor>
82
+ REFACTOR phase: Improve structure while keeping tests green.
83
+ - Extract value objects, push logic into domain layer
84
+ - Ensure naming matches ubiquitous language
85
+ - Remove duplication across bounded contexts (or make shared kernel explicit)
86
+ </refactor>
87
+ <verify>How to verify (tests pass + manual check if needed)</verify>
88
+ <done>What "done" looks like — expressed as passing test assertions</done>
89
+ </task>
90
+ ```
91
+
92
+ Task types: `auto`, `checkpoint:human-verify`, `checkpoint:decision`
93
+
94
+ ## Workflow
95
+ This is one step in the per-phase cycle:
96
+
97
+ ```
98
+ /discuss-phase N → /plan-phase N → /execute-phase N → /verify-work N
99
+ ```
100
+
101
+ After completing this command, tell the user to start a fresh session (`/clear`) and run `/execute-phase $1`. Do NOT suggest `/next-milestone`.
102
+
103
+ ## Domain Rules for Plans
104
+ - File/module structure should mirror bounded contexts (e.g., `src/billing/`, `src/catalog/`)
105
+ - Never scatter one aggregate's logic across multiple contexts without an explicit ACL
106
+ - If a plan introduces a new domain term, update `.planning/DOMAIN.md` first
107
+ - Cross-context communication should use domain events, not direct imports
@@ -0,0 +1,30 @@
1
+ ---
2
+ description: Show current GSD project status (milestone, phase, task, blockers)
3
+ allowed-tools: Bash, Read
4
+ ---
5
+
6
+ # /progress
7
+
8
+ Show current project status.
9
+
10
+ > **Tool note**: Invoke `draht-tools <subcommand>` as `node "${CLAUDE_PLUGIN_ROOT}/bin/draht-tools.cjs" <subcommand>` via the Bash tool.
11
+
12
+ ## Atomic Reasoning
13
+
14
+ Before checking progress, decompose project state into atomic reasoning units:
15
+
16
+ 1. **State the logical component** — What milestone are we in? What phase is active? What work is complete vs in-progress?
17
+ 2. **Validate independence** — Are there blockers? Are phases in the correct sequence? Is anything waiting on external input?
18
+ 3. **Verify correctness** — Does the reported state match reality? Are all verified phases truly complete? Are there unreported issues?
19
+
20
+ ## Steps
21
+ 1. Read `.planning/STATE.md` for current phase and status
22
+ 2. Read `.planning/ROADMAP.md` and extract all phases with their status
23
+ 3. Check for `.planning/CONTINUE-HERE.md` (paused session)
24
+ 4. Read `.planning/execution-log.jsonl` for the last 10 entries
25
+ 5. Report:
26
+ - Current phase and status
27
+ - Milestone completion (X of Y phases complete)
28
+ - Recent activity (last 5 task results)
29
+ - Any blockers or paused work
30
+ - Next suggested command based on state (e.g., `/resume-work`, `/discuss-phase N+1`)
@@ -0,0 +1,50 @@
1
+ ---
2
+ description: Execute a small ad-hoc task with tracking (implementer subagent + TDD cycle)
3
+ argument-hint: "<description>"
4
+ allowed-tools: Bash, Read, Write, Edit, Task
5
+ ---
6
+
7
+ # /quick
8
+
9
+ Execute a small ad-hoc task with tracking.
10
+
11
+ Task: $ARGUMENTS
12
+
13
+ > **Tool note**: Invoke `draht-tools <subcommand>` as `node "${CLAUDE_PLUGIN_ROOT}/bin/draht-tools.cjs" <subcommand>`. For subagents, use the **Task tool** with `subagent_type: "implementer"`.
14
+
15
+ ## Atomic Reasoning
16
+
17
+ Before executing, decompose this task into atomic reasoning units:
18
+
19
+ 1. **State the logical component** — What is the single, concrete outcome? What files need to change? What behavior needs to work?
20
+ 2. **Validate independence** — Can this be done without touching other features? What dependencies exist? What could break?
21
+ 3. **Verify correctness** — What test proves this works? What edge cases matter? Is this testable behavior or pure config?
22
+
23
+ **Synthesize execution plan:**
24
+ - Define specific files to modify
25
+ - Write failing test (if testable behavior)
26
+ - Implement minimal solution
27
+ - Verify and document
28
+
29
+ ## Steps
30
+ 1. Run `draht-tools next-quick-number` to get task number
31
+ 2. Analyze the task and write a concrete plan with actual task details (files, actions, verification). Pipe it into `draht-tools create-quick-plan`:
32
+ ```bash
33
+ echo 'plan content here' | node "${CLAUDE_PLUGIN_ROOT}/bin/draht-tools.cjs" create-quick-plan NNN "$ARGUMENTS"
34
+ ```
35
+ The plan content must include: a `# Quick Task NNN: title` heading, a `## Tasks` section with one or more `<task>` XML blocks containing real file paths, real actions, and real verification steps — NOT placeholders like `[files]`.
36
+
37
+ 3. **Delegate execution via the Task tool** with `subagent_type: "implementer"` and prompt:
38
+ "Execute this task: $ARGUMENTS
39
+
40
+ Follow the TDD cycle:
41
+ - RED — Write a failing test that describes the desired behaviour
42
+ - GREEN — Write the minimum implementation to make it pass
43
+ - REFACTOR — Clean up while keeping the test green
44
+
45
+ Exception: skip the TDD cycle only for pure config or documentation-only tasks that have no testable behaviour.
46
+
47
+ After completion, report: files changed, tests written, and verification results."
48
+
49
+ 4. Write summary: `draht-tools write-quick-summary NNN`
50
+ 5. Update state: `draht-tools update-state`
@@ -0,0 +1,35 @@
1
+ ---
2
+ description: Resume from the CONTINUE-HERE handoff document
3
+ allowed-tools: Bash, Read, Write, Edit
4
+ ---
5
+
6
+ # /resume-work
7
+
8
+ Resume from last session state.
9
+
10
+ > **Tool note**: Invoke `draht-tools <subcommand>` as `node "${CLAUDE_PLUGIN_ROOT}/bin/draht-tools.cjs" <subcommand>` via the Bash tool.
11
+
12
+ ## Atomic Reasoning
13
+
14
+ Before resuming, decompose handoff context into atomic reasoning units:
15
+
16
+ 1. **State the logical component** — What phase/task was active? What was the last accomplishment? What decisions were made?
17
+ 2. **Validate independence** — Are there blockers? What changed since the pause? Is the codebase in the expected state?
18
+ 3. **Verify correctness** — Is the handoff document complete? Does the current state match what was documented? Can work continue safely?
19
+
20
+ ## Steps
21
+ 1. Read `.planning/CONTINUE-HERE.md` (if missing, tell the user there's nothing to resume)
22
+ 2. Read `.planning/STATE.md` for current phase/status
23
+ 3. Run `git status` to check current working state
24
+ 4. Compare handoff document's "Uncommitted Changes" to actual git state — report any discrepancies
25
+ 5. Summarize to the user:
26
+ - What was in progress
27
+ - What the next step is
28
+ - Any blockers to resolve first
29
+ 6. Delete `.planning/CONTINUE-HERE.md` only after the user confirms work is resumed
30
+ 7. Proceed with the next step from the handoff
31
+
32
+ ## Rules
33
+ - Do not auto-execute the next step — confirm with the user first
34
+ - If the codebase state doesn't match the handoff (e.g., uncommitted changes missing), flag it before proceeding
35
+ - Preserve CONTINUE-HERE.md until the user acknowledges; this is the safety net
@@ -0,0 +1,55 @@
1
+ ---
2
+ description: Code review and security audit of recent changes (parallel reviewer + security-auditor subagents)
3
+ argument-hint: "[scope]"
4
+ allowed-tools: Bash, Read, Task
5
+ ---
6
+
7
+ # /review
8
+
9
+ Code review and security audit of recent changes, using subagents for parallel analysis.
10
+
11
+ Scope: $ARGUMENTS
12
+
13
+ If no scope given, reviews all recent uncommitted changes.
14
+
15
+ > **Tool note**: For subagents, use the **Task tool** and dispatch multiple in parallel (single assistant turn = multiple Task tool calls).
16
+
17
+ ## Atomic Reasoning
18
+
19
+ Before reviewing, decompose code changes into atomic reasoning units:
20
+
21
+ **For each changed file:**
22
+ 1. **State the logical component** — What does this change do? What problem does it solve? What behavior does it add/modify?
23
+ 2. **Validate independence** — Does this change have side effects? Does it affect other modules? Are there hidden dependencies?
24
+ 3. **Verify correctness** — Is this change correct? Type-safe? Secure? Does it follow conventions? What could go wrong?
25
+
26
+ **Synthesize review strategy:**
27
+ - Group changes by concern (correctness, security, style)
28
+ - Prioritize findings (critical, important, minor)
29
+ - Identify patterns across multiple files
30
+ - Check domain language compliance and bounded context boundaries
31
+
32
+ ## Steps
33
+ 1. Identify the scope:
34
+ - If argument given: use those files/directories/description as scope
35
+ - If no argument: run `git diff --stat` and `git diff --cached --stat` to find changes
36
+ 2. Determine the list of changed files and produce a scope summary
37
+
38
+ 3. **Delegate to subagents in parallel via the Task tool** (dispatch both in the same assistant turn):
39
+
40
+ - **Task tool** with `subagent_type: "reviewer"` and prompt:
41
+ "Review the following code changes for correctness, type safety, conventions, and potential issues. Scope: <scope summary and file list>. Read each changed file to understand the changes. For each finding: cite the exact file and line, explain the issue, suggest the fix. Prioritize: Critical (must fix) > Important (should fix) > Minor (style/optional). Check domain language compliance against `.planning/DOMAIN.md` if it exists."
42
+
43
+ - **Task tool** with `subagent_type: "security-auditor"` and prompt:
44
+ "Audit the following code changes for security vulnerabilities. Scope: <scope summary and file list>. Read each changed file. Check for: injection risks, auth bypasses, secrets in code, unsafe deserialization, path traversal, prototype pollution. Report findings with severity, file, line, and recommendation."
45
+
46
+ 4. Collect and merge results from both subagents
47
+ 5. Produce a unified, prioritized findings report:
48
+ - **Critical** — must fix before merge (security, data loss, crashes)
49
+ - **Important** — should fix (bugs, type issues, missing error handling)
50
+ - **Minor** — style, naming, or optional improvements
51
+
52
+ ## Rules
53
+ - Cite file paths and line numbers precisely
54
+ - Do not restate the diff — focus on findings
55
+ - If no issues found, state that explicitly