@draht/coding-agent 2026.3.5 → 2026.3.11-1
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 +55 -0
- package/README.md +6 -2
- package/agents/architect.md +1 -0
- package/agents/debugger.md +1 -0
- package/agents/git-committer.md +1 -0
- package/agents/implementer.md +1 -0
- package/agents/reviewer.md +1 -0
- package/agents/security-auditor.md +1 -0
- package/agents/verifier.md +1 -0
- package/dist/agents/architect.md +1 -0
- package/dist/agents/debugger.md +1 -0
- package/dist/agents/git-committer.md +1 -0
- package/dist/agents/implementer.md +1 -0
- package/dist/agents/reviewer.md +1 -0
- package/dist/agents/security-auditor.md +1 -0
- package/dist/agents/verifier.md +1 -0
- package/dist/cli/args.d.ts +6 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +24 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/attach-mode.d.ts +13 -0
- package/dist/cli/attach-mode.d.ts.map +1 -0
- package/dist/cli/attach-mode.js +97 -0
- package/dist/cli/attach-mode.js.map +1 -0
- package/dist/cli/list-sessions.d.ts +8 -0
- package/dist/cli/list-sessions.d.ts.map +1 -0
- package/dist/cli/list-sessions.js +52 -0
- package/dist/cli/list-sessions.js.map +1 -0
- package/dist/config.d.ts +7 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +15 -0
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session.d.ts +1 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +50 -17
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +2 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +25 -1
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/compaction/utils.d.ts +3 -0
- package/dist/core/compaction/utils.d.ts.map +1 -1
- package/dist/core/compaction/utils.js +16 -1
- package/dist/core/compaction/utils.js.map +1 -1
- package/dist/core/export-html/index.d.ts +5 -2
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/index.js +4 -3
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/export-html/template.js +11 -14
- package/dist/core/export-html/tool-renderer.d.ts +5 -2
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +12 -5
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +6 -6
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +3 -2
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +32 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +21 -2
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +2 -2
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +8 -8
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +4 -4
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +10 -9
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +7 -0
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/settings-manager.d.ts +4 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +38 -4
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +3 -3
- package/dist/core/skills.js.map +1 -1
- package/dist/core/socket-server/discovery.d.ts +19 -0
- package/dist/core/socket-server/discovery.d.ts.map +1 -0
- package/dist/core/socket-server/discovery.js +91 -0
- package/dist/core/socket-server/discovery.js.map +1 -0
- package/dist/core/socket-server/index.d.ts +13 -0
- package/dist/core/socket-server/index.d.ts.map +1 -0
- package/dist/core/socket-server/index.js +11 -0
- package/dist/core/socket-server/index.js.map +1 -0
- package/dist/core/socket-server/session-integration.d.ts +17 -0
- package/dist/core/socket-server/session-integration.d.ts.map +1 -0
- package/dist/core/socket-server/session-integration.js +77 -0
- package/dist/core/socket-server/session-integration.js.map +1 -0
- package/dist/core/socket-server/socket-client.d.ts +65 -0
- package/dist/core/socket-server/socket-client.d.ts.map +1 -0
- package/dist/core/socket-server/socket-client.js +197 -0
- package/dist/core/socket-server/socket-client.js.map +1 -0
- package/dist/core/socket-server/socket-server.d.ts +60 -0
- package/dist/core/socket-server/socket-server.d.ts.map +1 -0
- package/dist/core/socket-server/socket-server.js +273 -0
- package/dist/core/socket-server/socket-server.js.map +1 -0
- package/dist/core/socket-server/types.d.ts +81 -0
- package/dist/core/socket-server/types.d.ts.map +1 -0
- package/dist/core/socket-server/types.js +8 -0
- package/dist/core/socket-server/types.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +76 -11
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +2 -2
- package/dist/migrations.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +3 -3
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +1 -0
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +8 -23
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +2 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +10 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +14 -4
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts +21 -2
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +115 -9
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +64 -5
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/rpc/jsonl.d.ts +17 -0
- package/dist/modes/rpc/jsonl.d.ts.map +1 -0
- package/dist/modes/rpc/jsonl.js +49 -0
- package/dist/modes/rpc/jsonl.js.map +1 -0
- package/dist/modes/rpc/rpc-client.d.ts +1 -1
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +7 -11
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +9 -11
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/prompts/commands/discuss-phase.md +10 -0
- package/dist/prompts/commands/execute-phase.md +51 -34
- package/dist/prompts/commands/fix.md +8 -6
- package/dist/prompts/commands/init-project.md +12 -0
- package/dist/prompts/commands/map-codebase.md +17 -18
- package/dist/prompts/commands/new-project.md +12 -0
- package/dist/prompts/commands/next-milestone.md +5 -3
- package/dist/prompts/commands/plan-phase.md +27 -5
- package/dist/prompts/commands/quick.md +12 -5
- package/dist/prompts/commands/review.md +10 -10
- package/dist/prompts/commands/verify-work.md +31 -17
- package/docs/compaction.md +2 -0
- package/docs/custom-provider.md +11 -7
- package/docs/extensions.md +55 -3
- package/docs/keybindings.md +9 -1
- package/docs/models.md +5 -1
- package/docs/rpc.md +40 -3
- package/docs/session.md +2 -2
- package/docs/settings.md +1 -0
- package/docs/terminal-setup.md +28 -3
- package/docs/tmux.md +61 -0
- package/docs/tree.md +9 -0
- package/examples/extensions/overlay-qa-tests.ts +468 -1
- package/examples/extensions/provider-payload.ts +14 -0
- package/examples/extensions/with-deps/index.ts +1 -5
- package/package.json +7 -5
- package/prompts/commands/discuss-phase.md +10 -0
- package/prompts/commands/execute-phase.md +51 -34
- package/prompts/commands/fix.md +8 -6
- package/prompts/commands/init-project.md +12 -0
- package/prompts/commands/map-codebase.md +17 -18
- package/prompts/commands/new-project.md +12 -0
- package/prompts/commands/next-milestone.md +5 -3
- package/prompts/commands/plan-phase.md +27 -5
- package/prompts/commands/quick.md +12 -5
- package/prompts/commands/review.md +10 -10
- package/prompts/commands/verify-work.md +31 -17
package/prompts/commands/fix.md
CHANGED
|
@@ -4,7 +4,7 @@ description: "Diagnose and fix a bug with TDD discipline"
|
|
|
4
4
|
|
|
5
5
|
# /fix
|
|
6
6
|
|
|
7
|
-
Diagnose and fix a specific bug or failing task with TDD discipline.
|
|
7
|
+
Diagnose and fix a specific bug or failing task with TDD discipline, using a subagent for diagnosis.
|
|
8
8
|
|
|
9
9
|
## Usage
|
|
10
10
|
```
|
|
@@ -14,19 +14,21 @@ Diagnose and fix a specific bug or failing task with TDD discipline.
|
|
|
14
14
|
Issue: $ARGUMENTS
|
|
15
15
|
|
|
16
16
|
## Steps
|
|
17
|
-
1. **Diagnose**:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
2. **Write a reproducing test**:
|
|
21
|
-
- Write a test that demonstrates the bug (it must fail)
|
|
17
|
+
1. **Diagnose via subagent**: Use the `subagent` tool in **single mode** with the `debugger` agent:
|
|
18
|
+
"Diagnose this issue: $ARGUMENTS. Reproduce the bug by running the relevant test or command. Trace the root cause by reading the code. Identify the exact files and lines involved. Do NOT fix it yet — only report the diagnosis with: root cause, affected files, and a recommended fix approach. Do NOT run draht, draht-tools, or pi commands."
|
|
19
|
+
|
|
20
|
+
2. **Write a reproducing test**: Based on the diagnosis, write a test that demonstrates the bug (it must fail)
|
|
22
21
|
- Commit: `draht-tools commit-docs "red: reproduce bug"`
|
|
22
|
+
|
|
23
23
|
3. **Minimal fix**: Write the smallest change that makes the test pass
|
|
24
24
|
- Do not refactor or add features — just fix the bug
|
|
25
25
|
- Run the full test suite to check for regressions
|
|
26
26
|
- Commit: `draht-tools commit-docs "green: fix description"`
|
|
27
|
+
|
|
27
28
|
4. **Refactor** (if needed): Clean up without changing behavior
|
|
28
29
|
- Tests must stay green after every change
|
|
29
30
|
- Commit: `draht-tools commit-docs "refactor: description"`
|
|
31
|
+
|
|
30
32
|
5. **Update state**: `draht-tools update-state`
|
|
31
33
|
|
|
32
34
|
## Rules
|
|
@@ -45,6 +45,18 @@ For greenfield projects, use `/new-project` instead.
|
|
|
45
45
|
12. Run `draht-tools init-state`
|
|
46
46
|
13. Git commit via `draht-tools commit-docs "initialize project planning"`
|
|
47
47
|
|
|
48
|
+
## Workflow
|
|
49
|
+
After project initialization, phases are executed one at a time in new sessions:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
/init-project → /new → /discuss-phase 1 → /new → /plan-phase 1 → /new → /execute-phase 1 → /new → /verify-work 1
|
|
53
|
+
→ /new → /discuss-phase 2 → /new → /plan-phase 2 → /new → /execute-phase 2 → /new → /verify-work 2
|
|
54
|
+
→ ... (repeat for all phases in the milestone)
|
|
55
|
+
→ /new → /next-milestone (only after ALL phases are complete)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Each step runs in its own session (`/new` between steps). Do NOT suggest `/next-milestone` until every phase in the milestone is verified.
|
|
59
|
+
|
|
48
60
|
## Rules
|
|
49
61
|
- Ask 1-2 questions at a time, never dump 10 at once
|
|
50
62
|
- Follow threads based on answers
|
|
@@ -4,7 +4,7 @@ description: "Analyze existing codebase before planning"
|
|
|
4
4
|
|
|
5
5
|
# /map-codebase
|
|
6
6
|
|
|
7
|
-
Analyze existing codebase before planning.
|
|
7
|
+
Analyze existing codebase before planning, using subagents for parallel analysis.
|
|
8
8
|
|
|
9
9
|
## Usage
|
|
10
10
|
```
|
|
@@ -16,23 +16,22 @@ Directory: $1
|
|
|
16
16
|
## Steps
|
|
17
17
|
1. Run `draht-tools map-codebase $1`
|
|
18
18
|
2. Tool generates: STACK.md, ARCHITECTURE.md, CONVENTIONS.md, CONCERNS.md
|
|
19
|
-
3.
|
|
20
|
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
6. If `.planning/DOMAIN.md` does not already exist, create it with:
|
|
19
|
+
3. **Run parallel deep analysis via subagents:**
|
|
20
|
+
Use the `subagent` tool in **parallel mode** with these tasks:
|
|
21
|
+
- `architect` agent: "Analyze the codebase at $1. Identify bounded contexts from directory structure — look for top-level src/ subdirectories, packages, or modules that encapsulate coherent domain concepts. Note any cross-directory coupling suggesting blurred context boundaries. Extract domain language: collect PascalCase class/interface/type names, key function names, database table/collection names. Look for repeated nouns representing core domain concepts. Output a structured list of: bounded contexts (name + description), domain terms (glossary), aggregates per context, and context relationships (upstream/downstream, shared kernel, ACL). Do NOT run draht, draht-tools, or pi commands."
|
|
22
|
+
- `verifier` agent: "Analyze the test infrastructure at $1. Discover: test framework(s) in use (check package.json, config files), test directory conventions (co-located, __tests__/, test/), existing coverage configuration and goals, which layers have tests (unit, integration, e2e), gaps and recommendations. Output a structured test strategy report. Do NOT run draht, draht-tools, or pi commands."
|
|
23
|
+
|
|
24
|
+
4. Collect subagent results and merge with the draht-tools output
|
|
25
|
+
5. Create `.planning/DOMAIN.md` (if it doesn't exist) with:
|
|
27
26
|
- `## Bounded Contexts` — one entry per discovered context with a brief description
|
|
28
27
|
- `## Ubiquitous Language` — glossary of extracted domain terms
|
|
29
|
-
- `## Context Map` —
|
|
30
|
-
- `## Aggregates` —
|
|
28
|
+
- `## Context Map` — how bounded contexts relate (upstream/downstream, shared kernel, ACL)
|
|
29
|
+
- `## Aggregates` — aggregates and their root entities per context
|
|
31
30
|
- `## Domain Events` — any existing event names or patterns discovered
|
|
32
|
-
|
|
33
|
-
- Test
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
|
|
31
|
+
6. Create `.planning/TEST-STRATEGY.md` with:
|
|
32
|
+
- `## Test Framework` — chosen framework and rationale
|
|
33
|
+
- `## Directory Conventions` — where test files live relative to source
|
|
34
|
+
- `## Coverage Goals` — target coverage percentage and which paths are critical
|
|
35
|
+
- `## Testing Levels` — what is tested at unit level vs integration vs e2e, with examples
|
|
36
|
+
- `## Excluded` — what is explicitly not tested and why
|
|
37
|
+
7. Commit: `draht-tools commit-docs "map existing codebase"`
|
|
@@ -37,6 +37,18 @@ Description: $ARGUMENTS
|
|
|
37
37
|
11. Run `draht-tools init-state`
|
|
38
38
|
12. Git commit via `draht-tools commit-docs "initialize project planning"`
|
|
39
39
|
|
|
40
|
+
## Workflow
|
|
41
|
+
After project initialization, phases are executed one at a time in new sessions:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
/new-project → /new → /discuss-phase 1 → /new → /plan-phase 1 → /new → /execute-phase 1 → /new → /verify-work 1
|
|
45
|
+
→ /new → /discuss-phase 2 → /new → /plan-phase 2 → /new → /execute-phase 2 → /new → /verify-work 2
|
|
46
|
+
→ ... (repeat for all phases in the milestone)
|
|
47
|
+
→ /new → /next-milestone (only after ALL phases are complete)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Each step runs in its own session (`/new` between steps). Do NOT suggest `/next-milestone` until every phase in the milestone is verified.
|
|
51
|
+
|
|
40
52
|
## Rules
|
|
41
53
|
- Ask 1-2 questions at a time, never dump 10 at once
|
|
42
54
|
- Follow threads based on answers
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "Plan the next milestone after current
|
|
2
|
+
description: "Plan the next milestone after ALL phases in the current milestone are complete"
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# /next-milestone
|
|
6
6
|
|
|
7
|
-
Plan the next milestone after the current one
|
|
7
|
+
Plan the next milestone after ALL phases in the current one are complete.
|
|
8
8
|
|
|
9
9
|
## Usage
|
|
10
10
|
```
|
|
@@ -13,7 +13,9 @@ Plan the next milestone after the current one is complete.
|
|
|
13
13
|
|
|
14
14
|
## Prerequisites
|
|
15
15
|
- `.planning/ROADMAP.md` must exist
|
|
16
|
-
-
|
|
16
|
+
- ALL phases in the current milestone must be complete (verified via /verify-work)
|
|
17
|
+
- This command is ONLY for milestone transitions — NOT for moving between phases within a milestone
|
|
18
|
+
- Between phases, use `/discuss-phase`, `/plan-phase`, `/execute-phase`, `/verify-work` — never `/next-milestone`
|
|
17
19
|
|
|
18
20
|
## Steps
|
|
19
21
|
1. Load project context:
|
|
@@ -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
|
|
25
|
-
4.
|
|
26
|
-
5.
|
|
27
|
-
|
|
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.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
-
|
|
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
|
-
|
|
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:
|
|
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.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
|
|
24
|
-
3.
|
|
25
|
-
4.
|
|
26
|
-
5.
|
|
27
|
-
6.
|
|
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
|
-
|
|
31
|
-
- Report must include: test health summary (pass/fail/coverage), domain model status (any glossary violations), deliverable results
|
|
32
|
-
|
|
33
|
-
|
|
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.
|