@brunosps00/dev-workflow 2.2.0 → 2.3.0

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.
Files changed (119) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +46 -0
  3. package/README.md +12 -4
  4. package/lib/constants.js +24 -24
  5. package/lib/init.js +8 -0
  6. package/lib/instruction-health.js +38 -0
  7. package/lib/post-update.js +2 -1
  8. package/lib/validate.js +3 -1
  9. package/package.json +1 -1
  10. package/scaffold/config/routing.json +61 -23
  11. package/scaffold/en/agent-instructions.md +31 -137
  12. package/scaffold/en/commands/dw-analyze-project.md +2 -0
  13. package/scaffold/en/commands/dw-autopilot.md +22 -245
  14. package/scaffold/en/commands/dw-bugfix.md +9 -35
  15. package/scaffold/en/commands/dw-claude-run.md +29 -45
  16. package/scaffold/en/commands/dw-codex-run.md +30 -45
  17. package/scaffold/en/commands/dw-context-budget.md +6 -14
  18. package/scaffold/en/commands/dw-copilot-run.md +29 -41
  19. package/scaffold/en/commands/dw-generate-pr.md +2 -2
  20. package/scaffold/en/commands/dw-goal.md +11 -5
  21. package/scaffold/en/commands/dw-help.md +2 -2
  22. package/scaffold/en/commands/dw-plan.md +14 -7
  23. package/scaffold/en/commands/dw-qa.md +2 -0
  24. package/scaffold/en/commands/dw-resume.md +5 -11
  25. package/scaffold/en/commands/dw-review.md +4 -3
  26. package/scaffold/en/commands/dw-run.md +19 -166
  27. package/scaffold/en/commands/dw-skill-health.md +7 -0
  28. package/scaffold/en/commands/dw-update.md +18 -4
  29. package/scaffold/en/references/command-routing.md +53 -0
  30. package/scaffold/en/references/execution-contract.md +55 -0
  31. package/scaffold/en/templates/frontend-quality-template.md +43 -0
  32. package/scaffold/en/templates/task-template.md +20 -40
  33. package/scaffold/en/templates/tasks-template.md +9 -6
  34. package/scaffold/en/templates/techspec-template.md +4 -0
  35. package/scaffold/pt-br/agent-instructions.md +31 -137
  36. package/scaffold/pt-br/commands/dw-analyze-project.md +2 -0
  37. package/scaffold/pt-br/commands/dw-autopilot.md +22 -245
  38. package/scaffold/pt-br/commands/dw-bugfix.md +9 -35
  39. package/scaffold/pt-br/commands/dw-claude-run.md +29 -46
  40. package/scaffold/pt-br/commands/dw-codex-run.md +30 -45
  41. package/scaffold/pt-br/commands/dw-context-budget.md +6 -14
  42. package/scaffold/pt-br/commands/dw-copilot-run.md +29 -43
  43. package/scaffold/pt-br/commands/dw-generate-pr.md +2 -2
  44. package/scaffold/pt-br/commands/dw-goal.md +11 -5
  45. package/scaffold/pt-br/commands/dw-help.md +2 -2
  46. package/scaffold/pt-br/commands/dw-plan.md +14 -7
  47. package/scaffold/pt-br/commands/dw-qa.md +2 -0
  48. package/scaffold/pt-br/commands/dw-resume.md +7 -11
  49. package/scaffold/pt-br/commands/dw-review.md +4 -3
  50. package/scaffold/pt-br/commands/dw-run.md +19 -166
  51. package/scaffold/pt-br/commands/dw-skill-health.md +7 -0
  52. package/scaffold/pt-br/commands/dw-update.md +18 -4
  53. package/scaffold/pt-br/references/command-routing.md +53 -0
  54. package/scaffold/pt-br/references/execution-contract.md +55 -0
  55. package/scaffold/pt-br/templates/frontend-quality-template.md +43 -0
  56. package/scaffold/pt-br/templates/task-template.md +20 -40
  57. package/scaffold/pt-br/templates/tasks-template.md +9 -6
  58. package/scaffold/pt-br/templates/techspec-template.md +4 -0
  59. package/scaffold/scripts/lib/workflow-contract.mjs +101 -0
  60. package/scaffold/skill-registry.json +23 -23
  61. package/scaffold/skills/dw-cli-run/SKILL.md +33 -217
  62. package/scaffold/skills/dw-cli-run/references/dispatch-tuning.md +14 -72
  63. package/scaffold/skills/dw-codebase-intel/SKILL.md +5 -39
  64. package/scaffold/skills/dw-codebase-intel/agents/intel-updater.md +1 -1
  65. package/scaffold/skills/dw-codebase-intel/references/agents-detail.md +7 -0
  66. package/scaffold/skills/dw-codebase-intel/references/files-in-dw-intel-detail.md +16 -0
  67. package/scaffold/skills/dw-codebase-intel/references/how-dw-intel-reads-this-detail.md +12 -0
  68. package/scaffold/skills/dw-codebase-intel/references/how-to-compose-the-typical-flow-detail.md +11 -0
  69. package/scaffold/skills/dw-council/SKILL.md +2 -17
  70. package/scaffold/skills/dw-council/references/integration-with-other-dw-commands-detail.md +7 -0
  71. package/scaffold/skills/dw-council/references/phase-2-tensions-and-rebuttals-detail.md +15 -0
  72. package/scaffold/skills/dw-domain-modeling/SKILL.md +1 -1
  73. package/scaffold/skills/dw-execute-phase/SKILL.md +12 -32
  74. package/scaffold/skills/dw-execute-phase/agents/executor.md +15 -252
  75. package/scaffold/skills/dw-execute-phase/agents/plan-checker.md +4 -207
  76. package/scaffold/skills/dw-execute-phase/references/atomic-commits.md +8 -18
  77. package/scaffold/skills/dw-execute-phase/references/de-sloppify-pass-optional-cleanup-task-detail.md +12 -0
  78. package/scaffold/skills/dw-execute-phase/references/deviation-rules-during-execution-detail.md +8 -0
  79. package/scaffold/skills/dw-execute-phase/references/how-the-two-agents-compose-detail.md +7 -0
  80. package/scaffold/skills/dw-execute-phase/references/plan-verification.md +9 -155
  81. package/scaffold/skills/dw-execute-phase/references/wave-coordination.md +6 -97
  82. package/scaffold/skills/dw-git-discipline/SKILL.md +2 -2
  83. package/scaffold/skills/dw-grilling/SKILL.md +1 -1
  84. package/scaffold/skills/dw-incident-response/SKILL.md +1 -64
  85. package/scaffold/skills/dw-incident-response/references/the-five-phases-detail.md +66 -0
  86. package/scaffold/skills/dw-llm-eval/SKILL.md +5 -53
  87. package/scaffold/skills/dw-llm-eval/references/agent-tool-use-evaluation-detail.md +23 -0
  88. package/scaffold/skills/dw-llm-eval/references/anti-patterns-will-block-in-dw-review-code-only-detail.md +9 -0
  89. package/scaffold/skills/dw-llm-eval/references/consistency-run-to-run-stability-detail.md +10 -0
  90. package/scaffold/skills/dw-llm-eval/references/integration-with-dev-workflow-commands-detail.md +6 -0
  91. package/scaffold/skills/dw-llm-eval/references/the-oracle-ladder-detail.md +15 -0
  92. package/scaffold/skills/dw-memory/SKILL.md +4 -50
  93. package/scaffold/skills/dw-memory/references/context-budget.md +8 -56
  94. package/scaffold/skills/dw-memory/references/promotion-decision-test-detail.md +30 -0
  95. package/scaffold/skills/dw-minimalism/SKILL.md +4 -5
  96. package/scaffold/skills/dw-review-rigor/SKILL.md +1 -54
  97. package/scaffold/skills/dw-review-rigor/references/the-five-rules-detail.md +56 -0
  98. package/scaffold/skills/dw-simplification/SKILL.md +2 -55
  99. package/scaffold/skills/dw-simplification/references/pattern-recognition-detail.md +11 -0
  100. package/scaffold/skills/dw-simplification/references/the-five-rules-detail.md +48 -0
  101. package/scaffold/skills/dw-source-grounding/SKILL.md +1 -56
  102. package/scaffold/skills/dw-source-grounding/references/the-protocol-detect-fetch-implement-cite-detail.md +58 -0
  103. package/scaffold/skills/dw-testing-discipline/SKILL.md +25 -177
  104. package/scaffold/skills/dw-testing-discipline/references/agent-guardrails.md +9 -167
  105. package/scaffold/skills/dw-testing-discipline/references/core-rules.md +3 -3
  106. package/scaffold/skills/dw-testing-discipline/references/mutation-testing.md +19 -0
  107. package/scaffold/skills/dw-testing-discipline/references/patterns.md +3 -12
  108. package/scaffold/skills/dw-ui-discipline/SKILL.md +2 -59
  109. package/scaffold/skills/dw-ui-discipline/references/frontend-engineering.md +46 -0
  110. package/scaffold/skills/dw-ui-discipline/references/the-four-grounding-questions-detail.md +61 -0
  111. package/scaffold/skills/dw-verify/SKILL.md +26 -148
  112. package/scaffold/skills/dw-verify/references/verification-discovery-and-attribution.md +2 -2
  113. package/scaffold/skills/humanizer/SKILL.md +2 -1
  114. package/scaffold/skills/security-review/SKILL.md +3 -183
  115. package/scaffold/skills/security-review/references/do-not-flag-detail.md +49 -0
  116. package/scaffold/skills/security-review/references/quick-patterns-reference-detail.md +56 -0
  117. package/scaffold/skills/security-review/references/review-process-detail.md +84 -0
  118. package/scaffold/skills/vercel-react-best-practices/SKILL.md +1 -90
  119. package/scaffold/skills/vercel-react-best-practices/references/quick-reference-detail.md +92 -0
