@draht/coding-agent 2026.3.5 → 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.
Files changed (63) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/agents/architect.md +1 -0
  3. package/agents/debugger.md +1 -0
  4. package/agents/git-committer.md +1 -0
  5. package/agents/implementer.md +1 -0
  6. package/agents/reviewer.md +1 -0
  7. package/agents/security-auditor.md +1 -0
  8. package/agents/verifier.md +1 -0
  9. package/dist/agents/architect.md +1 -0
  10. package/dist/agents/debugger.md +1 -0
  11. package/dist/agents/git-committer.md +1 -0
  12. package/dist/agents/implementer.md +1 -0
  13. package/dist/agents/reviewer.md +1 -0
  14. package/dist/agents/security-auditor.md +1 -0
  15. package/dist/agents/verifier.md +1 -0
  16. package/dist/config.d.ts +7 -0
  17. package/dist/config.d.ts.map +1 -1
  18. package/dist/config.js +15 -0
  19. package/dist/config.js.map +1 -1
  20. package/dist/core/package-manager.d.ts.map +1 -1
  21. package/dist/core/package-manager.js +7 -7
  22. package/dist/core/package-manager.js.map +1 -1
  23. package/dist/core/prompt-templates.d.ts.map +1 -1
  24. package/dist/core/prompt-templates.js +4 -4
  25. package/dist/core/prompt-templates.js.map +1 -1
  26. package/dist/core/resource-loader.d.ts.map +1 -1
  27. package/dist/core/resource-loader.js +9 -8
  28. package/dist/core/resource-loader.js.map +1 -1
  29. package/dist/core/settings-manager.d.ts.map +1 -1
  30. package/dist/core/settings-manager.js +2 -2
  31. package/dist/core/settings-manager.js.map +1 -1
  32. package/dist/core/skills.d.ts.map +1 -1
  33. package/dist/core/skills.js +3 -3
  34. package/dist/core/skills.js.map +1 -1
  35. package/dist/migrations.d.ts.map +1 -1
  36. package/dist/migrations.js +2 -2
  37. package/dist/migrations.js.map +1 -1
  38. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  39. package/dist/modes/interactive/components/config-selector.js +3 -3
  40. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  41. package/dist/prompts/commands/discuss-phase.md +10 -0
  42. package/dist/prompts/commands/execute-phase.md +51 -34
  43. package/dist/prompts/commands/fix.md +8 -6
  44. package/dist/prompts/commands/init-project.md +12 -0
  45. package/dist/prompts/commands/map-codebase.md +17 -18
  46. package/dist/prompts/commands/new-project.md +12 -0
  47. package/dist/prompts/commands/next-milestone.md +5 -3
  48. package/dist/prompts/commands/plan-phase.md +27 -5
  49. package/dist/prompts/commands/quick.md +12 -5
  50. package/dist/prompts/commands/review.md +10 -10
  51. package/dist/prompts/commands/verify-work.md +31 -17
  52. package/package.json +4 -4
  53. package/prompts/commands/discuss-phase.md +10 -0
  54. package/prompts/commands/execute-phase.md +51 -34
  55. package/prompts/commands/fix.md +8 -6
  56. package/prompts/commands/init-project.md +12 -0
  57. package/prompts/commands/map-codebase.md +17 -18
  58. package/prompts/commands/new-project.md +12 -0
  59. package/prompts/commands/next-milestone.md +5 -3
  60. package/prompts/commands/plan-phase.md +27 -5
  61. package/prompts/commands/quick.md +12 -5
  62. package/prompts/commands/review.md +10 -10
  63. package/prompts/commands/verify-work.md +31 -17
@@ -4,7 +4,7 @@ description: "Create atomic execution plans for a roadmap phase"
4
4
 
5
5
  # /plan-phase
6
6
 
7
- Create atomic execution plans for a roadmap phase.
7
+ Create atomic execution plans for a roadmap phase, using subagents for parallel plan creation.
8
8
 
9
9
  ## Usage
10
10
  ```
@@ -21,10 +21,22 @@ Phase: $1
21
21
  b. Derive observable truths (3-7 from user perspective)
22
22
  c. From each observable truth, derive the test scenarios that would prove it (specific inputs → expected outputs or state changes)
23
23
  d. Map to required artifacts (files, endpoints, schemas)
24
- e. Break into atomic tasks (2-5 per plan)
25
- 4. Write plans: `draht-tools create-plan $1 P`
26
- 5. Validate: `draht-tools validate-plans $1`
27
- 6. Commit: `draht-tools commit-docs "create phase $1 plans"`
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"`
28
40
 
