draht-codex 2026.10.20 → 2026.10.23
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/.codex-plugin/plugin.json +1 -1
- package/CHANGELOG.md +16 -0
- package/agents/advisor.md +2 -2
- package/agents/architect.md +10 -71
- package/agents/debugger.md +12 -82
- package/agents/git-committer.md +10 -52
- package/agents/implementer.md +15 -63
- package/agents/investigator.md +11 -63
- package/agents/reviewer.md +15 -65
- package/agents/security-auditor.md +12 -105
- package/agents/spec-reviewer.md +12 -53
- package/agents/verifier.md +13 -54
- package/commands/atomic-commit.md +9 -9
- package/commands/create-verification-skill.md +8 -48
- package/commands/discuss-phase.md +5 -9
- package/commands/execute-phase.md +17 -47
- package/commands/fix.md +16 -130
- package/commands/grill.md +6 -51
- package/commands/init-project.md +10 -14
- package/commands/map-codebase.md +2 -2
- package/commands/new-project.md +9 -14
- package/commands/next-milestone.md +3 -7
- package/commands/orchestrate-loop.md +12 -12
- package/commands/orchestrate.md +12 -11
- package/commands/pause-work.md +1 -1
- package/commands/plan-phase.md +16 -38
- package/commands/quick.md +9 -78
- package/commands/resolve-conflicts.md +2 -15
- package/commands/triage.md +3 -14
- package/commands/verify-work.md +17 -106
- package/commands/why.md +18 -118
- package/hooks/hooks.json +10 -0
- package/package.json +4 -4
- package/scripts/checks-runtime.cjs +215 -0
- package/scripts/git-safety-hook.cjs +21 -0
- package/scripts/git-safety.cjs +198 -0
- package/scripts/gsd-post-task.cjs +78 -39
- package/scripts/gsd-quality-gate.cjs +206 -120
- package/scripts/prompt-context.cjs +40 -6
- package/scripts/session-start.cjs +6 -4
- package/scripts/stop-quality-gate.cjs +55 -25
- package/skills/atomic-commit/command.md +9 -9
- package/skills/atomic-reasoning/SKILL.md +6 -105
- package/skills/blast-radius/SKILL.md +1 -1
- package/skills/brainstorming/SKILL.md +8 -126
- package/skills/create-verification-skill/SKILL.md +1 -1
- package/skills/create-verification-skill/command.md +8 -48
- package/skills/ddd-workflow/SKILL.md +8 -101
- package/skills/debugging-workflow/SKILL.md +12 -122
- package/skills/discuss-phase/SKILL.md +1 -0
- package/skills/discuss-phase/agents/openai.yaml +2 -0
- package/skills/discuss-phase/command.md +5 -9
- package/skills/draht/SKILL.md +18 -14
- package/skills/epistemics/SKILL.md +12 -87
- package/skills/execute-phase/SKILL.md +1 -0
- package/skills/execute-phase/agents/openai.yaml +2 -0
- package/skills/execute-phase/command.md +17 -47
- package/skills/explainers/SKILL.md +1 -1
- package/skills/fix/SKILL.md +2 -1
- package/skills/fix/agents/openai.yaml +2 -0
- package/skills/fix/command.md +16 -130
- package/skills/grill/SKILL.md +1 -1
- package/skills/grill/command.md +6 -51
- package/skills/gsd-workflow/SKILL.md +37 -21
- package/skills/gsd-workflow/agents/openai.yaml +2 -0
- package/skills/init-project/SKILL.md +1 -0
- package/skills/init-project/agents/openai.yaml +2 -0
- package/skills/init-project/command.md +10 -14
- package/skills/loop-workflow/SKILL.md +7 -41
- package/skills/map-codebase/command.md +2 -2
- package/skills/model-tiering/SKILL.md +7 -7
- package/skills/new-project/SKILL.md +1 -0
- package/skills/new-project/agents/openai.yaml +2 -0
- package/skills/new-project/command.md +9 -14
- package/skills/next-milestone/SKILL.md +1 -0
- package/skills/next-milestone/agents/openai.yaml +2 -0
- package/skills/next-milestone/command.md +3 -7
- package/skills/orchestrate/command.md +12 -11
- package/skills/orchestrate-loop/command.md +12 -12
- package/skills/pause-work/SKILL.md +1 -0
- package/skills/pause-work/agents/openai.yaml +2 -0
- package/skills/pause-work/command.md +1 -1
- package/skills/plan-phase/SKILL.md +1 -0
- package/skills/plan-phase/agents/openai.yaml +2 -0
- package/skills/plan-phase/command.md +16 -38
- package/skills/progress/SKILL.md +1 -0
- package/skills/progress/agents/openai.yaml +2 -0
- package/skills/quick/SKILL.md +2 -1
- package/skills/quick/agents/openai.yaml +2 -0
- package/skills/quick/command.md +9 -78
- package/skills/resolve-conflicts/command.md +2 -15
- package/skills/resume-work/SKILL.md +1 -0
- package/skills/resume-work/agents/openai.yaml +2 -0
- package/skills/saga-spawner/SKILL.md +1 -1
- package/skills/tdd-workflow/SKILL.md +15 -104
- package/skills/triage/SKILL.md +2 -1
- package/skills/triage/agents/openai.yaml +2 -0
- package/skills/triage/command.md +3 -14
- package/skills/typescript-discipline/SKILL.md +12 -42
- package/skills/typescript-discipline/references/patterns.md +25 -266
- package/skills/unslop/SKILL.md +14 -105
- package/skills/verification-gate/SKILL.md +16 -76
- package/skills/verify-work/SKILL.md +1 -0
- package/skills/verify-work/agents/openai.yaml +2 -0
- package/skills/verify-work/command.md +17 -106
- package/skills/why/SKILL.md +1 -1
- package/skills/why/command.md +18 -118
|
@@ -13,22 +13,9 @@ Arguments: $ARGUMENTS
|
|
|
13
13
|
|
|
14
14
|
> **Tool note**: Invoke `draht-tools <subcommand>` as `node "${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-$HOME/.draht/codex-marketplace/plugins/draht}}/bin/draht-tools.cjs" <subcommand>`. For subagent delegation, spawn Codex subagents using the `implementer`, `spec-reviewer`, or `reviewer` agent prompts. Dispatch multiple parallel tasks in a single assistant turn by making multiple Codex subagent calls at once.
|
|
15
15
|
|
|
16
|
-
##
|
|
16
|
+
## Execution prerequisites
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- `gsd-pre-execute.cjs` exits non-zero (missing DOMAIN.md, missing plans, uncommitted changes blocking start)
|
|
21
|
-
- Any plan file contains placeholder text: `[TBD]`, `[files]`, `[description]`, "appropriate error handling", "similar to Task N", "..." in code positions, or empty `<test>` / `<action>` / `<verify>` / `<done>` sections — these are not executable
|
|
22
|
-
- A plan has zero `<task>` elements
|
|
23
|
-
- `.planning/DOMAIN.md` is absent on a non-greenfield project — implementers will guess at naming
|
|
24
|
-
- The working tree is dirty with changes unrelated to this phase
|
|
25
|
-
- An implementer subagent returns `STATUS: BLOCKED` — never retry blindly; report what blocked it and ask the user
|
|
26
|
-
|
|
27
|
-
## Atomic Reasoning
|
|
28
|
-
|
|
29
|
-
Decompose the work into independently verifiable units before acting; the `atomic-reasoning` skill holds the full discipline — load it when the decomposition is not obvious.
|
|
30
|
-
|
|
31
|
-
Within each group of independent plans, dispatch the riskiest plan first (highest uncertainty × blast radius) — its failure invalidates the rest of the phase most cheaply, before effort has been sunk into work it would obsolete.
|
|
18
|
+
Validate plans before execution and honor pre-execute hook failures. Preserve unrelated work. An implementation blocker stops that task; a review blocker follows the bounded correction loop below.
|
|
32
19
|
|
|
33
20
|
## Steps
|
|
34
21
|
|
|
@@ -39,7 +26,7 @@ Within each group of independent plans, dispatch the riskiest plan first (highes
|
|
|
39
26
|
If it exits non-zero, STOP and report errors to the user. Do not proceed.
|
|
40
27
|
|
|
41
28
|
1. Run `draht-tools discover-plans $1` to find and order plans
|
|
42
|
-
2. Read each plan file yourself (from `.planning/phases/`) and analyze dependencies to identify which plans can run in parallel vs sequential. **Graph-impact:** run `draht-tools graph-impact <each plan's files>` and
|
|
29
|
+
2. Read each plan file yourself (from `.planning/phases/`) and analyze dependencies to identify which plans can run in parallel vs sequential. **Graph-impact:** run `draht-tools graph-impact <each plan's files>` and use dependency and impact information to avoid conflicting changes and shared mutable resources.
|
|
43
30
|
3. **Validate plans before dispatching:**
|
|
44
31
|
```bash
|
|
45
32
|
node "${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-$HOME/.draht/codex-marketplace/plugins/draht}}/bin/draht-tools.cjs" validate-plans $1
|
|
@@ -48,11 +35,11 @@ Within each group of independent plans, dispatch the riskiest plan first (highes
|
|
|
48
35
|
|
|
49
36
|
4. **Per-plan execution loop.** For each plan (parallel where independent, sequential where dependent):
|
|
50
37
|
|
|
51
|
-
For each `<task>` in the plan, run a **three-stage** dispatch — implementer → spec-reviewer → reviewer — before moving to the next task. Do not pause for user input between tasks;
|
|
38
|
+
For each `<task>` in the plan, run a **three-stage** dispatch — implementer → spec-reviewer → reviewer — before moving to the next task. Do not pause for user input between tasks. Resolve missing context and review findings through the branches below; stop for an implementer blocker, unavailable required context, or the retry cap.
|
|
52
39
|
|
|
53
40
|
### Stage 1 — Implementer
|
|
54
41
|
Dispatch a Codex subagent using the `implementer` agent prompt and the prompt from the template below. Read the final `STATUS:` line in the response.
|
|
55
|
-
- `STATUS: DONE` →
|
|
42
|
+
- `STATUS: DONE` → inspect the actual verification evidence and checked state. Reuse results only if the relevant inputs and environment are unchanged; run missing, stale, or insufficient verification before Stage 2.
|
|
56
43
|
- `STATUS: DONE_WITH_CONCERNS` → note the concerns; if any are correctness issues, instruct the implementer to fix and re-dispatch; otherwise go to Stage 2.
|
|
57
44
|
- `STATUS: NEEDS_CONTEXT` → provide the missing context (paste the relevant file content or decision) and re-dispatch. Do not skip.
|
|
58
45
|
- `STATUS: BLOCKED` → STOP. Report the blocker to the user. Do not move on.
|
|
@@ -70,18 +57,20 @@ Within each group of independent plans, dispatch the riskiest plan first (highes
|
|
|
70
57
|
```
|
|
71
58
|
- `STATUS: DONE` → go to Stage 3.
|
|
72
59
|
- `STATUS: DONE_WITH_CONCERNS` → note, go to Stage 3.
|
|
60
|
+
- `STATUS: NEEDS_CONTEXT` → supply the missing spec, diff, or context and repeat this review; do not advance.
|
|
73
61
|
- `STATUS: BLOCKED` → re-dispatch the implementer with the "Required Fixes" list to address the gaps. Repeat Stage 1+2 until `DONE`. **Never proceed to Stage 3 with a non-compliant diff.** **Hard cap: 3 implementer re-dispatches per task (across Stage 2 and Stage 3 combined).** On the 3rd failed re-dispatch, record the task as failed via the post-task hook and STOP — report the disagreement to the user. Never negotiate past the cap.
|
|
74
62
|
|
|
75
63
|
### Stage 3 — Reviewer (code quality)
|
|
76
64
|
Once spec compliance is ✅, dispatch a Codex subagent using the `reviewer` agent prompt and a prompt of the form:
|
|
77
65
|
```
|
|
78
|
-
Code-quality review of the diff for task <task-name>. Focus on correctness, type safety, conventions, maintainability, and domain language compliance. Spec compliance has already been confirmed
|
|
66
|
+
Code-quality review of the diff for task <task-name>. Focus on correctness, type safety, conventions, maintainability, and domain language compliance. Spec compliance has already been confirmed. Do not repeat the full spec audit; escalate any discovered mismatch as Must fix for spec re-review.
|
|
79
67
|
|
|
80
68
|
Diff to review:
|
|
81
69
|
<run `git diff <range>` and paste, or instruct the agent to run it>
|
|
82
70
|
```
|
|
83
71
|
- `STATUS: DONE` → task is complete, run the post-task hook (below), then move to the next task.
|
|
84
72
|
- `STATUS: DONE_WITH_CONCERNS` → log the `Should fix` items; if any are correctness-critical, re-dispatch implementer; otherwise log and move on.
|
|
73
|
+
- `STATUS: NEEDS_CONTEXT` → supply the missing diff or context and repeat this review; do not advance.
|
|
85
74
|
- `STATUS: BLOCKED` → `Must fix` issues exist; re-dispatch the implementer with the issue list. Repeat the three stages until `DONE` — subject to the same **hard cap of 3 implementer re-dispatches per task**; at the cap, record the task as failed and STOP.
|
|
86
75
|
|
|
87
76
|
### Post-task hook
|
|
@@ -89,7 +78,7 @@ Within each group of independent plans, dispatch the riskiest plan first (highes
|
|
|
89
78
|
```bash
|
|
90
79
|
node "${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-$HOME/.draht/codex-marketplace/plugins/draht}}/scripts/gsd-post-task.cjs" <phase> <plan> <task-num> <status> <commit-hash>
|
|
91
80
|
```
|
|
92
|
-
If the hook exits non-zero
|
|
81
|
+
If the hook exits non-zero, do not advance to the next task; address the reported check failures within the existing retry cap. A **HARD STOP** (3 recorded failures) forbids another implementer dispatch: report to the user or create a fix plan.
|
|
93
82
|
|
|
94
83
|
5. After all plans complete, run `draht-tools verify-phase $1` yourself (not the subagent)
|
|
95
84
|
6. Run the post-phase hook to generate the phase report:
|
|
@@ -97,44 +86,38 @@ Within each group of independent plans, dispatch the riskiest plan first (highes
|
|
|
97
86
|
node "${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-$HOME/.draht/codex-marketplace/plugins/draht}}/scripts/gsd-post-phase.cjs" $1
|
|
98
87
|
```
|
|
99
88
|
7. Run `draht-tools update-state` yourself
|
|
100
|
-
8.
|
|
101
|
-
9.
|
|
89
|
+
8. If committing is authorized, final documentation commit: `draht-tools commit-docs "complete phase $1 execution"`
|
|
90
|
+
9. Identify `/verify-work $1` as the next step; a fresh session is optional
|
|
102
91
|
|
|
103
92
|
## Subagent Task Template (Stage 1: implementer)
|
|
104
93
|
|
|
105
94
|
```
|
|
106
|
-
Execute
|
|
95
|
+
Execute only task <task-name>. The full plan below is context; do not execute later tasks before the orchestrator completes this task's reviews:
|
|
107
96
|
|
|
108
97
|
<paste full plan XML here>
|
|
109
98
|
|
|
110
99
|
[Optional — orchestrator MAY paste a `draht-tools graph-context <task files>` slice here for orientation (pkg/layer/importers/imports/sinks). Codex subagents cannot run draht-tools.]
|
|
111
100
|
|
|
112
|
-
For
|
|
101
|
+
For the assigned <task>, follow its test requirements and this TDD cycle where applicable. Commit the phases only when the user has authorized commits:
|
|
113
102
|
1. RED — Write failing tests from <test>. Run the test runner, confirm they FAIL for the right reason. Commit with: git add <test-files> && git commit -m "red: <description>"
|
|
114
103
|
2. GREEN — Write minimal implementation from <action> to make tests pass. Run tests, confirm PASS. Commit with: git add <files> && git commit -m "green: <task name>"
|
|
115
104
|
3. REFACTOR — Apply <refactor> improvements if any. Tests must stay green after each change. Commit with: git add <files> && git commit -m "refactor: <description>"
|
|
116
105
|
4. VERIFY — Run the <verify> step, confirm <done> criteria are met.
|
|
117
106
|
|
|
118
|
-
|
|
107
|
+
Use established project terms and documented boundaries; read relevant domain context when present.
|
|
119
108
|
|
|
120
|
-
|
|
109
|
+
Comments explain non-obvious constraints or rationale; avoid step narration and diff restatements.
|
|
121
110
|
|
|
122
111
|
Checkpoint handling:
|
|
123
112
|
- type="auto" → execute silently.
|
|
124
113
|
- type="checkpoint:human-verify" → stop and report back what was built.
|
|
125
114
|
- type="checkpoint:decision" → stop and report the options.
|
|
126
115
|
|
|
127
|
-
Evidence rule:
|
|
116
|
+
Evidence rule: report decisive commands, working directories, outcomes, and the code/configuration state checked. A bare success status is insufficient; missing or stale evidence must be verified. If a plan instruction contradicts what you find in the code, stop and report NEEDS_CONTEXT — do not silently obey either side.
|
|
128
117
|
|
|
129
118
|
End your response with `STATUS: DONE` / `DONE_WITH_CONCERNS` / `NEEDS_CONTEXT` / `BLOCKED` per the agent contract.
|
|
130
119
|
```
|
|
131
120
|
|
|
132
|
-
## Two-Stage Review Rationale
|
|
133
|
-
|
|
134
|
-
- **Spec compliance prevents over/under-building.** Implementers can drift — adding "helpful" extras or skipping pieces they think are obvious. The spec-reviewer catches this with fresh eyes.
|
|
135
|
-
- **Code quality runs only after spec ✅.** Mixing the two reviews lets quality concerns mask spec gaps. Keep them ordered.
|
|
136
|
-
- **Never accept "close enough" on spec compliance.** A `BLOCKED` from spec-reviewer means re-dispatch implementer, not move on.
|
|
137
|
-
|
|
138
121
|
## Parallelization Rules
|
|
139
122
|
|
|
140
123
|
- Plans sharing no files and having no dependency edges can run in parallel
|
|
@@ -142,19 +125,6 @@ End your response with `STATUS: DONE` / `DONE_WITH_CONCERNS` / `NEEDS_CONTEXT` /
|
|
|
142
125
|
- **Inside a plan, tasks run sequentially** — the three-stage review loop must complete before the next task starts (so each task gets clean review context)
|
|
143
126
|
- If a parallel subagent fails, report which plan failed and continue with independent plans
|
|
144
127
|
|
|
145
|
-
## TDD Rules
|
|
146
|
-
|
|
147
|
-
- Never write implementation before a failing test exists
|
|
148
|
-
- If a test passes immediately after being written, it is not testing the right thing — fix it
|
|
149
|
-
- Red → Green → Refactor is not optional; skipping steps invalidates the safety net
|
|
150
|
-
- Each TDD phase gets its own commit so the history is auditable
|
|
151
|
-
|
|
152
|
-
## Domain Rules
|
|
153
|
-
|
|
154
|
-
- All identifiers (class names, method names, variables) must use the ubiquitous language from `.planning/DOMAIN.md`
|
|
155
|
-
- Do not import across bounded context boundaries directly — use domain events or ACL adapters
|
|
156
|
-
- If implementation reveals a missing domain term, stop and update DOMAIN.md before continuing
|
|
157
|
-
|
|
158
128
|
## Workflow
|
|
159
129
|
|
|
160
130
|
This is one step in the per-phase cycle:
|
|
@@ -163,7 +133,7 @@ This is one step in the per-phase cycle:
|
|
|
163
133
|
/discuss-phase N → /plan-phase N → /execute-phase N → /verify-work N
|
|
164
134
|
```
|
|
165
135
|
|
|
166
|
-
After completing this command,
|
|
136
|
+
After completing this command, identify `/verify-work $1` as the next step; a fresh session is optional. Do NOT suggest `/next-milestone`.
|
|
167
137
|
|
|
168
138
|
## Flags
|
|
169
139
|
|
package/commands/fix.md
CHANGED
|
@@ -6,149 +6,35 @@ allowed-tools: Bash, Read, Write, Edit, Task
|
|
|
6
6
|
|
|
7
7
|
# /fix
|
|
8
8
|
|
|
9
|
-
Diagnose and fix a bug using the **four-phase systematic debugging protocol**: root cause investigation → pattern analysis → ranked hypotheses & testing → implementation with a reproducing test.
|
|
10
|
-
|
|
11
9
|
Issue: $ARGUMENTS
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
## The Iron Law
|
|
16
|
-
|
|
17
|
-
> **NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.**
|
|
18
|
-
|
|
19
|
-
Symptom fixes are failure — they create new bugs in different places. If you find yourself proposing a "quick fix for now, investigate later", STOP and return to Phase 1.
|
|
20
|
-
|
|
21
|
-
## The Report Is a Symptom, Not a Diagnosis
|
|
22
|
-
|
|
23
|
-
**Procedure:** Restate the failure as observable behavior — "X happens when Y; expected Z" — before touching anything. If the user names a cause ("the cache is stale"), treat it as Hypothesis #0: it enters the Phase 3 ranking like any other hypothesis and does not skip Phase 1.
|
|
24
|
-
|
|
25
|
-
**Example:** "fix the stale cache bug" — Phase 1 traces the data flow and finds the cache is fine; the query behind it silently drops a filter. The fix lands in the query.
|
|
26
|
-
|
|
27
|
-
**Prevents:** shipping a correct fix to the wrong component.
|
|
11
|
+
Investigate and repair the reported defect within the requested scope. Historical design questions belong in `/why`; a triage trace supplies hypotheses, not an already-confirmed diagnosis.
|
|
28
12
|
|
|
29
|
-
|
|
13
|
+
> Invoke noninteractive Draht tooling as `node "${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-$HOME/.draht/codex-marketplace/plugins/draht}}/bin/draht-tools.cjs" <subcommand>`. The `debugging-workflow` skill provides investigation guidance.
|
|
30
14
|
|
|
31
|
-
##
|
|
15
|
+
## Investigation
|
|
32
16
|
|
|
33
|
-
|
|
34
|
-
- Proposing "quick fixes for now, investigate later"
|
|
35
|
-
- Attempting multiple changes simultaneously
|
|
36
|
-
- Skipping a reproducing test before fixing
|
|
37
|
-
- Proposing solutions before understanding data flow
|
|
38
|
-
- Reading code to build a causal theory before a red-capable reproduction command exists
|
|
39
|
-
- Making "one more fix attempt" after already trying 2+
|
|
40
|
-
- Watching each fix reveal new problems elsewhere
|
|
41
|
-
- Implementing before a failing test exists for the bug
|
|
17
|
+
Read the relevant source, errors, configuration, and history. Restate observed versus expected behavior and identify a command that can expose the symptom. Code inspection and hypotheses may precede reproduction; distinguish a candidate cause from a demonstrated one.
|
|
42
18
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
## Atomic Reasoning
|
|
46
|
-
|
|
47
|
-
Decompose the work into independently verifiable units before acting; the `atomic-reasoning` skill holds the full discipline — load it when the decomposition is not obvious.
|
|
48
|
-
|
|
49
|
-
## The Four Phases
|
|
50
|
-
|
|
51
|
-
### Phase 1 — Root Cause Investigation (before ANY fix)
|
|
52
|
-
|
|
53
|
-
Once the affected/buggy file is identified, run `draht-tools graph-context <buggy-file>` and `draht-tools graph-callers <buggy-file>` to orient (package, layer, who calls it) — paste the summary into the Codex subagent prompt to support its "trace UPWARD" step.
|
|
54
|
-
|
|
55
|
-
Dispatch the `debugger` subagent with this prompt:
|
|
19
|
+
Use the `debugger` agent when a separate investigation is useful. Pass the issue, relevant code/context, and this scope:
|
|
56
20
|
|
|
57
21
|
```
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
Issue: $ARGUMENTS
|
|
61
|
-
|
|
62
|
-
Walk through these steps and report on each:
|
|
63
|
-
1. Read the error message / stack trace carefully — exact line numbers, exact file paths.
|
|
64
|
-
2. Build a reproduction loop — ONE command that goes red on this bug. This step is the heart of the diagnosis; spend disproportionate effort here. Work down the ladder and take the first rung that reaches the bug:
|
|
65
|
-
- failing test at whatever seam reaches the bug (unit, integration, e2e)
|
|
66
|
-
- HTTP request script against a running dev server
|
|
67
|
-
- CLI invocation on a fixture input, output diffed against a known-good snapshot
|
|
68
|
-
- headless browser script asserting on DOM / console / network
|
|
69
|
-
- replay of a captured payload, trace, or event log through the code path in isolation
|
|
70
|
-
- throwaway harness: a minimal subset of the system (mocked deps) exercising the bug path in one call
|
|
71
|
-
- property/fuzz loop: hundreds of random inputs when the output is only sometimes wrong
|
|
72
|
-
- bisection harness: automate "checkout state X, run the check" so `git bisect run` can drive it
|
|
73
|
-
- differential loop: the same input through old vs new version (or two configs), outputs diffed
|
|
74
|
-
- last resort, human-in-the-loop: exact numbered steps for the user to run by hand, output pasted back
|
|
75
|
-
Flaky bugs: the goal is a HIGHER reproduction rate, not a clean repro — loop the trigger 100x, add stress, narrow timing windows until it fails often enough to debug against.
|
|
76
|
-
Exit checklist — all four must hold before you continue: (a) ONE named command (a test invocation, a script path, a curl); (b) you have ALREADY RUN it at least once; (c) your report shows the invocation AND its output (secrets redacted); (d) it asserts the user's EXACT symptom — able to go red on this bug and green once fixed, not merely "runs without erroring".
|
|
77
|
-
Self-interrupt: if you catch yourself reading code to build a causal theory before this command exists, STOP — anchoring on the first plausible idea is the exact failure this protocol prevents. No red-capable command, no steps 4-6.
|
|
78
|
-
If you genuinely cannot build a loop: list what you tried, name what you need (environment access, a captured artifact such as a log dump or recording, or permission to add temporary instrumentation), and end with STATUS: NEEDS_CONTEXT rather than guessing.
|
|
79
|
-
3. Check recent changes — `git log --oneline -20` and `git diff HEAD~5` against the affected files. What changed?
|
|
80
|
-
4. For multi-component flows: trace data flow. Where does the bad value originate? What called this with that value? Keep tracing UPWARD until you find the source. Fix at source, not at symptom.
|
|
81
|
-
5. State the root cause as one sentence: "X happens because Y at <file:line>."
|
|
82
|
-
6. Label every statement in your report: observed (you ran it and saw it), derived (follows necessarily from evidence), or assumed (unchecked — say what would check it). A root cause resting on an assumption is a hypothesis, not a diagnosis.
|
|
83
|
-
|
|
84
|
-
End your response with `STATUS: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED`.
|
|
22
|
+
Diagnose this issue; do not apply a production fix. Read the affected path and build a reproduction when feasible. Report the supported cause or labeled hypotheses, relevant files, reproduction command/output, and any missing evidence. Respect any read-only restriction, including on test or instrumentation edits.
|
|
23
|
+
End with exactly one: STATUS: DONE, STATUS: DONE_WITH_CONCERNS, STATUS: NEEDS_CONTEXT, or STATUS: BLOCKED.
|
|
85
24
|
```
|
|
86
25
|
|
|
87
|
-
If `
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
Read the root cause from Phase 1. Then:
|
|
92
|
-
|
|
93
|
-
1. Find working examples in the codebase that do the same kind of thing correctly — use `draht-tools graph-query "<concept>"` to locate reference implementations instead of grepping
|
|
94
|
-
2. Read those reference implementations **completely** — not skimmed
|
|
95
|
-
3. List every difference between the working code and the broken code, however small
|
|
96
|
-
4. Note dependencies: what config, settings, environment, or call-order does the working version assume?
|
|
97
|
-
|
|
98
|
-
If Phase 2 reveals a different root cause than Phase 1, go back to Phase 1 and re-investigate. Do not paper over the disagreement.
|
|
99
|
-
|
|
100
|
-
### Phase 3 — Ranked Hypotheses
|
|
101
|
-
|
|
102
|
-
1. Generate **3-5 ranked falsifiable hypotheses** before testing any of them. A single hypothesis anchors you to the first plausible idea — ranking forces the alternatives into view.
|
|
103
|
-
2. Each hypothesis must state its prediction: "If X is the cause, then changing Y will make the bug disappear / changing Z will make it worse." If you cannot state the prediction, it is a vibe — discard it or sharpen it.
|
|
104
|
-
3. If the user named a cause, it is **Hypothesis #0** and enters the ranking with the others — ranked on evidence, not privileged for being first.
|
|
105
|
-
4. Show the ranked list to the user before testing. Domain knowledge re-ranks instantly ("we just deployed a change to #3") and rules hypotheses out for free. Do not block waiting for a reply — proceed in ranked order if none comes.
|
|
106
|
-
5. Test in rank order, one hypothesis at a time. Design the **smallest possible change** that would prove or falsify the prediction — one variable, one line if possible — and re-run the Phase 1 reproduction command to read the verdict.
|
|
107
|
-
- **Prediction confirmed** → proceed to Phase 4 with this cause.
|
|
108
|
-
- **Falsified** → revert the probe, record which prediction failed, move to the next hypothesis. Do not pile changes on top.
|
|
109
|
-
6. When a probe needs logging, prefer one debugger/REPL inspection over ten log lines; if you must log, tag every line with one unique session prefix, e.g. `[DEBUG-a4f2]`, and never "log everything and grep".
|
|
110
|
-
7. If after 3 falsified hypotheses you are still failing, STOP. Question the architecture, not the ranking. Report to the user.
|
|
111
|
-
|
|
112
|
-
You may also say "I don't understand X" rather than pretend. That is the correct answer when it's true.
|
|
113
|
-
|
|
114
|
-
### Phase 4 — Implementation
|
|
115
|
-
|
|
116
|
-
Comment discipline: the fix ships no narration — comments exist ONLY for constraints the code cannot express: a protocol quirk, a deliberate deviation, a non-obvious invariant. If code needs comments to be understood, rewrite the code until it doesn't. Never narrate steps, restate the diff, or leave "removed X" / "this handles Y" breadcrumbs. Comment density above the surrounding file's norm is a defect — fix it before committing. A heavily-commented solution signals the design is wrong: redesign, don't annotate.
|
|
117
|
-
|
|
118
|
-
1. **Write the reproducing test FIRST.** Seed it from the Phase 1 reproduction command — the loop that already goes red is the test's skeleton; port its scenario and its symptom assertion to the right test seam. Smallest possible test that demonstrates the bug. Run it — confirm it FAILS for the right reason (not for a syntax error, not for a missing import).
|
|
119
|
-
- Commit: `git add <test-files> && git commit -m "red: reproduce <bug>"`
|
|
120
|
-
|
|
121
|
-
2. **Apply the single fix** identified in Phase 3. No other changes — no opportunistic refactor, no "while I'm here".
|
|
122
|
-
- Run the failing test — confirm it now PASSES.
|
|
123
|
-
- Run the FULL test suite — confirm no regressions.
|
|
124
|
-
- Commit: `git add <files> && git commit -m "green: fix <bug>"`
|
|
125
|
-
|
|
126
|
-
3. **Refactor (optional)** — only if there's clear improvement that doesn't change behaviour. Tests must stay green after every change.
|
|
127
|
-
- Commit: `git add <files> && git commit -m "refactor: <description>"`
|
|
26
|
+
- If `NEEDS_CONTEXT`, provide available missing information and retry within the budget.
|
|
27
|
+
- If `BLOCKED`, report the blocker and evidence; do not keep retrying.
|
|
28
|
+
- At most 3 re-dispatches or failed repair attempts; stop with a concise record when that bound is reached. It does not establish that the architecture is wrong.
|
|
128
29
|
|
|
129
|
-
|
|
30
|
+
Test plausible causes with discriminating observations or small experiments. Use the number of hypotheses the evidence warrants. Remove unsuccessful probes rather than layering speculative changes. When reproduction is unavailable, continue useful read-only investigation and identify what prevents confirmation.
|
|
130
31
|
|
|
131
|
-
|
|
32
|
+
## Repair
|
|
132
33
|
|
|
133
|
-
|
|
34
|
+
Apply a focused fix once the evidence supports it. Preserve a regression check: observe it fail for the intended reason before the repair, then pass afterward where a test seam exists. Explain any inability to establish that evidence. Run the original reproduction when available, relevant regression checks, and project-required validation; do not automatically run every available command.
|
|
134
35
|
|
|
135
|
-
|
|
36
|
+
Remove temporary instrumentation and avoid unrelated cleanup. Delegate the implementation to `implementer` only when useful, with the issue, scope, evidence, checks, and the same STATUS contract.
|
|
136
37
|
|
|
137
|
-
|
|
138
|
-
|--------|---------|
|
|
139
|
-
| "Simple bug, skip the process" | Simple bugs have root causes too. The process is fast. |
|
|
140
|
-
| "It's an emergency, no time" | Systematic debugging is *faster* than thrashing on guesses. |
|
|
141
|
-
| "I'll write the test after I confirm the fix" | Untested fixes don't stick. The test-first proves the bug existed. |
|
|
142
|
-
| "I'll just try a few things and see what works" | Can't isolate what worked. Creates new bugs. |
|
|
143
|
-
| "I already manually tested it" | A reproducing test is the only durable proof. |
|
|
144
|
-
| "The user already told me the cause" | The reporter saw the symptom. Their diagnosis is Hypothesis #0, not a finding. |
|
|
145
|
-
| "The fix passed, so my diagnosis was right" | Fixes can mask. Verify the causal chain, not just the symptom's absence. |
|
|
146
|
-
| "I can't reproduce it, but the cause is obvious from the code" | Reading code yields theories, not verdicts. No red-capable command, no diagnosis — report NEEDS_CONTEXT and name what's missing. |
|
|
38
|
+
Commit only when authorized. For recorded TDD phases use plain Git with explicit paths and `red:`, `green:`, `refactor:` subjects; never route source commits through docs-only tooling. Update GSD state only for an active GSD task.
|
|
147
39
|
|
|
148
|
-
|
|
149
|
-
- Always reproduce before fixing — a fix without a test is a guess
|
|
150
|
-
- One bug, one fix, one commit series. Do not bundle unrelated changes.
|
|
151
|
-
- Fix at the source, not the symptom
|
|
152
|
-
- If 3 fix attempts have failed, the architecture is wrong — stop and discuss
|
|
153
|
-
- If the fix is non-obvious, the commit body explains the chain
|
|
154
|
-
- Final report order: verdict first (fixed / not fixed, root cause in one sentence), then evidence (reproducing test red→green, suite results), then risk (what the fix could regress, what stays assumed)
|
|
40
|
+
Report the verdict and supported cause first, decisive commands/results next, then residual risk and missing evidence. A completion claim requires checks that cover the current state; reuse recorded results only when their inputs and environment remain unchanged.
|
package/commands/grill.md
CHANGED
|
@@ -6,61 +6,16 @@ allowed-tools: Bash, Read, Write, Edit, Task
|
|
|
6
6
|
|
|
7
7
|
# /grill
|
|
8
8
|
|
|
9
|
-
Interrogate the subject relentlessly until you reach a shared understanding. A grill has no fixed outcome: it can end in a refined spec, a ticket list, a decision record, plain notes, or nothing but the conversation. The output form is chosen at the end, never presumed at the start.
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
```
|
|
13
|
-
/grill [subject]
|
|
14
|
-
```
|
|
15
|
-
|
|
16
9
|
Subject: $ARGUMENTS
|
|
17
10
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
## The Design Tree
|
|
21
|
-
|
|
22
|
-
Map the subject as a **design tree**: every decision branches into the decisions that hang off it. The **frontier** is every decision whose prerequisites are already settled — the questions you can ask now without guessing at answers you haven't heard yet.
|
|
23
|
-
|
|
24
|
-
## Rounds
|
|
25
|
-
|
|
26
|
-
1. **Orient without blocking.** Skim what the subject names before round 1: files mentioned in it, `.planning/` if present, recent git history. Dispatch fact-finders for anything deeper — do not hold the first round for them.
|
|
27
|
-
2. **Ask the WHOLE frontier in one message.** Number every question, foundational → detailed, and give each one a recommended answer:
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
**Q1 — <title>**: <body; may offer options>
|
|
31
|
-
*Recommended:* <your recommended answer>
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
**Q2 — <title>**: <body>
|
|
36
|
-
*Recommended:* <your recommended answer>
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
3. **Defer dependent questions.** A question whose answer depends on another question still open this round belongs to a later round — asking it now means guessing at an answer you haven't heard.
|
|
40
|
-
4. **Let the user answer by number.** "1 yes, 2: B, 4 later" is a complete reply. Anything accepted by number or answered explicitly is **decided**. A recommendation acted on without confirmation is **assumed** and stays flagged until the user confirms it.
|
|
41
|
-
5. **Recompute and repeat.** Every answer reshapes the tree: settled decisions push the frontier outward and unblock the questions that hung off them. Recompute the frontier and ask the next round.
|
|
42
|
-
|
|
43
|
-
## Facts Are Your Job
|
|
44
|
-
|
|
45
|
-
Finding facts is your job, never the user's. When a frontier question needs an environment fact — filesystem, git history, code structure, existing docs — dispatch a fact-finder instead of asking. Don't block on it: a running exploration is an unsettled prerequisite, so only the questions downstream of it wait; ask the rest of the frontier now. Decisions belong to the user: put each one to them and wait.
|
|
46
|
-
|
|
47
|
-
## Done
|
|
48
|
-
|
|
49
|
-
The grill is done when the frontier is empty: every branch of the tree visited, nothing left silently assumed. Present the decided-vs-assumed summary, then — and only then — ask which artifact to produce:
|
|
11
|
+
Stress-test the subject through focused questions about assumptions, evidence, trade-offs, and failure modes. The result may be a refined idea, decision, spec, ticket list, or simply a clearer conversation; do not presume a GSD handoff.
|
|
50
12
|
|
|
51
|
-
|
|
52
|
-
2. **Ticket list** → `.planning/tickets/YYYY-MM-DD-<slug>.md`
|
|
53
|
-
3. **Decision record** → `.planning/decisions/YYYY-MM-DD-<slug>.md`
|
|
54
|
-
4. **Plain notes** → a file the user names
|
|
13
|
+
Read the relevant context before asking for repository facts. Use the `architect` agent for independent read-only fact-finding when useful; continue questions that do not depend on it.
|
|
55
14
|
|
|
56
|
-
|
|
15
|
+
Group related open decisions and ask the questions whose answers would change the result. Offer a recommendation with its trade-off when helpful. Defer questions that depend on unresolved answers. Preserve what the user decided, label assumptions, and follow new evidence that challenges the leading approach.
|
|
57
16
|
|
|
58
|
-
|
|
17
|
+
Continue while useful unresolved questions remain and the user wants deeper examination. There is no requirement to enumerate every imaginable branch or empty a fixed question tree. Respect requests to stop, narrow scope, or proceed with authorized work.
|
|
59
18
|
|
|
60
|
-
|
|
19
|
+
End with the decisions, consequential assumptions, remaining risks, and recommended next action. Produce the artifact the user requested; otherwise a chat summary is sufficient. Use project conventions for files, and `.planning/` only when that workflow is selected. Follow `unslop` for prose and preserve quoted user decisions exactly.
|
|
61
20
|
|
|
62
|
-
|
|
63
|
-
- **Asking the user for facts the environment can answer** — filesystem, git history, and code structure are yours to look up
|
|
64
|
-
- **Blocking a whole round on a running fact-finder** — only the questions downstream of it wait; ask the rest now
|
|
65
|
-
- **Presuming the outcome at round 1** — deciding early that this "is" a spec narrows the questioning to spec-shaped answers
|
|
66
|
-
- **Acting on the result before the user confirms shared understanding** — an empty frontier ends the questioning; only the user's confirmation ends the grill
|
|
21
|
+
A request to discuss alone does not authorize implementation. When the user subsequently asks to implement, use that authorization without requiring another ceremonial approval.
|
package/commands/init-project.md
CHANGED
|
@@ -14,15 +14,11 @@ Use this when you have an existing codebase and want to add structured planning.
|
|
|
14
14
|
|
|
15
15
|
> **Tool note**: Invoke `draht-tools <subcommand>` as `node "${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-$HOME/.draht/codex-marketplace/plugins/draht}}/bin/draht-tools.cjs" <subcommand>` via the Bash tool.
|
|
16
16
|
|
|
17
|
-
## Atomic Reasoning
|
|
18
|
-
|
|
19
|
-
Decompose the work into independently verifiable units before acting; the `atomic-reasoning` skill holds the full discipline — load it when the decomposition is not obvious.
|
|
20
|
-
|
|
21
17
|
## Steps
|
|
22
18
|
1. Run `draht-tools init` to check preconditions (git repo, etc.)
|
|
23
|
-
2. Run `draht-tools map-codebase` to
|
|
24
|
-
3.
|
|
25
|
-
4.
|
|
19
|
+
2. Run `draht-tools map-codebase` to generate structural docs and the knowledge graph. If graph generation fails, retry with `draht-tools map-graph --quiet` before querying it
|
|
20
|
+
3. Read `.planning/codebase/GRAPH_REPORT.md` for architecture, tech stack, and conventions. Use `draht-tools graph-query <topic>` and `draht-tools graph-context <file...>` for focused detail; use `graph-hotspots` or `graph-clusters` when needed instead of reading the full `MAP.json`
|
|
21
|
+
4. Clarify material gaps in the problem, scope, constraints, and success criteria; use existing answers and repository evidence before asking:
|
|
26
22
|
- What is this project? Who uses it?
|
|
27
23
|
- What are the current pain points or goals?
|
|
28
24
|
- What is MVP vs aspirational scope?
|
|
@@ -31,16 +27,16 @@ Decompose the work into independently verifiable units before acting; the `atomi
|
|
|
31
27
|
6. Run `draht-tools create-domain-model` to define bounded contexts, entities, and ubiquitous language
|
|
32
28
|
7. Create `.planning/DOMAIN.md` with the same sections as `/new-project`:
|
|
33
29
|
Bounded Contexts, Ubiquitous Language, Context Map, Aggregates, Domain Events.
|
|
34
|
-
Seed the Ubiquitous Language glossary from `GRAPH_REPORT.md` key concepts
|
|
30
|
+
Seed the Ubiquitous Language glossary from `GRAPH_REPORT.md` key concepts and focused `draht-tools graph-query <topic>` results (start from extracted terms, not zero)
|
|
35
31
|
8. Create `.planning/TEST-STRATEGY.md` with: Test Framework, Directory Conventions, Coverage Goals, Testing Levels, Excluded
|
|
36
|
-
9.
|
|
32
|
+
9. If research is needed before defining requirements, investigate the open questions and save findings with sources under `.planning/research/<topic>.md`
|
|
37
33
|
10. Run `draht-tools create-requirements` with v1/v2/out-of-scope (map requirements to bounded contexts)
|
|
38
34
|
11. Run `draht-tools create-roadmap` with phases
|
|
39
35
|
12. Run `draht-tools init-state`
|
|
40
|
-
13.
|
|
36
|
+
13. If committing is authorized, use `draht-tools commit-docs "initialize project planning"`
|
|
41
37
|
|
|
42
38
|
## Workflow
|
|
43
|
-
After project initialization, phases are executed one at a time in
|
|
39
|
+
After project initialization, phases are executed one at a time in dependency order:
|
|
44
40
|
|
|
45
41
|
```
|
|
46
42
|
/init-project → /discuss-phase 1 → /plan-phase 1 → /execute-phase 1 → /verify-work 1
|
|
@@ -49,9 +45,9 @@ After project initialization, phases are executed one at a time in fresh session
|
|
|
49
45
|
```
|
|
50
46
|
|
|
51
47
|
## Rules
|
|
52
|
-
-
|
|
48
|
+
- Group related questions and ask only those that change a material decision.
|
|
53
49
|
- Questions that depend on still-open answers wait for a later round
|
|
54
|
-
-
|
|
55
|
-
-
|
|
50
|
+
- Investigate repository facts directly; delegate independent research when useful.
|
|
51
|
+
- Respect explicit requirements; clarify the intended outcome when it is unclear.
|
|
56
52
|
- Respect what already exists — do not propose rewriting working code
|
|
57
53
|
- Stop when you have: current state, goals, MVP scope, constraints, success criteria
|
package/commands/map-codebase.md
CHANGED
|
@@ -20,7 +20,7 @@ Decompose the work into independently verifiable units before acting; the `atomi
|
|
|
20
20
|
1. Run `draht-tools map-codebase $1`
|
|
21
21
|
2. Tool generates the prose docs (STACK.md, ARCHITECTURE.md, CONVENTIONS.md, CONCERNS.md, DOMAIN-HINTS.md) **and**, in the same pass, the **living architecture map** (MAP.json + MAP.html + GRAPH_REPORT.md).
|
|
22
22
|
2a. The living architecture map produced by step 1 (re-run `draht-tools map-graph $1` any time to refresh just the map without rewriting the docs):
|
|
23
|
-
- `.planning/codebase/MAP.json` — machine-readable map with **entry points** (CLI bins, HTTP routes, library main exports), **sinks** (FS / net / DB / stdout / exec calls), **bounded contexts** (packages), **cross-package dataflow edges**, **symbol-resolved call edges**, **flows** (which sinks each entry point reaches and through which intermediate module), per-module **layer** (presentation / application / domain / infrastructure / support), and exports/imports per file.
|
|
23
|
+
- `.planning/codebase/MAP.json` — machine-readable map with **entry points** (CLI bins, HTTP routes, library main exports), **sinks** (FS / net / DB / stdout / exec calls), **bounded contexts** (packages), **cross-package dataflow edges**, **symbol-resolved call edges**, **flows** (which sinks each entry point reaches and through which intermediate module), per-module **layer** (presentation / application / domain / infrastructure / support), and exports/imports per file. Orient with `GRAPH_REPORT.md` and focused `graph-*` queries; load only relevant map slices into context.
|
|
24
24
|
- `.planning/codebase/MAP.html` — interactive layered visualization with four views:
|
|
25
25
|
- **Architecture** — packages drawn as containers in architectural layers, with cross-package dataflow arrows. Thickness encodes import count.
|
|
26
26
|
- **Modules** — every file inside its package container, import edges between them; click a package or sink to highlight.
|
|
@@ -49,7 +49,7 @@ Decompose the work into independently verifiable units before acting; the `atomi
|
|
|
49
49
|
- `## Aggregates` — aggregates and their root entities per context
|
|
50
50
|
- `## Domain Events` — any existing event names or patterns discovered
|
|
51
51
|
6. Create `.planning/TEST-STRATEGY.md` with: Test Framework, Directory Conventions, Coverage Goals, Testing Levels, Excluded
|
|
52
|
-
7.
|
|
52
|
+
7. If committing is authorized: `draht-tools commit-docs "map existing codebase"`
|
|
53
53
|
|
|
54
54
|
## Living map for agents
|
|
55
55
|
|
package/commands/new-project.md
CHANGED
|
@@ -12,14 +12,10 @@ Description: $ARGUMENTS
|
|
|
12
12
|
|
|
13
13
|
> **Tool note**: When this command says `draht-tools <subcommand>`, invoke it as `node "${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-$HOME/.draht/codex-marketplace/plugins/draht}}/bin/draht-tools.cjs" <subcommand>` via the Bash tool. `PLUGIN_ROOT` is used when Codex exposes it; `CLAUDE_PLUGIN_ROOT` is a compatibility fallback.
|
|
14
14
|
|
|
15
|
-
## Atomic Reasoning
|
|
16
|
-
|
|
17
|
-
Decompose the work into independently verifiable units before acting; the `atomic-reasoning` skill holds the full discipline — load it when the decomposition is not obvious.
|
|
18
|
-
|
|
19
15
|
## Steps
|
|
20
16
|
1. Run `draht-tools init` to check preconditions
|
|
21
17
|
2. If existing code detected, run `draht-tools map-codebase` first
|
|
22
|
-
3.
|
|
18
|
+
3. Clarify material gaps in the problem, scope, constraints, and success criteria; use existing answers and repository evidence before asking:
|
|
23
19
|
4. Run `draht-tools create-project` with gathered info
|
|
24
20
|
5. Run `draht-tools create-domain-model` to define bounded contexts, entities, and ubiquitous language
|
|
25
21
|
6. Create `.planning/DOMAIN.md` with:
|
|
@@ -34,14 +30,14 @@ Decompose the work into independently verifiable units before acting; the `atomi
|
|
|
34
30
|
- `## Coverage Goals` — target coverage percentage and which paths are critical
|
|
35
31
|
- `## Testing Levels` — what is tested at unit level vs integration vs e2e, with examples
|
|
36
32
|
- `## Excluded` — what is explicitly not tested and why (config files, generated code, etc.)
|
|
37
|
-
8.
|
|
33
|
+
8. If research is needed before defining requirements, investigate the open questions and save findings with sources under `.planning/research/<topic>.md`
|
|
38
34
|
9. Run `draht-tools create-requirements` with v1/v2/out-of-scope (map requirements to bounded contexts)
|
|
39
35
|
10. Run `draht-tools create-roadmap` with phases
|
|
40
36
|
11. Run `draht-tools init-state`
|
|
41
|
-
12.
|
|
37
|
+
12. If committing is authorized, use `draht-tools commit-docs "initialize project planning"`
|
|
42
38
|
|
|
43
39
|
## Workflow
|
|
44
|
-
After project initialization, phases are executed one at a time in
|
|
40
|
+
After project initialization, phases are executed one at a time in dependency order:
|
|
45
41
|
|
|
46
42
|
```
|
|
47
43
|
/new-project → /discuss-phase 1 → /plan-phase 1 → /execute-phase 1 → /verify-work 1
|
|
@@ -50,15 +46,14 @@ After project initialization, phases are executed one at a time in fresh session
|
|
|
50
46
|
→ /next-milestone (only after ALL phases are complete)
|
|
51
47
|
```
|
|
52
48
|
|
|
53
|
-
Start a fresh session
|
|
49
|
+
Start a fresh session only when context limits make it useful. Do NOT suggest `/next-milestone` until every phase in the milestone is verified.
|
|
54
50
|
|
|
55
51
|
## Rules
|
|
56
|
-
-
|
|
52
|
+
- Group related questions and ask only those that change a material decision.
|
|
57
53
|
- Questions that depend on still-open answers wait for a later round
|
|
58
|
-
-
|
|
54
|
+
- Investigate repository facts directly; delegate independent research when useful.
|
|
59
55
|
- Follow threads based on answers
|
|
60
56
|
- Use examples ("Like Stripe Checkout, or custom?")
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
- 3-7 follow-up rounds typical
|
|
57
|
+
- Distinguish user decisions from reasonable implementation assumptions; clarify only blocking ambiguity
|
|
58
|
+
- Respect explicit requirements; clarify the intended outcome when it is unclear.
|
|
64
59
|
- Stop when you have: problem, audience, MVP scope, constraints, success criteria
|
|
@@ -9,12 +9,8 @@ Plan the next milestone after ALL phases in the current one are complete.
|
|
|
9
9
|
|
|
10
10
|
> **Tool note**: Invoke `draht-tools <subcommand>` as `node "${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-$HOME/.draht/codex-marketplace/plugins/draht}}/bin/draht-tools.cjs" <subcommand>` via the Bash tool.
|
|
11
11
|
|
|
12
|
-
## Atomic Reasoning
|
|
13
|
-
|
|
14
|
-
Decompose the work into independently verifiable units before acting; the `atomic-reasoning` skill holds the full discipline — load it when the decomposition is not obvious.
|
|
15
|
-
|
|
16
12
|
## Steps
|
|
17
|
-
1.
|
|
13
|
+
1. Read `.planning/ROADMAP.md` and the current milestone's `*-UAT.md` reports under `.planning/phases/`. Require every phase to be marked `complete` with observed passing acceptance results; summary files alone do not prove completion
|
|
18
14
|
2. If any phase is not complete, STOP and tell the user which phase needs attention
|
|
19
15
|
3. Read all phase reports in `.planning/phase-N-report.md` to extract lessons learned
|
|
20
16
|
4. Read the execution log `.planning/execution-log.jsonl` for failure patterns
|
|
@@ -32,11 +28,11 @@ Decompose the work into independently verifiable units before acting; the `atomi
|
|
|
32
28
|
- Acceptance criteria
|
|
33
29
|
10. Update `.planning/ROADMAP.md` with the new milestone header and phases (status: `pending`)
|
|
34
30
|
11. Update `.planning/REQUIREMENTS.md` with any new requirements
|
|
35
|
-
12.
|
|
31
|
+
12. If committing is authorized: `draht-tools commit-docs "plan milestone <N>"`
|
|
36
32
|
|
|
37
33
|
## Rules
|
|
38
34
|
- Do not start planning phase details — that happens in `/discuss-phase` + `/plan-phase`
|
|
39
35
|
- Distinguish **verified-complete** (a UAT report shows observed passes) from **believed-complete** (someone said so) — only the former counts toward requirement satisfaction; the latter goes back on the list
|
|
40
36
|
- Respect lessons learned from the previous milestone — don't repeat mistakes
|
|
41
|
-
- Keep the next milestone focused
|
|
37
|
+
- Keep the next milestone focused; phase count follows coherent outcomes and dependencies
|
|
42
38
|
- Order the new phases risk-first: the phase carrying the highest uncertainty × blast radius comes earliest, so a wrong bet invalidates the least downstream work
|