@brunosps00/dev-workflow 1.0.4 → 1.0.6
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/README.md +71 -23
- package/bin/dev-workflow.js +29 -3
- package/lib/agents.js +410 -0
- package/lib/constants.js +16 -2
- package/lib/doctor.js +213 -0
- package/lib/init.js +96 -8
- package/lib/install-state.js +57 -0
- package/lib/list-installed.js +27 -0
- package/lib/migrate-skills.js +26 -2
- package/lib/profiles.js +44 -0
- package/lib/skill-registry.js +109 -0
- package/lib/subtasks.js +264 -0
- package/lib/uninstall.js +21 -12
- package/lib/utils.js +42 -1
- package/lib/wrappers.js +2 -1
- package/package.json +1 -1
- package/scaffold/agent-registry.json +272 -0
- package/scaffold/agents/core/dw-build-fixer.md +21 -0
- package/scaffold/agents/core/dw-code-explorer.md +32 -0
- package/scaffold/agents/core/dw-code-reviewer.md +28 -0
- package/scaffold/agents/core/dw-planner.md +23 -0
- package/scaffold/agents/core/dw-test-author.md +21 -0
- package/scaffold/agents/csharp/dw-csharp-reviewer.md +15 -0
- package/scaffold/agents/csharp/dw-dotnet-build-fixer.md +15 -0
- package/scaffold/agents/frontend/dw-qa-runner.md +21 -0
- package/scaffold/agents/python/dw-python-build-fixer.md +15 -0
- package/scaffold/agents/python/dw-python-reviewer.md +15 -0
- package/scaffold/agents/rust/dw-rust-build-fixer.md +15 -0
- package/scaffold/agents/rust/dw-rust-reviewer.md +15 -0
- package/scaffold/agents/security/dw-security-reviewer.md +24 -0
- package/scaffold/agents/security/dw-silent-failure-hunter.md +22 -0
- package/scaffold/agents/typescript/dw-typescript-build-fixer.md +15 -0
- package/scaffold/agents/typescript/dw-typescript-reviewer.md +15 -0
- package/scaffold/en/agent-instructions.md +51 -6
- package/scaffold/en/commands/dw-autopilot.md +156 -275
- package/scaffold/en/commands/dw-bugfix.md +12 -2
- package/scaffold/en/commands/dw-context-budget.md +28 -0
- package/scaffold/en/commands/dw-goal.md +136 -0
- package/scaffold/en/commands/dw-harness-audit.md +31 -0
- package/scaffold/en/commands/dw-help.md +22 -10
- package/scaffold/en/commands/dw-intel.md +6 -0
- package/scaffold/en/commands/dw-plan.md +20 -3
- package/scaffold/en/commands/dw-review.md +12 -0
- package/scaffold/en/commands/dw-skill-health.md +29 -0
- package/scaffold/en/commands/dw-subtask-complete.md +40 -0
- package/scaffold/en/commands/dw-subtask-resume.md +21 -0
- package/scaffold/en/commands/dw-subtask-start.md +22 -0
- package/scaffold/pt-br/agent-instructions.md +51 -6
- package/scaffold/pt-br/commands/dw-autopilot.md +159 -278
- package/scaffold/pt-br/commands/dw-bugfix.md +12 -2
- package/scaffold/pt-br/commands/dw-context-budget.md +28 -0
- package/scaffold/pt-br/commands/dw-goal.md +136 -0
- package/scaffold/pt-br/commands/dw-harness-audit.md +31 -0
- package/scaffold/pt-br/commands/dw-help.md +22 -10
- package/scaffold/pt-br/commands/dw-intel.md +6 -0
- package/scaffold/pt-br/commands/dw-plan.md +20 -3
- package/scaffold/pt-br/commands/dw-review.md +12 -0
- package/scaffold/pt-br/commands/dw-skill-health.md +29 -0
- package/scaffold/pt-br/commands/dw-subtask-complete.md +40 -0
- package/scaffold/pt-br/commands/dw-subtask-resume.md +21 -0
- package/scaffold/pt-br/commands/dw-subtask-start.md +22 -0
- package/scaffold/skill-registry.json +258 -0
- package/scaffold/skills/dw-codebase-intel/SKILL.md +12 -5
- package/scaffold/skills/dw-context-budget/SKILL.md +45 -0
- package/scaffold/skills/dw-search-first/SKILL.md +31 -0
- package/scaffold/skills/dw-silent-failure/SKILL.md +33 -0
- package/scaffold/skills/dw-verify/SKILL.md +2 -29
- package/scaffold/skills/dw-verify/references/verification-discovery-and-attribution.md +32 -0
- package/scaffold/skills/humanizer/SKILL.md +7 -412
- package/scaffold/skills/humanizer/references/ai-writing-patterns.md +418 -0
|
@@ -1,374 +1,255 @@
|
|
|
1
1
|
<system_instructions>
|
|
2
|
-
You are
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<critical>
|
|
9
|
-
|
|
10
|
-
- BEFORE each step: announce to the user `→ Invoking /dw-[name] — executing full instructions`.
|
|
11
|
-
- DURING: follow the instructions in `.dw/commands/[name].md` in full, without summarizing or substituting.
|
|
12
|
-
- AFTER: run `ls` on the artifact paths listed in that step and confirm they exist before updating `autopilot-state.json`. If any artifact is missing, the step did NOT run — re-execute the command formally.</critical>
|
|
13
|
-
|
|
14
|
-
<critical>FORBIDDEN RATIONALIZATIONS — if you think any of these, STOP and execute the command formally:
|
|
15
|
-
| Thought | Reality |
|
|
16
|
-
|---------|---------|
|
|
17
|
-
| "I already ran the tests manually" | The command produces structured artifacts. Run the command. |
|
|
18
|
-
| "I validated via ad-hoc Playwright" | `/dw-qa` requires RF matrix, bugs.md, screenshots, scripts, logs, checklist. Run the command. |
|
|
19
|
-
| "The implementation is obviously correct" | `/dw-review --coverage-only` requires a compliance matrix per RF/endpoint/task. Run the command. |
|
|
20
|
-
| "A strong manual validation is enough" | NO. Technical equivalence DOES NOT replace formal execution. |
|
|
21
|
-
| "I already checked build and lint, that's enough" | Build/lint DO NOT replace review nor QA. Run the commands. |
|
|
22
|
-
| "I wrote a summarized qa-report.md by hand" | A loose file IS NOT execution of `/dw-qa`. The full `QA/` tree is mandatory. |
|
|
23
|
-
| "The autopilot already advanced, I don't need to go back" | If the artifact doesn't exist, the step didn't run. Go back and execute. |
|
|
24
|
-
| "I fixed bugs along the way, so QA is already ok" | Fixing bugs does not replace running formal QA. Run `/dw-qa`. |</critical>
|
|
2
|
+
You are the full pipeline orchestrator. This command receives a user's wish and drives the PRD-to-PR workflow in two invocations:
|
|
3
|
+
|
|
4
|
+
1. **Planning invocation:** research/brainstorm when needed, PRD, TechSpec, Tasks, then STOP.
|
|
5
|
+
2. **Execution invocation:** resume from `autopilot-state.json`, run `/dw-goal --from-autopilot <prd-slug>`, then commit and PR gate.
|
|
6
|
+
|
|
7
|
+
<critical>The first invocation MUST stop after the planning artifacts are complete. Do not run implementation, QA, review, commit, or PR in the first invocation.</critical>
|
|
8
|
+
<critical>The second invocation MUST resume from the saved state and delegate Run → Review → QA/Fix → Review to `/dw-goal --from-autopilot <prd-slug>`.</critical>
|
|
9
|
+
<critical>Each step that invokes a `/dw-*` command MUST follow the complete instructions from `.dw/commands/`. Read and execute the full command, not a summarized version.</critical>
|
|
25
10
|
|
|
26
11
|
## When to Use
|
|
27
|
-
- Use when you want to go from an idea to a PR with minimal manual intervention
|
|
28
|
-
- Use for complete features that
|
|
29
|
-
- Do NOT use for small, well-scoped one-off tasks
|
|
30
|
-
- Do NOT use
|
|
31
|
-
- Do NOT use when
|
|
12
|
+
- Use when you want to go from an idea to a PR with minimal manual intervention but a hard planning stop.
|
|
13
|
+
- Use for complete features that require planning, execution, quality gates, and PR readiness.
|
|
14
|
+
- Do NOT use for small, well-scoped one-off tasks; use `/dw-run` with an existing plan.
|
|
15
|
+
- Do NOT use for surgical bug fixes; use `/dw-bugfix`.
|
|
16
|
+
- Do NOT use when the user wants manual control between every phase; use individual commands.
|
|
32
17
|
|
|
33
18
|
## Pipeline Position
|
|
34
|
-
**Predecessor:**
|
|
19
|
+
**Predecessor:** user wish | **Successor:** `/dw-goal`, `/dw-commit`, `/dw-generate-pr`
|
|
35
20
|
|
|
36
|
-
## Complementary Skills
|
|
21
|
+
## Complementary Skills / Commands
|
|
37
22
|
|
|
38
|
-
| Skill | Trigger |
|
|
39
|
-
|
|
40
|
-
| `dw-memory` |
|
|
41
|
-
| `dw-verify` |
|
|
23
|
+
| Skill or command | Trigger |
|
|
24
|
+
|------------------|---------|
|
|
25
|
+
| `dw-memory` | ALWAYS — preserve decisions across planning, goal execution, QA, review, and PR. |
|
|
26
|
+
| `dw-verify` | ALWAYS — invoked by gates and downstream commands before approval/commit/PR claims. |
|
|
27
|
+
| `/dw-goal` | ALWAYS on the second invocation — durable execution-quality objective. |
|
|
42
28
|
|
|
43
29
|
## Input Variables
|
|
44
30
|
|
|
45
31
|
| Variable | Description | Example |
|
|
46
32
|
|----------|-------------|---------|
|
|
47
|
-
| `{{WISH}}` | Description of what the user wants to build
|
|
48
|
-
| `{{PRD_SLUG}}` | Existing PRD slug
|
|
49
|
-
| `{{MODE}}` | Optional invocation flag | `--from-prd <slug>` |
|
|
33
|
+
| `{{WISH}}` | Description of what the user wants to build in default mode. | `"push notification preferences"` |
|
|
34
|
+
| `{{PRD_SLUG}}` | Existing PRD slug when `--from-prd` is used. | `prd-bugfix-stripe-webhook-retry` |
|
|
35
|
+
| `{{MODE}}` | Optional invocation flag. | `--from-prd <slug>` |
|
|
50
36
|
|
|
51
37
|
## Invocation Modes
|
|
52
38
|
|
|
53
39
|
| Invocation | Behavior |
|
|
54
40
|
|------------|----------|
|
|
55
|
-
| `/dw-autopilot "<wish>"` |
|
|
56
|
-
| `/dw-autopilot --from-prd <slug>` |
|
|
41
|
+
| `/dw-autopilot "<wish>"` | Planning invocation from scratch. Runs Codebase Intelligence → optional Research → Brainstorm → PRD → TechSpec → Tasks, writes state, then stops. |
|
|
42
|
+
| `/dw-autopilot --from-prd <slug>` | Planning invocation from an existing PRD. Starts at PRD approval, then TechSpec → Tasks, writes state, then stops. |
|
|
43
|
+
| `/dw-autopilot` on a PRD with `autopilot-state.json status=plan_complete` | Execution invocation. Runs `/dw-goal --from-autopilot <slug>`, then commit and PR gate. |
|
|
57
44
|
|
|
58
|
-
##
|
|
45
|
+
## Required Pause Points
|
|
59
46
|
|
|
60
|
-
|
|
47
|
+
Autopilot pauses at:
|
|
61
48
|
|
|
62
|
-
1. **
|
|
63
|
-
2. **
|
|
64
|
-
3. **
|
|
49
|
+
1. **PRD approval** before TechSpec.
|
|
50
|
+
2. **Tasks approval** before marking planning complete.
|
|
51
|
+
3. **Mandatory planning stop** after Tasks are approved and state is saved.
|
|
52
|
+
4. **PR gate** after the execution goal and commit complete.
|
|
65
53
|
|
|
66
|
-
|
|
54
|
+
Between these points, execute automatically while still respecting blocking questions required by the underlying command.
|
|
67
55
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
<critical>Read the `autopilot-state.json` file in the PRD directory. Skip ALL steps listed in `completed_steps`. Resume execution from `current_step`. Gates already passed (listed in `gates_passed`) MUST NOT be re-presented.</critical>
|
|
56
|
+
## Session Resumption
|
|
71
57
|
|
|
72
|
-
|
|
73
|
-
2. Report: "Resuming autopilot from step [N] ([name]). Steps 1-[N-1] already completed."
|
|
74
|
-
3. Continue execution normally from the indicated step
|
|
58
|
+
If this command is re-invoked on the same PRD:
|
|
75
59
|
|
|
76
|
-
|
|
60
|
+
<critical>Read `.dw/spec/<prd-slug>/autopilot-state.json` first. If `status` is `plan_complete`, do not repeat planning. Start the execution invocation by formally invoking `/dw-goal --from-autopilot <prd-slug>`.</critical>
|
|
77
61
|
|
|
78
|
-
|
|
62
|
+
State meanings:
|
|
79
63
|
|
|
80
|
-
|
|
64
|
+
| Status | Action |
|
|
65
|
+
|--------|--------|
|
|
66
|
+
| missing state | Start normal planning invocation. |
|
|
67
|
+
| `planning` | Resume from `current_step`, respecting completed/skipped steps. |
|
|
68
|
+
| `plan_complete` | Start execution invocation via `/dw-goal --from-autopilot <prd-slug>`. |
|
|
69
|
+
| `goal_active` | Continue `/dw-goal resume` or `/dw-goal --from-autopilot <prd-slug>` according to `.dw/goals/autopilot-<prd-slug>/status.json`. |
|
|
70
|
+
| `goal_complete` | Continue to commit and PR gate. |
|
|
71
|
+
| `completed` | Report already completed and show PR/commit summary if available. |
|
|
81
72
|
|
|
82
|
-
|
|
83
|
-
- Resolve `{{PRD_SLUG}}` to `.dw/spec/<slug>/`.
|
|
84
|
-
- Verify the directory exists and contains a `prd.md`. If either is missing, STOP and report: `--from-prd target .dw/spec/<slug>/prd.md not found. Run /dw-plan prd or fix the slug.`
|
|
85
|
-
- Check whether `.dw/bugfixes/*/escalated.md` references this slug. If yes, note in the progress block: `Resuming from bugfix escalation: <NNN-bugfix-slug> → <slug>`.
|
|
86
|
-
- Set `mode: "from-prd"` in `autopilot-state.json` and `skipped_steps: [1, 2, 3, 4]` with `skip_reason: "from-prd-mode"`.
|
|
87
|
-
- Jump directly to **GATE 1** (PRD approval) using the existing `prd.md`.
|
|
73
|
+
## Planning Invocation
|
|
88
74
|
|
|
89
|
-
|
|
90
|
-
- Set `mode: "autopilot"` and proceed to Step 1 normally.
|
|
75
|
+
### Step 0: Resolve Invocation Mode
|
|
91
76
|
|
|
92
|
-
|
|
77
|
+
1. If `--from-prd <slug>` is present:
|
|
78
|
+
- Resolve to `.dw/spec/<slug>/`.
|
|
79
|
+
- Verify `prd.md` exists; otherwise STOP with: `--from-prd target .dw/spec/<slug>/prd.md not found. Run /dw-plan prd or fix the slug.`
|
|
80
|
+
- Create or update `autopilot-state.json` with `mode: "from-prd"`, `status: "planning"`, `skipped_steps: [1,2,3,4]`, and `skip_reasons["1-4"] = "from-prd-mode"`.
|
|
81
|
+
- Jump to PRD approval using the existing PRD.
|
|
82
|
+
2. Otherwise:
|
|
83
|
+
- Create or update `autopilot-state.json` with `mode: "autopilot"`, `status: "planning"`, original wish, and `current_step: 1`.
|
|
93
84
|
|
|
94
85
|
### Step 1: Codebase Intelligence
|
|
95
86
|
|
|
96
|
-
<critical>If `.dw/intel/` exists,
|
|
87
|
+
<critical>If `.dw/intel/` exists, query it via `/dw-intel` before planning. Fall back to `.dw/rules/` and direct grep if absent.</critical>
|
|
97
88
|
|
|
98
|
-
-
|
|
99
|
-
-
|
|
100
|
-
- If `.dw/intel/` is absent, suggest running `/dw-intel --build` first for richer downstream context
|
|
89
|
+
- Identify tech stack, existing patterns, related features, and project constraints.
|
|
90
|
+
- If `.dw/intel/` is absent, suggest `/dw-intel --build` for richer future context, but continue with `.dw/rules/` and direct inspection.
|
|
101
91
|
|
|
102
92
|
### Step 2: Research (Conditional)
|
|
103
93
|
|
|
104
|
-
|
|
105
|
-
- **YES** (run `/dw-brainstorm --research`): new technology for the project, unknown domain, external API integrations, critical architectural decisions
|
|
106
|
-
- **NO** (skip to step 3): simple feature in an already mapped domain, refactoring existing code, basic CRUD
|
|
107
|
-
- If skipping, DOCUMENT the reason in the progress block. E.g.: "Research skipped — domain already mapped in .dw/rules/[file].md". The user must see the justification.
|
|
108
|
-
|
|
109
|
-
If executed, use `standard` mode by default. Incorporate findings into subsequent steps.
|
|
94
|
+
Run `/dw-brainstorm --research` when the feature involves new technology, unknown domain, external APIs, regulation, or high-impact architecture. Otherwise skip and record the reason in `skip_reasons`.
|
|
110
95
|
|
|
111
96
|
### Step 3: Brainstorm (Interactive)
|
|
112
97
|
|
|
113
|
-
Run `/dw-brainstorm` with accumulated context
|
|
114
|
-
- Generate 3 directions
|
|
115
|
-
- Present the 3 directions to the user with your recommendation highlighted and justified
|
|
116
|
-
- Wait for user confirmation on which direction to follow before proceeding
|
|
117
|
-
|
|
118
|
-
### Step 4: PRD (Interactive — 7+ Questions)
|
|
119
|
-
|
|
120
|
-
<critical>The PRD MUST include an interactive interview with the user. Ask AT LEAST 7 clarification questions BEFORE writing the PRD. Do NOT answer questions automatically based on context — the user MUST respond.</critical>
|
|
121
|
-
|
|
122
|
-
Run `/dw-plan prd` using brainstorm findings.
|
|
123
|
-
- Follow ALL command instructions, especially the clarification questions section
|
|
124
|
-
- Ask at least 7 questions about: problem, target users, critical features, scope, constraints, design, integration
|
|
125
|
-
- In each question, present a recommendation grounded in brainstorm and deep-research findings (if executed). E.g.: "Based on the research, I recommend X because [evidence]. Do you agree or prefer a different direction?"
|
|
126
|
-
- Wait for user responses to each question
|
|
127
|
-
- This step is BLOCKING — the command STOPS until a response is received from the user for EACH question. If the user does not respond, do NOT proceed. Do NOT assume answers based on context.
|
|
128
|
-
- Only after receiving all responses, write the complete PRD in `.dw/spec/prd-[name]/prd.md`
|
|
129
|
-
|
|
130
|
-
### === GATE 1: PRD Approval ===
|
|
98
|
+
Run `/dw-brainstorm` with accumulated context. Present three directions and wait for the user to choose one before continuing.
|
|
131
99
|
|
|
132
|
-
|
|
133
|
-
**In `--from-prd` mode:** the PRD already existed on disk before this autopilot run started (typically authored by `/dw-bugfix --analysis` or by a safety-valve escalation, or hand-edited).
|
|
100
|
+
### Step 4: PRD
|
|
134
101
|
|
|
135
|
-
|
|
136
|
-
- Summary of functional requirements
|
|
137
|
-
- Decisions made automatically (default mode) OR origin note: "PRD authored by /dw-bugfix escalation on <date>" / "PRD pre-existing on disk" (--from-prd mode)
|
|
138
|
-
- Open questions (if any)
|
|
102
|
+
Run `/dw-plan prd` using brainstorm/research findings.
|
|
139
103
|
|
|
140
|
-
|
|
104
|
+
<critical>The PRD stage must use the structured interview tool when available. If unavailable, ask the required questions in chat and record the fallback. The user must answer; do not infer answers.</critical>
|
|
141
105
|
|
|
142
|
-
|
|
106
|
+
After `prd.md` exists, present PRD summary and wait for explicit approval. If the user requests edits, update and re-present.
|
|
143
107
|
|
|
144
|
-
|
|
108
|
+
### Step 5: TechSpec
|
|
145
109
|
|
|
146
110
|
Run `/dw-plan techspec` from the approved PRD.
|
|
147
|
-
- Follow ALL command instructions, especially the clarification questions section
|
|
148
|
-
- Ask at least 7 questions about: preferred architecture, existing vs new libs, testing strategy, integration with existing systems, infrastructure constraints, performance, security
|
|
149
|
-
- In each question, present a technical recommendation grounded in brainstorm, deep-research, and approved PRD findings. E.g.: "Research indicated lib X has better performance for this case [source]. Want to use X or have another preference?"
|
|
150
|
-
- Wait for user responses to each question
|
|
151
|
-
- This step is BLOCKING — the command STOPS until a response is received from the user for EACH question. If the user does not respond, do NOT proceed. Do NOT assume answers based on context.
|
|
152
|
-
- Only after receiving all responses, generate in `.dw/spec/prd-[name]/techspec.md`
|
|
153
|
-
|
|
154
|
-
### Step 6: Tasks
|
|
155
|
-
|
|
156
|
-
Run `/dw-plan tasks` from PRD + TechSpec.
|
|
157
|
-
- Follow all command instructions
|
|
158
|
-
- Generate individual tasks in `.dw/spec/prd-[name]/`
|
|
159
|
-
|
|
160
|
-
### === GATE 2: Tasks Approval ===
|
|
161
|
-
|
|
162
|
-
Present to the user:
|
|
163
|
-
- Task list with brief descriptions
|
|
164
|
-
- Dependencies between tasks
|
|
165
|
-
- Total effort estimate
|
|
166
|
-
|
|
167
|
-
**Wait for explicit approval.** If the user requests changes, adjust and re-present.
|
|
168
|
-
|
|
169
|
-
### Step 7: Design Contract (Conditional)
|
|
170
|
-
|
|
171
|
-
Evaluate whether tasks involve frontend:
|
|
172
|
-
- **YES** (run `/dw-redesign-ui`): if there are tasks with visual components AND the `dw-ui-discipline` skill is available
|
|
173
|
-
- Generate the design contract in `.dw/spec/prd-[name]/design-contract.md`
|
|
174
|
-
- Present a summary of the design contract to the user (palette, typography, mobile/desktop layout) as a visual checkpoint before proceeding
|
|
175
|
-
- **NO** (skip to step 8): purely backend/infra tasks
|
|
176
|
-
|
|
177
|
-
### Step 8: Execution
|
|
178
|
-
|
|
179
|
-
Run `/dw-run` with the PRD path.
|
|
180
|
-
- Follow ALL command instructions, including the native plan-checker gate (PASS required) and wave-based parallel execution via the bundled `dw-execute-phase` skill agents
|
|
181
|
-
- Each task follows `/dw-run` with Level 1 validation
|
|
182
111
|
|
|
183
|
-
|
|
112
|
+
<critical>The TechSpec stage must use the structured interview tool when available. If unavailable, ask the required questions in chat and record the fallback. The user must answer; do not infer answers.</critical>
|
|
184
113
|
|
|
185
|
-
|
|
114
|
+
After `techspec.md` exists, present TechSpec summary and wait for explicit approval.
|
|
186
115
|
|
|
187
|
-
|
|
188
|
-
1. Identify build and lint commands in `package.json` (scripts `build`, `lint`, `lint:fix`, `type-check`, etc.)
|
|
189
|
-
2. Run lint with `--fix` enabled (e.g., `npm run lint -- --fix` or `npx eslint . --fix`) to auto-correct what's possible
|
|
190
|
-
3. Run build (e.g., `npm run build` or `npx tsc --noEmit`)
|
|
191
|
-
4. If any fail after `--fix`: analyze errors, fix manually, and re-run
|
|
192
|
-
5. Repeat until both build AND lint pass without errors
|
|
193
|
-
6. Only then proceed to the review
|
|
194
|
-
|
|
195
|
-
Run `/dw-review --coverage-only` to verify PRD compliance (Level 2).
|
|
196
|
-
- If gaps found: fix automatically and re-run the review
|
|
197
|
-
- Maximum 3 correction cycles
|
|
198
|
-
- Do NOT advance to QA until the review passes
|
|
199
|
-
|
|
200
|
-
<critical>Required artifacts for this step (verify BEFORE marking complete):
|
|
201
|
-
- Formatted output with compliance matrix shown to the user in the session
|
|
202
|
-
- Explicit verdict (PASS / GAP / FAIL) for EACH RF in the PRD, EACH endpoint in the TechSpec, and EACH task
|
|
203
|
-
- If gaps: correction commits before re-running the review
|
|
204
|
-
A short text review, a "looks good", or a conclusion "implementation is correct" WITHOUT the structured RF-by-RF matrix DOES NOT count. A mental or eyeball review DOES NOT count. If the matrix didn't appear in the output, the command didn't run — re-execute.</critical>
|
|
205
|
-
|
|
206
|
-
### Step 10: Visual QA
|
|
207
|
-
|
|
208
|
-
Run `/dw-qa` with Playwright MCP.
|
|
209
|
-
- Test happy paths, edge cases, negative flows, accessibility
|
|
210
|
-
- Document bugs with screenshots
|
|
211
|
-
|
|
212
|
-
<critical>Required artifacts for this step (run `ls` on EACH path BEFORE marking complete):
|
|
213
|
-
- `{{PRD_PATH}}/QA/qa-report.md` — exists and contains a per-RF section with PASS/FAIL
|
|
214
|
-
- `{{PRD_PATH}}/QA/bugs.md` — exists (may be empty if no bugs, but the file must exist)
|
|
215
|
-
- `{{PRD_PATH}}/QA/checklist.md` — exists and fully covered
|
|
216
|
-
- `{{PRD_PATH}}/QA/screenshots/` — directory exists and contains at least 1 PNG per RF tested (format `RF-XX-[slug]-PASS.png` or `-FAIL.png`)
|
|
217
|
-
- `{{PRD_PATH}}/QA/scripts/` — directory exists and contains Playwright `.spec.ts`/`.spec.js` scripts per RF
|
|
218
|
-
- `{{PRD_PATH}}/QA/logs/` — directory exists with captured console/network logs
|
|
219
|
-
Running Playwright ad-hoc, taking a few loose screenshots, or writing a short qa-report.md by hand DOES NOT replace this structure. If any artifact is missing or incomplete, the command did NOT run — invoke `/dw-qa` formally and follow its flow to completion.</critical>
|
|
220
|
-
|
|
221
|
-
### Step 11: Fix QA (Conditional)
|
|
222
|
-
|
|
223
|
-
If QA found bugs:
|
|
224
|
-
- Run `/dw-qa --fix` to fix and retest
|
|
225
|
-
- Loop until stable (maximum 5 cycles). After 5 cycles, STOP and ask the user how to proceed.
|
|
226
|
-
|
|
227
|
-
### Step 12: Implementation Review (Post-QA)
|
|
116
|
+
### Step 6: Tasks
|
|
228
117
|
|
|
229
|
-
|
|
118
|
+
Run `/dw-plan tasks` from PRD + TechSpec. Verify:
|
|
119
|
+
- `tasks.md` exists.
|
|
120
|
+
- per-task files exist.
|
|
121
|
+
- `tasks-validation.md` exists and passes or has an explicit user override.
|
|
230
122
|
|
|
231
|
-
|
|
232
|
-
1. Lint with `--fix` enabled
|
|
233
|
-
2. Build
|
|
234
|
-
3. If any fail: fix and re-run until they pass
|
|
123
|
+
### Step 7: Tasks Approval and Mandatory Stop
|
|
235
124
|
|
|
236
|
-
|
|
237
|
-
- If gaps found: fix and re-run
|
|
238
|
-
- Maximum 3 cycles
|
|
125
|
+
Present task summary, dependencies, and total effort. Wait for explicit approval.
|
|
239
126
|
|
|
240
|
-
|
|
127
|
+
After approval:
|
|
241
128
|
|
|
242
|
-
|
|
129
|
+
1. Save `.dw/spec/<prd-slug>/autopilot-state.json` with:
|
|
243
130
|
|
|
244
|
-
|
|
245
|
-
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"status": "plan_complete",
|
|
134
|
+
"current_step": "goal",
|
|
135
|
+
"next_command": "/dw-goal --from-autopilot <prd-slug>"
|
|
136
|
+
}
|
|
137
|
+
```
|
|
246
138
|
|
|
247
|
-
|
|
139
|
+
2. Include `completed_steps` for all completed planning steps and `step_artifacts` for `prd.md`, `techspec.md`, `tasks.md`, per-task files, and `tasks-validation.md`.
|
|
140
|
+
3. STOP and tell the user the planning phase is complete. Do not run implementation in this invocation.
|
|
248
141
|
|
|
249
|
-
|
|
142
|
+
## Execution Invocation
|
|
250
143
|
|
|
251
|
-
|
|
144
|
+
### Step 8: Durable Execution Goal
|
|
252
145
|
|
|
253
|
-
|
|
146
|
+
When `autopilot-state.json status=plan_complete`, formally invoke:
|
|
254
147
|
|
|
255
|
-
|
|
148
|
+
```text
|
|
149
|
+
/dw-goal --from-autopilot <prd-slug>
|
|
150
|
+
```
|
|
256
151
|
|
|
257
|
-
|
|
258
|
-
2. **If no match is found:** the bugfix index doesn't expect a back-write. Skip silently and continue to Step 14.
|
|
259
|
-
3. **If `SUMMARY.md` already exists in the matched directory:** do not overwrite. Continue to Step 14 — the human or a previous run already closed the loop.
|
|
260
|
-
4. **Otherwise, write `SUMMARY.md`** using `.dw/templates/bugfix-summary-template.md`. Source fields from:
|
|
261
|
-
- **Symptom (verbatim):** the `Symptom` section of `<prd_path>/prd.md`, or the first paragraph of the original `TASK.md` if the PRD doesn't carry it.
|
|
262
|
-
- **Root Cause:** the original `TASK.md` Root Cause section.
|
|
263
|
-
- **Resolution (2–4 bullets):** distilled from `<prd_path>/techspec.md` decisions + actual `git diff <base>...HEAD --stat` summary.
|
|
264
|
-
- **Files Touched:** parsed from `git diff <base>...HEAD --name-only` (exclude `.dw/` paths). If >5 files, that's expected for an escalated bugfix — list them all and add a note "escalated from bugfix because of scope".
|
|
265
|
-
- **Verification:** point to `<prd_path>/QA/qa-report.md` and the verify report referenced in Step 9's session output.
|
|
266
|
-
- **Related — Concerns touched:** copy from the corresponding entries in `.dw/rules/concerns.md` if any rows reference modules in `Files Touched`.
|
|
267
|
-
- **Frontmatter:** `slug: NNN-<slug>`, `created: <today's ISO date>`, `status: Fixed`, `severity: <inferred from PRD priority or default Medium>`, `related_concerns: [list from above]`.
|
|
268
|
-
5. **Append a final-line note** to `escalated.md`: `Closed by /dw-autopilot --from-prd on <YYYY-MM-DD>; SUMMARY.md written.` Preserve the original escalation line above it.
|
|
269
|
-
6. **Record the artifact** in `autopilot-state.json` `step_artifacts["13.5"] = [".dw/bugfixes/NNN-<slug>/SUMMARY.md", ".dw/bugfixes/NNN-<slug>/escalated.md"]`.
|
|
152
|
+
The goal owns this sequence:
|
|
270
153
|
|
|
271
|
-
|
|
154
|
+
1. `/dw-run <prd-path>`
|
|
155
|
+
2. `/dw-review <prd-path>` (full review: coverage, quality, conventions, security, constitution, verify)
|
|
156
|
+
3. `/dw-qa <prd-path>`
|
|
157
|
+
4. `/dw-qa --fix <prd-path>` if QA found Open bugs
|
|
158
|
+
5. `/dw-review <prd-path>` again after QA/fixes
|
|
272
159
|
|
|
273
|
-
|
|
160
|
+
<critical>Do not substitute `/dw-review --coverage-only` for the goal reviews. The autopilot quality goal requires full `/dw-review` before QA and after QA fixes.</critical>
|
|
274
161
|
|
|
275
|
-
|
|
162
|
+
After `/dw-goal` completes, verify `.dw/goals/autopilot-<prd-slug>/status.json` has `status: "complete"`, then set `autopilot-state.json status: "goal_complete"`.
|
|
276
163
|
|
|
277
|
-
|
|
164
|
+
### Step 9: Bugfix Loop Close (Conditional)
|
|
278
165
|
|
|
279
|
-
|
|
280
|
-
-
|
|
281
|
-
- `
|
|
282
|
-
-
|
|
283
|
-
- `
|
|
284
|
-
- `{{PRD_PATH}}/QA/scripts/` (non-empty with `.spec.*` files)
|
|
285
|
-
- `{{PRD_PATH}}/QA/logs/`
|
|
286
|
-
- Evidence of the last `/dw-review --coverage-only` run with RF-by-RF matrix (session output or reference in `autopilot-state.json`)
|
|
166
|
+
If `mode == "from-prd"` and the PRD slug matches `prd-bugfix-*`, close the bugfix index before commit:
|
|
167
|
+
- Find `.dw/bugfixes/*/escalated.md` that references the PRD slug.
|
|
168
|
+
- If `SUMMARY.md` is missing, write it from available PRD, TechSpec, QA, and diff evidence using `.dw/templates/bugfix-summary-template.md`.
|
|
169
|
+
- Never fabricate verification evidence.
|
|
170
|
+
- Record artifacts in `autopilot-state.json`.
|
|
287
171
|
|
|
288
|
-
|
|
289
|
-
- Every step 1 through 13 (and 13.5 when in `--from-prd` mode against a `prd-bugfix-*` PRD) that is NOT in `skipped_steps` must be in `completed_steps`
|
|
290
|
-
- Each completed step must have its artifacts listed in `step_artifacts`
|
|
172
|
+
### Step 10: Pre-Commit Audit
|
|
291
173
|
|
|
292
|
-
|
|
174
|
+
Before `/dw-commit`, verify:
|
|
175
|
+
- `.dw/goals/autopilot-<prd-slug>/status.json` is complete.
|
|
176
|
+
- `<prd-path>/QA/review-consolidated.md` exists from the final post-QA review.
|
|
177
|
+
- `<prd-path>/QA/qa-report.md` and `<prd-path>/QA/bugs.md` exist.
|
|
178
|
+
- `autopilot-state.json` records planning artifacts and the completed goal.
|
|
293
179
|
|
|
294
|
-
|
|
180
|
+
If anything is missing, STOP and re-run the missing formal command. Do not commit partial work.
|
|
295
181
|
|
|
296
|
-
|
|
297
|
-
- Semantic commits following Conventional Commits
|
|
298
|
-
- Do NOT wait for approval
|
|
182
|
+
### Step 11: Commit
|
|
299
183
|
|
|
300
|
-
|
|
184
|
+
Run `/dw-commit` automatically. Do not wait for approval after the goal is complete.
|
|
301
185
|
|
|
302
|
-
|
|
186
|
+
### Step 12: Pull Request Gate
|
|
303
187
|
|
|
304
|
-
|
|
305
|
-
- **NO**: inform that commits are ready and the user can generate the PR manually later
|
|
188
|
+
Ask: **"Commits completed. Do you want to generate the Pull Request?"**
|
|
306
189
|
|
|
307
|
-
|
|
190
|
+
- YES: run `/dw-generate-pr`.
|
|
191
|
+
- NO: report that commits are ready and PR can be generated later.
|
|
308
192
|
|
|
309
|
-
|
|
193
|
+
Mark `autopilot-state.json status: "completed"` after commit, and include PR link if generated.
|
|
310
194
|
|
|
311
195
|
## State Persistence
|
|
312
196
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
Save the file `.dw/spec/prd-[name]/autopilot-state.json` with the following format:
|
|
197
|
+
`autopilot-state.json` must include:
|
|
316
198
|
|
|
317
199
|
```json
|
|
318
200
|
{
|
|
319
201
|
"mode": "autopilot",
|
|
202
|
+
"status": "planning",
|
|
320
203
|
"wish": "original user description",
|
|
321
|
-
"prd_path": ".dw/spec/prd-
|
|
204
|
+
"prd_path": ".dw/spec/prd-name",
|
|
322
205
|
"from_prd_slug": null,
|
|
323
|
-
"current_step":
|
|
324
|
-
"completed_steps": [
|
|
325
|
-
"skipped_steps": [
|
|
326
|
-
"skip_reasons": {
|
|
327
|
-
"gates_passed": [
|
|
328
|
-
"step_artifacts": {
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
".dw/spec/prd-[name]/QA/checklist.md",
|
|
334
|
-
".dw/spec/prd-[name]/QA/screenshots/",
|
|
335
|
-
".dw/spec/prd-[name]/QA/scripts/",
|
|
336
|
-
".dw/spec/prd-[name]/QA/logs/"
|
|
337
|
-
],
|
|
338
|
-
"12": ["review-matrix-post-qa-shown-in-session"]
|
|
339
|
-
},
|
|
340
|
-
"started_at": "2026-04-10T14:30:00Z",
|
|
341
|
-
"last_updated": "2026-04-10T15:45:00Z"
|
|
206
|
+
"current_step": 1,
|
|
207
|
+
"completed_steps": [],
|
|
208
|
+
"skipped_steps": [],
|
|
209
|
+
"skip_reasons": {},
|
|
210
|
+
"gates_passed": [],
|
|
211
|
+
"step_artifacts": {},
|
|
212
|
+
"goal_slug": null,
|
|
213
|
+
"next_command": null,
|
|
214
|
+
"started_at": "2026-05-20T00:00:00Z",
|
|
215
|
+
"last_updated": "2026-05-20T00:00:00Z"
|
|
342
216
|
}
|
|
343
217
|
```
|
|
344
218
|
|
|
345
|
-
|
|
346
|
-
- A step ONLY moves to `completed_steps` after verifying its artifacts exist on disk
|
|
347
|
-
- If the session drops, re-invoke `/dw-autopilot` on the same PRD; the command reads `autopilot-state.json` and continues from the correct step, revalidating artifacts before trusting `completed_steps`
|
|
348
|
-
- When the pipeline finishes (after commit or PR), remove the file or mark `"status": "completed"`
|
|
349
|
-
- In `--from-prd` mode, set `from_prd_slug: "<slug>"`, `mode: "from-prd"`, and include steps 1–4 in `skipped_steps` with `skip_reason: "from-prd-mode"` — this is what the pre-commit audit checks against (Step 14 verifies that every step NOT in `skipped_steps` is in `completed_steps`)
|
|
350
|
-
|
|
351
|
-
<critical>After EACH completed step, display the updated progress block to the user. This is MANDATORY — the user MUST see what was done and what comes next. If a step was skipped, the reason MUST appear in the progress block.</critical>
|
|
219
|
+
Update state after each completed or skipped step. A step is complete only after required artifacts exist.
|
|
352
220
|
|
|
353
221
|
## Progress Format
|
|
354
222
|
|
|
355
|
-
|
|
223
|
+
Report progress after each step:
|
|
356
224
|
|
|
225
|
+
```text
|
|
226
|
+
=== AUTOPILOT =====================================
|
|
227
|
+
OK [1] Codebase Intelligence
|
|
228
|
+
OK [2] Research (skipped — known domain)
|
|
229
|
+
OK [3] Brainstorm
|
|
230
|
+
OK [4] PRD
|
|
231
|
+
OK [5] TechSpec
|
|
232
|
+
OK [6] Tasks
|
|
233
|
+
STOP [PLAN COMPLETE] Next: /dw-goal --from-autopilot prd-name
|
|
234
|
+
===================================================
|
|
357
235
|
```
|
|
236
|
+
|
|
237
|
+
During execution invocation:
|
|
238
|
+
|
|
239
|
+
```text
|
|
358
240
|
=== AUTOPILOT =====================================
|
|
359
|
-
OK [
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
OK [4/14] PRD
|
|
363
|
-
PAUSE [GATE 1] Awaiting PRD approval...
|
|
241
|
+
OK [PLAN] Already complete
|
|
242
|
+
RUN [GOAL] /dw-goal --from-autopilot prd-name
|
|
243
|
+
NEXT [COMMIT] after goal status=complete
|
|
364
244
|
===================================================
|
|
365
245
|
```
|
|
366
246
|
|
|
367
|
-
##
|
|
247
|
+
## Anti-patterns
|
|
368
248
|
|
|
369
|
-
|
|
370
|
-
-
|
|
371
|
-
-
|
|
372
|
-
-
|
|
249
|
+
- Do not continue into implementation during the first invocation.
|
|
250
|
+
- Do not skip `/dw-goal` during the second invocation.
|
|
251
|
+
- Do not replace full `/dw-review` with a narrower review in the execution goal.
|
|
252
|
+
- Do not mark state complete from manual validation alone.
|
|
253
|
+
- Do not re-run planning when `status=plan_complete`; resume the goal.
|
|
373
254
|
|
|
374
255
|
</system_instructions>
|
|
@@ -44,6 +44,15 @@
|
|
|
44
44
|
- `dw-testing-discipline`: use when the fix requires a reproducible E2E/retest flow in a web app — `references/playwright-recipes.md` for recipes, core rules + 6 agent guardrails for any test the fix adds, flaky-discipline if the bug surfaces intermittently.
|
|
45
45
|
- `dw-incident-response`: use when the bug has severity `critical` AND affects production AND was detected by alert/user-report (i.e., the bug IS an incident, not a backlog item). Triggers the 5-phase workflow (triage → investigation → resolution → communication → postmortem) with structured output in `.dw/incidents/`. Fixes ride on `/dw-bugfix` per the incident's resolution phase.
|
|
46
46
|
- `security-review`: use when the root cause touches auth, authorization, external input, upload, secrets, SQL, XSS, SSRF, or other sensitive surfaces
|
|
47
|
+
- `dw-silent-failure`: use when the symptom may be hidden by swallowed errors, dangerous fallbacks, retries, queue workers, or async detachment
|
|
48
|
+
|
|
49
|
+
## Agent Dispatch
|
|
50
|
+
|
|
51
|
+
When project agents are installed:
|
|
52
|
+
- Start with `dw-code-explorer` to trace reproduction flow and likely owners.
|
|
53
|
+
- Use `dw-build-fixer` or the language build-fixer only after a build/typecheck/test command fails.
|
|
54
|
+
- Use `dw-test-author` for the regression test.
|
|
55
|
+
- Use `dw-silent-failure-hunter` when the bug involves missing errors, incorrect success states, or fallback data.
|
|
47
56
|
|
|
48
57
|
## Input Variables
|
|
49
58
|
|
|
@@ -317,7 +326,7 @@
|
|
|
317
326
|
|
|
318
327
|
Next — pick one:
|
|
319
328
|
- Manual chain: `/dw-plan techspec prd-bugfix-<slug>` → `/dw-plan tasks prd-bugfix-<slug>` → `/dw-run` → `/dw-qa` → `/dw-review` → `/dw-commit` → `/dw-generate-pr`.
|
|
320
|
-
- Hand off to autopilot: `/dw-autopilot --from-prd prd-bugfix-<slug>` —
|
|
329
|
+
- Hand off to autopilot: `/dw-autopilot --from-prd prd-bugfix-<slug>` — runs the planning phase from the existing PRD, stops after Tasks, then a later autopilot invocation resumes through `/dw-goal`.
|
|
321
330
|
```
|
|
322
331
|
|
|
323
332
|
5. Stop this command. Do not proceed to step 5. The user (or autopilot) invokes `/dw-plan` or `/dw-autopilot --from-prd` next.
|
|
@@ -415,7 +424,8 @@
|
|
|
415
424
|
|
|
416
425
|
Option B (hand off to autopilot):
|
|
417
426
|
1. Run: `/dw-autopilot --from-prd prd-bugfix-<slug>`
|
|
418
|
-
2. Autopilot
|
|
427
|
+
2. Autopilot runs PRD approval, TechSpec, and Tasks, then stops with `status: plan_complete`.
|
|
428
|
+
3. A later autopilot invocation resumes via `/dw-goal --from-autopilot prd-bugfix-<slug>` for Run, full Review, QA/Fix, and post-QA full Review before commit/PR.
|
|
419
429
|
|
|
420
430
|
The bugfix index entry stays queryable via `/dw-intel "bugfix history in <module>"`. Downstream `/dw-review --bugfix <slug>` and `/dw-qa --bugfix <slug>` still target `.dw/bugfixes/NNN-<slug>/` when you want a focused review of just the eventual surgical patch.
|
|
421
431
|
```
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<system_instructions>
|
|
2
|
+
You are the context budget auditor for dev-workflow.
|
|
3
|
+
|
|
4
|
+
## When to Use
|
|
5
|
+
- Use when sessions feel slow, agents read too much, or the project has many skills/MCPs.
|
|
6
|
+
- Use before adding large skill packs or extra MCP servers.
|
|
7
|
+
- Use during `/dw-analyze-project` follow-up when the harness looks bloated.
|
|
8
|
+
|
|
9
|
+
## Process
|
|
10
|
+
1. Count approximate tokens for `CLAUDE.md`, `AGENTS.md`, `.dw/commands/*.md`, `.agents/skills/*/SKILL.md`, `.agents/agents/*.md`, `.claude/agents/*.md`, `.opencode/agent/*.md`, `.github/agents/*.agent.md`, `.dw/subtasks/pending/*/HANDOFF.md`, and `.claude/settings.json`.
|
|
11
|
+
2. Estimate prose tokens as `words * 1.3`; estimate JSON/tool schemas as `chars / 4`.
|
|
12
|
+
3. Flag:
|
|
13
|
+
- command files over 20KB,
|
|
14
|
+
- skill `SKILL.md` files over 12KB,
|
|
15
|
+
- agent files over 8KB,
|
|
16
|
+
- missing agent `output_budget_words` in `.dw/agent-registry.json` or scaffold registry,
|
|
17
|
+
- pending handoffs averaging over 1200 words,
|
|
18
|
+
- Copilot agents above 30k chars,
|
|
19
|
+
- more than 10 MCP servers,
|
|
20
|
+
- duplicate agent/skill names across platform folders,
|
|
21
|
+
- Claude/OpenCode agent files with provider-incompatible tool or permission fields.
|
|
22
|
+
4. Recommend the top 5 savings with concrete paths.
|
|
23
|
+
|
|
24
|
+
## Output
|
|
25
|
+
Write a concise report in chat. If `.dw/reports/` exists, also write `.dw/reports/context-budget.md`.
|
|
26
|
+
|
|
27
|
+
Final marker: `## CONTEXT-BUDGET COMPLETE`
|
|
28
|
+
</system_instructions>
|