@draht/coding-agent 2026.3.2 → 2026.3.4

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 (194) hide show
  1. package/CHANGELOG.md +194 -13
  2. package/README.md +90 -106
  3. package/agents/architect.md +45 -0
  4. package/agents/debugger.md +57 -0
  5. package/agents/git-committer.md +46 -0
  6. package/agents/implementer.md +25 -0
  7. package/agents/reviewer.md +52 -0
  8. package/agents/security-auditor.md +61 -0
  9. package/agents/verifier.md +44 -0
  10. package/bin/draht-tools.cjs +20 -20
  11. package/dist/agents/architect.md +45 -0
  12. package/dist/agents/debugger.md +57 -0
  13. package/dist/agents/git-committer.md +46 -0
  14. package/dist/agents/implementer.md +25 -0
  15. package/dist/agents/reviewer.md +52 -0
  16. package/dist/agents/security-auditor.md +61 -0
  17. package/dist/agents/verifier.md +44 -0
  18. package/dist/cli/args.d.ts.map +1 -1
  19. package/dist/cli/args.js +1 -0
  20. package/dist/cli/args.js.map +1 -1
  21. package/dist/cli.d.ts.map +1 -1
  22. package/dist/cli.js +5 -0
  23. package/dist/cli.js.map +1 -1
  24. package/dist/config.d.ts +0 -7
  25. package/dist/config.d.ts.map +1 -1
  26. package/dist/config.js +2 -14
  27. package/dist/config.js.map +1 -1
  28. package/dist/core/agent-session.d.ts +14 -4
  29. package/dist/core/agent-session.d.ts.map +1 -1
  30. package/dist/core/agent-session.js +167 -49
  31. package/dist/core/agent-session.js.map +1 -1
  32. package/dist/core/auth-storage.d.ts +1 -1
  33. package/dist/core/auth-storage.d.ts.map +1 -1
  34. package/dist/core/auth-storage.js +2 -1
  35. package/dist/core/auth-storage.js.map +1 -1
  36. package/dist/core/builtins/subagent.d.ts +14 -0
  37. package/dist/core/builtins/subagent.d.ts.map +1 -0
  38. package/dist/core/builtins/subagent.js +492 -0
  39. package/dist/core/builtins/subagent.js.map +1 -0
  40. package/dist/core/compaction/compaction.d.ts.map +1 -1
  41. package/dist/core/compaction/compaction.js +4 -1
  42. package/dist/core/compaction/compaction.js.map +1 -1
  43. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  44. package/dist/core/export-html/tool-renderer.js +6 -0
  45. package/dist/core/export-html/tool-renderer.js.map +1 -1
  46. package/dist/core/extensions/loader.d.ts.map +1 -1
  47. package/dist/core/extensions/loader.js +19 -8
  48. package/dist/core/extensions/loader.js.map +1 -1
  49. package/dist/core/extensions/runner.d.ts.map +1 -1
  50. package/dist/core/extensions/runner.js +1 -0
  51. package/dist/core/extensions/runner.js.map +1 -1
  52. package/dist/core/extensions/types.d.ts +8 -2
  53. package/dist/core/extensions/types.d.ts.map +1 -1
  54. package/dist/core/extensions/types.js.map +1 -1
  55. package/dist/core/model-registry.d.ts +1 -0
  56. package/dist/core/model-registry.d.ts.map +1 -1
  57. package/dist/core/model-registry.js +9 -6
  58. package/dist/core/model-registry.js.map +1 -1
  59. package/dist/core/model-resolver.d.ts.map +1 -1
  60. package/dist/core/model-resolver.js +35 -5
  61. package/dist/core/model-resolver.js.map +1 -1
  62. package/dist/core/prompt-templates.js.map +1 -1
  63. package/dist/core/resource-loader.d.ts +2 -0
  64. package/dist/core/resource-loader.d.ts.map +1 -1
  65. package/dist/core/resource-loader.js +5 -1
  66. package/dist/core/resource-loader.js.map +1 -1
  67. package/dist/core/sdk.d.ts +1 -1
  68. package/dist/core/sdk.d.ts.map +1 -1
  69. package/dist/core/sdk.js.map +1 -1
  70. package/dist/core/session-manager.js.map +1 -1
  71. package/dist/core/settings-manager.d.ts +3 -0
  72. package/dist/core/settings-manager.d.ts.map +1 -1
  73. package/dist/core/settings-manager.js +4 -0
  74. package/dist/core/settings-manager.js.map +1 -1
  75. package/dist/core/system-prompt.d.ts +4 -0
  76. package/dist/core/system-prompt.d.ts.map +1 -1
  77. package/dist/core/system-prompt.js +34 -12
  78. package/dist/core/system-prompt.js.map +1 -1
  79. package/dist/core/tools/edit-diff.js.map +1 -1
  80. package/dist/core/tools/path-utils.js.map +1 -1
  81. package/dist/index.d.ts +1 -1
  82. package/dist/index.d.ts.map +1 -1
  83. package/dist/index.js +1 -1
  84. package/dist/index.js.map +1 -1
  85. package/dist/main.d.ts.map +1 -1
  86. package/dist/main.js +5 -5
  87. package/dist/main.js.map +1 -1
  88. package/dist/migrations.d.ts +1 -1
  89. package/dist/migrations.d.ts.map +1 -1
  90. package/dist/migrations.js +3 -3
  91. package/dist/migrations.js.map +1 -1
  92. package/dist/modes/interactive/components/armin.js.map +1 -1
  93. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  94. package/dist/modes/interactive/components/daxnuts.js.map +1 -1
  95. package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
  96. package/dist/modes/interactive/components/extension-editor.d.ts +5 -2
  97. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
  98. package/dist/modes/interactive/components/extension-editor.js +9 -1
  99. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  100. package/dist/modes/interactive/components/extension-selector.js.map +1 -1
  101. package/dist/modes/interactive/components/footer.js.map +1 -1
  102. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  103. package/dist/modes/interactive/components/login-dialog.js +1 -1
  104. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  105. package/dist/modes/interactive/components/model-selector.d.ts +1 -1
  106. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  107. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  108. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  109. package/dist/modes/interactive/components/oauth-selector.js +1 -1
  110. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  111. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  112. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  113. package/dist/modes/interactive/components/session-selector.js +1 -1
  114. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  115. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  116. package/dist/modes/interactive/components/tool-execution.d.ts +2 -0
  117. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  118. package/dist/modes/interactive/components/tool-execution.js +28 -3
  119. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  120. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  121. package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
  122. package/dist/modes/interactive/components/user-message.d.ts +1 -0
  123. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  124. package/dist/modes/interactive/components/user-message.js +11 -0
  125. package/dist/modes/interactive/components/user-message.js.map +1 -1
  126. package/dist/modes/interactive/interactive-mode.d.ts +1 -1
  127. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  128. package/dist/modes/interactive/interactive-mode.js +28 -27
  129. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  130. package/dist/modes/interactive/theme/dark.json +1 -1
  131. package/dist/modes/interactive/theme/light.json +1 -1
  132. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  133. package/dist/modes/interactive/theme/theme.js +5 -0
  134. package/dist/modes/interactive/theme/theme.js.map +1 -1
  135. package/dist/prompts/commands/discuss-phase.md +3 -3
  136. package/dist/prompts/commands/execute-phase.md +9 -9
  137. package/dist/prompts/commands/fix.md +29 -0
  138. package/dist/prompts/commands/init-project.md +49 -0
  139. package/dist/prompts/commands/map-codebase.md +2 -2
  140. package/dist/prompts/commands/new-project.md +9 -9
  141. package/dist/prompts/commands/next-milestone.md +44 -0
  142. package/dist/prompts/commands/pause-work.md +2 -2
  143. package/dist/prompts/commands/plan-phase.md +5 -5
  144. package/dist/prompts/commands/progress.md +1 -1
  145. package/dist/prompts/commands/quick.md +4 -4
  146. package/dist/prompts/commands/resume-work.md +1 -1
  147. package/dist/prompts/commands/review.md +26 -0
  148. package/dist/prompts/commands/verify-work.md +4 -4
  149. package/docs/compaction.md +14 -14
  150. package/docs/custom-provider.md +19 -11
  151. package/docs/development.md +1 -1
  152. package/docs/extensions.md +52 -33
  153. package/docs/json.md +4 -4
  154. package/docs/packages.md +1 -1
  155. package/docs/providers.md +4 -2
  156. package/docs/rpc.md +1 -1
  157. package/docs/sdk.md +24 -24
  158. package/docs/session.md +6 -6
  159. package/docs/settings.md +1 -0
  160. package/docs/termux.md +1 -1
  161. package/docs/themes.md +2 -2
  162. package/docs/tui.md +20 -20
  163. package/examples/extensions/README.md +5 -4
  164. package/examples/extensions/antigravity-image-gen.ts +3 -1
  165. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  166. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  167. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  168. package/examples/extensions/custom-provider-qwen-cli/package.json +1 -1
  169. package/examples/extensions/doom-overlay/README.md +1 -1
  170. package/examples/extensions/dynamic-resources/dynamic.json +1 -1
  171. package/examples/extensions/dynamic-tools.ts +74 -0
  172. package/examples/extensions/subagent/README.md +11 -11
  173. package/examples/extensions/with-deps/package-lock.json +2 -2
  174. package/examples/extensions/with-deps/package.json +1 -1
  175. package/examples/sdk/README.md +3 -3
  176. package/package.json +11 -8
  177. package/prompts/commands/discuss-phase.md +3 -3
  178. package/prompts/commands/execute-phase.md +9 -9
  179. package/prompts/commands/fix.md +29 -0
  180. package/prompts/commands/init-project.md +49 -0
  181. package/prompts/commands/map-codebase.md +2 -2
  182. package/prompts/commands/new-project.md +9 -9
  183. package/prompts/commands/next-milestone.md +44 -0
  184. package/prompts/commands/pause-work.md +2 -2
  185. package/prompts/commands/plan-phase.md +5 -5
  186. package/prompts/commands/progress.md +1 -1
  187. package/prompts/commands/quick.md +4 -4
  188. package/prompts/commands/resume-work.md +1 -1
  189. package/prompts/commands/review.md +26 -0
  190. package/prompts/commands/verify-work.md +4 -4
  191. package/dist/extensions/gsd-commands.ts +0 -338
  192. package/dist/extensions/subagent.ts +0 -312
  193. package/extensions/gsd-commands.ts +0 -338
  194. package/extensions/subagent.ts +0 -312
