draht-codex 2026.7.30 → 2026.10.4-2
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 +81 -0
- package/README.md +57 -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 +3 -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 +6 -13
- package/commands/speak.md +45 -0
- package/commands/triage.md +161 -0
- package/commands/verify-work.md +6 -13
- package/commands/why.md +141 -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 +56 -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 +119 -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/explainers/SKILL.md +65 -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 +140 -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 +83 -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 +119 -0
- package/skills/verify-work/SKILL.md +1 -1
- package/skills/verify-work/command.md +117 -0
- package/skills/why/SKILL.md +14 -0
- package/skills/why/command.md +141 -0
package/commands/quick.md
CHANGED
|
@@ -18,17 +18,7 @@ Before planning, verify the task is actually quick: grep the blast radius (calle
|
|
|
18
18
|
|
|
19
19
|
## Atomic Reasoning
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
1. **State the logical component** — What is the single, concrete outcome? What files need to change? What behavior needs to work?
|
|
24
|
-
2. **Validate independence** — Can this be done without touching other features? What dependencies exist? What could break?
|
|
25
|
-
3. **Verify correctness** — What test proves this works? What edge cases matter? Is this testable behavior or pure config?
|
|
26
|
-
|
|
27
|
-
**Synthesize execution plan:**
|
|
28
|
-
- Define specific files to modify
|
|
29
|
-
- Write failing test (if testable behavior)
|
|
30
|
-
- Implement minimal solution
|
|
31
|
-
- Verify and document
|
|
21
|
+
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.
|
|
32
22
|
|
|
33
23
|
## Steps
|
|
34
24
|
1. Run `draht-tools next-quick-number` to get task number
|
|
@@ -49,6 +39,8 @@ Before executing, decompose this task into atomic reasoning units:
|
|
|
49
39
|
|
|
50
40
|
Exception: skip the TDD cycle only for pure config or documentation-only tasks that have no testable behaviour.
|
|
51
41
|
|
|
42
|
+
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.
|
|
43
|
+
|
|
52
44
|
After completion, report: files changed, tests written, and verification results.
|
|
53
45
|
|
|
54
46
|
End your response with `STATUS: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED` per the agent contract.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Resolve an in-progress git merge or rebase conflict by reconstructing both sides' intent
|
|
3
|
+
argument-hint: "[branch or context, e.g. agent/<taskId>]"
|
|
4
|
+
allowed-tools: Bash, Read, Write, Edit
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /resolve-conflicts
|
|
8
|
+
|
|
9
|
+
Resolve an in-progress git merge, rebase, or cherry-pick conflict by reconstructing the intent of both sides — never by picking a side blind.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
```
|
|
13
|
+
/resolve-conflicts [branch or context]
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Context: $ARGUMENTS
|
|
17
|
+
|
|
18
|
+
## When This Applies
|
|
19
|
+
|
|
20
|
+
- `git status` reports unmerged paths — a merge, rebase, or cherry-pick is mid-flight.
|
|
21
|
+
- A draht subagent run reported a failed worktree merge-back: the agent's work sits on an unmerged `agent/<taskId>` branch. Run `git merge agent/<taskId>` first to enter the conflict, then continue here.
|
|
22
|
+
|
|
23
|
+
## The Iron Law
|
|
24
|
+
|
|
25
|
+
> **EVERY HUNK RESOLUTION MUST BE JUSTIFIED BY THE RECOVERED INTENT OF BOTH SIDES. NO INTENT, NO RESOLUTION.**
|
|
26
|
+
|
|
27
|
+
A conflict is two changes with a reason each. Until you can state both reasons, you are not resolving — you are guessing.
|
|
28
|
+
|
|
29
|
+
## Phase 1 — Map the Conflict
|
|
30
|
+
|
|
31
|
+
1. `git status` — list every conflicted file.
|
|
32
|
+
2. Classify the operation: merge, rebase, or cherry-pick. Identify which ref is "ours" and which is "theirs" — a rebase swaps the intuitive meaning.
|
|
33
|
+
3. State the operation's goal in one sentence: what is this merge or rebase trying to bring in?
|
|
34
|
+
4. Read every conflict marker in full — all of them — before resolving any.
|
|
35
|
+
|
|
36
|
+
## Phase 2 — Intent Archaeology
|
|
37
|
+
|
|
38
|
+
For each side of each conflicted area, recover why the change was made:
|
|
39
|
+
|
|
40
|
+
- Commit messages: `git log --merge -p -- <file>` shows the commits touching the conflicted file from both sides.
|
|
41
|
+
- Each side's diff against the merge base: `git diff <base> <side> -- <file>`.
|
|
42
|
+
- PRs, issues, or tickets referenced in those commit messages.
|
|
43
|
+
- Planning documents (for example under `.planning/`) when the project keeps them.
|
|
44
|
+
|
|
45
|
+
Exit criterion: a one-sentence intent statement per side, per conflicted area. If an intent cannot be determined, STOP and ask the user — do not guess.
|
|
46
|
+
|
|
47
|
+
## Phase 3 — Resolve Hunk by Hunk
|
|
48
|
+
|
|
49
|
+
- Preserve both intents wherever they are compatible.
|
|
50
|
+
- Where they are incompatible, pick the side that matches the operation's stated goal and RECORD the trade-off — every recorded trade-off must appear in the merge commit message in Phase 5.
|
|
51
|
+
- Never invent behaviour that exists on neither side.
|
|
52
|
+
- If no stated goal decides an incompatibility, STOP and ask the user.
|
|
53
|
+
- Do not run `--abort` on your own. Aborting can be the right escape hatch — draht's own worktree isolator aborts failed merge-backs to keep the base branch clean — but it discards resolution work, so it is the user's call. Stop and ask instead.
|
|
54
|
+
|
|
55
|
+
## Phase 4 — Run the Project's Checks
|
|
56
|
+
|
|
57
|
+
Discover the project's own gates — package scripts, Makefile, CI config — and run them in order: typecheck, then tests, then lint/format. Fix what the merge broke, under the same rule: no invented behaviour.
|
|
58
|
+
|
|
59
|
+
## Phase 5 — Finish the Operation
|
|
60
|
+
|
|
61
|
+
- Merge: stage the resolved files and commit. The merge commit message names each recorded trade-off — which intent won where, and why.
|
|
62
|
+
- Rebase or cherry-pick: `git rebase --continue` / `git cherry-pick --continue` until every commit is replayed.
|
|
63
|
+
- Never `--no-verify`.
|
|
64
|
+
|
|
65
|
+
## Red Flags — STOP
|
|
66
|
+
|
|
67
|
+
Stop immediately if you catch yourself:
|
|
68
|
+
- Resolving a hunk whose "why" you cannot state for both sides
|
|
69
|
+
- Taking one side wholesale because it is newer, bigger, or yours
|
|
70
|
+
- Introducing behaviour that exists on neither side
|
|
71
|
+
- Finishing with failing checks, or reaching for `--no-verify`
|
|
72
|
+
- Running `--abort` without explicit user sign-off
|
package/commands/resume-work.md
CHANGED
|
@@ -9,14 +9,6 @@ Resume from last session state.
|
|
|
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
|
-
Before resuming, decompose handoff context into atomic reasoning units:
|
|
15
|
-
|
|
16
|
-
1. **State the logical component** — What phase/task was active? What was the last accomplishment? What decisions were made?
|
|
17
|
-
2. **Validate independence** — Are there blockers? What changed since the pause? Is the codebase in the expected state?
|
|
18
|
-
3. **Verify correctness** — Is the handoff document complete? Does the current state match what was documented? Can work continue safely?
|
|
19
|
-
|
|
20
12
|
## Steps
|
|
21
13
|
1. Read `.planning/CONTINUE-HERE.md` (if missing, tell the user there's nothing to resume)
|
|
22
14
|
2. Read `.planning/STATE.md` for current phase/status
|
package/commands/review.md
CHANGED
|
@@ -16,18 +16,9 @@ If no scope given, reviews all recent uncommitted changes.
|
|
|
16
16
|
|
|
17
17
|
## Atomic Reasoning
|
|
18
18
|
|
|
19
|
-
|
|
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
20
|
|
|
21
|
-
|
|
22
|
-
1. **State the logical component** — What does this change do? What problem does it solve? What behavior does it add/modify?
|
|
23
|
-
2. **Validate independence** — Does this change have side effects? Does it affect other modules? Are there hidden dependencies?
|
|
24
|
-
3. **Verify correctness** — Is this change correct? Type-safe? Secure? Does it follow conventions? What could go wrong?
|
|
25
|
-
|
|
26
|
-
**Synthesize review strategy:**
|
|
27
|
-
- Group changes by concern (correctness, security, style, spec compliance)
|
|
28
|
-
- Prioritize findings (critical, important, minor)
|
|
29
|
-
- Identify patterns across multiple files
|
|
30
|
-
- Check domain language compliance and bounded context boundaries
|
|
21
|
+
Check domain language compliance and bounded context boundaries.
|
|
31
22
|
|
|
32
23
|
## Steps
|
|
33
24
|
1. Identify the scope:
|
|
@@ -46,7 +37,7 @@ Before reviewing, decompose code changes into atomic reasoning units:
|
|
|
46
37
|
|
|
47
38
|
- **Codex subagent** with ``reviewer` agent prompt` and prompt:
|
|
48
39
|
```
|
|
49
|
-
Review the following code changes for correctness, type safety, conventions, and potential issues. Scope: <scope summary and file list>. Read each changed file to understand the changes. For each finding: cite the exact file and line, explain the issue, suggest the fix. Prioritize: Critical (must fix) > Important (should fix) > Minor (style/optional). Check domain language compliance against `.planning/DOMAIN.md` if it exists.
|
|
40
|
+
Review the following code changes for correctness, type safety, conventions, and potential issues. Scope: <scope summary and file list>. Read each changed file to understand the changes. For each finding: cite the exact file and line, explain the issue, suggest the fix. Prioritize: Critical (must fix) > Important (should fix) > Minor (style/optional). Treat comment-heavy new code as a design defect, not a style nit: comments exist only for constraints the code cannot express — if new code needed narration to be understood (step-by-step comments, diff restatements, "removed X" / "this handles Y" breadcrumbs), report the finding as "code needed narration" at Important or higher; the fix is rewriting the code until the comments are unnecessary, not deleting the comments. Check domain language compliance against `.planning/DOMAIN.md` if it exists.
|
|
50
41
|
|
|
51
42
|
End with `STATUS: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED`.
|
|
52
43
|
```
|
|
@@ -69,7 +60,7 @@ Before reviewing, decompose code changes into atomic reasoning units:
|
|
|
69
60
|
|
|
70
61
|
5. Read each subagent's final `STATUS:` line.
|
|
71
62
|
6. Collect and merge results from all dispatched subagents.
|
|
72
|
-
7. **Refute before reporting.** For each Critical or Important finding, attempt to kill it yourself before it reaches the report: read the code path that would make it a false positive — an upstream guard clause, a type constraint, an existing test that covers the case. A finding that survives an honest refutation attempt is **confirmed** (you traced the failing path); one you couldn't confirm is downgraded and labeled **suspected**. Reporting unattacked findings trains readers to ignore the report.
|
|
63
|
+
7. **Refute before reporting.** For each Critical or Important finding, attempt to kill it yourself before it reaches the report: read the code path that would make it a false positive — an upstream guard clause, a type constraint, an existing test that covers the case. A finding that survives an honest refutation attempt is **confirmed** (you traced the failing path); one you couldn't confirm is downgraded and labeled **suspected**. Reporting unattacked findings trains readers to ignore the report. A Critical finding whose refutation hinges on library or runtime behavior gets a rung-4 script, not an argument: write and run a small script or test against the real code yourself — this proof stays with the orchestrator; the review subagents are scoped to reading the diff — per the `blast-radius` skill.
|
|
73
64
|
8. Produce a unified, prioritized findings report. Verdict first: one line — mergeable or not, and why. Then findings:
|
|
74
65
|
- **Critical** — must fix before merge (security `BLOCKED`, spec gaps for required deliverables, correctness issues that cause data loss / crashes)
|
|
75
66
|
- **Important** — should fix (bugs, type issues, spec over-builds, missing error handling)
|
|
@@ -77,6 +68,8 @@ Before reviewing, decompose code changes into atomic reasoning units:
|
|
|
77
68
|
|
|
78
69
|
Each finding carries its label (confirmed/suspected). End with residual risk: what the review did NOT cover (files skipped, paths not traced) — a review that claims total coverage it doesn't have is worse than a scoped one.
|
|
79
70
|
|
|
71
|
+
When a finding spans a call path or several files, show that path as a Mermaid diagram per the `explainers` skill, built only from the files and lines the finding cites. Report prose follows the `unslop` skill.
|
|
72
|
+
|
|
80
73
|
## Reading STATUS
|
|
81
74
|
|
|
82
75
|
- Any subagent returning `STATUS: BLOCKED` → its findings escalate to Critical in the merged report
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Speak text aloud via ElevenLabs text-to-speech (voice output for summaries, status updates, or any message the user should hear)
|
|
3
|
+
allowed-tools: Bash, Read
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /speak
|
|
7
|
+
|
|
8
|
+
Speak text aloud to the user through the local audio device, using the ElevenLabs text-to-speech API.
|
|
9
|
+
|
|
10
|
+
> **Tool note**: Invoke the speak helper as `node "${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-$HOME/.draht/codex-marketplace/plugins/draht}}/scripts/speak.cjs" [options] "text"` via the Bash tool.
|
|
11
|
+
|
|
12
|
+
## What to speak
|
|
13
|
+
|
|
14
|
+
- `$ARGUMENTS` is the text to speak. If it is empty, speak a short spoken-style summary of the most recent result or answer in the conversation.
|
|
15
|
+
- Rewrite for the ear before speaking: short sentences, no markdown, no code blocks, no raw URLs or file paths (say "the gateway config" instead of reading a path aloud). Keep it under roughly 60 seconds of speech (~1000 characters) unless the user asked for the full text.
|
|
16
|
+
- Speak in the language the user is currently using.
|
|
17
|
+
|
|
18
|
+
## Helper options
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
node "${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-$HOME/.draht/codex-marketplace/plugins/draht}}/scripts/speak.cjs" [options] "text"
|
|
22
|
+
--voice <id> ElevenLabs voice id (default: $DRAHT_SPEAK_VOICE_ID or George)
|
|
23
|
+
--model <id> model id (default: $DRAHT_SPEAK_MODEL_ID or eleven_flash_v2_5)
|
|
24
|
+
--speed <n> speaking speed 0.25–4.0
|
|
25
|
+
--lang <code> ISO 639-1 language hint (e.g. de, en)
|
|
26
|
+
--out <file> also keep the mp3 at this path
|
|
27
|
+
--no-play synthesize only, do not play audio
|
|
28
|
+
--force bypass the 4000-character cost guard
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Long text can also be piped on stdin instead of passed as an argument.
|
|
32
|
+
|
|
33
|
+
## API key
|
|
34
|
+
|
|
35
|
+
The helper resolves the key in this order: `$ELEVENLABS_API_KEY` → an `ELEVENLABS_API_KEY=` line in a `.env` file in the working directory → `$HOME/.draht/keys/elevenlabs.key`. If it reports no key, tell the user to store their ElevenLabs API key in one of those places (the `$HOME/.draht/keys/elevenlabs.key` file is the recommended persistent location) — never ask them to paste the key into the chat.
|
|
36
|
+
|
|
37
|
+
## Delegating
|
|
38
|
+
|
|
39
|
+
To speak without blocking the main conversation — or to voice progress updates during long-running work — spawn the `speaker` subagent with the text to speak and the helper path above.
|
|
40
|
+
|
|
41
|
+
## Steps
|
|
42
|
+
|
|
43
|
+
1. Determine the text (from `$ARGUMENTS` or by summarizing), rewrite it for the ear.
|
|
44
|
+
2. Run the helper via Bash. On error, relay the helper's message (missing key, rate limit, no audio player) — do not retry more than once.
|
|
45
|
+
3. Confirm briefly what was spoken (one line, e.g. "Spoke the phase summary, 12 seconds.").
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Triage an external issue report — classify, bounded cause trace, dedupe against GitHub Issues, fail-closed ticket creation, one typed verdict
|
|
3
|
+
argument-hint: "<pasted report, issue URL, or gh issue view output>"
|
|
4
|
+
allowed-tools: Bash, Read, Task
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /triage
|
|
8
|
+
|
|
9
|
+
Classify one external issue report and end with one useful verdict. Create a tracker issue only for a clear, new bug. Do not reproduce or fix anything here — `/fix` owns that, and a `[triage:bug]` verdict is its entry ticket.
|
|
10
|
+
|
|
11
|
+
Report: $ARGUMENTS
|
|
12
|
+
|
|
13
|
+
> **Tool note**: For the bounded cause trace, spawn a Codex subagent using the `debugger` agent prompt — findings-only diagnosis (no fixes, no writes); classification and every tracker write stay with the orchestrator.
|
|
14
|
+
|
|
15
|
+
## Fail-Closed Rules
|
|
16
|
+
|
|
17
|
+
- One report, one run, one verdict. Do not narrate progress into the tracker.
|
|
18
|
+
- **Prefer no ticket over a guessed or duplicate ticket.**
|
|
19
|
+
- The `debugger` dispatch is findings-only: it diagnoses and reports; it fixes nothing, writes nothing, and never touches the tracker.
|
|
20
|
+
- No repository access → no cause trace: continue with a conservative classification and say in the verdict that cause tracing was unavailable.
|
|
21
|
+
- No confident dedupe → no ticket.
|
|
22
|
+
- Never create an issue that cannot link back to the source report.
|
|
23
|
+
- If a `gh` operation the creation gate requires is unavailable (not installed, unauthenticated, wrong repo), fail closed for that write and say so — the verdict still lands.
|
|
24
|
+
|
|
25
|
+
## 1 — Freeze the source coordinates
|
|
26
|
+
|
|
27
|
+
Pin what "the report" is before delegating or searching, and store it immutably for the rest of the run:
|
|
28
|
+
|
|
29
|
+
- A pasted report → quote its first line verbatim and record where it came from (chat, e-mail, support tool) as the user stated it.
|
|
30
|
+
- An issue URL or `gh issue view` output → store `owner/repo` + issue number, then read it whole: `gh issue view <n> --repo <owner/repo> --json url,title,state,body,comments`.
|
|
31
|
+
- Resolve the target repo for dedupe and creation: the current repo unless the report names another. Ambiguous target → ask; never guess where a ticket lands.
|
|
32
|
+
|
|
33
|
+
Every later read, search, and write uses these stored values. A reply, a cross-link, or a search hit never replaces them.
|
|
34
|
+
|
|
35
|
+
## 2 — Read the whole report
|
|
36
|
+
|
|
37
|
+
Capture before judging:
|
|
38
|
+
|
|
39
|
+
- Reporter wording, verbatim
|
|
40
|
+
- Product version, build, environment, platform when present
|
|
41
|
+
- Expected behavior vs observed behavior
|
|
42
|
+
- Frequency and trigger
|
|
43
|
+
- Error text or stack signature
|
|
44
|
+
- Existing issue, commit, or PR links
|
|
45
|
+
- Any explicit statement that someone is already fixing it
|
|
46
|
+
|
|
47
|
+
If the report references an attachment, screenshot, or recording you cannot read, say so in the verdict — do not invent what it shows.
|
|
48
|
+
|
|
49
|
+
## 3 — Trace cause before routing
|
|
50
|
+
|
|
51
|
+
A bounded source-and-history pass, before choosing a category or an owner. Dispatch the `debugger` agent with this prompt:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
Investigate this external issue report using root-cause discipline. FINDINGS ONLY: do NOT fix anything, do NOT write or edit files, do NOT create or comment on tracker issues.
|
|
55
|
+
|
|
56
|
+
Report (frozen — do not reinterpret):
|
|
57
|
+
<reporter wording, expected/observed, error text or stack signature, version/environment, trigger>
|
|
58
|
+
|
|
59
|
+
Bounded pass — report on each step:
|
|
60
|
+
1. Identify the likely code path from the reported action to the observed result (file:line anchors).
|
|
61
|
+
2. Check whether the visible symptom belongs to that code path or to a dependency below it.
|
|
62
|
+
3. If the report looks like a regression: `git log --oneline -20` and recent diffs on the affected files — name candidate commits.
|
|
63
|
+
4. Check whether a merged commit or open PR already addresses the same symptom.
|
|
64
|
+
5. Separate confirmed facts from hypotheses — label every statement observed, derived, or assumed.
|
|
65
|
+
|
|
66
|
+
Stop at diagnosis strength sufficient for routing — a complete root cause is /fix's job, not yours. Do not build a reproduction unless one command is already obvious from the report itself.
|
|
67
|
+
|
|
68
|
+
End with STATUS: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
The pass does not need a complete root cause — it must be strong enough to avoid routing a visible symptom to the wrong component. A keyword match between the report and a module name is not a trace; a visible symptom alone is not enough when cause tracing points to a dependency below it. When the report smells like a regression and design intent matters ("was this behaviour a decision or an accident?"), a bounded `/why` consult can supplement the trace — not a full archaeology run.
|
|
72
|
+
|
|
73
|
+
If the repository cannot be read, skip the dispatch, classify conservatively, and record "cause tracing unavailable" for the verdict.
|
|
74
|
+
|
|
75
|
+
## 4 — Classify
|
|
76
|
+
|
|
77
|
+
Choose exactly one:
|
|
78
|
+
|
|
79
|
+
- **Bug** — something violates intended behavior: wrong output, broken state, error, crash, hang, silent no-op, regression.
|
|
80
|
+
- **Performance** — measurable slowness, excess memory, jank, resource drain. Treat as a bug; preserve every measurement and profile the reporter supplied.
|
|
81
|
+
- **Feature request** — current behavior looks intentional; the reporter wants different behavior or a new affordance.
|
|
82
|
+
- **Question or feedback** — asks how something works, or expresses a preference without a concrete defect.
|
|
83
|
+
- **Reroute** — cause tracing shows another repo or team owns it. A route needs evidence from the report or the trace. Say where the report belongs in the verdict; never file it here.
|
|
84
|
+
|
|
85
|
+
When the bug-versus-feature line is unclear, do not file. Ask one focused question in the verdict and close with the `other` marker.
|
|
86
|
+
|
|
87
|
+
## 5 — Dedupe against GitHub Issues
|
|
88
|
+
|
|
89
|
+
GitHub Issues via `gh` is the one tracker this command speaks: search (`gh issue list --search`, `gh search issues`), read (`gh issue view`), update (`gh issue comment`), create (`gh issue create`), compensate (`gh issue close`). Preflight once: `gh auth status` and the resolved target repo.
|
|
90
|
+
|
|
91
|
+
For bug and performance reports, search open AND closed issues before creating anything:
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
gh issue list --repo <owner/repo> --state all --search "<exact error or crash signature>"
|
|
95
|
+
gh issue list --repo <owner/repo> --state all --search "<area> <trigger> <symptom>"
|
|
96
|
+
gh issue list --repo <owner/repo> --state all --search "<version or date window, suspected regression commit>"
|
|
97
|
+
gh search issues --repo <owner/repo> "<source URL or distinctive reporter phrase>"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Choose one typed outcome and name it in the verdict:
|
|
101
|
+
|
|
102
|
+
- **Confident duplicate** — same signature, or same area + trigger + symptom, or a confirmed shared cause. Add the source reference and one short recurrence note to the existing issue (`gh issue comment`); do not reopen, relabel, or reassign it. Create nothing.
|
|
103
|
+
- **Possibly related** — a shared cause is plausible but not proven. Link it in the verdict as uncertain. Create nothing.
|
|
104
|
+
- **Weak resemblance** — similarity is superficial. Record it as checked; it does not block creation.
|
|
105
|
+
- **No match.**
|
|
106
|
+
|
|
107
|
+
A long-closed issue is a regression lead, not automatically a live duplicate — feed it back into the cause trace instead of linking it as the answer.
|
|
108
|
+
|
|
109
|
+
## 6 — Decide whether to create
|
|
110
|
+
|
|
111
|
+
Create only when ALL of these hold:
|
|
112
|
+
|
|
113
|
+
1. The classification is bug or performance.
|
|
114
|
+
2. The behavior is clearly broken — a violated intent, not a preference.
|
|
115
|
+
3. The issue is still live: no merged commit or open PR from step 3 already addresses it.
|
|
116
|
+
4. Dedupe ran and found no confident duplicate and no plausibly-related live match.
|
|
117
|
+
5. The frozen source coordinates are in hand, so the new issue links back to where the report came from.
|
|
118
|
+
6. `gh` is authenticated against the resolved target repo and title/body/labels resolve — never invent labels, milestones, assignees, or priority.
|
|
119
|
+
7. The run can still compensate: `gh issue close` on its own creation remains possible if the verdict fails to land.
|
|
120
|
+
|
|
121
|
+
Never create for a feature request, question, feedback item, reroute, possible duplicate, confident duplicate, or already-fixed report. If a condition fails, the verdict names which one.
|
|
122
|
+
|
|
123
|
+
The new issue must be self-contained:
|
|
124
|
+
|
|
125
|
+
- Plain title naming the area and the symptom — no guessed root cause in the title
|
|
126
|
+
- Reporter quote
|
|
127
|
+
- Expected and observed behavior
|
|
128
|
+
- Version and environment, or `unknown`
|
|
129
|
+
- Trigger and frequency
|
|
130
|
+
- Source reference (issue URL, or where the pasted report came from)
|
|
131
|
+
- Short cause-trace findings with hypotheses labeled as hypotheses
|
|
132
|
+
- Links to any artifacts (logs, screenshots, profiles)
|
|
133
|
+
|
|
134
|
+
**Compensation**: if this run created an issue and the verdict then cannot be delivered — the run aborts, or the creation turns out wrong before the verdict lands — close the created issue with `gh issue close <n> --comment "triage compensation: verdict did not land"`. An orphaned guess in the tracker is worse than no ticket.
|
|
135
|
+
|
|
136
|
+
## 7 — One verdict
|
|
137
|
+
|
|
138
|
+
Lead with the outcome. Link the existing or new issue when there is one. Name the dedupe outcome. Mention the reroute destination or the one missing fact when needed. Keep it short — the `unslop` bar applies, and every claim follows the `epistemics` labeling the trace carried.
|
|
139
|
+
|
|
140
|
+
End the report with exactly one marker line, the last line of the response:
|
|
141
|
+
|
|
142
|
+
```text
|
|
143
|
+
[triage:bug]
|
|
144
|
+
[triage:bug] tracker=https://github.com/OWNER/REPO/issues/N
|
|
145
|
+
[triage:performance]
|
|
146
|
+
[triage:performance] tracker=https://github.com/OWNER/REPO/issues/N
|
|
147
|
+
[triage:other]
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
`bug` and `performance` carry `tracker=` only when this run matched or created a live issue. Everything else — feature request, question, feedback, reroute, unclear — closes with `[triage:other]`. Never emit two markers; never bury the marker mid-report. A follow-up `/fix` run takes the marker plus its tracker link as the issue input.
|
|
151
|
+
|
|
152
|
+
## Rationalization Table
|
|
153
|
+
|
|
154
|
+
| Excuse | Reality |
|
|
155
|
+
|---|---|
|
|
156
|
+
| "The report names the component, route it there" | A keyword match is not a trace. Route on a confirmed code path or signature, or say the owner is unclear. |
|
|
157
|
+
| "Probably a duplicate of #123" | Probably means possibly related: link it as uncertain and create nothing. |
|
|
158
|
+
| "Filing a ticket is harmless" | A guessed or duplicate ticket costs a maintainer two triages. Prefer no ticket. |
|
|
159
|
+
| "The old closed issue matches, done" | A long-closed issue is a regression lead — trace what re-broke it. |
|
|
160
|
+
| "No repo access, but the cause is obvious" | Reading a report yields hypotheses. Classify conservatively and say the trace was unavailable. |
|
|
161
|
+
| "I'll fix it while I'm here" | Triage ends at the verdict. Hand `[triage:bug]` to `/fix`. |
|
package/commands/verify-work.md
CHANGED
|
@@ -14,18 +14,7 @@ Phase: $1
|
|
|
14
14
|
|
|
15
15
|
## Atomic Reasoning
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
**For each deliverable:**
|
|
20
|
-
1. **State the logical component** — What was this deliverable meant to produce? What user value does it provide?
|
|
21
|
-
2. **Validate independence** — Can this deliverable be tested independently? What are its dependencies?
|
|
22
|
-
3. **Verify correctness** — What tests prove it works? What edge cases must pass? What security concerns exist?
|
|
23
|
-
|
|
24
|
-
**Synthesize verification strategy:**
|
|
25
|
-
- Group parallel verification tasks (test suite, security audit, code review, spec compliance, domain compliance)
|
|
26
|
-
- Map each deliverable to its plan file (the spec)
|
|
27
|
-
- Identify critical vs optional checks
|
|
28
|
-
- Plan fix strategies for potential failures
|
|
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.
|
|
29
18
|
|
|
30
19
|
## Steps
|
|
31
20
|
0. **Refresh the living map (guarded).** If `.planning/codebase/MAP.json` is older than HEAD, run `draht-tools map-graph --quiet` (skip if the post-phase hook already refreshed). This keeps the graph boundary check below accurate.
|
|
@@ -38,6 +27,8 @@ Before verifying, decompose phase acceptance into atomic reasoning units:
|
|
|
38
27
|
```
|
|
39
28
|
Run the full test suite for this project. Check package.json for the test command. Record pass/fail counts. Then run any available lint and typecheck commands (e.g. npm run check, npm run lint, npx tsc --noEmit). Report all results with error details.
|
|
40
29
|
|
|
30
|
+
If a project verification skill exists (a `verify-<app>` skill under `.draht/skills/`, generated by /create-verification-skill), drive the app with it: launch, run its Doctor check, drive ONE mapped feature from its feature map the way a user would, capture the evidence artifacts it names, and clean up per its Cleanup section — cleanup never removes the evidence. Report which feature you drove and where the evidence lives; this is observed evidence of user-visible behaviour. If no such skill exists, say so: test output is then the ceiling of the evidence.
|
|
31
|
+
|
|
41
32
|
End with `STATUS: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED`.
|
|
42
33
|
```
|
|
43
34
|
|
|
@@ -88,11 +79,13 @@ Before verifying, decompose phase acceptance into atomic reasoning units:
|
|
|
88
79
|
8. Record results (pass/fail/partially/skip). Label each: **observed** (you or a subagent ran it and quoted output), **derived** (follows necessarily from something observed), or **assumed** (unchecked). Verdicts inherit the weakest label they rest on.
|
|
89
80
|
|
|
90
81
|
9. For failures: diagnose and create fix plans via `draht-tools create-fix-plan $1 P`
|
|
91
|
-
- Fix plans MUST include a reproducing test that demonstrates the failure before any implementation
|
|
82
|
+
- Fix plans MUST include a reproducing test that demonstrates the failure before any implementation — held to the /fix Phase 1 red-capable standard: one named command, already run once, invocation and output shown, asserting the exact failing symptom (red now, green once fixed)
|
|
92
83
|
- Spec-reviewer omissions become explicit fix-plan tasks (one task per omission)
|
|
93
84
|
|
|
94
85
|
10. Write UAT report: `draht-tools write-uat $1`
|
|
95
86
|
- Order: **verdict first** (phase pass/fail, X/Y deliverables, in the first line), **evidence second** (test health summary with pass/fail/coverage, security audit results, spec compliance summary per plan, domain model status, deliverable results with labels), **risk last** (what was NOT tested and how it could bite). Never bury a failure under passes.
|
|
87
|
+
- Report prose follows the `unslop` skill — plain words, active voice, no filler; quoted command output and the verdict-first ordering stay untouched.
|
|
88
|
+
- When the user asks, also write an HTML explainer of the UAT report per the `explainers` skill, with the deliverable results and their observed/derived/assumed labels as its data block. The UAT report stays the source of truth.
|
|
96
89
|
|
|
97
90
|
11. If all passed: mark phase complete.
|
|
98
91
|
- If more phases remain in the milestone: tell the user to start a fresh session and run `/discuss-phase N+1`.
|
package/commands/why.md
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Investigate why code is the way it is — design rationale, history, rejected alternatives — via parallel evidence investigators and a confidence-tiered, citation-backed synthesis
|
|
3
|
+
argument-hint: "<file, symbol, or question>"
|
|
4
|
+
allowed-tools: Bash, Read, Task
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /why
|
|
8
|
+
|
|
9
|
+
Reconstruct why code is the way it is — the design rationale, the history, the rejected alternatives — from the evidence the repository and its surroundings actually carry. The output is a confidence-tiered, citation-backed answer with an explicit coverage map, never a plausible story.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
```
|
|
13
|
+
/why <file, symbol, or question>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Question: $ARGUMENTS
|
|
17
|
+
|
|
18
|
+
> **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 `investigator` agent prompt — one per available evidence category, dispatched in parallel (single assistant turn = multiple Codex subagent calls). To escalate a contested synthesis, consult the `advisor` agent.
|
|
19
|
+
|
|
20
|
+
## Routing
|
|
21
|
+
|
|
22
|
+
`/why` answers intent, history, and forces. Something misbehaving right now is a defect — route it to `/fix`, which is reproduction-gated. A `/why` run that uncovers a live defect hands off to `/fix`; a `/fix` that needs design intent (is this behaviour a decision or an accident?) consults `/why`. For structure and architecture walkthroughs — what the code IS rather than why it is that way — use `/map-codebase`.
|
|
23
|
+
|
|
24
|
+
## Epistemics
|
|
25
|
+
|
|
26
|
+
Every claim in the output follows the `epistemics` skill — five confidence tiers, cite-or-label-as-inference, null results as evidence. Load it before synthesising; the epistemic framing is the product, and de-hedging it to sound authoritative is the exact failure this command exists to prevent.
|
|
27
|
+
|
|
28
|
+
## Steps
|
|
29
|
+
|
|
30
|
+
### 1 — Parse the target and the question archetype
|
|
31
|
+
|
|
32
|
+
Identify what is being asked about (file, symbol, pattern, value) and which archetype the question is: design rationale ("why is this a queue?"), tradeoff-vs-alternative ("why X instead of Y?"), defensive reasoning ("why the triple-check here?"), external forcing function ("why did this change in March?"), dead code ("why does this exist at all?"), or a broad sweep ("why is this module shaped like this?"). If the target is vague, state your best-guess interpretation from context and proceed — do not block on a clarifying question.
|
|
33
|
+
|
|
34
|
+
### 2 — Build the code anchor
|
|
35
|
+
|
|
36
|
+
Cheap, done once by the lead, pasted into every brief:
|
|
37
|
+
|
|
38
|
+
- file paths and line ranges; the key symbols involved
|
|
39
|
+
- `git blame -L <range> <file>` on the target lines
|
|
40
|
+
- `git log --follow --oneline -20 <file>`
|
|
41
|
+
- PR numbers extracted from `(#N)` commit subjects; for each, `gh pr view <n> --json title,body,author,createdAt,mergedAt,labels,closingIssuesReferences,comments,reviews`
|
|
42
|
+
- linked ticket and ADR identifiers found along the way
|
|
43
|
+
- optionally a pasted `draht-tools graph-context <file>` slice for orientation (lead-only; subagents cannot run draht-tools)
|
|
44
|
+
|
|
45
|
+
### 3 — Probe the evidence map
|
|
46
|
+
|
|
47
|
+
Five categories. Probe availability before dispatching; each row is the assigned investigator's playbook.
|
|
48
|
+
|
|
49
|
+
| Category | Availability probe | What it uniquely surfaces + playbook |
|
|
50
|
+
|---|---|---|
|
|
51
|
+
| Git history | Always available | Pickaxe (`git log -S`/`-G`), blame, `git show`; test names encoding edge cases; `red:`/`green:`/`refactor:` and `docs:` prefixes as semantic signal. Pitfalls: squash flatlands → fall back to the PR record; misleading messages → read the diff; cargo-culted patterns → investigate the origin commit; bot commits carry no motivation. |
|
|
52
|
+
| Review record | `git remote` + `gh auth status` | PR bodies, review threads, linked issues — the argument that happened before merge, including rejected alternatives. |
|
|
53
|
+
| Planning record | `.planning/` exists | `STATE.md` `## Decisions` (dated, attributed) and `## Lessons`; `phases/NN-*/` PLAN, SUMMARY, VERIFICATION, and UAT files (observed/derived/assumed labels); `specs/`; `quick/`; `loop/PROGRESS.md`; `CONTINUE-HERE.md`. Probe before assuming `.planning/decisions/` and `.planning/tickets/` — they exist only when a grill chose that output. |
|
|
54
|
+
| Decision records | `docs/adr/` and `CHANGELOG.md` files exist | ADR titles are decisions; dated Update blocks cite forcing commits; per-package changelogs date user-visible shifts. |
|
|
55
|
+
| External systems | A registered extension tool only | Tracker, chat, observability, error tracking, analytics — the conversational and operational record. Searchable only via a project-registered tool; when none exists, do not dispatch: record one Sources Consulted gap line — "External records: unavailable — no tool registered in this runtime; the conversational and operational record was not searched." |
|
|
56
|
+
|
|
57
|
+
The map is extensible: a project-registered tool adds an investigator with the same brief shape; an unavailable category is a coverage gap, never a silent drop.
|
|
58
|
+
|
|
59
|
+
**Incident overlay**: when the target looks defensive — null guards, retry, timeout, rate limiting, feature flags — instruct every investigator to hunt incident-shaped evidence inside its own category: revert-then-reapply chains, `## Lessons` entries, ADR Update blocks, UAT failure verdicts.
|
|
60
|
+
|
|
61
|
+
### 4 — Dispatch parallel investigators
|
|
62
|
+
|
|
63
|
+
Dispatch one investigator per AVAILABLE category, all in a single assistant turn when the host allows it; if the category count exceeds what the host can dispatch at once, fold overflow into the nearest category. Skip rules:
|
|
64
|
+
|
|
65
|
+
- A skip needs a written justification that surfaces in Sources Consulted. Unavailability is a gap, not a choice.
|
|
66
|
+
- "Provably irrelevant, not just 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 guess, so search it.
|
|
67
|
+
|
|
68
|
+
Each brief is standalone:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
You are investigating ONE evidence category for a why-question. Gather evidence, not narrative — a verbatim quote with a precise citation beats a paragraph of plausible summary.
|
|
72
|
+
|
|
73
|
+
Question: <the question and its archetype>
|
|
74
|
+
|
|
75
|
+
Code anchor:
|
|
76
|
+
<the anchor from Step 2>
|
|
77
|
+
|
|
78
|
+
Your category: <name + the playbook row from Step 3>
|
|
79
|
+
<if the incident overlay applies: hunt incident-shaped evidence inside your category — revert/re-apply chains, Lessons entries, ADR Update blocks, UAT failure verdicts>
|
|
80
|
+
|
|
81
|
+
Report using exactly these sections: Source / What I Searched (queries verbatim) / Direct Evidence Found / Indirect-Circumstantial Evidence (inference chain + alternative readings) / Contradictions / Gaps / Additional Leads.
|
|
82
|
+
|
|
83
|
+
Stay inside your category; record cross-category references under Additional Leads for the owning investigator — never chase them.
|
|
84
|
+
|
|
85
|
+
Do NOT run draht, draht-tools, or pi commands.
|
|
86
|
+
|
|
87
|
+
End with STATUS: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
`NEEDS_CONTEXT` / `BLOCKED` → supply the missing info and re-dispatch. Hard cap: 3 re-dispatches total.
|
|
91
|
+
|
|
92
|
+
### 5 — Synthesize (the lead, in this context)
|
|
93
|
+
|
|
94
|
+
- Investigator claims are inputs, not verdicts — spot-verify load-bearing citations with git/gh before repeating them.
|
|
95
|
+
- Merge duplicate citations into one authoritative reference.
|
|
96
|
+
- Surface contradictions without picking a side.
|
|
97
|
+
- Tier every claim per the `epistemics` skill.
|
|
98
|
+
- Hand each investigator's Additional Leads to the owning category's follow-up, or record them as gaps.
|
|
99
|
+
- When competing hypotheses are decision-changing for an imminent code change, consult the `advisor` agent with the tiered findings for a steer.
|
|
100
|
+
|
|
101
|
+
### 6 — Output contract
|
|
102
|
+
|
|
103
|
+
Exact section order:
|
|
104
|
+
|
|
105
|
+
1. **The Question**
|
|
106
|
+
2. **The Code in Question** — what it does mechanically, in two or three sentences
|
|
107
|
+
3. **What We Found** — [Direct] and [Supported] bullets, each cited
|
|
108
|
+
4. **What We Can Reasonably Infer** — [Inferred] bullets with the chain visible: "Given A and B, C is likely because D"
|
|
109
|
+
5. **Competing Hypotheses** — hypothesis + evidence for + evidence against. Don't force a winner. Skip only when there is one clear answer.
|
|
110
|
+
6. **What We Don't Know** — specific searches that came up empty, named unavailable sources, people who would know
|
|
111
|
+
7. **Sources Consulted** — one line per category INCLUDING empties, gaps, and justified skips: `- <Category>: <what was searched>. <found / no relevant results / skipped: reason / unavailable: gap>`
|
|
112
|
+
8. **Confidence Summary** — 1-2 sentences
|
|
113
|
+
|
|
114
|
+
Report prose follows the `unslop` skill; citations and quoted evidence stay verbatim.
|
|
115
|
+
|
|
116
|
+
**Diagram**: when the answer is a chain — the commits that built the code, a forcing sequence, a call path — add one Mermaid diagram after What We Can Reasonably Infer, per the `explainers` skill. Solid edges carry [Direct] or [Supported] facts; [Inferred] links are dashed and labelled. **HTML**: when the user asks, also render the report as an HTML explainer per the same skill; the Markdown report stays the source of truth.
|
|
117
|
+
|
|
118
|
+
**Closing hook**: when the question precedes a change, convert the findings into a Preserve / Change / Avoid / Risk constraint set suitable for `/discuss-phase` or `/plan-phase`.
|
|
119
|
+
|
|
120
|
+
**Effort valve**: a trivial single-commit target whose PR or commit already answers the question may be handled inline by the lead running the git-history archaeology itself — only after stating why the other available categories would be redundant. The output contract and the coverage map still apply.
|
|
121
|
+
|
|
122
|
+
## Failure Modes — STOP
|
|
123
|
+
|
|
124
|
+
Stop immediately if you catch yourself:
|
|
125
|
+
|
|
126
|
+
- **Confident storytelling** — an uncited bullet belongs under Inferred or Hypotheses, never under What We Found
|
|
127
|
+
- Citing code as evidence of its own intent
|
|
128
|
+
- Recency bias — explaining an accretion as one decision; trace back
|
|
129
|
+
- Sycophantic agreement with the asker's embedded hypothesis
|
|
130
|
+
- Skipping the gaps section
|
|
131
|
+
- Skipping investigators by anticipation — a null result is a data point; a skipped search is a blind spot
|
|
132
|
+
- Collapsing categories into one investigator
|
|
133
|
+
|
|
134
|
+
## Rationalization Table
|
|
135
|
+
|
|
136
|
+
| Excuse | Reality |
|
|
137
|
+
|--------|---------|
|
|
138
|
+
| "The commit message says X, done" | One source is a lead, not a verdict — the record contradicts itself more often than it lies consistently. |
|
|
139
|
+
| "The code obviously does this for performance" | Code is mechanics; motivation needs an external source or an [Inferred] label. |
|
|
140
|
+
| "The user already told me why" | That is a hypothesis; check it independently. |
|
|
141
|
+
| "No .planning/ here, nothing to search" | git and gh still exist; report the missing categories as gaps, don't invent. |
|