@@ -1,158 +1,12 @@
1
- # Plan verification — the 6-dimension goal-backward analysis
1
+ # Plan verification — six dimensions
2
2
 
3
- The `dw-plan-checker` agent verifies that a `tasks.md` will achieve the PRD goal BEFORE execution starts. This document details each dimension's checks, examples, and pass/fail criteria.
3
+ Read when validating a planned execution. Verify expected outcomes, not literal headings or arbitrary task/file quotas. Relevant evidence may appear in the task, approved TechSpec sections or execution matrix.
4
4
 
5
- ## Why pre-execution verification
5
+ 1. **Requirement coverage:** extract `<REQ-ID>` verbatim (`FR-N.M` in English, `RF-N.M` in Portuguese). Every required outcome must be addressed by one or more tasks; an existing implementation may satisfy it when explicitly verified.
6
+ 2. **Task completeness:** identify affected surfaces, intended behavior, verification and acceptance criteria. Schema 1.1 uses Implementation, Verification and success criteria, and Relevant files and decisions (or translated headings). These concepts are required; exact header spelling is not. Check the execution assignment and rationale, including concrete external model/effort and approved alternatives.
7
+ 3. **Dependencies:** validate `Depends on:` and execution-plan.json agree, all IDs exist, and the graph is acyclic. Queue ready tasks to respect at most 3 workers and actual host capacity. No synthetic dependencies to limit concurrency. One writer per worktree; dependent work sees dependency commits on its execution branch.
8
+ 4. **Artifact wiring:** produced services, endpoints, schemas and UI elements must be connected to their intended consumers or deliverable. Check the planned wiring, not just file existence.
9
+ 5. **Execution feasibility:** task packets should be bounded with relevant context and durable checkpoints. Large task/file counts are a reason to inspect feasibility, not an automatic failure. Parallelism is optional. Separate worktrees need an approved integration path before dependent work; otherwise execute serially on the shared execution branch.
10
+ 6. **Constraints:** check relevant project rules and locked architecture decisions within actual instruction precedence. Do not scan every skill. Security and constitution exceptions follow the project's established process.
6
11
 