@@ -8,36 +8,36 @@ Execute all plans in a phase with atomic commits.
8
8
  ```
9
9
 
10
10
  ## Steps
11
- 1. Run `draht discover-plans N` to find and order plans
11
+ 1. Run `draht-tools discover-plans N` to find and order plans
12
12
  2. For each plan in dependency order:
13
- a. Load plan: `draht read-plan N P`
13
+ a. Load plan: `draht-tools read-plan N P`
14
14
  b. Execute each task in strict TDD cycle:
15
15
 
16
16
  **🔴 RED — Write failing tests first**
17
17
  - Write the test cases from `<test>`
18
18
  - Run tests — confirm they FAIL (if they pass, the test is wrong)
19
- - Commit failing tests: `draht commit-task N P T "red: test description"`
19
+ - Commit failing tests: `draht-tools commit-task N P T "red: test description"`
20
20
 
21
21
  **🟢 GREEN — Minimal implementation**
22
22
  - Write the minimum code from `<action>` to make tests pass
23
23
  - Use domain language from `<context>` and `<domain>` for all names
24
24
  - Run tests — confirm they PASS
25
- - Commit: `draht commit-task N P T "green: task name"`
25
+ - Commit: `draht-tools commit-task N P T "green: task name"`
26
26
 
27
27
  **🔵 REFACTOR — Clean up with safety net**
28
28
  - Apply improvements from `<refactor>` (if any)
29
29
  - Run tests after each change — must stay green
30
30
  - Verify domain language compliance (names match DOMAIN.md)
31
- - Commit: `draht commit-task N P T "refactor: description"`
31
+ - Commit: `draht-tools commit-task N P T "refactor: description"`
32
32
 
33
33
  **✅ VERIFY**
34
34
  - Run the `<verify>` step
35
35
  - Confirm `<done>` criteria met
36
36
 
37
- c. Write summary: `draht write-summary N P`
38
- 3. Phase verification: `draht verify-phase N`
39
- 4. Update state: `draht update-state`
40
- 5. Final commit: `draht commit-docs "complete phase N execution"`
37
+ c. Write summary: `draht-tools write-summary N P`
38
+ 3. Phase verification: `draht-tools verify-phase N`
39
+ 4. Update state: `draht-tools update-state`
40
+ 5. Final commit: `draht-tools commit-docs "complete phase N execution"`
41
41
 
42
42
  ## TDD Rules
43
43
  - Never write implementation before a failing test exists
@@ -0,0 +1,29 @@
1
+ # /fix
2
+
3
+ Diagnose and fix a specific bug or failing task with TDD discipline.
4
+
5
+ ## Usage
6
+ ```
7
+ /fix [description of what's broken]
8
+ ```
9
+
10
+ ## Steps
11
+ 1. **Diagnose**: Read the relevant code and error output to identify the root cause
12
+ - If a test is failing, run it first to see the actual error
13
+ - If a runtime bug, reproduce it and capture the error
14
+ 2. **Write a reproducing test**: Before touching any implementation:
15
+ - Write a test that demonstrates the bug (it must fail)
16
+ - Commit: `draht-tools commit-docs "red: reproduce bug"`
17
+ 3. **Minimal fix**: Write the smallest change that makes the test pass
18
+ - Do not refactor or add features — just fix the bug
19
+ - Run the full test suite to check for regressions
20
+ - Commit: `draht-tools commit-docs "green: fix description"`
21
+ 4. **Refactor** (if needed): Clean up without changing behavior
22
+ - Tests must stay green after every change
23
+ - Commit: `draht-tools commit-docs "refactor: description"`
24
+ 5. **Update state**: `draht-tools update-state`
25
+
26
+ ## Rules
27
+ - Always reproduce before fixing — a fix without a test is a guess
28
+ - One bug, one fix, one commit. Do not bundle unrelated changes.
29
+ - If the root cause spans multiple files, explain the chain in the commit message
@@ -0,0 +1,49 @@
1
+ # /init-project
2
+
3
+ Initialize GSD planning framework for an existing project: codebase mapping → questioning → domain model → requirements → roadmap.
4
+
5
+ ## Usage
6
+ ```
7
+ /init-project [focus area or goal]
8
+ ```
9
+
10
+ Use this when you have an existing codebase and want to add GSD methodology.
11
+ For greenfield projects, use `/new-project` instead.
12
+
13
+ ## Steps
14
+ 1. Run `draht-tools init` to check preconditions (git repo, etc.)
15
+ 2. Run `draht-tools map-codebase` to build a structural map of the existing code
16
+ 3. Analyze the codebase map to understand architecture, tech stack, and conventions
17
+ 4. Deep questioning phase (3-7 rounds, 1-2 questions at a time):
18
+ - What is this project? Who uses it?
19
+ - What are the current pain points or goals?
20
+ - What is MVP vs aspirational scope?
21
+ - What constraints exist (infra, team size, deadlines)?
22
+ 5. Run `draht-tools create-project` with gathered info
23
+ 6. Run `draht-tools create-domain-model` to define bounded contexts, entities, and ubiquitous language
24
+ 7. Create `.planning/DOMAIN.md` with:
25
+ - `## Bounded Contexts` — each context with name, responsibility, and brief description
26
+ - `## Ubiquitous Language` — glossary of domain terms agreed with the user (term → definition)
27
+ - `## Context Map` — how bounded contexts relate to each other (upstream/downstream, shared kernel, ACL)
28
+ - `## Aggregates` — aggregates and their root entities per context
29
+ - `## Domain Events` — named events that cross context boundaries
30
+ 8. Create `.planning/TEST-STRATEGY.md` with:
31
+ - `## Test Framework` — chosen framework and rationale
32
+ - `## Directory Conventions` — where test files live relative to source
33
+ - `## Coverage Goals` — target coverage percentage and which paths are critical
34
+ - `## Testing Levels` — what is tested at unit level vs integration vs e2e, with examples
35
+ - `## Excluded` — what is explicitly not tested and why (config files, generated code, etc.)
36
+ 9. Optional research phase via `draht-tools research`
37
+ 10. Run `draht-tools create-requirements` with v1/v2/out-of-scope (map requirements to bounded contexts)
38
+ 11. Run `draht-tools create-roadmap` with phases
39
+ 12. Run `draht-tools init-state`
40
+ 13. Git commit via `draht-tools commit-docs "initialize GSD planning"`
41
+
42
+ ## Rules
43
+ - Ask 1-2 questions at a time, never dump 10 at once
44
+ - Follow threads based on answers
45
+ - Use examples ("Like Stripe Checkout, or custom?")
46
+ - Confirm, don't assume
47
+ - 3-7 follow-up rounds typical
48
+ - Respect what already exists — do not propose rewriting working code
49
+ - Stop when you have: current state, goals, MVP scope, constraints, success criteria
@@ -8,7 +8,7 @@ Analyze existing codebase before planning.
8
8
  ```
9
9
 
10
10
  ## Steps
11
- 1. Run `draht map-codebase [dir]`
11
+ 1. Run `draht-tools map-codebase [dir]`
12
12
  2. Tool generates: STACK.md, ARCHITECTURE.md, CONVENTIONS.md, CONCERNS.md
13
13
  3. Review output, supplement with your own analysis if needed
14
14
  4. Identify implicit bounded contexts from directory structure:
@@ -29,4 +29,4 @@ Analyze existing codebase before planning.
29
29
  - Existing coverage configuration and goals (if any)
30
30
  - Which layers have tests today (unit, integration, e2e)
31
31
  - Gaps and recommendations
32
- 8. Commit: `draht commit-docs "map existing codebase"`
32
+ 8. Commit: `draht-tools commit-docs "map existing codebase"`
@@ -8,11 +8,11 @@ Initialize a new GSD project: questioning → research → requirements → road
8
8
  ```
9
9
 
10
10
  ## Steps
11
- 1. Run `draht init` to check preconditions
12
- 2. If existing code detected, run `draht map-codebase` first
11
+ 1. Run `draht-tools init` to check preconditions
12
+ 2. If existing code detected, run `draht-tools map-codebase` first
13
13
  3. Deep questioning phase (3-7 rounds, 1-2 questions at a time)
14
- 4. Run `draht create-project` with gathered info
15
- 5. Run `draht create-domain-model` to define bounded contexts, entities, and ubiquitous language
14
+ 4. Run `draht-tools create-project` with gathered info
15
+ 5. Run `draht-tools create-domain-model` to define bounded contexts, entities, and ubiquitous language
16
16
  6. Create `.planning/DOMAIN.md` with:
17
17
  - `## Bounded Contexts` — each context with name, responsibility, and brief description
18
18
  - `## Ubiquitous Language` — glossary of domain terms agreed with the user (term → definition)
@@ -25,11 +25,11 @@ Initialize a new GSD project: questioning → research → requirements → road
25
25
  - `## Coverage Goals` — target coverage percentage and which paths are critical
26
26
  - `## Testing Levels` — what is tested at unit level vs integration vs e2e, with examples
27
27
  - `## Excluded` — what is explicitly not tested and why (config files, generated code, etc.)
28
- 8. Optional research phase via `draht research`
29
- 9. Run `draht create-requirements` with v1/v2/out-of-scope (map requirements to bounded contexts)
30
- 10. Run `draht create-roadmap` with phases
31
- 11. Run `draht init-state`
32
- 12. Git commit via `draht commit-docs "initialize GSD project"`
28
+ 8. Optional research phase via `draht-tools research`
29
+ 9. Run `draht-tools create-requirements` with v1/v2/out-of-scope (map requirements to bounded contexts)
30
+ 10. Run `draht-tools create-roadmap` with phases
31
+ 11. Run `draht-tools init-state`
32
+ 12. Git commit via `draht-tools commit-docs "initialize GSD project"`
33
33
 
34
34
  ## Rules
35
35
  - Ask 1-2 questions at a time, never dump 10 at once
@@ -0,0 +1,44 @@
1
+ # /next-milestone
2
+
3
+ Plan the next milestone after the current one is complete.
4
+
5
+ ## Usage
6
+ ```
7
+ /next-milestone
8
+ ```
9
+
10
+ ## Prerequisites
11
+ - `.planning/ROADMAP.md` must exist
12
+ - Current milestone should be complete or nearly complete
13
+
14
+ ## Steps
15
+ 1. Load project context:
16
+ - Read `.planning/ROADMAP.md` — identify the completed milestone and its phases
17
+ - Read `.planning/STATE.md` — understand current status
18
+ - Read `.planning/REQUIREMENTS.md` — check which requirements are satisfied
19
+ - Read `.planning/DOMAIN.md` (if exists) — review domain model for evolution needs
20
+ 2. Review completed work:
21
+ - Scan `.planning/phases/` for all UAT reports (`*-UAT.md`) and summaries (`*-SUMMARY.md`)
22
+ - Note what was built, what worked well, what had issues
23
+ 3. Assess requirements:
24
+ - Which v1 requirements are now satisfied?
25
+ - Which v1 requirements remain?
26
+ - Should any v2 requirements be promoted based on what we learned?
27
+ - Are there new requirements discovered during implementation?
28
+ 4. Propose next milestone:
29
+ - Define 3-5 phases, each with a clear goal (outcome, not activity)
30
+ - Order phases by dependency
31
+ - Map each phase to specific requirements
32
+ - Estimate relative complexity
33
+ 5. Present the proposed milestone for user approval before writing files
34
+ 6. After approval:
35
+ - Update `ROADMAP.md` with the new milestone and phases
36
+ - Update `STATE.md` to reflect milestone transition
37
+ - Update `REQUIREMENTS.md` if requirements changed
38
+ - Update `DOMAIN.md` if domain model needs evolution
39
+ - Commit: `draht-tools commit-docs "plan next milestone"`
40
+
41
+ ## Rules
42
+ - Always review what was actually built, not just what was planned
43
+ - Be honest about requirements that slipped or changed scope
44
+ - Each phase goal must be testable — "user can X" not "implement Y"
@@ -8,5 +8,5 @@ Create a handoff document for session continuity.
8
8
  ```
9
9
 
10
10
  ## Steps
11
- 1. Run `draht pause` — creates CONTINUE-HERE.md
12
- 2. Commit: `draht commit-docs "pause work"`
11
+ 1. Run `draht-tools pause` — creates CONTINUE-HERE.md
12
+ 2. Commit: `draht-tools commit-docs "pause work"`
@@ -8,17 +8,17 @@ Create atomic execution plans for a roadmap phase.
8
8
  ```
9
9
 
10
10
  ## Steps
11
- 1. Run `draht load-phase-context N` to gather all context
12
- 2. Optional: `draht research-phase N` for domain research
11
+ 1. Run `draht-tools load-phase-context N` to gather all context
12
+ 2. Optional: `draht-tools research-phase N` for domain research
13
13
  3. Goal-backward planning:
14
14
  a. State the goal (outcome, not activity)
15
15
  b. Derive observable truths (3-7 from user perspective)
16
16
  c. From each observable truth, derive the test scenarios that would prove it (specific inputs → expected outputs or state changes)
17
17
  d. Map to required artifacts (files, endpoints, schemas)
18
18
  e. Break into atomic tasks (2-5 per plan)
19
- 4. Write plans: `draht create-plan N P`
20
- 5. Validate: `draht validate-plans N`
21
- 6. Commit: `draht commit-docs "create phase N plans"`
19
+ 4. Write plans: `draht-tools create-plan N P`
20
+ 5. Validate: `draht-tools validate-plans N`
21
+ 6. Commit: `draht-tools commit-docs "create phase N plans"`
22
22
 
23
23
  ## Plan Format
24
24
  Plans use XML task format:
@@ -8,5 +8,5 @@ Show current project status.
8
8
  ```
9
9
 
10
10
  ## Steps
11
- 1. Run `draht progress` — outputs formatted status
11
+ 1. Run `draht-tools progress` — outputs formatted status
12
12
  2. Display the result as-is
@@ -8,12 +8,12 @@ Execute a small ad-hoc task with GSD tracking.
8
8
  ```
9
9
 
10
10
  ## Steps
11
- 1. Run `draht next-quick-number` to get task number
12
- 2. Create quick plan: `draht create-quick-plan NNN "description"`
11
+ 1. Run `draht-tools next-quick-number` to get task number
12
+ 2. Create quick plan: `draht-tools create-quick-plan NNN "description"`
13
13
  3. Execute tasks following the TDD cycle:
14
14
  - **🔴 RED** — Write a failing test that describes the desired behaviour
15
15
  - **🟢 GREEN** — Write the minimum implementation to make it pass
16
16
  - **🔵 REFACTOR** — Clean up while keeping the test green
17
17
  - *Exception: skip the TDD cycle only for pure config or documentation-only tasks that have no testable behaviour*
18
- 4. Write summary: `draht write-quick-summary NNN`
19
- 5. Update state: `draht update-state`
18
+ 4. Write summary: `draht-tools write-quick-summary NNN`
19
+ 5. Update state: `draht-tools update-state`
@@ -8,6 +8,6 @@ Resume from last session state.
8
8
  ```
9
9
 
10
10
  ## Steps
11
- 1. Run `draht resume` — loads CONTINUE-HERE.md or STATE.md
11
+ 1. Run `draht-tools resume` — loads CONTINUE-HERE.md or STATE.md
12
12
  2. Display context and ask to continue
13
13
  3. Delete CONTINUE-HERE.md after confirmation
@@ -0,0 +1,26 @@
1
+ # /review
2
+
3
+ Ad-hoc code review and security audit of recent changes or a specific scope.
4
+
5
+ ## Usage
6
+ ```
7
+ /review [scope]
8
+ ```
9
+
10
+ If no scope given, reviews all recent uncommitted changes.
11
+
12
+ ## Steps
13
+ 1. Identify the scope:
14
+ - If argument given: review those files/directories/description
15
+ - If no argument: run `git diff --stat` and `git diff --cached --stat` to find changes
16
+ 2. For each changed file, examine:
17
+ - Correctness: logic errors, off-by-one, null handling, error paths
18
+ - Type safety: any `as` casts, `any` types, missing null checks
19
+ - Conventions: naming, file organization, import style
20
+ - Security: injection risks, auth bypasses, secrets in code, unsafe deserialization
21
+ - Performance: unnecessary allocations, missing indexes, N+1 queries
22
+ 3. Produce a prioritized findings report:
23
+ - **Critical** — must fix before merge (security, data loss, crashes)
24
+ - **Important** — should fix (bugs, type issues, missing error handling)
25
+ - **Minor** — style, naming, or optional improvements
26
+ 4. For each finding: cite the exact file and line, explain the issue, suggest the fix
@@ -15,13 +15,13 @@ Walk through acceptance testing of completed phase work.
15
15
  - Load `.planning/DOMAIN.md` and extract all defined terms
16
16
  - Scan source files for PascalCase identifiers not present in the glossary
17
17
  - Flag any bounded context boundary violations (cross-context direct imports)
18
- 3. Run quality gate: `draht quality-gate --strict`
19
- 4. Run `draht extract-deliverables N` to get testable items
18
+ 3. Run quality gate: `draht-tools quality-gate --strict`
19
+ 4. Run `draht-tools extract-deliverables N` to get testable items
20
20
  5. Walk user through each deliverable one at a time
21
21
  6. Record results (pass/fail/partially/skip)
22
- 7. For failures: diagnose and create fix plans via `draht create-fix-plan N P`
22
+ 7. For failures: diagnose and create fix plans via `draht-tools create-fix-plan N P`
23
23
  - Fix plans MUST include a reproducing test that demonstrates the failure before any implementation
24
- 8. Write UAT report: `draht write-uat N`
24
+ 8. Write UAT report: `draht-tools write-uat N`
25
25
  - Report must include: test health summary (pass/fail/coverage), domain model status (any glossary violations), deliverable results
26
26
  9. If all passed: mark phase complete
27
27
  10. If failures: route to `execute-phase N --gaps-only`
@@ -2,14 +2,14 @@
2
2
 
3
3
  LLMs have limited context windows. When conversations grow too long, pi uses compaction to summarize older content while preserving recent work. This page covers both auto-compaction and branch summarization.
4
4
 
5
- **Source files** ([pi-mono](https://github.com/badlogic/pi-mono)):
6
- - [`packages/coding-agent/src/core/compaction/compaction.ts`](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) - Auto-compaction logic
7
- - [`packages/coding-agent/src/core/compaction/branch-summarization.ts`](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) - Branch summarization
8
- - [`packages/coding-agent/src/core/compaction/utils.ts`](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/src/core/compaction/utils.ts) - Shared utilities (file tracking, serialization)
9
- - [`packages/coding-agent/src/core/session-manager.ts`](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/src/core/session-manager.ts) - Entry types (`CompactionEntry`, `BranchSummaryEntry`)
10
- - [`packages/coding-agent/src/core/extensions/types.ts`](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/src/core/extensions/types.ts) - Extension event types
5
+ **Source files** ([pi-mono](https://github.com/draht-dev/draht)):
6
+ - [`packages/coding-agent/src/core/compaction/compaction.ts`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) - Auto-compaction logic
7
+ - [`packages/coding-agent/src/core/compaction/branch-summarization.ts`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) - Branch summarization
8
+ - [`packages/coding-agent/src/core/compaction/utils.ts`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/compaction/utils.ts) - Shared utilities (file tracking, serialization)
9
+ - [`packages/coding-agent/src/core/session-manager.ts`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/session-manager.ts) - Entry types (`CompactionEntry`, `BranchSummaryEntry`)
10
+ - [`packages/coding-agent/src/core/extensions/types.ts`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/extensions/types.ts) - Extension event types
11
11
 
12
- For TypeScript definitions in your project, inspect `node_modules/@mariozechner/pi-coding-agent/dist/`.
12
+ For TypeScript definitions in your project, inspect `node_modules/@draht/coding-agent/dist/`.
13
13
 
14
14
  ## Overview
15
15
 
@@ -116,7 +116,7 @@ Never cut at tool results (they must stay with their tool call).
116
116
 
117
117
  ### CompactionEntry Structure
118
118
 
119
- Defined in [`session-manager.ts`](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/src/core/session-manager.ts):
119
+ Defined in [`session-manager.ts`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/session-manager.ts):
120
120
 
121
121
  ```typescript
122
122
  interface CompactionEntry<T = unknown> {
@@ -140,7 +140,7 @@ interface CompactionDetails {
140
140
 
141
141
  Extensions can store any JSON-serializable data in `details`. The default compaction tracks file operations, but custom extension implementations can use their own structure.
142
142
 
143
- See [`prepareCompaction()`](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) and [`compact()`](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) for the implementation.
143
+ See [`prepareCompaction()`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) and [`compact()`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) for the implementation.
144
144
 
145
145
  ## Branch Summarization
146
146
 
@@ -183,7 +183,7 @@ This means file tracking accumulates across multiple compactions or nested branc
183
183
 
184
184
  ### BranchSummaryEntry Structure
185
185
 
186
- Defined in [`session-manager.ts`](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/src/core/session-manager.ts):
186
+ Defined in [`session-manager.ts`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/session-manager.ts):
187
187
 
188
188
  ```typescript
189
189
  interface BranchSummaryEntry<T = unknown> {
@@ -206,7 +206,7 @@ interface BranchSummaryDetails {
206
206
 
207
207
  Same as compaction, extensions can store custom data in `details`.
208
208
 
209
- See [`collectEntriesForBranchSummary()`](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts), [`prepareBranchEntries()`](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts), and [`generateBranchSummary()`](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) for the implementation.
209
+ See [`collectEntriesForBranchSummary()`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts), [`prepareBranchEntries()`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts), and [`generateBranchSummary()`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) for the implementation.
210
210
 
211
211
  ## Summary Format
212
212
 
@@ -250,7 +250,7 @@ path/to/changed.ts
250
250
 
251
251
  ### Message Serialization
252
252
 
253
- Before summarization, messages are serialized to text via [`serializeConversation()`](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/src/core/compaction/utils.ts):
253
+ Before summarization, messages are serialized to text via [`serializeConversation()`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/compaction/utils.ts):
254
254
 
255
255
  ```
256
256
  [User]: What they said
@@ -264,7 +264,7 @@ This prevents the model from treating it as a conversation to continue.
264
264
 
265
265
  ## Custom Summarization via Extensions
266
266
 
267
- Extensions can intercept and customize both compaction and branch summarization. See [`extensions/types.ts`](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/src/core/extensions/types.ts) for event type definitions.
267
+ Extensions can intercept and customize both compaction and branch summarization. See [`extensions/types.ts`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/extensions/types.ts) for event type definitions.
268
268
 
269
269
  ### session_before_compact
270
270
 
@@ -305,7 +305,7 @@ pi.on("session_before_compact", async (event, ctx) => {
305
305
  To generate a summary with your own model, convert messages to text using `serializeConversation`:
306
306
 
307
307
  ```typescript
308
- import { convertToLlm, serializeConversation } from "@mariozechner/pi-coding-agent";
308
+ import { convertToLlm, serializeConversation } from "@draht/coding-agent";
309
309
 
310
310
  pi.on("session_before_compact", async (event, ctx) => {
311
311
  const { preparation } = event;
@@ -31,7 +31,7 @@ See these complete provider examples:
31
31
  ## Quick Reference
32
32
 
33
33
  ```typescript
34
- import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
34
+ import type { ExtensionAPI } from "@draht/coding-agent";
35
35
 
36
36
  export default function (pi: ExtensionAPI) {
37
37
  // Override baseUrl for existing provider
@@ -172,10 +172,17 @@ models: [{
172
172
  // ...
173
173
  compat: {
174
174
  supportsDeveloperRole: false, // use "system" instead of "developer"
175
- supportsReasoningEffort: false, // disable reasoning_effort param
175
+ supportsReasoningEffort: true,
176
+ reasoningEffortMap: { // map pi-ai levels to provider values
177
+ minimal: "default",
178
+ low: "default",
179
+ medium: "default",
180
+ high: "default",
181
+ xhigh: "default"
182
+ },
176
183
  maxTokensField: "max_tokens", // instead of "max_completion_tokens"
177
184
  requiresToolResultName: true, // tool results need name field
178
- requiresMistralToolIds: true // tool IDs must be 9 alphanumeric chars
185
+ requiresMistralToolIds: true,
179
186
  thinkingFormat: "qwen" // uses enable_thinking: true
180
187
  }
181
188
  }]
@@ -200,7 +207,7 @@ pi.registerProvider("custom-api", {
200
207
  Add OAuth/SSO authentication that integrates with `/login`:
201
208
 
202
209
  ```typescript
203
- import type { OAuthCredentials, OAuthLoginCallbacks } from "@mariozechner/pi-ai";
210
+ import type { OAuthCredentials, OAuthLoginCallbacks } from "@draht/ai";
204
211
 
205
212
  pi.registerProvider("corporate-ai", {
206
213
  baseUrl: "https://ai.corp.com/v1",
@@ -293,11 +300,11 @@ interface OAuthCredentials {
293
300
  For providers with non-standard APIs, implement `streamSimple`. Study the existing provider implementations before writing your own:
294
301
 
295
302
  **Reference implementations:**
296
- - [anthropic.ts](https://github.com/badlogic/pi-mono/blob/main/packages/ai/src/providers/anthropic.ts) - Anthropic Messages API
297
- - [openai-completions.ts](https://github.com/badlogic/pi-mono/blob/main/packages/ai/src/providers/openai-completions.ts) - OpenAI Chat Completions
298
- - [openai-responses.ts](https://github.com/badlogic/pi-mono/blob/main/packages/ai/src/providers/openai-responses.ts) - OpenAI Responses API
299
- - [google.ts](https://github.com/badlogic/pi-mono/blob/main/packages/ai/src/providers/google.ts) - Google Generative AI
300
- - [amazon-bedrock.ts](https://github.com/badlogic/pi-mono/blob/main/packages/ai/src/providers/amazon-bedrock.ts) - AWS Bedrock
303
+ - [anthropic.ts](https://github.com/draht-dev/draht/blob/main/packages/ai/src/providers/anthropic.ts) - Anthropic Messages API
304
+ - [openai-completions.ts](https://github.com/draht-dev/draht/blob/main/packages/ai/src/providers/openai-completions.ts) - OpenAI Chat Completions
305
+ - [openai-responses.ts](https://github.com/draht-dev/draht/blob/main/packages/ai/src/providers/openai-responses.ts) - OpenAI Responses API
306
+ - [google.ts](https://github.com/draht-dev/draht/blob/main/packages/ai/src/providers/google.ts) - Google Generative AI
307
+ - [amazon-bedrock.ts](https://github.com/draht-dev/draht/blob/main/packages/ai/src/providers/amazon-bedrock.ts) - AWS Bedrock
301
308
 
302
309
  ### Stream Pattern
303
310
 
@@ -312,7 +319,7 @@ import {
312
319
  type SimpleStreamOptions,
313
320
  calculateCost,
314
321
  createAssistantMessageEventStream,
315
- } from "@mariozechner/pi-ai";
322
+ } from "@draht/ai";
316
323
 
317
324
  function streamMyProvider(
318
325
  model: Model<any>,
@@ -469,7 +476,7 @@ pi.registerProvider("my-provider", {
469
476
 
470
477
  ## Testing Your Implementation
471
478
 
472
- Test your provider against the same test suites used by built-in providers. Copy and adapt these test files from [packages/ai/test/](https://github.com/badlogic/pi-mono/tree/main/packages/ai/test):
479
+ Test your provider against the same test suites used by built-in providers. Copy and adapt these test files from [packages/ai/test/](https://github.com/draht-dev/draht/tree/main/packages/ai/test):
473
480
 
474
481
  | Test | Purpose |
475
482
  |------|---------|
@@ -568,6 +575,7 @@ interface ProviderModelConfig {
568
575
  supportsStore?: boolean;
569
576
  supportsDeveloperRole?: boolean;
570
577
  supportsReasoningEffort?: boolean;
578
+ reasoningEffortMap?: Partial<Record<"minimal" | "low" | "medium" | "high" | "xhigh", string>>;
571
579
  supportsUsageInStreaming?: boolean;
572
580
  maxTokensField?: "max_completion_tokens" | "max_tokens";
573
581
  requiresToolResultName?: boolean;
@@ -5,7 +5,7 @@ See [AGENTS.md](../../../AGENTS.md) for additional guidelines.
5
5
  ## Setup
6
6
 
7
7
  ```bash
8
- git clone https://github.com/badlogic/pi-mono
8
+ git clone https://github.com/draht-dev/draht
9
9
  cd pi-mono
10
10
  npm install
11
11
  npm run build