draht-codex 2026.10.20 → 2026.10.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.codex-plugin/plugin.json +1 -1
- package/CHANGELOG.md +16 -0
- package/agents/advisor.md +2 -2
- package/agents/architect.md +10 -71
- package/agents/debugger.md +12 -82
- package/agents/git-committer.md +10 -52
- package/agents/implementer.md +15 -63
- package/agents/investigator.md +11 -63
- package/agents/reviewer.md +15 -65
- package/agents/security-auditor.md +12 -105
- package/agents/spec-reviewer.md +12 -53
- package/agents/verifier.md +13 -54
- package/commands/atomic-commit.md +9 -9
- package/commands/create-verification-skill.md +8 -48
- package/commands/discuss-phase.md +5 -9
- package/commands/execute-phase.md +17 -47
- package/commands/fix.md +16 -130
- package/commands/grill.md +6 -51
- package/commands/init-project.md +10 -14
- package/commands/map-codebase.md +2 -2
- package/commands/new-project.md +9 -14
- package/commands/next-milestone.md +3 -7
- package/commands/orchestrate-loop.md +12 -12
- package/commands/orchestrate.md +12 -11
- package/commands/pause-work.md +1 -1
- package/commands/plan-phase.md +16 -38
- package/commands/quick.md +9 -78
- package/commands/resolve-conflicts.md +2 -15
- package/commands/triage.md +3 -14
- package/commands/verify-work.md +17 -106
- package/commands/why.md +18 -118
- package/hooks/hooks.json +10 -0
- package/package.json +4 -4
- package/scripts/checks-runtime.cjs +215 -0
- package/scripts/git-safety-hook.cjs +21 -0
- package/scripts/git-safety.cjs +198 -0
- package/scripts/gsd-post-task.cjs +78 -39
- package/scripts/gsd-quality-gate.cjs +206 -120
- package/scripts/prompt-context.cjs +40 -6
- package/scripts/session-start.cjs +6 -4
- package/scripts/stop-quality-gate.cjs +55 -25
- package/skills/atomic-commit/command.md +9 -9
- package/skills/atomic-reasoning/SKILL.md +6 -105
- package/skills/blast-radius/SKILL.md +1 -1
- package/skills/brainstorming/SKILL.md +8 -126
- package/skills/create-verification-skill/SKILL.md +1 -1
- package/skills/create-verification-skill/command.md +8 -48
- package/skills/ddd-workflow/SKILL.md +8 -101
- package/skills/debugging-workflow/SKILL.md +12 -122
- package/skills/discuss-phase/SKILL.md +1 -0
- package/skills/discuss-phase/agents/openai.yaml +2 -0
- package/skills/discuss-phase/command.md +5 -9
- package/skills/draht/SKILL.md +18 -14
- package/skills/epistemics/SKILL.md +12 -87
- package/skills/execute-phase/SKILL.md +1 -0
- package/skills/execute-phase/agents/openai.yaml +2 -0
- package/skills/execute-phase/command.md +17 -47
- package/skills/explainers/SKILL.md +1 -1
- package/skills/fix/SKILL.md +2 -1
- package/skills/fix/agents/openai.yaml +2 -0
- package/skills/fix/command.md +16 -130
- package/skills/grill/SKILL.md +1 -1
- package/skills/grill/command.md +6 -51
- package/skills/gsd-workflow/SKILL.md +37 -21
- package/skills/gsd-workflow/agents/openai.yaml +2 -0
- package/skills/init-project/SKILL.md +1 -0
- package/skills/init-project/agents/openai.yaml +2 -0
- package/skills/init-project/command.md +10 -14
- package/skills/loop-workflow/SKILL.md +7 -41
- package/skills/map-codebase/command.md +2 -2
- package/skills/model-tiering/SKILL.md +7 -7
- package/skills/new-project/SKILL.md +1 -0
- package/skills/new-project/agents/openai.yaml +2 -0
- package/skills/new-project/command.md +9 -14
- package/skills/next-milestone/SKILL.md +1 -0
- package/skills/next-milestone/agents/openai.yaml +2 -0
- package/skills/next-milestone/command.md +3 -7
- package/skills/orchestrate/command.md +12 -11
- package/skills/orchestrate-loop/command.md +12 -12
- package/skills/pause-work/SKILL.md +1 -0
- package/skills/pause-work/agents/openai.yaml +2 -0
- package/skills/pause-work/command.md +1 -1
- package/skills/plan-phase/SKILL.md +1 -0
- package/skills/plan-phase/agents/openai.yaml +2 -0
- package/skills/plan-phase/command.md +16 -38
- package/skills/progress/SKILL.md +1 -0
- package/skills/progress/agents/openai.yaml +2 -0
- package/skills/quick/SKILL.md +2 -1
- package/skills/quick/agents/openai.yaml +2 -0
- package/skills/quick/command.md +9 -78
- package/skills/resolve-conflicts/command.md +2 -15
- package/skills/resume-work/SKILL.md +1 -0
- package/skills/resume-work/agents/openai.yaml +2 -0
- package/skills/saga-spawner/SKILL.md +1 -1
- package/skills/tdd-workflow/SKILL.md +15 -104
- package/skills/triage/SKILL.md +2 -1
- package/skills/triage/agents/openai.yaml +2 -0
- package/skills/triage/command.md +3 -14
- package/skills/typescript-discipline/SKILL.md +12 -42
- package/skills/typescript-discipline/references/patterns.md +25 -266
- package/skills/unslop/SKILL.md +14 -105
- package/skills/verification-gate/SKILL.md +16 -76
- package/skills/verify-work/SKILL.md +1 -0
- package/skills/verify-work/agents/openai.yaml +2 -0
- package/skills/verify-work/command.md +17 -106
- package/skills/why/SKILL.md +1 -1
- package/skills/why/command.md +18 -118
|
@@ -14,15 +14,11 @@ Use this when you have an existing codebase and want to add structured planning.
|
|
|
14
14
|
|
|
15
15
|
> **Tool note**: Invoke `draht-tools <subcommand>` as `node "${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-$HOME/.draht/codex-marketplace/plugins/draht}}/bin/draht-tools.cjs" <subcommand>` via the Bash tool.
|
|
16
16
|
|
|
17
|
-
## Atomic Reasoning
|
|
18
|
-
|
|
19
|
-
Decompose the work into independently verifiable units before acting; the `atomic-reasoning` skill holds the full discipline — load it when the decomposition is not obvious.
|
|
20
|
-
|
|
21
17
|
## Steps
|
|
22
18
|
1. Run `draht-tools init` to check preconditions (git repo, etc.)
|
|
23
|
-
2. Run `draht-tools map-codebase` to
|
|
24
|
-
3.
|
|
25
|
-
4.
|
|
19
|
+
2. Run `draht-tools map-codebase` to generate structural docs and the knowledge graph. If graph generation fails, retry with `draht-tools map-graph --quiet` before querying it
|
|
20
|
+
3. Read `.planning/codebase/GRAPH_REPORT.md` for architecture, tech stack, and conventions. Use `draht-tools graph-query <topic>` and `draht-tools graph-context <file...>` for focused detail; use `graph-hotspots` or `graph-clusters` when needed instead of reading the full `MAP.json`
|
|
21
|
+
4. Clarify material gaps in the problem, scope, constraints, and success criteria; use existing answers and repository evidence before asking:
|
|
26
22
|
- What is this project? Who uses it?
|
|
27
23
|
- What are the current pain points or goals?
|
|
28
24
|
- What is MVP vs aspirational scope?
|
|
@@ -31,16 +27,16 @@ Decompose the work into independently verifiable units before acting; the `atomi
|
|
|
31
27
|
6. Run `draht-tools create-domain-model` to define bounded contexts, entities, and ubiquitous language
|
|
32
28
|
7. Create `.planning/DOMAIN.md` with the same sections as `/new-project`:
|
|
33
29
|
Bounded Contexts, Ubiquitous Language, Context Map, Aggregates, Domain Events.
|
|
34
|
-
Seed the Ubiquitous Language glossary from `GRAPH_REPORT.md` key concepts
|
|
30
|
+
Seed the Ubiquitous Language glossary from `GRAPH_REPORT.md` key concepts and focused `draht-tools graph-query <topic>` results (start from extracted terms, not zero)
|
|
35
31
|
8. Create `.planning/TEST-STRATEGY.md` with: Test Framework, Directory Conventions, Coverage Goals, Testing Levels, Excluded
|
|
36
|
-
9.
|
|
32
|
+
9. If research is needed before defining requirements, investigate the open questions and save findings with sources under `.planning/research/<topic>.md`
|
|
37
33
|
10. Run `draht-tools create-requirements` with v1/v2/out-of-scope (map requirements to bounded contexts)
|
|
38
34
|
11. Run `draht-tools create-roadmap` with phases
|
|
39
35
|
12. Run `draht-tools init-state`
|
|
40
|
-
13.
|
|
36
|
+
13. If committing is authorized, use `draht-tools commit-docs "initialize project planning"`
|
|
41
37
|
|
|
42
38
|
## Workflow
|
|
43
|
-
After project initialization, phases are executed one at a time in
|
|
39
|
+
After project initialization, phases are executed one at a time in dependency order:
|
|
44
40
|
|
|
45
41
|
```
|
|
46
42
|
/init-project → /discuss-phase 1 → /plan-phase 1 → /execute-phase 1 → /verify-work 1
|
|
@@ -49,9 +45,9 @@ After project initialization, phases are executed one at a time in fresh session
|
|
|
49
45
|
```
|
|
50
46
|
|
|
51
47
|
## Rules
|
|
52
|
-
-
|
|
48
|
+
- Group related questions and ask only those that change a material decision.
|
|
53
49
|
- Questions that depend on still-open answers wait for a later round
|
|
54
|
-
-
|
|
55
|
-
-
|
|
50
|
+
- Investigate repository facts directly; delegate independent research when useful.
|
|
51
|
+
- Respect explicit requirements; clarify the intended outcome when it is unclear.
|
|
56
52
|
- Respect what already exists — do not propose rewriting working code
|
|
57
53
|
- Stop when you have: current state, goals, MVP scope, constraints, success criteria
|
|
@@ -1,52 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: loop-workflow
|
|
3
|
-
description:
|
|
3
|
+
description: Design bounded agent loops with explicit stopping conditions, deterministic checks, and recoverable progress.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Loop Workflow
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Use a loop when repeated work has an observable stopping condition. A small task can finish in one pass; GSD phases and fresh sessions are optional coordination choices.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Define the check, iteration/time budget, and stall condition before starting. Completion depends on the check's actual outcome, not the worker's status text. A check proves only the property it tests; review its adequacy for the goal.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Track commands, outcomes, and the input state they verified. Reuse current evidence when unchanged; invalidate it after relevant changes. Run completion checks outside the worker when the loop runtime supports it. A fresh-context review is useful for long or high-risk work, not mandatory on every iteration.
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|---|---|---|
|
|
16
|
-
| Turn-based | the check | TDD cycle inside one task (red → green → refactor → verify) |
|
|
17
|
-
| Goal-based | the stop condition | `/orchestrate-loop` (deterministic check + max iterations) |
|
|
18
|
-
| Phase-based | the spec | `/execute-phase` → `/verify-work` → `--gaps-only` cycle |
|
|
19
|
-
| Session-based | the process | GSD per-phase cycle (`/discuss-phase → /plan-phase → /execute-phase → /verify-work`), fresh context each step |
|
|
14
|
+
Make each iteration a coherent increment and record enough progress to resume. Commits require authorization; a progress log or checkpoint can preserve state without committing. At startup inspect the current state and existing evidence before deciding what to rerun.
|
|
20
15
|
|
|
21
|
-
|
|
16
|
+
Do not weaken the agreed check to declare success. If the check itself is wrong, report the defect and resolve its contract explicitly. Stop at the configured budget or when repeated attempts yield no new evidence; summarize the failures and missing input instead of retrying unchanged.
|
|
22
17
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
1. **Deterministic check** — a command whose exit code proves the goal. The loop is only as good as its check; a near-perfect verifier is the highest-leverage component of any loop.
|
|
26
|
-
2. **Explicit stop conditions** — criterion met, max iterations, stall. Every loop needs a bound; an unbounded loop is a bug, not persistence.
|
|
27
|
-
3. **Independent evaluation** — the agent doing the work never decides completion. Re-run the check outside the worker; route the final verdict to a fresh-context evaluator. Agents systematically overrate their own work.
|
|
28
|
-
4. **Recoverable state** — every iteration commits and appends a progress log, so any iteration can die without losing the loop. Fresh iterations run a startup ritual: read the progress log, run the check, observe before changing anything.
|
|
29
|
-
5. **One increment per cycle** — small verified steps beat one-shot attempts. Batching increments hides which change broke the check.
|
|
30
|
-
|
|
31
|
-
## Known Failure Modes → Counters
|
|
32
|
-
|
|
33
|
-
| Failure mode | Counter |
|
|
34
|
-
|---|---|
|
|
35
|
-
| Premature completion claims | Independent re-run of the check; evidence before claims |
|
|
36
|
-
| Self-graded verification | Fresh-context evaluator (spec-reviewer / reviewer) |
|
|
37
|
-
| One-shotting too much per cycle | One increment, one commit per iteration |
|
|
38
|
-
| State lost at context death | Commit every iteration + append-only progress log |
|
|
39
|
-
| Weakening tests or the check to pass | Tests and check are immutable inside a loop; violation means revert + hard stop |
|
|
40
|
-
| Spinning on the same failure | Stall detection — two identical failure signatures in a row means change the inputs, consult `advisor`, or stop |
|
|
41
|
-
| Time blindness (hours burned re-running slow checks) | Keep checks fast and their output terse: failures only |
|
|
42
|
-
|
|
43
|
-
## Interaction With Other Disciplines
|
|
44
|
-
|
|
45
|
-
- `verification-gate` supplies the evidence rules for reading loop results: label them observed / derived / assumed
|
|
46
|
-
- `tdd-workflow` is the innermost loop; `/orchestrate-loop` wraps the same shape at goal level
|
|
47
|
-
- `atomic-reasoning` cuts the increments: an increment is well-cut only if its check can fail while all others pass
|
|
48
|
-
- `model-tiering` sets the economics: loops are volume work, so workers run on the executor tier while steering (the orchestrating context, `advisor`, `spec-reviewer`) stays on the strongest tier — most loop tokens bill at the worker rate
|
|
49
|
-
|
|
50
|
-
## Scope
|
|
51
|
-
|
|
52
|
-
This skill is the discipline reference behind `/orchestrate-loop` and the retry mechanics in `/execute-phase` and `/verify-work`. Consult it before constructing any ad-hoc retry-until-done behaviour.
|
|
18
|
+
Choose models from the available catalog according to task difficulty and measured results. The `model-tiering` skill describes options; a loop does not require a cheap worker or separate advisor.
|
|
@@ -20,7 +20,7 @@ Decompose the work into independently verifiable units before acting; the `atomi
|
|
|
20
20
|
1. Run `draht-tools map-codebase $1`
|
|
21
21
|
2. Tool generates the prose docs (STACK.md, ARCHITECTURE.md, CONVENTIONS.md, CONCERNS.md, DOMAIN-HINTS.md) **and**, in the same pass, the **living architecture map** (MAP.json + MAP.html + GRAPH_REPORT.md).
|
|
22
22
|
2a. The living architecture map produced by step 1 (re-run `draht-tools map-graph $1` any time to refresh just the map without rewriting the docs):
|
|
23
|
-
- `.planning/codebase/MAP.json` — machine-readable map with **entry points** (CLI bins, HTTP routes, library main exports), **sinks** (FS / net / DB / stdout / exec calls), **bounded contexts** (packages), **cross-package dataflow edges**, **symbol-resolved call edges**, **flows** (which sinks each entry point reaches and through which intermediate module), per-module **layer** (presentation / application / domain / infrastructure / support), and exports/imports per file.
|
|
23
|
+
- `.planning/codebase/MAP.json` — machine-readable map with **entry points** (CLI bins, HTTP routes, library main exports), **sinks** (FS / net / DB / stdout / exec calls), **bounded contexts** (packages), **cross-package dataflow edges**, **symbol-resolved call edges**, **flows** (which sinks each entry point reaches and through which intermediate module), per-module **layer** (presentation / application / domain / infrastructure / support), and exports/imports per file. Orient with `GRAPH_REPORT.md` and focused `graph-*` queries; load only relevant map slices into context.
|
|
24
24
|
- `.planning/codebase/MAP.html` — interactive layered visualization with four views:
|
|
25
25
|
- **Architecture** — packages drawn as containers in architectural layers, with cross-package dataflow arrows. Thickness encodes import count.
|
|
26
26
|
- **Modules** — every file inside its package container, import edges between them; click a package or sink to highlight.
|
|
@@ -49,7 +49,7 @@ Decompose the work into independently verifiable units before acting; the `atomi
|
|
|
49
49
|
- `## Aggregates` — aggregates and their root entities per context
|
|
50
50
|
- `## Domain Events` — any existing event names or patterns discovered
|
|
51
51
|
6. Create `.planning/TEST-STRATEGY.md` with: Test Framework, Directory Conventions, Coverage Goals, Testing Levels, Excluded
|
|
52
|
-
7.
|
|
52
|
+
7. If committing is authorized: `draht-tools commit-docs "map existing codebase"`
|
|
53
53
|
|
|
54
54
|
## Living map for agents
|
|
55
55
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: model-tiering
|
|
3
|
-
description:
|
|
3
|
+
description: Choose executor, advisor, and orchestrator models when configuring a workflow's quality, cost, and latency tradeoffs.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Model Tiering
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Use an executor for routine work and a stronger advisor or orchestrator where its judgment improves the result. Select available models from the host's current catalog.
|
|
9
9
|
|
|
10
|
-
- **Advisor tier** —
|
|
11
|
-
- **Executor tier** — a
|
|
10
|
+
- **Advisor tier** — a model with stronger performance on the task's difficult decisions
|
|
11
|
+
- **Executor tier** — a faster or cheaper model capable of the implementation work
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Tiering does not guarantee savings or better results. Compare executor-only, executor-with-advisor, and stronger-model-only runs on representative tasks; measure accepted results, total billed tokens, latency, and retries. Re-evaluate when model versions or workflow prompts change. API behavior and current guidance: <https://platform.claude.com/docs/en/agents-and-tools/tool-use/advisor-tool>.
|
|
14
14
|
|
|
15
15
|
## Pattern 1 — Advisor: the executor pulls intelligence down
|
|
16
16
|
|
|
@@ -18,9 +18,9 @@ Run the session on the executor tier; dispatch the `advisor` agent (pinned to th
|
|
|
18
18
|
|
|
19
19
|
- **Once early** — after orientation (finding files, reading what's there) but BEFORE substantive work: writing, committing to an interpretation, building on an assumption
|
|
20
20
|
- **When stuck** — recurring errors, an approach that is not converging, results that don't fit
|
|
21
|
-
- **Once before declaring done** on hard tasks — after writes and test output exist;
|
|
21
|
+
- **Once before declaring done** on hard tasks — after writes and test output exist; save the deliverable before the consult and commit only when the task authorizes it
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
Weigh the advice heavily; the user's instructions, empirical failure, and primary sources override it. If your evidence points one way and the advisor points another, don't silently switch — surface the conflict in one reconcile consult ("I found X, you suggest Y — which constraint breaks the tie?").
|
|
24
24
|
|
|
25
25
|
Target ~1–3 consults per task. On short reactive tasks where the next action is dictated by output just read, skip the advisor — its value is highest before the approach crystallizes.
|
|
26
26
|
|
|
@@ -12,14 +12,10 @@ Description: $ARGUMENTS
|
|
|
12
12
|
|
|
13
13
|
> **Tool note**: When this command says `draht-tools <subcommand>`, invoke it as `node "${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-$HOME/.draht/codex-marketplace/plugins/draht}}/bin/draht-tools.cjs" <subcommand>` via the Bash tool. `PLUGIN_ROOT` is used when Codex exposes it; `CLAUDE_PLUGIN_ROOT` is a compatibility fallback.
|
|
14
14
|
|
|
15
|
-
## Atomic Reasoning
|
|
16
|
-
|
|
17
|
-
Decompose the work into independently verifiable units before acting; the `atomic-reasoning` skill holds the full discipline — load it when the decomposition is not obvious.
|
|
18
|
-
|
|
19
15
|
## Steps
|
|
20
16
|
1. Run `draht-tools init` to check preconditions
|
|
21
17
|
2. If existing code detected, run `draht-tools map-codebase` first
|
|
22
|
-
3.
|
|
18
|
+
3. Clarify material gaps in the problem, scope, constraints, and success criteria; use existing answers and repository evidence before asking:
|
|
23
19
|
4. Run `draht-tools create-project` with gathered info
|
|
24
20
|
5. Run `draht-tools create-domain-model` to define bounded contexts, entities, and ubiquitous language
|
|
25
21
|
6. Create `.planning/DOMAIN.md` with:
|
|
@@ -34,14 +30,14 @@ Decompose the work into independently verifiable units before acting; the `atomi
|
|
|
34
30
|
- `## Coverage Goals` — target coverage percentage and which paths are critical
|
|
35
31
|
- `## Testing Levels` — what is tested at unit level vs integration vs e2e, with examples
|
|
36
32
|
- `## Excluded` — what is explicitly not tested and why (config files, generated code, etc.)
|
|
37
|
-
8.
|
|
33
|
+
8. If research is needed before defining requirements, investigate the open questions and save findings with sources under `.planning/research/<topic>.md`
|
|
38
34
|
9. Run `draht-tools create-requirements` with v1/v2/out-of-scope (map requirements to bounded contexts)
|
|
39
35
|
10. Run `draht-tools create-roadmap` with phases
|
|
40
36
|
11. Run `draht-tools init-state`
|
|
41
|
-
12.
|
|
37
|
+
12. If committing is authorized, use `draht-tools commit-docs "initialize project planning"`
|
|
42
38
|
|
|
43
39
|
## Workflow
|
|
44
|
-
After project initialization, phases are executed one at a time in
|
|
40
|
+
After project initialization, phases are executed one at a time in dependency order:
|
|
45
41
|
|
|
46
42
|
```
|
|
47
43
|
/new-project → /discuss-phase 1 → /plan-phase 1 → /execute-phase 1 → /verify-work 1
|
|
@@ -50,15 +46,14 @@ After project initialization, phases are executed one at a time in fresh session
|
|
|
50
46
|
→ /next-milestone (only after ALL phases are complete)
|
|
51
47
|
```
|
|
52
48
|
|
|
53
|
-
Start a fresh session
|
|
49
|
+
Start a fresh session only when context limits make it useful. Do NOT suggest `/next-milestone` until every phase in the milestone is verified.
|
|
54
50
|
|
|
55
51
|
## Rules
|
|
56
|
-
-
|
|
52
|
+
- Group related questions and ask only those that change a material decision.
|
|
57
53
|
- Questions that depend on still-open answers wait for a later round
|
|
58
|
-
-
|
|
54
|
+
- Investigate repository facts directly; delegate independent research when useful.
|
|
59
55
|
- Follow threads based on answers
|
|
60
56
|
- Use examples ("Like Stripe Checkout, or custom?")
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
- 3-7 follow-up rounds typical
|
|
57
|
+
- Distinguish user decisions from reasonable implementation assumptions; clarify only blocking ambiguity
|
|
58
|
+
- Respect explicit requirements; clarify the intended outcome when it is unclear.
|
|
64
59
|
- Stop when you have: problem, audience, MVP scope, constraints, success criteria
|
|
@@ -9,12 +9,8 @@ Plan the next milestone after ALL phases in the current one are complete.
|
|
|
9
9
|
|
|
10
10
|
> **Tool note**: Invoke `draht-tools <subcommand>` as `node "${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-$HOME/.draht/codex-marketplace/plugins/draht}}/bin/draht-tools.cjs" <subcommand>` via the Bash tool.
|
|
11
11
|
|
|
12
|
-
## Atomic Reasoning
|
|
13
|
-
|
|
14
|
-
Decompose the work into independently verifiable units before acting; the `atomic-reasoning` skill holds the full discipline — load it when the decomposition is not obvious.
|
|
15
|
-
|
|
16
12
|
## Steps
|
|
17
|
-
1.
|
|
13
|
+
1. Read `.planning/ROADMAP.md` and the current milestone's `*-UAT.md` reports under `.planning/phases/`. Require every phase to be marked `complete` with observed passing acceptance results; summary files alone do not prove completion
|
|
18
14
|
2. If any phase is not complete, STOP and tell the user which phase needs attention
|
|
19
15
|
3. Read all phase reports in `.planning/phase-N-report.md` to extract lessons learned
|
|
20
16
|
4. Read the execution log `.planning/execution-log.jsonl` for failure patterns
|
|
@@ -32,11 +28,11 @@ Decompose the work into independently verifiable units before acting; the `atomi
|
|
|
32
28
|
- Acceptance criteria
|
|
33
29
|
10. Update `.planning/ROADMAP.md` with the new milestone header and phases (status: `pending`)
|
|
34
30
|
11. Update `.planning/REQUIREMENTS.md` with any new requirements
|
|
35
|
-
12.
|
|
31
|
+
12. If committing is authorized: `draht-tools commit-docs "plan milestone <N>"`
|
|
36
32
|
|
|
37
33
|
## Rules
|
|
38
34
|
- Do not start planning phase details — that happens in `/discuss-phase` + `/plan-phase`
|
|
39
35
|
- Distinguish **verified-complete** (a UAT report shows observed passes) from **believed-complete** (someone said so) — only the former counts toward requirement satisfaction; the latter goes back on the list
|
|
40
36
|
- Respect lessons learned from the previous milestone — don't repeat mistakes
|
|
41
|
-
- Keep the next milestone focused
|
|
37
|
+
- Keep the next milestone focused; phase count follows coherent outcomes and dependencies
|
|
42
38
|
- Order the new phases risk-first: the phase carrying the highest uncertainty × blast radius comes earliest, so a wrong bet invalidates the least downstream work
|
|
@@ -35,7 +35,7 @@ Decompose the work into independently verifiable units before acting; the `atomi
|
|
|
35
35
|
| Create atomic commits | `git-committer` |
|
|
36
36
|
| Strategic steer at a decision point — rare, high-leverage | `advisor` |
|
|
37
37
|
|
|
38
|
-
`spec-reviewer` and `reviewer` are distinct on purpose. Spec-reviewer ONLY checks "did the diff implement what the spec asked, no more no less". Reviewer evaluates quality (naming, structure, type safety).
|
|
38
|
+
`spec-reviewer` and `reviewer` are distinct on purpose. Spec-reviewer ONLY checks "did the diff implement what the spec asked, no more no less". Reviewer evaluates quality (naming, structure, type safety). When both reviews are required, run spec-reviewer before reviewer. Select reviews for the task’s risk and acceptance criteria.
|
|
39
39
|
|
|
40
40
|
## Effort Scaling
|
|
41
41
|
|
|
@@ -44,16 +44,16 @@ Match orchestration weight to the task — over-orchestration burns tokens witho
|
|
|
44
44
|
| Task shape | Dispatch |
|
|
45
45
|
|---|---|
|
|
46
46
|
| Single question or trivial fix | One agent, or handle it directly — no orchestration |
|
|
47
|
-
| One change set to evaluate |
|
|
47
|
+
| One change set to evaluate | Only the reviewers needed to resolve material risks or acceptance gaps |
|
|
48
48
|
| Multi-part feature with known decomposition | Fan-out / fan-in |
|
|
49
49
|
| Goal needing iteration until a measurable criterion holds | `/orchestrate-loop` |
|
|
50
50
|
|
|
51
51
|
## Model Tiering
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
Choose available models from the current provider catalog and measure quality, latency, and cost on the workload — see the `model-tiering` skill:
|
|
54
54
|
|
|
55
|
-
- **Orchestrator pattern** —
|
|
56
|
-
- **Advisor pattern** —
|
|
55
|
+
- **Orchestrator pattern** — use a capable model for decomposition and assign bounded worker tasks to models that pass the relevant checks. Keep the same model when a cheaper or faster worker has not demonstrated acceptable results.
|
|
56
|
+
- **Advisor pattern** — consult `advisor` when a concrete unresolved decision benefits from another model. Provide the question and evidence; no fixed consultation count is required.
|
|
57
57
|
|
|
58
58
|
## Orchestration Modes
|
|
59
59
|
|
|
@@ -64,10 +64,10 @@ Dispatch several Codex subagent calls in a single assistant turn when the sub-ta
|
|
|
64
64
|
Dispatch Codex subagent calls sequentially when later work depends on earlier output. Example: architect produces plan → implementer executes plan → verifier runs tests → reviewer audits the diff.
|
|
65
65
|
|
|
66
66
|
### Fan-out / Fan-in
|
|
67
|
-
Architect decomposes
|
|
67
|
+
Architect decomposes independent work → dispatch implementers in parallel → collect results for verification and review. When both reviews are selected, spec review precedes quality review; `/execute-phase` keeps its explicit per-task sequence.
|
|
68
68
|
|
|
69
69
|
### Two-Stage Review (spec → quality)
|
|
70
|
-
|
|
70
|
+
When the requested workflow needs separate spec and quality review, use this order:
|
|
71
71
|
|
|
72
72
|
```
|
|
73
73
|
implementer → spec-reviewer → reviewer
|
|
@@ -82,12 +82,13 @@ When the work cannot land in one dispatch but success is provable by a determini
|
|
|
82
82
|
|
|
83
83
|
## Reading Subagent Status
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
Require each dispatched agent to end its response with exactly one of these status lines, then branch on it:
|
|
86
86
|
|
|
87
87
|
- `STATUS: DONE` — check the evidence before proceeding: a `DONE` that quotes no verification output (test counts, command results) is treated as `DONE_WITH_CONCERNS` — re-run the decisive check yourself. Subagent claims are inputs, not verdicts.
|
|
88
88
|
- `STATUS: DONE_WITH_CONCERNS` — note the concerns. If they're correctness-related, address before moving on; otherwise log and continue.
|
|
89
89
|
- `STATUS: NEEDS_CONTEXT` — provide the missing information and re-dispatch the same agent. Do NOT skip ahead with a guess.
|
|
90
|
-
- `STATUS: BLOCKED` —
|
|
90
|
+
- `STATUS: BLOCKED` from a review agent (`spec-reviewer`, `reviewer`, or `security-auditor`) — send actionable required fixes to the implementer, then repeat the required reviews. Allow at most 3 implementer re-dispatches per task across review stages, or the active workflow's stricter cap. At the cap, stop and report the unresolved findings.
|
|
91
|
+
- `STATUS: BLOCKED` from an implementer or another non-review agent — stop and report the blocker to the user. Do not retry unchanged inputs.
|
|
91
92
|
|
|
92
93
|
## Steps
|
|
93
94
|
1. Read the task description and identify sub-tasks
|
|
@@ -102,5 +103,5 @@ Every draht agent ends its response with one of four status lines. Branch on it:
|
|
|
102
103
|
- Every dispatch is a complete brief: objective, expected output format, tool guidance, and task boundaries — subagents cannot see the main conversation
|
|
103
104
|
- Do not nest delegations deeply — one level is usually enough
|
|
104
105
|
- Never retry the same agent on the same input after `BLOCKED` — change something
|
|
105
|
-
-
|
|
106
|
-
-
|
|
106
|
+
- If both spec and quality review are required, spec-reviewer runs first
|
|
107
|
+
- Use a fresh reviewer for unresolved semantic risks. Reuse auditable check results for unchanged inputs; rerun when state changed or evidence cannot be verified. Required failed checks block completion.
|
|
@@ -10,7 +10,7 @@ Run fresh-context worker iterations against a fixed goal until an independent ch
|
|
|
10
10
|
|
|
11
11
|
Goal: $ARGUMENTS
|
|
12
12
|
|
|
13
|
-
> **Tool note**:
|
|
13
|
+
> **Tool note**: Dispatch subagents using the matching Draht agent role. Workers are `implementer` (or `debugger` for pure-diagnosis goals); use `spec-reviewer` for acceptance criteria the check cannot establish. One worker per iteration — never parallel workers inside the loop.
|
|
14
14
|
|
|
15
15
|
## When to Loop vs Orchestrate
|
|
16
16
|
|
|
@@ -59,17 +59,17 @@ Each iteration dispatches ONE fresh worker whose prompt contains, in full (worke
|
|
|
59
59
|
2. The last 3 entries of `PROGRESS.md` and the last 5 `git log --oneline` lines — the recoverable state
|
|
60
60
|
3. The previous iteration's failure evidence, terse: the failing assertions or error lines, not full output
|
|
61
61
|
4. Standing orders:
|
|
62
|
-
- **
|
|
62
|
+
- **Orient** — read the progress log and current check evidence; rerun if the evidence is missing or its inputs changed
|
|
63
63
|
- **One increment** — the smallest change that moves the check toward passing; do not batch
|
|
64
|
-
- **
|
|
64
|
+
- **Preserve the increment** in the working tree and progress log; commit only when authorized
|
|
65
65
|
- **Append one `PROGRESS.md` entry** — what changed / check result observed / suggested next step
|
|
66
66
|
- Never edit or delete tests or the check to make it pass; never claim completion without quoting check output
|
|
67
67
|
|
|
68
68
|
## Independent Verification — the gate
|
|
69
69
|
|
|
70
|
-
After
|
|
70
|
+
After each iteration, inspect the CHECK’s exit status, output, and input state. Reuse auditable successful evidence when the inputs are unchanged; otherwise run the CHECK. A worker’s unsupported completion claim is insufficient.
|
|
71
71
|
|
|
72
|
-
- **Check passes** →
|
|
72
|
+
- **Check passes** → compare the full diff with the contract. Use `spec-reviewer` when semantic acceptance criteria remain outside the check. Required findings trigger a targeted iteration within the existing cap.
|
|
73
73
|
- **Check fails** → extract the terse failure evidence and feed it into the next iteration's prompt as guidance.
|
|
74
74
|
|
|
75
75
|
## Stall Detection
|
|
@@ -77,7 +77,7 @@ After EVERY iteration, re-run the CHECK yourself and read exit code and output.
|
|
|
77
77
|
Stop early when the loop is running but not progressing:
|
|
78
78
|
|
|
79
79
|
- Two consecutive iterations with the identical failure signature, or
|
|
80
|
-
- An iteration that produced no
|
|
80
|
+
- An iteration that produced no relevant change or new diagnostic evidence
|
|
81
81
|
|
|
82
82
|
On stall, do not dispatch the same input again — change something: decompose the goal, add context the workers were missing, switch worker (`implementer` → `debugger`), consult `advisor` for a course correction, or surface to the user with the evidence so far.
|
|
83
83
|
|
|
@@ -85,16 +85,16 @@ On stall, do not dispatch the same input again — change something: decompose t
|
|
|
85
85
|
|
|
86
86
|
1. Parse `$ARGUMENTS` into GOAL and flags; derive the CHECK; refuse to loop without one
|
|
87
87
|
2. Write `.planning/loop/LOOP.md` and `.planning/loop/PROGRESS.md`
|
|
88
|
-
3. Iterate: dispatch worker →
|
|
89
|
-
4. On success:
|
|
88
|
+
3. Iterate: dispatch worker → validate current CHECK evidence → branch (pass → gate, fail → next iteration, stall / max / BLOCKED → hard stop)
|
|
89
|
+
4. On success: resolve any required spec review, then report — outcome first, check output quoted, iterations used
|
|
90
90
|
5. On any hard stop: append a handoff entry to `PROGRESS.md` (state observed, failure evidence, recommended next step) and report with observed / derived / assumed labels
|
|
91
91
|
6. Leave `.planning/loop/` in place as the loop's record
|
|
92
92
|
|
|
93
93
|
## Rules
|
|
94
94
|
|
|
95
|
-
- One worker
|
|
96
|
-
-
|
|
97
|
-
-
|
|
95
|
+
- One worker and one verifiable increment per iteration; commits require authorization
|
|
96
|
+
- Choose available worker models that meet the task’s checks; change tiers only when evidence supports the tradeoff
|
|
97
|
+
- Completion requires current passing check evidence and any required review; an agent’s confidence is not a check
|
|
98
98
|
- Never raise max iterations mid-loop without asking the user
|
|
99
|
-
- Tests and the check are immutable inside the loop; tampering means
|
|
99
|
+
- Tests and the check are immutable inside the loop; tampering means stop and report the affected changes; do not discard unrelated work
|
|
100
100
|
- Evidence discipline applies to the loop verdict: label results observed / derived / assumed
|
|
@@ -22,7 +22,7 @@ Create a handoff document for session continuity.
|
|
|
22
22
|
- `## Blockers` — anything waiting on external input or clarification
|
|
23
23
|
4. **Distill lessons before the context is lost**: for anything this session tried that failed, or an approach that worked against expectations, append one dated bullet to `.planning/STATE.md` under `## Lessons` (create the section before `## Blockers` if missing). Lessons name what to do differently — "runner hits TLS issue in PowerShell, use bash", not "had problems with tests".
|
|
24
24
|
5. Update `.planning/STATE.md` last activity timestamp via `draht-tools update-state`
|
|
25
|
-
6.
|
|
25
|
+
6. If committing is authorized: `draht-tools commit-docs "pause work — handoff"`
|
|
26
26
|
7. Tell the user: "Resume with `/resume-work` in a fresh session."
|
|
27
27
|
|
|
28
28
|
## Rules
|
|
@@ -10,31 +10,13 @@ Create atomic execution plans for a roadmap phase, using subagents for parallel
|
|
|
10
10
|
|
|
11
11
|
Phase: $1
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
> Invoke noninteractive Draht tooling as `node "${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-$HOME/.draht/codex-marketplace/plugins/draht}}/bin/draht-tools.cjs" <subcommand>`.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
## Planning constraints
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
- A task's `<test>` section names no concrete test cases (e.g., "test the function" with no inputs/outputs)
|
|
19
|
-
- A task's `<files>` section lists no concrete file paths
|
|
20
|
-
- A task takes more than ~5 minutes of focused work — break it down further
|
|
21
|
-
- The plan introduces new domain terms that are NOT in `.planning/DOMAIN.md` — update DOMAIN.md first
|
|
22
|
-
- A plan touches more than one bounded context without explicit ACL — split per context
|
|
23
|
-
- The first plan is scaffolding/boilerplate while an unproven risk (new integration, unfamiliar API, untested pattern) sits in a later plan — reorder so the risk is proven first
|
|
17
|
+
Use coherent tasks with concrete files, behavior, and verification. Group dependent changes that need to land together; split unrelated outcomes. Task size follows the behavior and dependency structure, not a time limit or fixed count. Resolve uncertainty that could invalidate later work early, and state material assumptions and how to check them.
|
|
24
18
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
> **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 a Codex subagent using the `architect` agent prompt. Dispatch multiple parallel tasks in a single assistant turn by making multiple Codex subagent calls at once.
|
|
28
|
-
|
|
29
|
-
## Atomic Reasoning
|
|
30
|
-
|
|
31
|
-
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
|
-
|
|
33
|
-
**Atomicity test:** a task is atomic only if its `<verify>` can fail while every other task passes. If two tasks can only be checked together, they are one task.
|
|
34
|
-
|
|
35
|
-
- **Order risk-first**: score each truth by uncertainty (has this codebase done it before?) × blast radius (how much becomes invalid if it's wrong?). The plan proving the highest-scoring truth executes first; boilerplate goes last. Boilerplate never invalidates a phase — the risky part regularly does.
|
|
36
|
-
|
|
37
|
-
- Write every assumption a plan rests on as an explicit `Assumes:` line (with how to confirm it) in the plan header. Unwritten assumptions become the executor's bugs.
|
|
19
|
+
The `atomic-reasoning` skill can help with difficult decomposition. Respect existing domain vocabulary and architecture; do not require new DDD layers or events solely because a plan crosses directories. Validate the saved plan with `draht-tools validate-plans $1` and resolve its errors before execution.
|
|
38
20
|
|
|
39
21
|
## Steps
|
|
40
22
|
1. Run `draht-tools load-phase-context $1` to gather all context
|
|
@@ -42,13 +24,13 @@ Decompose the work into independently verifiable units before acting; the `atomi
|
|
|
42
24
|
2. Optional: `draht-tools research-phase $1` for domain research
|
|
43
25
|
3. Goal-backward planning:
|
|
44
26
|
a. State the goal (outcome, not activity)
|
|
45
|
-
b. Derive observable
|
|
27
|
+
b. Derive the observable outcomes required by the user
|
|
46
28
|
c. From each observable truth, derive the test scenarios that would prove it (specific inputs → expected outputs or state changes)
|
|
47
29
|
d. Map to required artifacts (files, endpoints, schemas)
|
|
48
|
-
- GRAPH-ORIENT: read `.planning/codebase/
|
|
49
|
-
e.
|
|
30
|
+
- GRAPH-ORIENT: read `.planning/codebase/GRAPH_REPORT.md` (regenerate with `draht-tools map-graph` if absent), then run `draht-tools graph-context <target-files>` for pkg/layer/importers and `draht-tools graph-query <term...>` to locate the code. Load relevant results rather than the full MAP.json.
|
|
31
|
+
e. Group tasks according to dependencies and coherent outcomes
|
|
50
32
|
4. Identify which plans are independent (no shared files, no dependency edges)
|
|
51
|
-
- GRAPH-IMPACT: run `draht-tools graph-impact <plan-files>` per plan;
|
|
33
|
+
- GRAPH-IMPACT: run `draht-tools graph-impact <plan-files>` per plan; use affected entry points and dependencies to assess shared risks; serialize conflicting changes. Disjoint file sets alone do not prove independence.
|
|
52
34
|
|
|
53
35
|
5. **Delegate plan creation to subagents via Codex subagents:**
|
|
54
36
|
- For **independent plans**: dispatch multiple `spawn_agent` calls in parallel (single assistant turn), each using the `architect` agent prompt, one per plan.
|
|
@@ -87,7 +69,7 @@ Decompose the work into independently verifiable units before acting; the `atomi
|
|
|
87
69
|
The content must contain real task details (files, actions, tests) — NOT placeholder brackets. If `create-plan` is called without stdin, it writes a useless template.
|
|
88
70
|
|
|
89
71
|
8. Validate: `draht-tools validate-plans $1` — if it exits non-zero, fix the offending plan before commit.
|
|
90
|
-
9.
|
|
72
|
+
9. If committing is authorized: `draht-tools commit-docs "create phase $1 plans"`
|
|
91
73
|
10. Show the user the execution order as a Mermaid `flowchart TD` per the `explainers` skill: one `subgraph` per wave, one node per plan, edges for the dependencies the saved plans declare. Draw it from the saved plan files, not from memory. It goes in your reply, not into the plan files.
|
|
92
74
|
|
|
93
75
|
## Plan Format
|
|
@@ -95,8 +77,8 @@ Plans use XML task format:
|
|
|
95
77
|
```xml
|
|
96
78
|
<task type="auto">
|
|
97
79
|
<n>Task name</n>
|
|
98
|
-
<context>
|
|
99
|
-
<domain>
|
|
80
|
+
<context>Relevant project context or module boundary</context>
|
|
81
|
+
<domain>Existing domain concepts affected, if applicable</domain>
|
|
100
82
|
<files>affected files</files>
|
|
101
83
|
<test>
|
|
102
84
|
RED phase: Write failing tests FIRST.
|
|
@@ -113,9 +95,7 @@ Plans use XML task format:
|
|
|
113
95
|
</action>
|
|
114
96
|
<refactor>
|
|
115
97
|
REFACTOR phase: Improve structure while keeping tests green.
|
|
116
|
-
-
|
|
117
|
-
- Ensure naming matches ubiquitous language
|
|
118
|
-
- Remove duplication across bounded contexts (or make shared kernel explicit)
|
|
98
|
+
- Apply useful structural improvements within scope; preserve behavior
|
|
119
99
|
</refactor>
|
|
120
100
|
<verify>How to verify (tests pass + manual check if needed)</verify>
|
|
121
101
|
<done>What "done" looks like — expressed as passing test assertions</done>
|
|
@@ -131,10 +111,8 @@ This is one step in the per-phase cycle:
|
|
|
131
111
|
/discuss-phase N → /plan-phase N → /execute-phase N → /verify-work N
|
|
132
112
|
```
|
|
133
113
|
|
|
134
|
-
After completing this command,
|
|
114
|
+
After completing this command, identify `/execute-phase $1` as the next step; a fresh session is optional. Do NOT suggest `/next-milestone`.
|
|
115
|
+
|
|
116
|
+
## Domain context
|
|
135
117
|
|
|
136
|
-
|
|
137
|
-
- File/module structure should mirror bounded contexts (e.g., `src/billing/`, `src/catalog/`)
|
|
138
|
-
- Never scatter one aggregate's logic across multiple contexts without an explicit ACL
|
|
139
|
-
- If a plan introduces a new domain term, update `.planning/DOMAIN.md` first
|
|
140
|
-
- Cross-context communication should use domain events, not direct imports
|
|
118
|
+
Use established project terms and boundaries. Update an existing domain document when the plan changes the model; do not introduce DDD ceremony for unrelated work.
|
package/skills/progress/SKILL.md
CHANGED
package/skills/quick/SKILL.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
+
disable-model-invocation: true
|
|
2
3
|
name: quick
|
|
3
|
-
description:
|
|
4
|
+
description: Run the Draht quick command when the user explicitly selects it for an ad-hoc task.
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Draht Command: quick
|