draht-codex 2026.7.13 → 2026.9.5-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/.codex-plugin/plugin.json +1 -1
- package/CHANGELOG.md +74 -0
- package/README.md +56 -6
- package/agents/debugger.md +12 -1
- package/agents/git-committer.md +1 -0
- package/agents/implementer.md +11 -2
- package/agents/investigator.md +75 -0
- package/agents/reviewer.md +7 -0
- package/agents/speaker.md +44 -0
- package/agents/verifier.md +4 -3
- package/bin/draht-tools.cjs +472 -41
- package/bin/judge +613 -0
- package/cli.mjs +769 -46
- package/commands/atomic-commit.md +1 -12
- package/commands/create-verification-skill.md +105 -0
- package/commands/discuss-phase.md +3 -14
- package/commands/execute-phase.md +7 -14
- package/commands/fix.md +38 -17
- package/commands/grill.md +66 -0
- package/commands/init-project.md +5 -15
- package/commands/map-codebase.md +1 -13
- package/commands/new-project.md +5 -15
- package/commands/next-milestone.md +2 -13
- package/commands/orchestrate.md +1 -1
- package/commands/pause-work.md +1 -8
- package/commands/plan-phase.md +2 -11
- package/commands/progress.md +0 -8
- package/commands/quick.md +3 -11
- package/commands/resolve-conflicts.md +72 -0
- package/commands/resume-work.md +0 -8
- package/commands/review.md +4 -13
- package/commands/speak.md +45 -0
- package/commands/triage.md +161 -0
- package/commands/verify-work.md +5 -13
- package/commands/why.md +137 -0
- package/graph-archive.mjs +125 -0
- package/graph-manifest.mjs +97 -0
- package/hooks/hooks.json +39 -0
- package/package.json +5 -3
- package/scripts/gsd-quality-gate.cjs +3 -3
- package/scripts/judge-hook.cjs +42 -0
- package/scripts/judge-hook.py +391 -0
- package/scripts/judgegates.py +673 -0
- package/scripts/judgelib.py +382 -0
- package/scripts/speak.cjs +202 -0
- package/skills/atomic-commit/SKILL.md +1 -1
- package/skills/atomic-commit/command.md +62 -0
- package/skills/blast-radius/SKILL.md +55 -0
- package/skills/brainstorming/SKILL.md +11 -4
- package/skills/cinematic-continuation/SKILL.md +111 -0
- package/skills/cinematic-continuation/references/continuity-schema.md +75 -0
- package/skills/cinematic-continuation/references/seedance-adapter.md +44 -0
- package/skills/cinematic-continuation/references/style-bible.md +223 -0
- package/skills/cinematic-continuation/scripts/compile-continuation.mjs +173 -0
- package/skills/cinematic-continuation/templates/continuation-spec.json +50 -0
- package/skills/create-verification-skill/SKILL.md +14 -0
- package/skills/create-verification-skill/command.md +105 -0
- package/skills/debugging-workflow/SKILL.md +38 -10
- package/skills/discuss-phase/SKILL.md +1 -1
- package/skills/discuss-phase/command.md +44 -0
- package/skills/draht/SKILL.md +118 -0
- package/skills/epistemics/SKILL.md +99 -0
- package/skills/execute-phase/SKILL.md +1 -1
- package/skills/execute-phase/command.md +170 -0
- package/skills/fix/SKILL.md +1 -1
- package/skills/fix/command.md +154 -0
- package/skills/grill/SKILL.md +14 -0
- package/skills/grill/command.md +66 -0
- package/skills/gsd-workflow/SKILL.md +2 -0
- package/skills/init-project/SKILL.md +1 -1
- package/skills/init-project/command.md +57 -0
- package/skills/judge/SKILL.md +57 -0
- package/skills/map-codebase/SKILL.md +1 -1
- package/skills/map-codebase/command.md +61 -0
- package/skills/new-project/SKILL.md +1 -1
- package/skills/new-project/command.md +64 -0
- package/skills/next-milestone/SKILL.md +1 -1
- package/skills/next-milestone/command.md +42 -0
- package/skills/orchestrate/SKILL.md +1 -1
- package/skills/orchestrate/command.md +106 -0
- package/skills/orchestrate-loop/SKILL.md +1 -1
- package/skills/orchestrate-loop/command.md +100 -0
- package/skills/pause-work/SKILL.md +1 -1
- package/skills/pause-work/command.md +32 -0
- package/skills/plan-phase/SKILL.md +1 -1
- package/skills/plan-phase/command.md +139 -0
- package/skills/progress/SKILL.md +1 -1
- package/skills/progress/command.md +22 -0
- package/skills/quick/SKILL.md +1 -1
- package/skills/quick/command.md +91 -0
- package/skills/resolve-conflicts/SKILL.md +14 -0
- package/skills/resolve-conflicts/command.md +72 -0
- package/skills/resume-work/SKILL.md +1 -1
- package/skills/resume-work/command.md +27 -0
- package/skills/review/SKILL.md +1 -1
- package/skills/review/command.md +81 -0
- package/skills/saga-spawner/SKILL.md +131 -0
- package/skills/speak/SKILL.md +14 -0
- package/skills/speak/command.md +45 -0
- package/skills/tdd-workflow/SKILL.md +2 -0
- package/skills/triage/SKILL.md +14 -0
- package/skills/triage/command.md +161 -0
- package/skills/typescript-discipline/SKILL.md +50 -0
- package/skills/typescript-discipline/references/patterns.md +294 -0
- package/skills/unslop/SKILL.md +101 -0
- package/skills/verify-work/SKILL.md +1 -1
- package/skills/verify-work/command.md +116 -0
- package/skills/why/SKILL.md +14 -0
- package/skills/why/command.md +137 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: epistemics
|
|
3
|
+
description: Confidence calibration for investigation findings — five tiers (Direct, Supported, Inferred, Speculative, Unknown) that determine both which output section a claim goes in and how it is phrased; cite-or-label-as-inference; null results as first-class evidence; competing hypotheses without forcing a winner; the Sources Consulted coverage map. Use whenever reporting why code exists, summarising an investigation, writing a postmortem, or presenting findings whose evidence is historical, fragmentary, or secondhand. Triggers on "why was this built", "what's the history", "design rationale", "how confident are we", or any moment the agent is about to present an intent claim it cannot cite.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Epistemics
|
|
7
|
+
|
|
8
|
+
Code does not carry its own motivation. A diff shows what changed; nothing in it shows why. Every claim about intent, history, or rationale therefore rests on external evidence — a commit message, a PR description, a decision record, a planning note — and the honesty of a findings report lives in how precisely each claim's evidence is represented.
|
|
9
|
+
|
|
10
|
+
## The Core Rule
|
|
11
|
+
|
|
12
|
+
> **If you can't cite it, it's inference, not fact — and it must be labeled as such.**
|
|
13
|
+
|
|
14
|
+
A report that states inferences as facts is not a summary, it is fiction with a confident tone. The calibration below is the product; de-hedging it to sound authoritative is the exact failure this skill exists to prevent.
|
|
15
|
+
|
|
16
|
+
## The Five Tiers
|
|
17
|
+
|
|
18
|
+
The tier a claim earns determines **both** which output section it belongs in **and** the vocabulary allowed to phrase it.
|
|
19
|
+
|
|
20
|
+
1. **Direct** — an explicit statement of intent by someone in a position to know, citable verbatim. Phrase as fact with the citation adjacent.
|
|
21
|
+
- A PR description: "Switching to cursor pagination because offset scans time out past 100k rows" (PR #212).
|
|
22
|
+
- An ADR title and context section naming the decision and its forcing constraint.
|
|
23
|
+
- A `.planning/STATE.md` `## Decisions` line, dated and attributed.
|
|
24
|
+
2. **Supported** — multiple independent indirect sources converge on the same reading. Phrase as fact with all citations, and say the support is convergent, not explicit.
|
|
25
|
+
- A commit message names the symptom and the linked issue describes the incident it fixed.
|
|
26
|
+
- An inline comment names an upstream constraint and the dependency's changelog confirms it existed at that date.
|
|
27
|
+
3. **Inferred** — one plausible reading of circumstantial evidence. Phrase with hedged vocabulary and show the inference chain: "Given A and B, C is likely because D."
|
|
28
|
+
- The retry wrapper landed two days after a revert of the same call site — consistent with a reaction to a production failure, but nothing says so.
|
|
29
|
+
4. **Speculative** — a hypothesis the evidence neither supports nor rules out. Belongs only in a hypotheses section, phrased as a candidate, never in findings.
|
|
30
|
+
5. **Unknown** — the searches ran and came up empty, or the source that would know is unavailable. Reported explicitly, never silently omitted.
|
|
31
|
+
|
|
32
|
+
## Phrasing Guide
|
|
33
|
+
|
|
34
|
+
Confidence-carrying words assert knowledge of intent. Each one demands a citation immediately adjacent:
|
|
35
|
+
|
|
36
|
+
- "because", "the reason is", "was designed to", "fixes", "the team decided"
|
|
37
|
+
|
|
38
|
+
Hedge words mark inference and are the only vocabulary allowed for tier 3:
|
|
39
|
+
|
|
40
|
+
- "appears to", "likely", "suggests", "is consistent with", "one reading is"
|
|
41
|
+
|
|
42
|
+
Banned words: "obviously", "clearly", "of course", "just". And replace "I think" with "the evidence suggests" — the reader needs the evidence's confidence, not yours.
|
|
43
|
+
|
|
44
|
+
## Never Cite Code as Evidence of Its Own Intent
|
|
45
|
+
|
|
46
|
+
Code is mechanics; motivation is external. "The cache exists to reduce latency" cited to the cache implementation is circular — the code proves a cache exists, not why anyone wanted one. A performance rationale needs a source outside the code: a commit message, a benchmark in the PR, a decision record. Without one, it is an Inferred claim wearing a fact's clothes.
|
|
47
|
+
|
|
48
|
+
## Null Results Are Evidence; Skipped Searches Are Blind Spots
|
|
49
|
+
|
|
50
|
+
- A **null result** — "searched the review record for pagination discussion across the file's full history; nothing found" — is a data point. It rules readings out and belongs in the report.
|
|
51
|
+
- A **skipped search** is a blind spot. It rules nothing out and must be reported as a gap, not dressed up as a null result.
|
|
52
|
+
|
|
53
|
+
The reader cannot tell the two apart unless the report distinguishes them. Always state what was searched (queries verbatim) so an empty result is meaningful.
|
|
54
|
+
|
|
55
|
+
## Contradictions Are Findings
|
|
56
|
+
|
|
57
|
+
When two sources disagree — the commit message says performance, the linked ticket says a correctness bug — surface both with their citations. Do not pick the tidier narrative, do not average them into a vague middle. The historical record contradicts itself more often than it lies consistently, and the contradiction is usually the most informative thing the investigation found.
|
|
58
|
+
|
|
59
|
+
## The Sycophancy Trap
|
|
60
|
+
|
|
61
|
+
When the question embeds a hypothesis — "why did we switch to X, was it performance?" — the embedded guess is a candidate to check independently, not a conclusion to confirm. Search for evidence that would support it AND evidence that would contradict it, at equal effort.
|
|
62
|
+
|
|
63
|
+
> **The user's guess is a prompt for investigation, not a conclusion to validate.**
|
|
64
|
+
|
|
65
|
+
## Anti-Rationalization
|
|
66
|
+
|
|
67
|
+
- Never retrofit intent: "this must have been for scalability" is storytelling unless a source says so.
|
|
68
|
+
- A consistent pattern across files may be a deliberate convention — or copy-paste of the first instance. Investigate the origin, don't infer policy from repetition.
|
|
69
|
+
- Absence of evidence is not evidence of absence: "no discussion found" supports "we found no discussion", not "there was no discussion".
|
|
70
|
+
|
|
71
|
+
## The Coverage-Map Contract
|
|
72
|
+
|
|
73
|
+
Every findings report ends with a **Sources Consulted** map: one line per evidence category, including the empty ones. A category may be skipped only with a written justification, and only two justifications are valid:
|
|
74
|
+
|
|
75
|
+
1. **Unavailable in this runtime** — the source cannot be searched here. That is a coverage gap, not a choice, and is reported as one.
|
|
76
|
+
2. **Provably irrelevant, not probably.** A build-time script with no runtime path provably cannot appear in runtime error tracking. "It's feature code, error tracking won't have anything" is a probability judgment, not a proof — search it.
|
|
77
|
+
|
|
78
|
+
## Calibration Checklist
|
|
79
|
+
|
|
80
|
+
Before finalizing any findings report:
|
|
81
|
+
|
|
82
|
+
- Does every factual claim have a citation adjacent to it?
|
|
83
|
+
- Is every uncited claim phrased with tier-3 hedge vocabulary and filed in an inference section?
|
|
84
|
+
- Is any claim citing code as evidence of its own intent?
|
|
85
|
+
- Is the gaps section present and specific? **If no gaps are mentioned, that's suspicious** — every real investigation has them.
|
|
86
|
+
|
|
87
|
+
## Failure Modes
|
|
88
|
+
|
|
89
|
+
- **Confident storytelling** — a plausible narrative assembled from mechanics and phrased as history. The most common failure, and the hardest to spot from inside.
|
|
90
|
+
- **Citing code as evidence of its own intent** — circular sourcing dressed as citation.
|
|
91
|
+
- **Recency bias** — explaining the current shape as one decision when it is an accretion of many. Trace back through the history; the first version's rationale is usually not the current version's.
|
|
92
|
+
- **Sycophantic confirmation** — finding only the evidence that agrees with the asker's framing.
|
|
93
|
+
- **Skipping the gaps section** — shipping a coverage map with no empties is claiming a completeness no investigation has.
|
|
94
|
+
|
|
95
|
+
## Relationship to verification-gate
|
|
96
|
+
|
|
97
|
+
`verification-gate` governs claims about **present** state that a command can prove — run the command, read the output, then claim. Epistemics governs claims about **historical intent** that no command can prove: there is nothing to run, so the discipline is to tier and cite instead. The two compose; neither substitutes for the other.
|
|
98
|
+
|
|
99
|
+
One fixed-format carve-out: `verify-work`'s observed/derived/assumed labels and its verdict-first UAT ordering are fixed report formats — epistemics governs historical-intent claims and never rewords those labels or that ordering.
|
|
@@ -8,7 +8,7 @@ description: Draht command prompt wrapper for execute-phase. Use when the user s
|
|
|
8
8
|
This skill exposes the Draht prompt command template to Codex's `$draht` and `/skills` surfaces.
|
|
9
9
|
|
|
10
10
|
When invoked:
|
|
11
|
-
1. Read
|
|
11
|
+
1. Read `./command.md` in this skill's directory.
|
|
12
12
|
2. Treat the user's text after the skill mention as `$ARGUMENTS`. If the template uses `$1`, use the first positional argument.
|
|
13
13
|
3. Follow that command template as the active workflow.
|
|
14
14
|
4. Use Draht support skills such as `atomic-reasoning`, `tdd-workflow`, `verification-gate`, or `debugging-workflow` when the command template calls for that discipline.
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Execute all plans in a phase with atomic commits (parallel implementer subagents + per-task two-stage review + TDD cycle)
|
|
3
|
+
argument-hint: "<phase-number> [--gaps-only]"
|
|
4
|
+
allowed-tools: Bash, Read, Write, Edit, Task
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /execute-phase
|
|
8
|
+
|
|
9
|
+
Execute all plans in a phase with atomic commits, parallelizing independent plans via subagents. Each task is implemented, then **spec-reviewed**, then **quality-reviewed** before the next task begins.
|
|
10
|
+
|
|
11
|
+
Phase: $1
|
|
12
|
+
Arguments: $ARGUMENTS
|
|
13
|
+
|
|
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
|
+
|
|
16
|
+
## Red Flags — STOP
|
|
17
|
+
|
|
18
|
+
STOP and report to the user instead of proceeding if **any** of these is true:
|
|
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.
|
|
32
|
+
|
|
33
|
+
## Steps
|
|
34
|
+
|
|
35
|
+
0. Run the pre-execute check:
|
|
36
|
+
```bash
|
|
37
|
+
node "${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-$HOME/.draht/codex-marketplace/plugins/draht}}/scripts/gsd-pre-execute.cjs" $1
|
|
38
|
+
```
|
|
39
|
+
If it exits non-zero, STOP and report errors to the user. Do not proceed.
|
|
40
|
+
|
|
41
|
+
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 parallelize ONLY plans whose blast-radius/sink sets are disjoint; serialize any plans with overlapping reverse-dependents.
|
|
43
|
+
3. **Validate plans before dispatching:**
|
|
44
|
+
```bash
|
|
45
|
+
node "${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-$HOME/.draht/codex-marketplace/plugins/draht}}/bin/draht-tools.cjs" validate-plans $1
|
|
46
|
+
```
|
|
47
|
+
If any plan reports placeholders or missing sections, STOP and fix the plan (or have the user re-run `/plan-phase`) before dispatching.
|
|
48
|
+
|
|
49
|
+
4. **Per-plan execution loop.** For each plan (parallel where independent, sequential where dependent):
|
|
50
|
+
|
|
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; only stop when a stage returns `STATUS: BLOCKED` or `STATUS: NEEDS_CONTEXT`.
|
|
52
|
+
|
|
53
|
+
### Stage 1 — Implementer
|
|
54
|
+
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` → **re-derive before trusting**: a `DONE` that does not quote its verification output (test counts, command output) is treated as `DONE_WITH_CONCERNS` — run the task's `<verify>` step yourself and read the result before Stage 2. Subagent claims are inputs, not verdicts.
|
|
56
|
+
- `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
|
+
- `STATUS: NEEDS_CONTEXT` → provide the missing context (paste the relevant file content or decision) and re-dispatch. Do not skip.
|
|
58
|
+
- `STATUS: BLOCKED` → STOP. Report the blocker to the user. Do not move on.
|
|
59
|
+
|
|
60
|
+
### Stage 2 — Spec-reviewer
|
|
61
|
+
Once the implementer is DONE, dispatch a Codex subagent using the `spec-reviewer` agent prompt and a prompt of the form:
|
|
62
|
+
```
|
|
63
|
+
Review the diff for task <task-name> in plan <plan-file> against the spec below. ONLY check spec compliance — does the diff implement exactly what the spec asked for, no more, no less?
|
|
64
|
+
|
|
65
|
+
Task spec:
|
|
66
|
+
<paste the <task>...</task> XML>
|
|
67
|
+
|
|
68
|
+
Diff to review:
|
|
69
|
+
<run `git diff <range>` and paste, or instruct the agent to run it>
|
|
70
|
+
```
|
|
71
|
+
- `STATUS: DONE` → go to Stage 3.
|
|
72
|
+
- `STATUS: DONE_WITH_CONCERNS` → note, go to Stage 3.
|
|
73
|
+
- `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
|
+
|
|
75
|
+
### Stage 3 — Reviewer (code quality)
|
|
76
|
+
Once spec compliance is ✅, dispatch a Codex subagent using the `reviewer` agent prompt and a prompt of the form:
|
|
77
|
+
```
|
|
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 — do NOT re-check spec.
|
|
79
|
+
|
|
80
|
+
Diff to review:
|
|
81
|
+
<run `git diff <range>` and paste, or instruct the agent to run it>
|
|
82
|
+
```
|
|
83
|
+
- `STATUS: DONE` → task is complete, run the post-task hook (below), then move to the next task.
|
|
84
|
+
- `STATUS: DONE_WITH_CONCERNS` → log the `Should fix` items; if any are correctness-critical, re-dispatch implementer; otherwise log and move on.
|
|
85
|
+
- `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
|
+
|
|
87
|
+
### Post-task hook
|
|
88
|
+
After Stage 3 passes for a task — or when a task hits the re-dispatch cap — record the result:
|
|
89
|
+
```bash
|
|
90
|
+
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
|
+
```
|
|
92
|
+
If the hook exits non-zero (3+ recorded failures for the task), that is a **harness-enforced hard stop**: do not dispatch any further implementer runs for this task; report to the user or create a fix plan.
|
|
93
|
+
|
|
94
|
+
5. After all plans complete, run `draht-tools verify-phase $1` yourself (not the subagent)
|
|
95
|
+
6. Run the post-phase hook to generate the phase report:
|
|
96
|
+
```bash
|
|
97
|
+
node "${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-$HOME/.draht/codex-marketplace/plugins/draht}}/scripts/gsd-post-phase.cjs" $1
|
|
98
|
+
```
|
|
99
|
+
7. Run `draht-tools update-state` yourself
|
|
100
|
+
8. Final commit: `draht-tools commit-docs "complete phase $1 execution"`
|
|
101
|
+
9. Tell the user to start a fresh session (`/clear`) and run `/verify-work $1`
|
|
102
|
+
|
|
103
|
+
## Subagent Task Template (Stage 1: implementer)
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
Execute this plan. Here is the full plan content:
|
|
107
|
+
|
|
108
|
+
<paste full plan XML here>
|
|
109
|
+
|
|
110
|
+
[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
|
+
|
|
112
|
+
For each <task> in the plan, follow this TDD cycle:
|
|
113
|
+
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
|
+
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
|
+
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
|
+
4. VERIFY — Run the <verify> step, confirm <done> criteria are met.
|
|
117
|
+
|
|
118
|
+
Domain rules: Use ubiquitous language from .planning/DOMAIN.md (read it). Do not import across bounded context boundaries.
|
|
119
|
+
|
|
120
|
+
Comment discipline: 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.
|
|
121
|
+
|
|
122
|
+
Checkpoint handling:
|
|
123
|
+
- type="auto" → execute silently.
|
|
124
|
+
- type="checkpoint:human-verify" → stop and report back what was built.
|
|
125
|
+
- type="checkpoint:decision" → stop and report the options.
|
|
126
|
+
|
|
127
|
+
Evidence rule: quote the decisive output of every test run and <verify> step in your report (pass/fail counts, exit codes, error text). Unquoted claims will be re-run by the orchestrator. If a plan instruction contradicts what you find in the code, stop and report NEEDS_CONTEXT — do not silently obey either side.
|
|
128
|
+
|
|
129
|
+
End your response with `STATUS: DONE` / `DONE_WITH_CONCERNS` / `NEEDS_CONTEXT` / `BLOCKED` per the agent contract.
|
|
130
|
+
```
|
|
131
|
+
|
|
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
|
+
## Parallelization Rules
|
|
139
|
+
|
|
140
|
+
- Plans sharing no files and having no dependency edges can run in parallel
|
|
141
|
+
- If plan B depends on output of plan A, plan B must wait for A to complete
|
|
142
|
+
- **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
|
+
- If a parallel subagent fails, report which plan failed and continue with independent plans
|
|
144
|
+
|
|
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
|
+
## Workflow
|
|
159
|
+
|
|
160
|
+
This is one step in the per-phase cycle:
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
/discuss-phase N → /plan-phase N → /execute-phase N → /verify-work N
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
After completing this command, tell the user to start a fresh session (`/clear`) and run `/verify-work $1`. Do NOT suggest `/next-milestone`.
|
|
167
|
+
|
|
168
|
+
## Flags
|
|
169
|
+
|
|
170
|
+
- `--gaps-only` → only execute FIX-PLAN.md files from failed verification
|
package/skills/fix/SKILL.md
CHANGED
|
@@ -8,7 +8,7 @@ description: Draht command prompt wrapper for fix. Use when the user selects the
|
|
|
8
8
|
This skill exposes the Draht prompt command template to Codex's `$draht` and `/skills` surfaces.
|
|
9
9
|
|
|
10
10
|
When invoked:
|
|
11
|
-
1. Read
|
|
11
|
+
1. Read `./command.md` in this skill's directory.
|
|
12
12
|
2. Treat the user's text after the skill mention as `$ARGUMENTS`. If the template uses `$1`, use the first positional argument.
|
|
13
13
|
3. Follow that command template as the active workflow.
|
|
14
14
|
4. Use Draht support skills such as `atomic-reasoning`, `tdd-workflow`, `verification-gate`, or `debugging-workflow` when the command template calls for that discipline.
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Diagnose and fix a bug using a 4-phase systematic debugging protocol with TDD discipline
|
|
3
|
+
argument-hint: "<description of what's broken>"
|
|
4
|
+
allowed-tools: Bash, Read, Write, Edit, Task
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /fix
|
|
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
|
+
Issue: $ARGUMENTS
|
|
12
|
+
|
|
13
|
+
> **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 subagents, spawn Codex subagents using the `debugger` or `implementer` agent prompts.
|
|
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.
|
|
28
|
+
|
|
29
|
+
Not every why is a bug: if the user is asking why the code is *shaped* the way it is — intent, history, design rationale — and nothing is misbehaving, route to `/why` instead. `/fix` answers defects; `/why` answers intent. When Phase 1 needs design intent (is this behaviour a decision or an accident?), consult `/why` and feed its Preserve/Avoid constraints into the hypothesis ranking. A `/triage` verdict ending in `[triage:bug]` or `[triage:performance]` is a ready entry here: take the linked tracker issue as the report and treat triage's cause-trace findings as ranked-hypothesis material — labeled hypotheses, not a diagnosis.
|
|
30
|
+
|
|
31
|
+
## Red Flags — STOP
|
|
32
|
+
|
|
33
|
+
Stop immediately if you catch yourself:
|
|
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
|
|
42
|
+
|
|
43
|
+
When you've tried **3 fix attempts and still failing**, STOP. This is a **hard cap**, not advice — an architectural problem, not a hypothesis problem. Report back to the user — do not try a 4th fix. Before reporting, append one line to `.planning/STATE.md` under `## Lessons`: what was tried, why it failed, dated — so the next session doesn't repeat the same three attempts.
|
|
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:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
Investigate this issue using Phase 1 root-cause discipline. Do NOT fix anything — only diagnose.
|
|
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`.
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
If `BLOCKED` or `NEEDS_CONTEXT`: provide the missing info and re-dispatch. Do not skip ahead.
|
|
88
|
+
|
|
89
|
+
### Phase 2 — Pattern Analysis
|
|
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>"`
|
|
128
|
+
|
|
129
|
+
4. **Verify the fix solved the original symptom**, not just the unit test. Run the user-level reproduction one more time.
|
|
130
|
+
|
|
131
|
+
5. **Sweep instrumentation** — grep your `[DEBUG-` prefix across the tree; the fix is not done until the grep returns nothing. Tagged probes die here; untagged probes survive to pollute production.
|
|
132
|
+
|
|
133
|
+
6. **Update state**: `draht-tools update-state`
|
|
134
|
+
|
|
135
|
+
## Rationalization Table
|
|
136
|
+
|
|
137
|
+
| Excuse | Reality |
|
|
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. |
|
|
147
|
+
|
|
148
|
+
## Rules
|
|
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)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: grill
|
|
3
|
+
description: Draht command prompt wrapper for grill. Use when the user wants to stress-test any subject — an idea, a spec, raw tickets, an architecture decision, or an open discussion — through relentless structured interrogation with no presumed outcome. Triggers on phrases like "grill", "stress-test", "poke holes in", "interrogate", "tear this apart".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Draht Command: grill
|
|
7
|
+
|
|
8
|
+
This skill exposes the Draht prompt command template to Codex's `$draht` and `/skills` surfaces.
|
|
9
|
+
|
|
10
|
+
When invoked:
|
|
11
|
+
1. Read `./command.md` in this skill's directory.
|
|
12
|
+
2. Treat the user's text after the skill mention as `$ARGUMENTS`. If the template uses `$1`, use the first positional argument.
|
|
13
|
+
3. Follow that command template as the active workflow.
|
|
14
|
+
4. Use Draht support skills such as `atomic-reasoning`, `tdd-workflow`, `verification-gate`, or `debugging-workflow` when the command template calls for that discipline.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Grill any subject in whole-frontier question rounds — an idea, a spec, raw tickets, an architecture decision, or an open discussion; the output form is chosen at the end, not presumed at the start
|
|
3
|
+
argument-hint: "[subject]"
|
|
4
|
+
allowed-tools: Bash, Read, Write, Edit, Task
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /grill
|
|
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
|
+
Subject: $ARGUMENTS
|
|
17
|
+
|
|
18
|
+
> **Tool note**: For environment facts, spawn a Codex subagent using the `architect` agent prompt — read-only fact-finding; never block the current round on it.
|
|
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:
|
|
50
|
+
|
|
51
|
+
1. **Refined spec** → `.planning/specs/YYYY-MM-DD-<slug>-design.md`. When it describes a project to build, offer to hand off to `/new-project` or `/init-project`.
|
|
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
|
|
55
|
+
|
|
56
|
+
Whatever form is chosen, write the artifact through the `unslop` skill; the user's own words in quoted decisions stay verbatim.
|
|
57
|
+
|
|
58
|
+
When no `.planning/` directory exists, every mode becomes a standalone file the user names. "No artifact" is a valid answer — sometimes the conversation was the point. Never start implementing or invoke a planning command without the user's explicit go-ahead.
|
|
59
|
+
|
|
60
|
+
## Anti-Patterns — STOP
|
|
61
|
+
|
|
62
|
+
- **Dribbling questions one at a time** — a serial interview hides the decision tree and wastes rounds; ask the whole frontier, numbered, with recommended answers
|
|
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
|
|
@@ -7,6 +7,8 @@ description: Draht's Get Shit Done workflow — how to use /new-project, /discus
|
|
|
7
7
|
|
|
8
8
|
Draht's GSD workflow is a milestone → phase → plan → task hierarchy that lives in `.planning/` and is driven by slash commands + hooks.
|
|
9
9
|
|
|
10
|
+
At repository-saga scope, each planned `saga-spawner` beat maps 1:1 to one roadmap phase; the saga graph schedules phases without replacing their plans or verification.
|
|
11
|
+
|
|
10
12
|
## Directory Structure
|
|
11
13
|
|
|
12
14
|
```
|
|
@@ -8,7 +8,7 @@ description: Draht command prompt wrapper for init-project. Use when the user se
|
|
|
8
8
|
This skill exposes the Draht prompt command template to Codex's `$draht` and `/skills` surfaces.
|
|
9
9
|
|
|
10
10
|
When invoked:
|
|
11
|
-
1. Read
|
|
11
|
+
1. Read `./command.md` in this skill's directory.
|
|
12
12
|
2. Treat the user's text after the skill mention as `$ARGUMENTS`. If the template uses `$1`, use the first positional argument.
|
|
13
13
|
3. Follow that command template as the active workflow.
|
|
14
14
|
4. Use Draht support skills such as `atomic-reasoning`, `tdd-workflow`, `verification-gate`, or `debugging-workflow` when the command template calls for that discipline.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Initialize GSD planning for an existing project (codebase mapping → questioning → domain model → roadmap)
|
|
3
|
+
argument-hint: "[focus area]"
|
|
4
|
+
allowed-tools: Bash, Read, Write, Edit, Task
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /init-project
|
|
8
|
+
|
|
9
|
+
Initialize planning framework for an existing project: codebase mapping → questioning → domain model → requirements → roadmap.
|
|
10
|
+
|
|
11
|
+
Focus: $ARGUMENTS
|
|
12
|
+
|
|
13
|
+
Use this when you have an existing codebase and want to add structured planning. For greenfield projects, use `/new-project` instead.
|
|
14
|
+
|
|
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
|
+
|
|
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
|
+
## Steps
|
|
22
|
+
1. Run `draht-tools init` to check preconditions (git repo, etc.)
|
|
23
|
+
2. Run `draht-tools map-codebase` to build a structural map of the existing code, then `draht-tools map-graph` to produce `.planning/codebase/MAP.json` + `GRAPH_REPORT.md` (map-codebase alone does NOT emit MAP.json)
|
|
24
|
+
3. Analyze the codebase map to understand architecture, tech stack, and conventions: read `.planning/codebase/MAP.json` and run `draht-tools graph-hotspots` + `draht-tools graph-clusters` to surface high-traffic and cohesive modules
|
|
25
|
+
4. Deep questioning phase (3-7 rounds — each round asks the whole frontier: settled-prerequisite questions only, numbered, each with a recommended answer):
|
|
26
|
+
- What is this project? Who uses it?
|
|
27
|
+
- What are the current pain points or goals?
|
|
28
|
+
- What is MVP vs aspirational scope?
|
|
29
|
+
- What constraints exist (infra, team size, deadlines)?
|
|
30
|
+
5. Run `draht-tools create-project` with gathered info
|
|
31
|
+
6. Run `draht-tools create-domain-model` to define bounded contexts, entities, and ubiquitous language
|
|
32
|
+
7. Create `.planning/DOMAIN.md` with the same sections as `/new-project`:
|
|
33
|
+
Bounded Contexts, Ubiquitous Language, Context Map, Aggregates, Domain Events.
|
|
34
|
+
Seed the Ubiquitous Language glossary from `GRAPH_REPORT.md` key concepts / `modules[*].symbols` (start from extracted terms, not zero)
|
|
35
|
+
8. Create `.planning/TEST-STRATEGY.md` with: Test Framework, Directory Conventions, Coverage Goals, Testing Levels, Excluded
|
|
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 project planning"`
|
|
41
|
+
|
|
42
|
+
## Workflow
|
|
43
|
+
After project initialization, phases are executed one at a time in fresh sessions:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
/init-project → /discuss-phase 1 → /plan-phase 1 → /execute-phase 1 → /verify-work 1
|
|
47
|
+
→ ... (repeat for all phases in the milestone)
|
|
48
|
+
→ /next-milestone (only after ALL phases are complete)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Rules
|
|
52
|
+
- Ask the whole frontier per round — numbered, each with a recommended answer; the user replies by number, and accepted-by-number counts as decided
|
|
53
|
+
- Questions that depend on still-open answers wait for a later round
|
|
54
|
+
- Finding facts is your job, never the user's — dispatch a subagent for anything the environment can answer and keep asking the rest of the frontier while it runs
|
|
55
|
+
- When the focus names a solution ("migrate to X"), ask what problem it solves — the existing code may admit a smaller answer
|
|
56
|
+
- Respect what already exists — do not propose rewriting working code
|
|
57
|
+
- Stop when you have: current state, goals, MVP scope, constraints, success criteria
|