29
41
  ## Plan Format
30
42
  Plans use XML task format:
@@ -60,6 +72,16 @@ Plans use XML task format:
60
72
 
61
73
  Task types: `auto`, `checkpoint:human-verify`, `checkpoint:decision`
62
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
+
63
85
  ## Domain Rules for Plans
64
86
  - File/module structure should mirror bounded contexts (e.g., `src/billing/`, `src/catalog/`)
65
87
  - Never scatter one aggregate's logic across multiple contexts without an explicit ACL
@@ -16,10 +16,17 @@ Task: $ARGUMENTS
16
16
  ## Steps
17
17
  1. Run `draht-tools next-quick-number` to get task number
18
18
  2. Create quick plan: `draht-tools create-quick-plan NNN "$ARGUMENTS"`
19
- 3. Execute tasks following the TDD cycle:
20
- - **🔴 RED** — Write a failing test that describes the desired behaviour
21
- - **🟢 GREEN** — Write the minimum implementation to make it pass
22
- - **🔵 REFACTOR** — Clean up while keeping the test green
23
- - *Exception: skip the TDD cycle only for pure config or documentation-only tasks that have no testable behaviour*
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
+
24
31
  4. Write summary: `draht-tools write-quick-summary NNN`
25
32
  5. Update state: `draht-tools update-state`
@@ -4,7 +4,7 @@ description: "Code review and security audit of recent changes"
4
4
 
5
5
  # /review
6
6
 
7
- Ad-hoc code review and security audit of recent changes or a specific scope.
7
+ Code review and security audit of recent changes, using subagents for parallel analysis.
8
8
 
9
9
  ## Usage
10
10
  ```
@@ -17,16 +17,16 @@ If no scope given, reviews all recent uncommitted changes.
17
17
 
18
18
  ## Steps
19
19
  1. Identify the scope:
20
- - If argument given: review those files/directories/description
20
+ - If argument given: use those files/directories/description as scope
21
21
  - If no argument: run `git diff --stat` and `git diff --cached --stat` to find changes
22
- 2. For each changed file, examine:
23
- - Correctness: logic errors, off-by-one, null handling, error paths
24
- - Type safety: any `as` casts, `any` types, missing null checks
25
- - Conventions: naming, file organization, import style
26
- - Security: injection risks, auth bypasses, secrets in code, unsafe deserialization
27
- - Performance: unnecessary allocations, missing indexes, N+1 queries
28
- 3. Produce a prioritized findings report:
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:
29
30
  - **Critical** — must fix before merge (security, data loss, crashes)
30
31
  - **Important** — should fix (bugs, type issues, missing error handling)
31
32
  - **Minor** — style, naming, or optional improvements
32
- 4. For each finding: cite the exact file and line, explain the issue, suggest the fix
@@ -4,7 +4,7 @@ description: "Acceptance testing of completed phase work"
4
4
 
5
5
  # /verify-work
6
6
 
7
- Walk through acceptance testing of completed phase work.
7
+ Walk through acceptance testing of completed phase work, using subagents for parallel verification.
8
8
 
9
9
  ## Usage
10
10
  ```
@@ -14,20 +14,34 @@ Walk through acceptance testing of completed phase work.
14
14
  Phase: $1
15
15
 
16
16
  ## Steps
17
- 1. Run full test suite and capture results:
18
- - Execute all tests (`bun test` or project-specific runner)
19
- - Record pass/fail counts verification cannot proceed if tests are failing
20
- 2. Check domain language violations:
21
- - Load `.planning/DOMAIN.md` and extract all defined terms
22
- - Scan source files for PascalCase identifiers not present in the glossary
23
- - Flag any bounded context boundary violations (cross-context direct imports)
24
- 3. Run quality gate: `draht-tools quality-gate --strict`
25
- 4. Run `draht-tools extract-deliverables $1` to get testable items
26
- 5. Walk user through each deliverable one at a time
27
- 6. Record results (pass/fail/partially/skip)
28
- 7. For failures: diagnose and create fix plans via `draht-tools create-fix-plan $1 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`
29
28
  - Fix plans MUST include a reproducing test that demonstrates the failure before any implementation
30
- 8. Write UAT report: `draht-tools write-uat $1`
31
- - Report must include: test health summary (pass/fail/coverage), domain model status (any glossary violations), deliverable results
32
- 9. If all passed: mark phase complete
33
- 10. If failures: route to `execute-phase $1 --gaps-only`
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.