@draht/coding-agent 2026.3.4 → 2026.3.6
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.
- package/CHANGELOG.md +36 -0
- package/agents/architect.md +1 -0
- package/agents/debugger.md +1 -0
- package/agents/git-committer.md +1 -0
- package/agents/implementer.md +1 -0
- package/agents/reviewer.md +1 -0
- package/agents/security-auditor.md +1 -0
- package/agents/verifier.md +1 -0
- package/dist/agents/architect.md +1 -0
- package/dist/agents/debugger.md +1 -0
- package/dist/agents/git-committer.md +1 -0
- package/dist/agents/implementer.md +1 -0
- package/dist/agents/reviewer.md +1 -0
- package/dist/agents/security-auditor.md +1 -0
- package/dist/agents/verifier.md +1 -0
- package/dist/config.d.ts +7 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +15 -0
- package/dist/config.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +7 -7
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +8 -6
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +9 -8
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +2 -2
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +3 -3
- package/dist/core/skills.js.map +1 -1
- package/dist/gsd/domain-validator.d.ts +18 -0
- package/dist/gsd/domain-validator.d.ts.map +1 -0
- package/dist/gsd/domain-validator.js +61 -0
- package/dist/gsd/domain-validator.js.map +1 -0
- package/dist/gsd/domain.d.ts +12 -0
- package/dist/gsd/domain.d.ts.map +1 -0
- package/dist/gsd/domain.js +113 -0
- package/dist/gsd/domain.js.map +1 -0
- package/dist/gsd/git.d.ts +20 -0
- package/dist/gsd/git.d.ts.map +1 -0
- package/dist/gsd/git.js +59 -0
- package/dist/gsd/git.js.map +1 -0
- package/dist/gsd/hook-utils.d.ts +22 -0
- package/dist/gsd/hook-utils.d.ts.map +1 -0
- package/dist/gsd/hook-utils.js +100 -0
- package/dist/gsd/hook-utils.js.map +1 -0
- package/dist/gsd/index.d.ts +9 -0
- package/dist/gsd/index.d.ts.map +1 -0
- package/dist/gsd/index.js +8 -0
- package/dist/gsd/index.js.map +1 -0
- package/dist/gsd/planning.d.ts +20 -0
- package/dist/gsd/planning.d.ts.map +1 -0
- package/dist/gsd/planning.js +167 -0
- package/dist/gsd/planning.js.map +1 -0
- package/dist/hooks/gsd/draht-post-task.js +44 -11
- package/dist/hooks/gsd/draht-quality-gate.js +99 -57
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +2 -2
- package/dist/migrations.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +3 -3
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +2 -2
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/prompts/agents/build.md +5 -1
- package/dist/prompts/agents/plan.md +5 -1
- package/dist/prompts/agents/verify.md +5 -1
- package/dist/prompts/commands/atomic-commit.md +8 -16
- package/dist/prompts/commands/discuss-phase.md +19 -3
- package/dist/prompts/commands/execute-phase.md +59 -35
- package/dist/prompts/commands/fix.md +14 -6
- package/dist/prompts/commands/init-project.md +21 -3
- package/dist/prompts/commands/map-codebase.md +24 -19
- package/dist/prompts/commands/new-project.md +20 -2
- package/dist/prompts/commands/next-milestone.md +8 -2
- package/dist/prompts/commands/pause-work.md +4 -0
- package/dist/prompts/commands/plan-phase.md +35 -7
- package/dist/prompts/commands/progress.md +4 -0
- package/dist/prompts/commands/quick.md +20 -7
- package/dist/prompts/commands/resume-work.md +4 -0
- package/dist/prompts/commands/review.md +16 -10
- package/dist/prompts/commands/verify-work.md +37 -17
- package/hooks/gsd/draht-post-task.js +44 -11
- package/hooks/gsd/draht-quality-gate.js +99 -57
- package/package.json +5 -5
- package/prompts/agents/build.md +5 -1
- package/prompts/agents/plan.md +5 -1
- package/prompts/agents/verify.md +5 -1
- package/prompts/commands/atomic-commit.md +8 -16
- package/prompts/commands/discuss-phase.md +19 -3
- package/prompts/commands/execute-phase.md +59 -35
- package/prompts/commands/fix.md +14 -6
- package/prompts/commands/init-project.md +21 -3
- package/prompts/commands/map-codebase.md +24 -19
- package/prompts/commands/new-project.md +20 -2
- package/prompts/commands/next-milestone.md +8 -2
- package/prompts/commands/pause-work.md +4 -0
- package/prompts/commands/plan-phase.md +35 -7
- package/prompts/commands/progress.md +4 -0
- package/prompts/commands/quick.md +20 -7
- package/prompts/commands/resume-work.md +4 -0
- package/prompts/commands/review.md +16 -10
- package/prompts/commands/verify-work.md +37 -17
|
@@ -1,43 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Execute all plans in a phase with atomic commits"
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# /execute-phase
|
|
2
6
|
|
|
3
|
-
Execute all plans in a phase with atomic commits.
|
|
7
|
+
Execute all plans in a phase with atomic commits, parallelizing independent plans via subagents.
|
|
4
8
|
|
|
5
9
|
## Usage
|
|
6
10
|
```
|
|
7
11
|
/execute-phase [N] [--gaps-only]
|
|
8
12
|
```
|
|
9
13
|
|
|
14
|
+
Phase: $1
|
|
15
|
+
Arguments: $ARGUMENTS
|
|
16
|
+
|
|
10
17
|
## Steps
|
|
11
|
-
1. Run `draht-tools discover-plans
|
|
12
|
-
2.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
18
|
+
1. Run `draht-tools discover-plans $1` to find and order plans
|
|
19
|
+
2. Read each plan file yourself (from `.planning/phases/`) and analyze dependencies to identify which plans can run in parallel vs sequential
|
|
20
|
+
3. **Delegate execution to subagents:**
|
|
21
|
+
- For independent plans (no shared files, no dependency chain): use the `subagent` tool in **parallel mode** with `implementer` agents, one per plan.
|
|
22
|
+
- For dependent plans: execute them sequentially, each via a **single** `subagent` call to `implementer`, waiting for the previous to complete before starting the next.
|
|
23
|
+
- Each subagent task must include:
|
|
24
|
+
- The full plan content (paste it into the task — the subagent cannot run draht-tools)
|
|
25
|
+
- The TDD cycle instructions (see template below)
|
|
26
|
+
- Instructions to commit with `git add <files> && git commit -m "description"`
|
|
27
|
+
|
|
28
|
+
4. After all subagents complete, collect results and check for failures
|
|
29
|
+
5. Run `draht-tools verify-phase $1` yourself (not the subagent)
|
|
30
|
+
6. Run `draht-tools update-state` yourself
|
|
31
|
+
7. Final commit: `draht-tools commit-docs "complete phase $1 execution"`
|
|
32
|
+
8. After execution, tell the user to start a new session and run `/verify-work $1`.
|
|
33
|
+
|
|
34
|
+
## Subagent Task Template
|
|
35
|
+
|
|
36
|
+
Each implementer subagent receives a task like:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
Execute this plan. Here is the full plan content:
|
|
40
|
+
|
|
41
|
+
<paste full plan XML here>
|
|
42
|
+
|
|
43
|
+
For each <task> in the plan, follow this TDD cycle:
|
|
44
|
+
1. RED — Write failing tests from <test>. Run the test runner, confirm they FAIL. Commit with: git add <test-files> && git commit -m "red: <description>"
|
|
45
|
+
2. GREEN — Write minimal implementation from <action> to make tests pass. Run tests, confirm PASS. Commit with: git add <files> && git commit -m "green: <task name>"
|
|
46
|
+
3. REFACTOR — Apply <refactor> improvements if any. Tests must stay green after each change. Commit with: git add <files> && git commit -m "refactor: <description>"
|
|
47
|
+
4. VERIFY — Run the <verify> step, confirm <done> criteria are met.
|
|
48
|
+
|
|
49
|
+
Domain rules: Use ubiquitous language from .planning/DOMAIN.md (read it). Do not import across bounded context boundaries.
|
|
50
|
+
Checkpoint handling: type="auto" → execute silently. type="checkpoint:human-verify" → stop and report back what was built. type="checkpoint:decision" → stop and report the options.
|
|
51
|
+
|
|
52
|
+
Important: Do NOT run draht, draht-tools, draht help, or pi commands. Use only standard tools (read, bash, edit, write, grep, find, ls).
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Parallelization Rules
|
|
56
|
+
- Plans sharing no files and having no dependency edges can run in parallel
|
|
57
|
+
- If plan B depends on output of plan A, plan B must wait for A to complete
|
|
58
|
+
- Maximum parallel subagents: follow the subagent tool limits (max 8 tasks, 4 concurrent)
|
|
59
|
+
- If a parallel subagent fails, report which plan failed and continue with independent plans
|
|
41
60
|
|
|
42
61
|
## TDD Rules
|
|
43
62
|
- Never write implementation before a failing test exists
|
|
@@ -50,10 +69,15 @@ Execute all plans in a phase with atomic commits.
|
|
|
50
69
|
- Do not import across bounded context boundaries directly — use domain events or ACL adapters
|
|
51
70
|
- If implementation reveals a missing domain term, stop and update DOMAIN.md before continuing
|
|
52
71
|
|
|
53
|
-
##
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
|
|
72
|
+
## Workflow
|
|
73
|
+
This is one step in the per-phase cycle. Each step runs in its own session (`/new` between steps):
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
/discuss-phase N → /new → /plan-phase N → /new → /execute-phase N → /new → /verify-work N → /new → /discuss-phase N+1 → ...
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
After completing this command, tell the user to start a new session and run `/verify-work $1`.
|
|
80
|
+
Do NOT suggest `/next-milestone` — that is only after ALL phases in the milestone are verified.
|
|
57
81
|
|
|
58
82
|
## Flags
|
|
59
83
|
- `--gaps-only` → only execute FIX-PLAN.md files from failed verification
|
package/prompts/commands/fix.md
CHANGED
|
@@ -1,26 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Diagnose and fix a bug with TDD discipline"
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# /fix
|
|
2
6
|
|
|
3
|
-
Diagnose and fix a specific bug or failing task with TDD discipline.
|
|
7
|
+
Diagnose and fix a specific bug or failing task with TDD discipline, using a subagent for diagnosis.
|
|
4
8
|
|
|
5
9
|
## Usage
|
|
6
10
|
```
|
|
7
11
|
/fix [description of what's broken]
|
|
8
12
|
```
|
|
9
13
|
|
|
14
|
+
Issue: $ARGUMENTS
|
|
15
|
+
|
|
10
16
|
## Steps
|
|
11
|
-
1. **Diagnose**:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
2. **Write a reproducing test**:
|
|
15
|
-
- Write a test that demonstrates the bug (it must fail)
|
|
17
|
+
1. **Diagnose via subagent**: Use the `subagent` tool in **single mode** with the `debugger` agent:
|
|
18
|
+
"Diagnose this issue: $ARGUMENTS. Reproduce the bug by running the relevant test or command. Trace the root cause by reading the code. Identify the exact files and lines involved. Do NOT fix it yet — only report the diagnosis with: root cause, affected files, and a recommended fix approach. Do NOT run draht, draht-tools, or pi commands."
|
|
19
|
+
|
|
20
|
+
2. **Write a reproducing test**: Based on the diagnosis, write a test that demonstrates the bug (it must fail)
|
|
16
21
|
- Commit: `draht-tools commit-docs "red: reproduce bug"`
|
|
22
|
+
|
|
17
23
|
3. **Minimal fix**: Write the smallest change that makes the test pass
|
|
18
24
|
- Do not refactor or add features — just fix the bug
|
|
19
25
|
- Run the full test suite to check for regressions
|
|
20
26
|
- Commit: `draht-tools commit-docs "green: fix description"`
|
|
27
|
+
|
|
21
28
|
4. **Refactor** (if needed): Clean up without changing behavior
|
|
22
29
|
- Tests must stay green after every change
|
|
23
30
|
- Commit: `draht-tools commit-docs "refactor: description"`
|
|
31
|
+
|
|
24
32
|
5. **Update state**: `draht-tools update-state`
|
|
25
33
|
|
|
26
34
|
## Rules
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Initialize planning for an existing project"
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# /init-project
|
|
2
6
|
|
|
3
|
-
Initialize
|
|
7
|
+
Initialize planning framework for an existing project: codebase mapping → questioning → domain model → requirements → roadmap.
|
|
4
8
|
|
|
5
9
|
## Usage
|
|
6
10
|
```
|
|
7
11
|
/init-project [focus area or goal]
|
|
8
12
|
```
|
|
9
13
|
|
|
10
|
-
|
|
14
|
+
Focus: $ARGUMENTS
|
|
15
|
+
|
|
16
|
+
Use this when you have an existing codebase and want to add structured planning.
|
|
11
17
|
For greenfield projects, use `/new-project` instead.
|
|
12
18
|
|
|
13
19
|
## Steps
|
|
@@ -37,7 +43,19 @@ For greenfield projects, use `/new-project` instead.
|
|
|
37
43
|
10. Run `draht-tools create-requirements` with v1/v2/out-of-scope (map requirements to bounded contexts)
|
|
38
44
|
11. Run `draht-tools create-roadmap` with phases
|
|
39
45
|
12. Run `draht-tools init-state`
|
|
40
|
-
13. Git commit via `draht-tools commit-docs "initialize
|
|
46
|
+
13. Git commit via `draht-tools commit-docs "initialize project planning"`
|
|
47
|
+
|
|
48
|
+
## Workflow
|
|
49
|
+
After project initialization, phases are executed one at a time in new sessions:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
/init-project → /new → /discuss-phase 1 → /new → /plan-phase 1 → /new → /execute-phase 1 → /new → /verify-work 1
|
|
53
|
+
→ /new → /discuss-phase 2 → /new → /plan-phase 2 → /new → /execute-phase 2 → /new → /verify-work 2
|
|
54
|
+
→ ... (repeat for all phases in the milestone)
|
|
55
|
+
→ /new → /next-milestone (only after ALL phases are complete)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Each step runs in its own session (`/new` between steps). Do NOT suggest `/next-milestone` until every phase in the milestone is verified.
|
|
41
59
|
|
|
42
60
|
## Rules
|
|
43
61
|
- Ask 1-2 questions at a time, never dump 10 at once
|
|
@@ -1,32 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Analyze existing codebase before planning"
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# /map-codebase
|
|
2
6
|
|
|
3
|
-
Analyze existing codebase before planning.
|
|
7
|
+
Analyze existing codebase before planning, using subagents for parallel analysis.
|
|
4
8
|
|
|
5
9
|
## Usage
|
|
6
10
|
```
|
|
7
11
|
/map-codebase [directory]
|
|
8
12
|
```
|
|
9
13
|
|
|
14
|
+
Directory: $1
|
|
15
|
+
|
|
10
16
|
## Steps
|
|
11
|
-
1. Run `draht-tools map-codebase
|
|
17
|
+
1. Run `draht-tools map-codebase $1`
|
|
12
18
|
2. Tool generates: STACK.md, ARCHITECTURE.md, CONVENTIONS.md, CONCERNS.md
|
|
13
|
-
3.
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
6. If `.planning/DOMAIN.md` does not already exist, create it with:
|
|
19
|
+
3. **Run parallel deep analysis via subagents:**
|
|
20
|
+
Use the `subagent` tool in **parallel mode** with these tasks:
|
|
21
|
+
- `architect` agent: "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). Do NOT run draht, draht-tools, or pi commands."
|
|
22
|
+
- `verifier` agent: "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. Do NOT run draht, draht-tools, or pi commands."
|
|
23
|
+
|
|
24
|
+
4. Collect subagent results and merge with the draht-tools output
|
|
25
|
+
5. Create `.planning/DOMAIN.md` (if it doesn't exist) with:
|
|
21
26
|
- `## Bounded Contexts` — one entry per discovered context with a brief description
|
|
22
27
|
- `## Ubiquitous Language` — glossary of extracted domain terms
|
|
23
|
-
- `## Context Map` —
|
|
24
|
-
- `## Aggregates` —
|
|
28
|
+
- `## Context Map` — how bounded contexts relate (upstream/downstream, shared kernel, ACL)
|
|
29
|
+
- `## Aggregates` — aggregates and their root entities per context
|
|
25
30
|
- `## Domain Events` — any existing event names or patterns discovered
|
|
26
|
-
|
|
27
|
-
- Test
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
|
|
31
|
+
6. Create `.planning/TEST-STRATEGY.md` with:
|
|
32
|
+
- `## Test Framework` — chosen framework and rationale
|
|
33
|
+
- `## Directory Conventions` — where test files live relative to source
|
|
34
|
+
- `## Coverage Goals` — target coverage percentage and which paths are critical
|
|
35
|
+
- `## Testing Levels` — what is tested at unit level vs integration vs e2e, with examples
|
|
36
|
+
- `## Excluded` — what is explicitly not tested and why
|
|
37
|
+
7. Commit: `draht-tools commit-docs "map existing codebase"`
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Initialize a new project with structured planning"
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# /new-project
|
|
2
6
|
|
|
3
|
-
Initialize a new
|
|
7
|
+
Initialize a new project: questioning → research → requirements → roadmap.
|
|
4
8
|
|
|
5
9
|
## Usage
|
|
6
10
|
```
|
|
7
11
|
/new-project [description]
|
|
8
12
|
```
|
|
9
13
|
|
|
14
|
+
Description: $ARGUMENTS
|
|
15
|
+
|
|
10
16
|
## Steps
|
|
11
17
|
1. Run `draht-tools init` to check preconditions
|
|
12
18
|
2. If existing code detected, run `draht-tools map-codebase` first
|
|
@@ -29,7 +35,19 @@ Initialize a new GSD project: questioning → research → requirements → road
|
|
|
29
35
|
9. Run `draht-tools create-requirements` with v1/v2/out-of-scope (map requirements to bounded contexts)
|
|
30
36
|
10. Run `draht-tools create-roadmap` with phases
|
|
31
37
|
11. Run `draht-tools init-state`
|
|
32
|
-
12. Git commit via `draht-tools commit-docs "initialize
|
|
38
|
+
12. Git commit via `draht-tools commit-docs "initialize project planning"`
|
|
39
|
+
|
|
40
|
+
## Workflow
|
|
41
|
+
After project initialization, phases are executed one at a time in new sessions:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
/new-project → /new → /discuss-phase 1 → /new → /plan-phase 1 → /new → /execute-phase 1 → /new → /verify-work 1
|
|
45
|
+
→ /new → /discuss-phase 2 → /new → /plan-phase 2 → /new → /execute-phase 2 → /new → /verify-work 2
|
|
46
|
+
→ ... (repeat for all phases in the milestone)
|
|
47
|
+
→ /new → /next-milestone (only after ALL phases are complete)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Each step runs in its own session (`/new` between steps). Do NOT suggest `/next-milestone` until every phase in the milestone is verified.
|
|
33
51
|
|
|
34
52
|
## Rules
|
|
35
53
|
- Ask 1-2 questions at a time, never dump 10 at once
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Plan the next milestone after ALL phases in the current milestone are complete"
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# /next-milestone
|
|
2
6
|
|
|
3
|
-
Plan the next milestone after the current one
|
|
7
|
+
Plan the next milestone after ALL phases in the current one are complete.
|
|
4
8
|
|
|
5
9
|
## Usage
|
|
6
10
|
```
|
|
@@ -9,7 +13,9 @@ Plan the next milestone after the current one is complete.
|
|
|
9
13
|
|
|
10
14
|
## Prerequisites
|
|
11
15
|
- `.planning/ROADMAP.md` must exist
|
|
12
|
-
-
|
|
16
|
+
- ALL phases in the current milestone must be complete (verified via /verify-work)
|
|
17
|
+
- This command is ONLY for milestone transitions — NOT for moving between phases within a milestone
|
|
18
|
+
- Between phases, use `/discuss-phase`, `/plan-phase`, `/execute-phase`, `/verify-work` — never `/next-milestone`
|
|
13
19
|
|
|
14
20
|
## Steps
|
|
15
21
|
1. Load project context:
|
|
@@ -1,24 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Create atomic execution plans for a roadmap phase"
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# /plan-phase
|
|
2
6
|
|
|
3
|
-
Create atomic execution plans for a roadmap phase.
|
|
7
|
+
Create atomic execution plans for a roadmap phase, using subagents for parallel plan creation.
|
|
4
8
|
|
|
5
9
|
## Usage
|
|
6
10
|
```
|
|
7
11
|
/plan-phase [N]
|
|
8
12
|
```
|
|
9
13
|
|
|
14
|
+
Phase: $1
|
|
15
|
+
|
|
10
16
|
## Steps
|
|
11
|
-
1. Run `draht-tools load-phase-context
|
|
12
|
-
2. Optional: `draht-tools research-phase
|
|
17
|
+
1. Run `draht-tools load-phase-context $1` to gather all context
|
|
18
|
+
2. Optional: `draht-tools research-phase $1` for domain research
|
|
13
19
|
3. Goal-backward planning:
|
|
14
20
|
a. State the goal (outcome, not activity)
|
|
15
21
|
b. Derive observable truths (3-7 from user perspective)
|
|
16
22
|
c. From each observable truth, derive the test scenarios that would prove it (specific inputs → expected outputs or state changes)
|
|
17
23
|
d. Map to required artifacts (files, endpoints, schemas)
|
|
18
|
-
e. Break into
|
|
19
|
-
4.
|
|
20
|
-
5.
|
|
21
|
-
|
|
24
|
+
e. Break into plan groups of 2-5 tasks each
|
|
25
|
+
4. Identify which plans are independent (no shared files, no dependency edges)
|
|
26
|
+
5. **Delegate plan creation to subagents:**
|
|
27
|
+
- For independent plans: use the `subagent` tool in **parallel mode** with `architect` agents, one per plan. Each task should include the phase context, the specific observable truths, target files, and the XML task format (below).
|
|
28
|
+
- For dependent plans: create them sequentially, each via a **single** `subagent` call to `architect`, passing the outputs of predecessor plans as context.
|
|
29
|
+
- Each subagent task must include:
|
|
30
|
+
- The phase context summary (paste it — subagents cannot run draht-tools)
|
|
31
|
+
- The specific observable truths this plan must satisfy
|
|
32
|
+
- The target files/artifacts
|
|
33
|
+
- The XML task format specification (below)
|
|
34
|
+
- Instruction to output the plan as XML (you will save it via `draht-tools create-plan`)
|
|
35
|
+
|
|
36
|
+
6. Collect all plan outputs from subagents
|
|
37
|
+
7. Save plans yourself: `draht-tools create-plan $1 P` for each plan
|
|
38
|
+
8. Validate: `draht-tools validate-plans $1`
|
|
39
|
+
9. Commit: `draht-tools commit-docs "create phase $1 plans"`
|
|
22
40
|
|
|
23
41
|
## Plan Format
|
|
24
42
|
Plans use XML task format:
|
|
@@ -54,6 +72,16 @@ Plans use XML task format:
|
|
|
54
72
|
|
|
55
73
|
Task types: `auto`, `checkpoint:human-verify`, `checkpoint:decision`
|
|
56
74
|
|
|
75
|
+
## Workflow
|
|
76
|
+
This is one step in the per-phase cycle. Each step runs in its own session (`/new` between steps):
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
/discuss-phase N → /new → /plan-phase N → /new → /execute-phase N → /new → /verify-work N → /new → /discuss-phase N+1 → ...
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
After completing this command, tell the user to start a new session and run `/execute-phase $1`.
|
|
83
|
+
Do NOT suggest `/next-milestone` — that is only after ALL phases in the milestone are verified.
|
|
84
|
+
|
|
57
85
|
## Domain Rules for Plans
|
|
58
86
|
- File/module structure should mirror bounded contexts (e.g., `src/billing/`, `src/catalog/`)
|
|
59
87
|
- Never scatter one aggregate's logic across multiple contexts without an explicit ACL
|
|
@@ -1,19 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Execute a small ad-hoc task with tracking"
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# /quick
|
|
2
6
|
|
|
3
|
-
Execute a small ad-hoc task with
|
|
7
|
+
Execute a small ad-hoc task with tracking.
|
|
4
8
|
|
|
5
9
|
## Usage
|
|
6
10
|
```
|
|
7
11
|
/quick [description]
|
|
8
12
|
```
|
|
9
13
|
|
|
14
|
+
Task: $ARGUMENTS
|
|
15
|
+
|
|
10
16
|
## Steps
|
|
11
17
|
1. Run `draht-tools next-quick-number` to get task number
|
|
12
|
-
2. Create quick plan: `draht-tools create-quick-plan NNN "
|
|
13
|
-
3.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
+
2. Create quick plan: `draht-tools create-quick-plan NNN "$ARGUMENTS"`
|
|
19
|
+
3. **Delegate execution to subagent**: Use the `subagent` tool in **single mode** with the `implementer` agent:
|
|
20
|
+
"Execute this task: $ARGUMENTS
|
|
21
|
+
|
|
22
|
+
Follow the TDD cycle:
|
|
23
|
+
- RED — Write a failing test that describes the desired behaviour
|
|
24
|
+
- GREEN — Write the minimum implementation to make it pass
|
|
25
|
+
- REFACTOR — Clean up while keeping the test green
|
|
26
|
+
Exception: skip the TDD cycle only for pure config or documentation-only tasks that have no testable behaviour.
|
|
27
|
+
|
|
28
|
+
After completion, report: files changed, tests written, and verification results.
|
|
29
|
+
Do NOT run draht, draht-tools, draht help, or pi commands — use only standard tools."
|
|
30
|
+
|
|
18
31
|
4. Write summary: `draht-tools write-quick-summary NNN`
|
|
19
32
|
5. Update state: `draht-tools update-state`
|
|
@@ -1,26 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Code review and security audit of recent changes"
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# /review
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
Code review and security audit of recent changes, using subagents for parallel analysis.
|
|
4
8
|
|
|
5
9
|
## Usage
|
|
6
10
|
```
|
|
7
11
|
/review [scope]
|
|
8
12
|
```
|
|
9
13
|
|
|
14
|
+
Scope: $ARGUMENTS
|
|
15
|
+
|
|
10
16
|
If no scope given, reviews all recent uncommitted changes.
|
|
11
17
|
|
|
12
18
|
## Steps
|
|
13
19
|
1. Identify the scope:
|
|
14
|
-
- If argument given:
|
|
20
|
+
- If argument given: use those files/directories/description as scope
|
|
15
21
|
- If no argument: run `git diff --stat` and `git diff --cached --stat` to find changes
|
|
16
|
-
2.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
2. Determine the list of changed files and produce a scope summary
|
|
23
|
+
3. **Delegate to subagents in parallel:**
|
|
24
|
+
Use the `subagent` tool in **parallel mode** with these tasks:
|
|
25
|
+
- `reviewer` agent: "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). Do NOT run draht, draht-tools, or pi commands."
|
|
26
|
+
- `security-auditor` agent: "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. Do NOT run draht, draht-tools, or pi commands."
|
|
27
|
+
|
|
28
|
+
4. Collect and merge results from both subagents
|
|
29
|
+
5. Produce a unified, prioritized findings report:
|
|
23
30
|
- **Critical** — must fix before merge (security, data loss, crashes)
|
|
24
31
|
- **Important** — should fix (bugs, type issues, missing error handling)
|
|
25
32
|
- **Minor** — style, naming, or optional improvements
|
|
26
|
-
4. For each finding: cite the exact file and line, explain the issue, suggest the fix
|
|
@@ -1,27 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Acceptance testing of completed phase work"
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# /verify-work
|
|
2
6
|
|
|
3
|
-
Walk through acceptance testing of completed phase work.
|
|
7
|
+
Walk through acceptance testing of completed phase work, using subagents for parallel verification.
|
|
4
8
|
|
|
5
9
|
## Usage
|
|
6
10
|
```
|
|
7
11
|
/verify-work [N]
|
|
8
12
|
```
|
|
9
13
|
|
|
14
|
+
Phase: $1
|
|
15
|
+
|
|
10
16
|
## Steps
|
|
11
|
-
1. Run
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
3.
|
|
19
|
-
4.
|
|
20
|
-
5.
|
|
21
|
-
6.
|
|
22
|
-
7. For failures: diagnose and create fix plans via `draht-tools create-fix-plan N P`
|
|
17
|
+
1. Run `draht-tools extract-deliverables $1` to get testable items
|
|
18
|
+
2. **Run parallel verification via subagents:**
|
|
19
|
+
Use the `subagent` tool in **parallel mode** with these tasks:
|
|
20
|
+
- `verifier` agent: "Run the full test suite for this project. Check package.json for the test command. Record pass/fail counts. Then run any available lint and typecheck commands (e.g. npm run check, npm run lint, npx tsc --noEmit). Report all results with error details. Do NOT run draht, draht-tools, or pi commands."
|
|
21
|
+
- `security-auditor` agent: "Audit the recent code changes (use git log and git diff to find them). Check for injection risks, auth bypasses, secrets in code, unsafe patterns. Report findings by severity. Do NOT run draht, draht-tools, or pi commands."
|
|
22
|
+
- `reviewer` agent: "Review the recent code changes (use git log and git diff). Check domain language compliance against `.planning/DOMAIN.md` if it exists — scan for identifiers not in the glossary and cross-context boundary violations. Report findings. Do NOT run draht, draht-tools, or pi commands."
|
|
23
|
+
|
|
24
|
+
3. Collect results from all subagents
|
|
25
|
+
4. Walk user through each deliverable one at a time, incorporating findings from the parallel checks
|
|
26
|
+
5. Record results (pass/fail/partially/skip)
|
|
27
|
+
6. For failures: diagnose and create fix plans via `draht-tools create-fix-plan $1 P`
|
|
23
28
|
- Fix plans MUST include a reproducing test that demonstrates the failure before any implementation
|
|
24
|
-
|
|
25
|
-
- Report must include: test health summary (pass/fail/coverage), domain model status (any glossary violations), deliverable results
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
7. Write UAT report: `draht-tools write-uat $1`
|
|
30
|
+
- Report must include: test health summary (pass/fail/coverage), security audit results, domain model status (any glossary violations), deliverable results
|
|
31
|
+
8. If all passed: mark phase complete.
|
|
32
|
+
- If more phases remain in the milestone: tell the user to start a new session and run `/discuss-phase N+1`.
|
|
33
|
+
- If ALL phases in the milestone are complete: tell the user to start a new session and run `/next-milestone`.
|
|
34
|
+
9. If failures: route to `execute-phase $1 --gaps-only`
|
|
35
|
+
|
|
36
|
+
## Workflow
|
|
37
|
+
This is the last step in the per-phase cycle. Each step runs in its own session (`/new` between steps):
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
/discuss-phase N → /new → /plan-phase N → /new → /execute-phase N → /new → /verify-work N
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
After verify-work passes:
|
|
44
|
+
- More phases remaining → `/new` → `/discuss-phase N+1`
|
|
45
|
+
- ALL phases in milestone verified → `/new` → `/next-milestone`
|
|
46
|
+
|
|
47
|
+
`/next-milestone` is ONLY for generating new phases after every phase in the current milestone is complete.
|