@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.
- package/CHANGELOG.md +194 -13
- package/README.md +90 -106
- package/agents/architect.md +45 -0
- package/agents/debugger.md +57 -0
- package/agents/git-committer.md +46 -0
- package/agents/implementer.md +25 -0
- package/agents/reviewer.md +52 -0
- package/agents/security-auditor.md +61 -0
- package/agents/verifier.md +44 -0
- package/bin/draht-tools.cjs +20 -20
- package/dist/agents/architect.md +45 -0
- package/dist/agents/debugger.md +57 -0
- package/dist/agents/git-committer.md +46 -0
- package/dist/agents/implementer.md +25 -0
- package/dist/agents/reviewer.md +52 -0
- package/dist/agents/security-auditor.md +61 -0
- package/dist/agents/verifier.md +44 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +1 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +5 -0
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +0 -7
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -14
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session.d.ts +14 -4
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +167 -49
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +2 -1
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/builtins/subagent.d.ts +14 -0
- package/dist/core/builtins/subagent.d.ts.map +1 -0
- package/dist/core/builtins/subagent.js +492 -0
- package/dist/core/builtins/subagent.js.map +1 -0
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +4 -1
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +6 -0
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +19 -8
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +1 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +8 -2
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/model-registry.d.ts +1 -0
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +9 -6
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +35 -5
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/resource-loader.d.ts +2 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +5 -1
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +3 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +4 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/system-prompt.d.ts +4 -0
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +34 -12
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/edit-diff.js.map +1 -1
- package/dist/core/tools/path-utils.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +5 -5
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +3 -3
- package/dist/migrations.js.map +1 -1
- package/dist/modes/interactive/components/armin.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/daxnuts.js.map +1 -1
- package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts +5 -2
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +9 -1
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +1 -1
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +1 -1
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +1 -1
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +2 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +28 -3
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts +1 -0
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +11 -0
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +28 -27
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/dark.json +1 -1
- package/dist/modes/interactive/theme/light.json +1 -1
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +5 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/prompts/commands/discuss-phase.md +3 -3
- package/dist/prompts/commands/execute-phase.md +9 -9
- package/dist/prompts/commands/fix.md +29 -0
- package/dist/prompts/commands/init-project.md +49 -0
- package/dist/prompts/commands/map-codebase.md +2 -2
- package/dist/prompts/commands/new-project.md +9 -9
- package/dist/prompts/commands/next-milestone.md +44 -0
- package/dist/prompts/commands/pause-work.md +2 -2
- package/dist/prompts/commands/plan-phase.md +5 -5
- package/dist/prompts/commands/progress.md +1 -1
- package/dist/prompts/commands/quick.md +4 -4
- package/dist/prompts/commands/resume-work.md +1 -1
- package/dist/prompts/commands/review.md +26 -0
- package/dist/prompts/commands/verify-work.md +4 -4
- package/docs/compaction.md +14 -14
- package/docs/custom-provider.md +19 -11
- package/docs/development.md +1 -1
- package/docs/extensions.md +52 -33
- package/docs/json.md +4 -4
- package/docs/packages.md +1 -1
- package/docs/providers.md +4 -2
- package/docs/rpc.md +1 -1
- package/docs/sdk.md +24 -24
- package/docs/session.md +6 -6
- package/docs/settings.md +1 -0
- package/docs/termux.md +1 -1
- package/docs/themes.md +2 -2
- package/docs/tui.md +20 -20
- package/examples/extensions/README.md +5 -4
- package/examples/extensions/antigravity-image-gen.ts +3 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/custom-provider-qwen-cli/package.json +1 -1
- package/examples/extensions/doom-overlay/README.md +1 -1
- package/examples/extensions/dynamic-resources/dynamic.json +1 -1
- package/examples/extensions/dynamic-tools.ts +74 -0
- package/examples/extensions/subagent/README.md +11 -11
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/sdk/README.md +3 -3
- package/package.json +11 -8
- package/prompts/commands/discuss-phase.md +3 -3
- package/prompts/commands/execute-phase.md +9 -9
- package/prompts/commands/fix.md +29 -0
- package/prompts/commands/init-project.md +49 -0
- package/prompts/commands/map-codebase.md +2 -2
- package/prompts/commands/new-project.md +9 -9
- package/prompts/commands/next-milestone.md +44 -0
- package/prompts/commands/pause-work.md +2 -2
- package/prompts/commands/plan-phase.md +5 -5
- package/prompts/commands/progress.md +1 -1
- package/prompts/commands/quick.md +4 -4
- package/prompts/commands/resume-work.md +1 -1
- package/prompts/commands/review.md +26 -0
- package/prompts/commands/verify-work.md +4 -4
- package/dist/extensions/gsd-commands.ts +0 -338
- package/dist/extensions/subagent.ts +0 -312
- package/extensions/gsd-commands.ts +0 -338
- 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,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`
|
package/docs/compaction.md
CHANGED
|
@@ -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/
|
|
6
|
-
- [`packages/coding-agent/src/core/compaction/compaction.ts`](https://github.com/
|
|
7
|
-
- [`packages/coding-agent/src/core/compaction/branch-summarization.ts`](https://github.com/
|
|
8
|
-
- [`packages/coding-agent/src/core/compaction/utils.ts`](https://github.com/
|
|
9
|
-
- [`packages/coding-agent/src/core/session-manager.ts`](https://github.com/
|
|
10
|
-
- [`packages/coding-agent/src/core/extensions/types.ts`](https://github.com/
|
|
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/@
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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 "@
|
|
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;
|
package/docs/custom-provider.md
CHANGED
|
@@ -31,7 +31,7 @@ See these complete provider examples:
|
|
|
31
31
|
## Quick Reference
|
|
32
32
|
|
|
33
33
|
```typescript
|
|
34
|
-
import type { ExtensionAPI } from "@
|
|
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:
|
|
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
|
|
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 "@
|
|
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/
|
|
297
|
-
- [openai-completions.ts](https://github.com/
|
|
298
|
-
- [openai-responses.ts](https://github.com/
|
|
299
|
-
- [google.ts](https://github.com/
|
|
300
|
-
- [amazon-bedrock.ts](https://github.com/
|
|
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 "@
|
|
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/
|
|
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;
|