7
- Mid-execution discovery of plan flaws is expensive: context burned, partial commits to revert, deviation logs to resolve. Pre-execution verification catches the same flaws at zero implementation cost. The trade-off: 1-2 minutes of plan-checker time vs. potentially 30+ minutes of mid-execution rework.
8
-
9
- ## The 6 dimensions
10
-
11
- ### 1. Requirement Coverage
12
-
13
- **Goal:** every PRD requirement (`<REQ-ID>`) has at least one task addressing it.
14
-
15
- <critical>`<REQ-ID>` is language-dependent: `FR-N.M` in English projects, `RF-N.M` in Portuguese ones. This skill is shared by both — extract the IDs verbatim from `prd.md` and match those exact strings downstream; never hardcode a prefix.</critical>
16
-
17
- **Steps:**
18
- 1. Extract numbered requirements from `prd.md`. Pattern: `### <REQ-ID>` or `**<REQ-ID>:**` or numbered list under "Functional Requirements" / "Requisitos Funcionais".
19
- 2. Build `Set<REQ-ID>` of expected requirements.
20
- 3. Scan `tasks.md` and `<NN>_task.md` files for `Closes <REQ-ID>` / the `FRs`/`RFs` table column / `Requirement: <REQ-ID>` markers.
21
- 4. Compute `uncovered = expected - addressed`.
22
-
23
- **Pass:** `uncovered` is empty.
24
- **Revise:** uncovered non-empty AND fixable by adding tasks.
25
- **Block:** PRD has no numbered requirements (`expected` is empty) — verifying intent is impossible.
26
-
27
- **Common failures:**
28
- - Planner forgot a non-obvious requirement (e.g., audit logging) buried in PRD prose
29
- - Compound requirement ("user can sign up AND verify email") only addressed for one half
30
- - Requirement covered indirectly but no task explicitly marks the closure
31
-
32
- ### 2. Task Completeness
33
-
34
- **Goal:** each task has all four parts: files, action, verification, done criteria.
35
-
36
- **Steps:**
37
- For each task in `tasks.md`:
38
- - Open `<NN>_task.md` (or inline section)
39
- - Check for required sections:
40
- - `## Files` (or `Files to create/modify:`) — explicit paths
41
- - `## Action` (or `Implement:`) — what to do, concrete
42
- - `## Verification` (or `Verify:`) — how to know it worked (linter, tests, build, manual)
43
- - `## Done` (or `Done when:`) — criteria for marking `[x]`
44
-
45
- **Pass:** all four sections present in every task.
46
- **Revise:** ≥1 task missing one section.
47
-
48
- **Common failures:**
49
- - "Files: TBD" or "Files: see techspec" — too vague
50
- - No verification → executor can't decide when to commit
51
- - Done criteria absent → executor commits but can't mark `[x]` confidently
52
-
53
- ### 3. Dependency Soundness
54
-
55
- **Goal:** `Depends on:` graph is acyclic, references valid, waves are reasonable.
56
-
57
- **Steps:**
58
- 1. Parse every task's `Depends on:` field (none / comma-separated task numbers).
59
- 2. Build directed graph (node = task, edge = depends-on relation).
60
- 3. Topological sort:
61
- - Cycle → BLOCK with the cycle path
62
- - Reference to non-existent task number → REVISE with the dangling ref
63
- 4. Compute wave widths. Any wave > 8 tasks → REVISE (split with synthetic barrier).
64
-
65
- **Pass:** topological sort succeeds, all refs valid, waves ≤ 8 wide.
66
-
67
- **Common failures:**
68
- - Bidirectional dependency (`02 depends on 03; 03 depends on 02`) — likely planner confusion; needs re-think
69
- - Typo in `Depends on: 02` when the task is actually numbered `2.5` or `03`
70
- - 10 independent test files all in wave 1 → split into smaller waves
71
-
72
- ### 4. Artifact Wiring
73
-
74
- **Goal:** every artifact produced by a task is consumed by a downstream task OR is a leaf deliverable referenced in PRD's user stories.
75
-
76
- **Steps:**
77
- 1. For each task, identify what it PRODUCES:
78
- - New files (from `Files: + src/foo.ts`)
79
- - New exports (from `Implement: export function bar()`)
80
- - New endpoints (from `Action: add POST /api/baz`)
81
- 2. For each downstream task (later in topo order), identify what it CONSUMES:
82
- - Imports (from `Files: src/quux.ts (modify) — imports bar`)
83
- - References (from `Action: call /api/baz`)
84
- 3. Cross-reference: every produced artifact should be either consumed downstream OR explicitly mentioned in PRD as a user-facing deliverable.
85
-
86
- **Pass:** zero orphan artifacts.
87
- **Revise:** ≥1 artifact created without consumer or PRD reference — likely incomplete plan.
88
-
89
- **Common failures:**
90
- - Task creates a service but no task wires it into the router
91
- - Task creates a migration file but no task runs it (`prisma migrate deploy`)
92
- - Task creates a config but no task reads it
93
-
94
- ### 5. Context Budget
95
-
96
- **Goal:** the phase fits in a practical execution window.
97
-
98
- **Steps:**
99
- 1. Count tasks. Practical limit: 12 tasks per phase before quality degrades.
100
- 2. Estimate aggregate file changes: sum of files mentioned in `Files:` across all tasks. Limit: 30 files per phase.
101
- 3. Check parallelism setup: are wave-1 tasks running in parallel? (frontmatter `parallel: true` or default).
102
-
103
- **Pass:** ≤12 tasks, ≤30 aggregate files, wave 1 has parallel execution if multi-task.
104
-
105
- **Revise:** > 12 tasks → suggest splitting into 2 phases. > 30 files → reduce scope or split.
106
-
107
- **Common failures:**
108
- - Mega-phase with 20 tasks because the planner couldn't decompose
109
- - Single-task waves where parallelism was forgotten
110
-
111
- ### 6. Constraint Compliance
112
-
113
- **Goal:** tasks honor locked decisions and project conventions.
114
-
115
- **Steps:**
116
- 1. Read `.dw/rules/index.md` and `.dw/rules/<module>.md` for relevant modules.
117
- 2. Read `CONTEXT.md` if exists; extract `## Decisions` (LOCKED) section.
118
- 3. Read `./CLAUDE.md` for project hard constraints.
119
- 4. For each task, check if its `Action` or `Files` violate:
120
- - A locked decision
121
- - A project rule (forbidden pattern, mandated tool)
122
- - A CLAUDE.md directive
123
-
124
- **Pass:** zero violations.
125
- **Block:** ≥1 hard violation. The plan must change before execution.
126
-
127
- **Common failures:**
128
- - Locked decision says "framework: Fastify" but task says "use Express"
129
- - Project rules forbid raw SQL; task uses `pg.query()` directly
130
- - CLAUDE.md says "no env files committed"; task adds `.env.production`
131
-
132
- ## Verdict resolution
133
-
134
- After running all 6 dimensions:
135
-
136
- | Outcome | Verdict |
137
- |---------|---------|
138
- | All 6 PASS | PASS — proceed to execution |
139
- | Any REVISE, no BLOCK | REVISE — re-plan |
140
- | Any BLOCK | BLOCK — surface to user, no auto-replan |
141
-
142
- `PASS` is the only state that allows `/dw-execute-phase` to proceed.
143
-
144
- ## Bounded revision loop
145
-
146
- The plan-checker is part of a bounded quality loop:
147
-
148
- 1. `/dw-plan tasks` produces v1 of `tasks.md`
149
- 2. `/dw-plan-checker` runs → REVISE
150
- 3. `/dw-plan tasks --revise` produces v2 (consumes plan-checker's issues as input)
151
- 4. `/dw-plan-checker` runs → PASS or REVISE again
152
- 5. After 3 revisions without reaching PASS → escalate to user (something fundamental is wrong)
153
-
154
- The escalation cap prevents infinite loops where the planner can't satisfy the verifier. At 3 strikes, the user sees the diff between PRD and the failing tasks.md and decides next step.
155
-
156
- ## Time budget
157
-
158
- Plan-checker target: 1-2 minutes. The 6 dimensions are mostly file reads and grep operations; no heavy analysis. If plan-checker exceeds 5 minutes, it's a sign the agent is over-thinking — bias toward issuing REVISE for ambiguous cases rather than analyzing them deeply.
12
+ Return PASS when all dimensions are supported; REVISE for fixable draft inconsistencies; BLOCK for unresolved material decisions, conflicts, cycles or unavailable required capabilities. The parent repairs REVISE findings within approved scope and rechecks affected dimensions. Do not restart product interviews for discoverable facts or repeat a valid plan check without changed inputs. At a real repeated impasse report evidence and the exact missing decision, preserving the draft.
@@ -1,102 +1,11 @@
1
- # Wave coordination — how the executor parallelizes tasks
1
+ # Dependency scheduling
2
2
 
3
- Tasks within a phase have dependencies. Some can run in parallel; others must wait. The executor groups tasks into **waves** and runs each wave as parallel subagent dispatches, with sequential ordering between waves.
3
+ Read for multi-task execution. Parse `Depends on:` from tasks.md and cross-check execution-plan.json. Topologically order tasks; reject cycles and missing task IDs. The installed workflow-contract helper can validate the JSON graph and return ready tasks.
4
4
 
5
- ## Wave computation
5
+ A wave is a set of ready tasks, not a requirement to spawn parallel agents. Run at most 3 approved workers per workstream, limited further by host capacity. Serialize writers sharing a worktree. Do not introduce fake dependencies to enforce a concurrency limit; queue ready work instead.
6
6
 
7
- Input: `tasks.md` with each task carrying a `Depends on:` field (none, or comma-separated task IDs).
7
+ Dependent tasks use the same execution branch and see dependency commits before starting, even when successive tasks use different CLIs. Independent worktrees require a planned integration path before dependent work and authorization for that integration. Without it, run sequentially on the execution branch. Do not merge into the owner's branch solely to progress.
8
8
 
9
- Algorithm: topological sort.
9
+ Each writer owns scoped task changes and its commit. Parent updates consolidated state after handoffs; avoid concurrent edits to shared tasks.md. Commit IDs need not follow numeric task order when tasks are independent. A failed task blocks its dependents; independent authorized tasks can continue.
10
10
 
11
- 1. Build dependency graph: node per task, edge from each `Depends on:` to the dependent task.
12
- 2. Cycle check: if a cycle exists → abort with `EXEC-FAILED: dependency cycle`.
13
- 3. Wave assignment:
14
- - Wave 1 = tasks with zero dependencies
15
- - Wave N = tasks whose all dependencies are in waves 1..N-1
16
- 4. Output: ordered list of waves, each wave a list of task IDs.
17
-
18
- ## Example
19
-
20
- ```
21
- tasks.md:
22
- - 1.0 Create user schema Depends on: none
23
- - 2.0 Create user model Depends on: 1.0
24
- - 3.0 Create order schema Depends on: none
25
- - 4.0 Wire auth middleware Depends on: 2.0
26
- - 5.0 Add login endpoint Depends on: 4.0
27
- - 6.0 Add order endpoint Depends on: 2.0, 3.0
28
- - 7.0 Wire validation rules Depends on: 4.0, 6.0
29
-
30
- Computed waves:
31
- Wave 1: [1.0, 3.0] (no deps; can run in parallel)
32
- Wave 2: [2.0] (depends on 1.0)
33
- Wave 3: [4.0, 6.0] (depend on wave 2)
34
- Wave 4: [5.0, 7.0] (depend on wave 3)
35
- ```
36
-
37
- ## Parallel execution within a wave
38
-
39
- Within a wave, the executor dispatches tasks in parallel via subagent calls (one subagent per task). Each subagent:
40
-
41
- 1. Reads its `<NN>_task.md`
42
- 2. Implements
43
- 3. Verifies (lint/tests/build)
44
- 4. Commits atomically (per `atomic-commits.md`)
45
- 5. Marks `[x]` in `tasks.md`
46
- 6. Returns success or deviation status to the orchestrating executor
47
-
48
- The orchestrating executor:
49
-
50
- - Spawns N subagents in parallel (single message, N tool calls)
51
- - Waits for all to return
52
- - If all PASS → proceed to next wave
53
- - If ANY return deviation/blocked → resolve before next wave (see deviation rules in `agents/executor.md`)
54
-
55
- ## Wave width limits
56
-
57
- Practical caps to keep context budget sane:
58
-
59
- - **Soft cap: 5 tasks per wave** — tested as the upper bound where parallel execution stays efficient
60
- - **Hard cap: 8 tasks per wave** — beyond this, the orchestrator's context fills with subagent results faster than tasks complete
61
-
62
- If a wave exceeds the hard cap, the planner should split: introduce a synthetic dependency to bisect the wave. Example: if Wave 3 has 10 independent tasks, force tasks 06-10 to depend on a "wave 3a barrier" so they go to Wave 3.5.
63
-
64
- The plan-checker (Dimension 5) flags wide waves before execution.
65
-
66
- ## Cross-wave atomicity
67
-
68
- Each wave is a checkpoint:
69
-
70
- - After all tasks in a wave commit, run a `git status` check — should be clean (everything committed).
71
- - If any task in a wave failed permanently (Rule 3 deviation), abort BEFORE starting the next wave. Leave the partial work committed; surface to user via `EXEC-BLOCKED`.
72
- - Don't run waves N+1 with broken commits in wave N. The dependencies aren't satisfied.
73
-
74
- ## Order within a wave
75
-
76
- Within a wave, order doesn't matter logically (no deps between same-wave tasks). But for **commit history readability**, the executor should commit in numeric order of task ID (1.0 commit before 2.0 even if both are wave 1). The parallel subagent results may arrive out of order; the executor collects and commits sequentially.
77
-
78
- This means: subagents return their changes (files written, but NOT committed). The executor commits them in numeric order.
79
-
80
- (Alternative: subagents commit independently and accept commit interleaving. Pick this if commit-order doesn't matter for the project; the orchestrator sets a flag.)
81
-
82
- ## When to NOT use waves
83
-
84
- Single-task changes (`/dw-quick`, `/dw-run`) bypass waves entirely. Waves are for `/dw-run` and `/dw-execute-phase` — phase-scale execution.
85
-
86
- ## Verification of wave structure (pre-execution)
87
-
88
- The plan-checker (Dimension 3 in `plan-checker.md`) verifies:
89
- - Topological sort succeeds (no cycles)
90
- - All `Depends on:` references point to existing tasks
91
- - No wave exceeds the hard cap (8 tasks)
92
-
93
- If these fail, plan-checker returns REVISE before any code is touched.
94
-
95
- ## Resume after checkpoint
96
-
97
- If the executor checkpoints mid-phase, `active-session.md` records:
98
- - `last_completed_task`
99
- - `last_wave_completed`
100
- - `remaining_tasks`
101
-
102
- `/dw-resume` reads this, recomputes waves from `tasks.md`, skips already-committed tasks, and resumes from the wave containing `last_completed_task + 1`.
11
+ Resume from execution-state.json and actual completed commits, not `last_completed_task + 1`: tasks may finish out of order. Revalidate dependency/evidence state and preserve approved assignments. See `.dw/references/execution-contract.md` for session identity and bookkeeping.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: dw-git-discipline
3
- description: Use when committing or opening a PR. Atomic commits (one intent), Conventional Commits, trunk-based pattern, branch hygiene. Triggers before /dw-commit, /dw-generate-pr, or any git operation.
3
+ description: Use when committing or opening a PR. Atomic commits (one intent), Conventional Commits, trunk-based pattern, branch hygiene. Use for /dw-commit or /dw-generate-pr, not ordinary Git inspection.
4
4
  allowed-tools:
5
5
  - Read
6
6
  - Bash
@@ -54,7 +54,7 @@ See `references/branch-hygiene.md` for naming conventions and rebase-vs-merge gu
54
54
  When wired into `/dw-commit`, every commit must:
55
55
 
56
56
  1. Have a single logical intent (one feature, one fix, one refactor — not mixed).
57
- 2. Pass lint + tests + build BEFORE the commit is created.
57
+ 2. Have valid evidence for applicable project-required checks before commit, using `dw-verify`; reuse equivalent evidence without repeating checks solely for a new stage.
58
58
  3. Use Conventional Commits format with correct type/scope.
59
59
  4. Have a body that explains WHY for non-trivial changes.
60
60
  5. NOT skip pre-commit hooks (`--no-verify` is forbidden unless user explicitly authorizes).
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: dw-grilling
3
- description: "Internal decision-tree interview protocol for the native Grill flow. Loaded by /dw-brainstorm (grill mode) and /dw-plan to stress-test a plan or PRD to shared understanding: build a dependency-ordered decision tree, ask exactly ONE unresolved decision per turn with a recommended answer plus rationale and a real alternative, discover facts from the repo/docs instead of asking, leave decisions to the user, and gate alignment on explicit confirmation. Pipeline-internal, never exported, never implements code."
3
+ description: Internal decision-tree interview protocol for the native Grill flow.
4
4
  allowed-tools:
5
5
  - Read
6
6
  - Grep
@@ -55,70 +55,7 @@ Before starting any phase:
55
55
 
56
56
  ## The five phases
57
57
 
58
- Each phase writes to `.dw/incidents/<YYYY-MM-DD>-<slug>/`. Slug is auto-generated from incident title (kebab-case, ≤30 chars).
59
-
60
- ### Phase 1 — Detection & Triage
61
-
62
- **Output:** `.dw/incidents/<date>-<slug>/01-triage.md`
63
-
64
- Steps:
65
- 1. Classify severity using the table above.
66
- 2. Assess blast radius: which services, how many users affected, revenue impact if known.
67
- 3. Identify immediate mitigation: rollback, feature flag toggle, traffic redirect.
68
-
69
- See `references/severity-and-triage.md` for diagnostic commands per stack (Kubernetes, Docker, generic HTTP).
70
-
71
- **Checkpoint:** present triage summary. Wait for user confirmation before moving to investigation.
72
-
73
- ### Phase 2 — Investigation & Root Cause
74
-
75
- **Output:** `.dw/incidents/<date>-<slug>/02-investigation.md`
76
-
77
- Steps:
78
- 1. Build timeline: when did it start? What changed?
79
- 2. Correlate signals: metrics spike + deploy + error logs.
80
- 3. Hypothesis testing: one theory at a time; verify each before moving on.
81
- 4. Identify root cause: not the first symptom, but the underlying assumption that broke.
82
-
83
- Common forensic tools:
84
- - `git bisect` for regressions.
85
- - Recent deploy log: `git log --oneline --since="24 hours ago"`.
86
- - For live monitoring during investigation, `/dw-debug-protocol` flaky-investigation patterns apply.
87
-
88
- **Checkpoint:** present root-cause hypothesis. Wait for user confirmation before applying fix.
89
-
90
- ### Phase 3 — Resolution & Recovery
91
-
92
- **Output:** `.dw/incidents/<date>-<slug>/03-resolution.md`
93
-
94
- Steps:
95
- 1. Apply fix: hotfix branch → fast PR (via `/dw-generate-pr`) → deploy.
96
- 2. Verify: health checks green, error rate back to baseline.
97
- 3. Monitor 30 minutes post-fix for SEV-1/2 to confirm stability.
98
-
99
- **Checkpoint:** confirm full recovery before drafting communications.
100
-
101
- ### Phase 4 — Communication
102
-
103
- **Output:** `.dw/incidents/<date>-<slug>/04-communication.md`
104
-
105
- Two communications generated using the templates in `references/communication-templates.md`:
106
- - **Initial notification** (sent during the incident; updated every 30 min for SEV-1/2).
107
- - **Resolution notification** (sent when phase 3 confirms recovery).
108
-
109
- ### Phase 5 — Postmortem
110
-
111
- **Output:** `.dw/incidents/<date>-<slug>/05-postmortem.md`
112
-
113
- Generate a **blameless** postmortem using `references/postmortem-template.md`. Sections:
114
- - Summary (2–3 sentences).
115
- - Timeline (per-minute events from alert to all-clear).
116
- - Root cause (technical, no blame).
117
- - Impact (users affected, revenue, error-budget consumed).
118
- - What went well / What went wrong.
119
- - Action items (owner + due date + priority — see `references/blameless-discipline.md` for the quality bar).
120
-
121
- **Quality bar for action items:** see `references/blameless-discipline.md`. "Improve monitoring" does NOT count. "Add Datadog SLO alert at p99 > 800ms with on-call routing by 2026-06-01, owner: @bruno" counts.
58
+ For the five phases, read `references/the-five-phases-detail.md`. Load only when this part of the task applies.
122
59
 
123
60
  ## Required reading by context
124
61
 
@@ -0,0 +1,66 @@
1
+ ## The five phases
2
+
3
+ Each phase writes to `.dw/incidents/<YYYY-MM-DD>-<slug>/`. Slug is auto-generated from incident title (kebab-case, ≤30 chars).
4
+
5
+ ### Phase 1 — Detection & Triage
6
+
7
+ **Output:** `.dw/incidents/<date>-<slug>/01-triage.md`
8
+
9
+ Steps:
10
+ 1. Classify severity using the table above.
11
+ 2. Assess blast radius: which services, how many users affected, revenue impact if known.
12
+ 3. Identify immediate mitigation: rollback, feature flag toggle, traffic redirect.
13
+
14
+ See `severity-and-triage.md` for diagnostic commands per stack (Kubernetes, Docker, generic HTTP).
15
+
16
+ **Checkpoint:** present triage summary. Wait for user confirmation before moving to investigation.
17
+
18
+ ### Phase 2 — Investigation & Root Cause
19
+
20
+ **Output:** `.dw/incidents/<date>-<slug>/02-investigation.md`
21
+
22
+ Steps:
23
+ 1. Build timeline: when did it start? What changed?
24
+ 2. Correlate signals: metrics spike + deploy + error logs.
25
+ 3. Hypothesis testing: one theory at a time; verify each before moving on.
26
+ 4. Identify root cause: not the first symptom, but the underlying assumption that broke.
27
+
28
+ Common forensic tools:
29
+ - `git bisect` for regressions.
30
+ - Recent deploy log: `git log --oneline --since="24 hours ago"`.
31
+ - For live monitoring during investigation, `/dw-debug-protocol` flaky-investigation patterns apply.
32
+
33
+ **Checkpoint:** present root-cause hypothesis. Wait for user confirmation before applying fix.
34
+
35
+ ### Phase 3 — Resolution & Recovery
36
+
37
+ **Output:** `.dw/incidents/<date>-<slug>/03-resolution.md`
38
+
39
+ Steps:
40
+ 1. Apply fix: hotfix branch → fast PR (via `/dw-generate-pr`) → deploy.
41
+ 2. Verify: health checks green, error rate back to baseline.
42
+ 3. Monitor 30 minutes post-fix for SEV-1/2 to confirm stability.
43
+
44
+ **Checkpoint:** confirm full recovery before drafting communications.
45
+
46
+ ### Phase 4 — Communication
47
+
48
+ **Output:** `.dw/incidents/<date>-<slug>/04-communication.md`
49
+
50
+ Two communications generated using the templates in `communication-templates.md`:
51
+ - **Initial notification** (sent during the incident; updated every 30 min for SEV-1/2).
52
+ - **Resolution notification** (sent when phase 3 confirms recovery).
53
+
54
+ ### Phase 5 — Postmortem
55
+
56
+ **Output:** `.dw/incidents/<date>-<slug>/05-postmortem.md`
57
+
58
+ Generate a **blameless** postmortem using `postmortem-template.md`. Sections:
59
+ - Summary (2–3 sentences).
60
+ - Timeline (per-minute events from alert to all-clear).
61
+ - Root cause (technical, no blame).
62
+ - Impact (users affected, revenue, error-budget consumed).
63
+ - What went well / What went wrong.
64
+ - Action items (owner + due date + priority — see `blameless-discipline.md` for the quality bar).
65
+
66
+ **Quality bar for action items:** see `blameless-discipline.md`. "Improve monitoring" does NOT count. "Add Datadog SLO alert at p99 > 800ms with on-call routing by 2026-06-01, owner: @bruno" counts.
@@ -26,19 +26,7 @@ If the feature is fully deterministic (no LLM in the loop), use `dw-testing-disc
26
26
 
27
27
  ## The oracle ladder
28
28
 
29
- Five rungs, climb from CHEAPEST/STRICTEST to MOST EXPENSIVE/SUBJECTIVE. Always start at the bottom; only climb when the lower rung can't cover the case.
30
-
31
- | Rung | What it checks | Cost | When to use |
32
- |------|----------------|------|-------------|
33
- | 1. **Exact match** | `output === expected` | ~free | Structured outputs (function calls, JSON with stable shape, classifications) |
34
- | 2. **Schema validation** | Output matches JSON schema / type contract | ~free | Output shape matters; specific values vary |
35
- | 3. **Outcome state** | Side effect produced the expected change (DB row, file written, tool called) | cheap | Agents, tool-use, RAG with concrete answers |
36
- | 4. **LLM-as-judge** | A different model grades the output against a rubric | medium ($$$) | Subjective quality (helpfulness, tone, faithfulness) where no rule can decide |
37
- | 5. **Human review** | Domain expert scores | expensive | Calibration of rung 4; high-stakes outputs; edge cases |
38
-
39
- **Rule:** never reach for rung 4 before checking if rungs 1-3 can cover the case. Every rung up costs an order of magnitude more (latency, money, calibration effort) — and adds entropy.
40
-
41
- See `references/oracle-ladder.md` for examples per rung and the climbing decision tree.
29
+ For the oracle ladder, read `references/the-oracle-ladder-detail.md`. Load only when this part of the task applies.
42
30
 
43
31
  ## LLM-as-judge discipline (when rung 4 is needed)
44
32
 
@@ -68,14 +56,7 @@ See `references/reference-dataset.md` for case-design principles, sampling from
68
56
 
69
57
  ## Consistency (run-to-run stability)
70
58
 
71
- The oracle ladder measures whether an output is *correct*; it does not measure whether the feature is *stable*. Because LLMs are non-deterministic, a case that passes once may fail the next run. Measure it:
72
-
73
- - Re-run each case **N times** (default 3) against the same code + model + prompt.
74
- - Record `pass_rate` (e.g. `2/3`) and `consistency` (fraction agreeing with the majority verdict) per case in `runs/<YYYY-MM-DD>.jsonl`.
75
- - A case with pass_rate strictly between `1/N` and `(N-1)/N` is **flaky** — a signal, not a pass. A 2/3 pass hides a one-in-three production failure; investigate before shipping.
76
- - Sample at the **temperature the feature uses in production** — consistency measured at temp 0 lies about a temp-0.7 feature.
77
-
78
- Deterministic rungs (1–3) are usually stable; consistency matters most for rung 4 (LLM-as-judge) and agent trajectories. Record the run count `N` in the run log so later comparisons are apples-to-apples.
59
+ For consistency (run-to-run stability), read `references/consistency-run-to-run-stability-detail.md`. Load only when this part of the task applies.
79
60
 
80
61
  ## RAG evaluation
81
62
 
@@ -91,27 +72,7 @@ Precision alone misses hallucination. Faithfulness alone misses retrieval failur
91
72
 
92
73
  ## Agent / tool-use evaluation
93
74
 
94
- Two questions distinguish good agent eval from bad:
95
-
96
- ### Question 1: outcome or trajectory?
97
-
98
- | Approach | What it checks | Failure mode |
99
- |----------|---------------|--------------|
100
- | **Outcome-only** | Did the agent achieve the goal? Was the final state correct? | Misses "ghost actions" — agent did the right thing for the wrong reasons |
101
- | **Trajectory** | Did the agent take the expected sequence of steps / tool calls? | Punishes legitimate creativity — agent solved it via a different valid path |
102
-
103
- **Recommendation:** outcome-only with side-effect assertion as default. Trajectory match for cases where the path matters (e.g., "must call `get-user` before `update-user`").
104
-
105
- ### Question 2: which trajectory match mode?
106
-
107
- When trajectory matching IS the right call, four modes are available:
108
-
109
- - **Strict** — same tool calls, same order, same arguments. Use when both sequence and parameters are part of the contract.
110
- - **Unordered** — same tool calls, any order. Use when concurrent calls are valid.
111
- - **Subset** — actual trajectory contains a subset of reference calls. Use to enforce "don't exceed expected tool use" (frugality / cost).
112
- - **Superset** — actual contains all reference calls plus possibly more. Use when specific tools are mandatory but extras are acceptable.
113
-
114
- See `references/agent-eval.md` for examples and the decision tree.
75
+ For agent / tool-use evaluation, read `references/agent-tool-use-evaluation-detail.md`. Load only when this part of the task applies.
115
76
 
116
77
  ## Required reading by context
117
78
 
@@ -125,20 +86,11 @@ See `references/agent-eval.md` for examples and the decision tree.
125
86
 
126
87
  ## Anti-patterns (will block in `/dw-review --code-only`)
127
88
 
128
- - **LLM-as-judge without calibration evidence.** PR adds LLM-as-judge but the calibration Spearman score is missing or < 0.80. REJECTED.
129
- - **Same-model judge.** Judge model is the same as the system under test. REJECTED unless explicitly documented (and even then, results are suspect).
130
- - **Single-rung eval.** Feature ships with only LLM-as-judge; no rung 1-3 grounding. REJECTED — the cheap rungs catch the loud failures.
131
- - **Synthetic-only dataset.** No traceable production-failure source for any case. REJECTED — confirm at least 20% of cases come from real user inputs.
132
- - **"Looks good to me" QA.** No reference dataset, no metric, no rubric — just sampling output and calling it good. REJECTED.
133
- - **Coverage as metric.** Quoting "we tested 50 prompts" without saying what was measured. The number is meaningless without the metric.
134
- - **Single-run eval on a non-deterministic feature.** Each case run once at production temperature; a lucky pass reported as a pass. REJECTED — report `pass_rate` over N runs (see Consistency).
89
+ For anti-patterns (will block in `/dw-review --code-only`), read `references/anti-patterns-will-block-in-dw-review-code-only-detail.md`. Load only when this part of the task applies.
135
90
 
136
91
  ## Integration with dev-workflow commands
137
92
 
138
- - `/dw-plan tasks`: when the PRD has an AI feature requirement, an eval-plan subtask is mandatory. The task references this skill's oracle ladder.
139
- - `/dw-review --code-only`: AI feature PRs require a reference dataset + ≥2 oracle rungs (lower rungs FIRST). The constitution gate also applies — if the project has principles about AI feature reliability, they're enforced here.
140
- - `/dw-qa --ai`: new mode (when this skill is bundled) — runs the reference dataset against the current implementation, logs to `QA/logs/ai/<feature>-<date>.jsonl`, computes precision@k / faithfulness / outcome accuracy per the feature type.
141
- - `/dw-bugfix` when the bug is an AI failure mode (hallucination, tool misuse, classification error): adds the failing case to the reference dataset BEFORE fixing — the case is now a regression test forever.
93
+ For integration with dev-workflow commands, read `references/integration-with-dev-workflow-commands-detail.md`. Load only when this part of the task applies.
142
94
 
143
95
  ## When the discipline bends
144
96
 
@@ -0,0 +1,23 @@
1
+ ## Agent / tool-use evaluation
2
+
3
+ Two questions distinguish good agent eval from bad:
4
+
5
+ ### Question 1: outcome or trajectory?
6
+
7
+ | Approach | What it checks | Failure mode |
8
+ |----------|---------------|--------------|
9
+ | **Outcome-only** | Did the agent achieve the goal? Was the final state correct? | Misses "ghost actions" — agent did the right thing for the wrong reasons |
10
+ | **Trajectory** | Did the agent take the expected sequence of steps / tool calls? | Punishes legitimate creativity — agent solved it via a different valid path |
11
+
12
+ **Recommendation:** outcome-only with side-effect assertion as default. Trajectory match for cases where the path matters (e.g., "must call `get-user` before `update-user`").
13
+
14
+ ### Question 2: which trajectory match mode?
15
+
16
+ When trajectory matching IS the right call, four modes are available:
17
+
18
+ - **Strict** — same tool calls, same order, same arguments. Use when both sequence and parameters are part of the contract.
19
+ - **Unordered** — same tool calls, any order. Use when concurrent calls are valid.
20
+ - **Subset** — actual trajectory contains a subset of reference calls. Use to enforce "don't exceed expected tool use" (frugality / cost).
21
+ - **Superset** — actual contains all reference calls plus possibly more. Use when specific tools are mandatory but extras are acceptable.
22
+
23
+ See `agent-eval.md` for examples and the decision tree.
@@ -0,0 +1,9 @@
1
+ ## Anti-patterns (will block in `/dw-review --code-only`)
2
+
3
+ - **LLM-as-judge without calibration evidence.** PR adds LLM-as-judge but the calibration Spearman score is missing or < 0.80. REJECTED.
4
+ - **Same-model judge.** Judge model is the same as the system under test. REJECTED unless explicitly documented (and even then, results are suspect).
5
+ - **Single-rung eval.** Feature ships with only LLM-as-judge; no rung 1-3 grounding. REJECTED — the cheap rungs catch the loud failures.
6
+ - **Synthetic-only dataset.** No traceable production-failure source for any case. REJECTED — confirm at least 20% of cases come from real user inputs.
7
+ - **"Looks good to me" QA.** No reference dataset, no metric, no rubric — just sampling output and calling it good. REJECTED.
8
+ - **Coverage as metric.** Quoting "we tested 50 prompts" without saying what was measured. The number is meaningless without the metric.
9
+ - **Single-run eval on a non-deterministic feature.** Each case run once at production temperature; a lucky pass reported as a pass. REJECTED — report `pass_rate` over N runs (see Consistency).
@@ -0,0 +1,10 @@
1
+ ## Consistency (run-to-run stability)
2
+
3
+ The oracle ladder measures whether an output is *correct*; it does not measure whether the feature is *stable*. Because LLMs are non-deterministic, a case that passes once may fail the next run. Measure it:
4
+
5
+ - Re-run each case **N times** (default 3) against the same code + model + prompt.
6
+ - Record `pass_rate` (e.g. `2/3`) and `consistency` (fraction agreeing with the majority verdict) per case in `runs/<YYYY-MM-DD>.jsonl`.
7
+ - A case with pass_rate strictly between `1/N` and `(N-1)/N` is **flaky** — a signal, not a pass. A 2/3 pass hides a one-in-three production failure; investigate before shipping.
8
+ - Sample at the **temperature the feature uses in production** — consistency measured at temp 0 lies about a temp-0.7 feature.
9
+
10
+ Deterministic rungs (1–3) are usually stable; consistency matters most for rung 4 (LLM-as-judge) and agent trajectories. Record the run count `N` in the run log so later comparisons are apples-to-apples.
@@ -0,0 +1,6 @@
1
+ ## Integration with dev-workflow commands
2
+
3
+ - `/dw-plan tasks`: when the PRD has an AI feature requirement, an eval-plan subtask is mandatory. The task references this skill's oracle ladder.
4
+ - `/dw-review --code-only`: AI feature PRs require a reference dataset + ≥2 oracle rungs (lower rungs FIRST). The constitution gate also applies — if the project has principles about AI feature reliability, they're enforced here.
5
+ - `/dw-qa --ai`: new mode (when this skill is bundled) — runs the reference dataset against the current implementation, logs to `QA/logs/ai/<feature>-<date>.jsonl`, computes precision@k / faithfulness / outcome accuracy per the feature type.
6
+ - `/dw-bugfix` when the bug is an AI failure mode (hallucination, tool misuse, classification error): adds the failing case to the reference dataset BEFORE fixing — the case is now a regression test forever.
@@ -0,0 +1,15 @@
1
+ ## The oracle ladder
2
+
3
+ Five rungs, climb from CHEAPEST/STRICTEST to MOST EXPENSIVE/SUBJECTIVE. Always start at the bottom; only climb when the lower rung can't cover the case.
4
+
5
+ | Rung | What it checks | Cost | When to use |
6
+ |------|----------------|------|-------------|
7
+ | 1. **Exact match** | `output === expected` | ~free | Structured outputs (function calls, JSON with stable shape, classifications) |
8
+ | 2. **Schema validation** | Output matches JSON schema / type contract | ~free | Output shape matters; specific values vary |
9
+ | 3. **Outcome state** | Side effect produced the expected change (DB row, file written, tool called) | cheap | Agents, tool-use, RAG with concrete answers |
10
+ | 4. **LLM-as-judge** | A different model grades the output against a rubric | medium ($$$) | Subjective quality (helpfulness, tone, faithfulness) where no rule can decide |
11
+ | 5. **Human review** | Domain expert scores | expensive | Calibration of rung 4; high-stakes outputs; edge cases |
12
+
13
+ **Rule:** never reach for rung 4 before checking if rungs 1-3 can cover the case. Every rung up costs an order of magnitude more (latency, money, calibration effort) — and adds entropy.
14
+
15
+ See `oracle-ladder.md` for examples per rung and the climbing decision tree.