@brunosps00/dev-workflow 1.0.5 → 1.1.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.
- package/README.md +17 -13
- package/bin/dev-workflow.js +5 -0
- package/lib/constants.js +6 -4
- package/lib/install-deps.js +88 -3
- package/lib/setup-wsl-browser.js +149 -0
- package/package.json +1 -1
- package/scaffold/en/agent-instructions.md +7 -5
- package/scaffold/en/commands/dw-analyze-project.md +22 -0
- package/scaffold/en/commands/dw-autopilot.md +158 -275
- package/scaffold/en/commands/dw-bugfix.md +3 -2
- package/scaffold/en/commands/dw-functional-doc.md +11 -3
- package/scaffold/en/commands/dw-generate-pr.md +2 -2
- package/scaffold/en/commands/dw-goal.md +136 -0
- package/scaffold/en/commands/dw-help.md +9 -7
- package/scaffold/en/commands/dw-plan.md +9 -3
- package/scaffold/en/commands/dw-qa.md +1 -1
- package/scaffold/en/commands/dw-redesign-ui.md +2 -2
- package/scaffold/en/commands/dw-review.md +7 -5
- package/scaffold/en/commands/dw-secure-audit.md +72 -15
- package/scaffold/en/templates/constitution-template.md +8 -3
- package/scaffold/en/templates/functional-doc/playwright.flow.mjs.tpl +17 -0
- package/scaffold/pt-br/agent-instructions.md +7 -5
- package/scaffold/pt-br/commands/dw-analyze-project.md +22 -0
- package/scaffold/pt-br/commands/dw-autopilot.md +161 -278
- package/scaffold/pt-br/commands/dw-bugfix.md +3 -2
- package/scaffold/pt-br/commands/dw-functional-doc.md +11 -3
- package/scaffold/pt-br/commands/dw-generate-pr.md +2 -2
- package/scaffold/pt-br/commands/dw-goal.md +136 -0
- package/scaffold/pt-br/commands/dw-help.md +9 -7
- package/scaffold/pt-br/commands/dw-plan.md +9 -3
- package/scaffold/pt-br/commands/dw-qa.md +1 -1
- package/scaffold/pt-br/commands/dw-redesign-ui.md +2 -2
- package/scaffold/pt-br/commands/dw-review.md +7 -5
- package/scaffold/pt-br/commands/dw-secure-audit.md +72 -15
- package/scaffold/pt-br/templates/constitution-template.md +8 -3
- package/scaffold/pt-br/templates/functional-doc/playwright.flow.mjs.tpl +17 -0
- package/scaffold/scripts/cdp-relay/Cargo.toml +16 -0
- package/scaffold/scripts/cdp-relay/src/main.rs +49 -0
- package/scaffold/scripts/functional-doc/generate-dossier.mjs +7 -9
- package/scaffold/scripts/functional-doc/run-playwright-flow.mjs +192 -183
- package/scaffold/scripts/lib/capture-screenshots.mjs +133 -0
- package/scaffold/scripts/lib/resolve-browser.mjs +405 -0
- package/scaffold/scripts/lib/ui-slop-detect.mjs +102 -0
- package/scaffold/skills/dw-testing-discipline/references/playwright-recipes.md +50 -0
- package/scaffold/skills/dw-ui-discipline/SKILL.md +5 -0
- package/scaffold/skills/dw-ui-discipline/references/color-oklch.md +60 -0
- package/scaffold/skills/dw-ui-discipline/references/motion.md +52 -0
- package/scaffold/skills/dw-ui-discipline/references/responsive.md +52 -0
- package/scaffold/skills/dw-ui-discipline/references/type-scale.md +48 -0
- package/scaffold/skills/dw-ui-discipline/references/ux-writing.md +52 -0
- package/scaffold/skills/security-review/SKILL.md +19 -0
- package/scaffold/skills/security-review/references/sast.md +67 -0
- package/scaffold/skills/security-review/references/secrets.md +46 -0
- package/scaffold/en/templates/functional-doc/playwright.spec.ts.tpl +0 -19
- package/scaffold/pt-br/templates/functional-doc/playwright.spec.ts.tpl +0 -19
|
@@ -1,374 +1,257 @@
|
|
|
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, 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
|
|
159
|
+
6. **Security Gate** — the post-QA `/dw-review` (step 5) triggers `/dw-secure-audit`, producing a fresh `.dw/secure-audit/audit-summary.md`. This step **ensures** that verdict is APPROVED: if it is missing/stale/REJECTED, run `/dw-secure-audit <prd-path>` standalone, then loop back to `/dw-bugfix` per finding and re-check. SECRET findings always block (no ADR escape). Do not force a second full scan when a fresh APPROVED summary already exists.
|
|
272
160
|
|
|
273
|
-
|
|
161
|
+
<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
162
|
|
|
275
|
-
|
|
163
|
+
After `/dw-goal` completes, verify `.dw/goals/autopilot-<prd-slug>/status.json` has `status: "complete"`, then set `autopilot-state.json status: "goal_complete"`.
|
|
276
164
|
|
|
277
|
-
|
|
165
|
+
### Step 9: Bugfix Loop Close (Conditional)
|
|
278
166
|
|
|
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`)
|
|
167
|
+
If `mode == "from-prd"` and the PRD slug matches `prd-bugfix-*`, close the bugfix index before commit:
|
|
168
|
+
- Find `.dw/bugfixes/*/escalated.md` that references the PRD slug.
|
|
169
|
+
- If `SUMMARY.md` is missing, write it from available PRD, TechSpec, QA, and diff evidence using `.dw/templates/bugfix-summary-template.md`.
|
|
170
|
+
- Never fabricate verification evidence.
|
|
171
|
+
- Record artifacts in `autopilot-state.json`.
|
|
287
172
|
|
|
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`
|
|
173
|
+
### Step 10: Pre-Commit Audit
|
|
291
174
|
|
|
292
|
-
|
|
175
|
+
Before `/dw-commit`, verify:
|
|
176
|
+
- `.dw/goals/autopilot-<prd-slug>/status.json` is complete.
|
|
177
|
+
- `<prd-path>/QA/review-consolidated.md` exists from the final post-QA review.
|
|
178
|
+
- `<prd-path>/QA/qa-report.md` and `<prd-path>/QA/bugs.md` exist.
|
|
179
|
+
- **Security Gate passed:** `.dw/secure-audit/audit-summary.md` exists, is fresh (post-last-edit), and status is APPROVED. If missing/stale/REJECTED → STOP (do not commit).
|
|
180
|
+
- `autopilot-state.json` records planning artifacts and the completed goal.
|
|
293
181
|
|
|
294
|
-
|
|
182
|
+
If anything is missing, STOP and re-run the missing formal command. Do not commit partial work.
|
|
295
183
|
|
|
296
|
-
|
|
297
|
-
- Semantic commits following Conventional Commits
|
|
298
|
-
- Do NOT wait for approval
|
|
184
|
+
### Step 11: Commit
|
|
299
185
|
|
|
300
|
-
|
|
186
|
+
Run `/dw-commit` automatically. Do not wait for approval after the goal is complete.
|
|
301
187
|
|
|
302
|
-
|
|
188
|
+
### Step 12: Pull Request Gate
|
|
303
189
|
|
|
304
|
-
|
|
305
|
-
- **NO**: inform that commits are ready and the user can generate the PR manually later
|
|
190
|
+
Ask: **"Commits completed. Do you want to generate the Pull Request?"**
|
|
306
191
|
|
|
307
|
-
|
|
192
|
+
- YES: run `/dw-generate-pr`.
|
|
193
|
+
- NO: report that commits are ready and PR can be generated later.
|
|
308
194
|
|
|
309
|
-
|
|
195
|
+
Mark `autopilot-state.json status: "completed"` after commit, and include PR link if generated.
|
|
310
196
|
|
|
311
197
|
## State Persistence
|
|
312
198
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
Save the file `.dw/spec/prd-[name]/autopilot-state.json` with the following format:
|
|
199
|
+
`autopilot-state.json` must include:
|
|
316
200
|
|
|
317
201
|
```json
|
|
318
202
|
{
|
|
319
203
|
"mode": "autopilot",
|
|
204
|
+
"status": "planning",
|
|
320
205
|
"wish": "original user description",
|
|
321
|
-
"prd_path": ".dw/spec/prd-
|
|
206
|
+
"prd_path": ".dw/spec/prd-name",
|
|
322
207
|
"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"
|
|
208
|
+
"current_step": 1,
|
|
209
|
+
"completed_steps": [],
|
|
210
|
+
"skipped_steps": [],
|
|
211
|
+
"skip_reasons": {},
|
|
212
|
+
"gates_passed": [],
|
|
213
|
+
"step_artifacts": {},
|
|
214
|
+
"goal_slug": null,
|
|
215
|
+
"next_command": null,
|
|
216
|
+
"started_at": "2026-05-20T00:00:00Z",
|
|
217
|
+
"last_updated": "2026-05-20T00:00:00Z"
|
|
342
218
|
}
|
|
343
219
|
```
|
|
344
220
|
|
|
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>
|
|
221
|
+
Update state after each completed or skipped step. A step is complete only after required artifacts exist.
|
|
352
222
|
|
|
353
223
|
## Progress Format
|
|
354
224
|
|
|
355
|
-
|
|
225
|
+
Report progress after each step:
|
|
356
226
|
|
|
227
|
+
```text
|
|
228
|
+
=== AUTOPILOT =====================================
|
|
229
|
+
OK [1] Codebase Intelligence
|
|
230
|
+
OK [2] Research (skipped — known domain)
|
|
231
|
+
OK [3] Brainstorm
|
|
232
|
+
OK [4] PRD
|
|
233
|
+
OK [5] TechSpec
|
|
234
|
+
OK [6] Tasks
|
|
235
|
+
STOP [PLAN COMPLETE] Next: /dw-goal --from-autopilot prd-name
|
|
236
|
+
===================================================
|
|
357
237
|
```
|
|
238
|
+
|
|
239
|
+
During execution invocation:
|
|
240
|
+
|
|
241
|
+
```text
|
|
358
242
|
=== AUTOPILOT =====================================
|
|
359
|
-
OK [
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
OK [4/14] PRD
|
|
363
|
-
PAUSE [GATE 1] Awaiting PRD approval...
|
|
243
|
+
OK [PLAN] Already complete
|
|
244
|
+
RUN [GOAL] /dw-goal --from-autopilot prd-name
|
|
245
|
+
NEXT [COMMIT] after goal status=complete
|
|
364
246
|
===================================================
|
|
365
247
|
```
|
|
366
248
|
|
|
367
|
-
##
|
|
249
|
+
## Anti-patterns
|
|
368
250
|
|
|
369
|
-
|
|
370
|
-
-
|
|
371
|
-
-
|
|
372
|
-
-
|
|
251
|
+
- Do not continue into implementation during the first invocation.
|
|
252
|
+
- Do not skip `/dw-goal` during the second invocation.
|
|
253
|
+
- Do not replace full `/dw-review` with a narrower review in the execution goal.
|
|
254
|
+
- Do not mark state complete from manual validation alone.
|
|
255
|
+
- Do not re-run planning when `status=plan_complete`; resume the goal.
|
|
373
256
|
|
|
374
257
|
</system_instructions>
|
|
@@ -326,7 +326,7 @@
|
|
|
326
326
|
|
|
327
327
|
Next — pick one:
|
|
328
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`.
|
|
329
|
-
- 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`.
|
|
330
330
|
```
|
|
331
331
|
|
|
332
332
|
5. Stop this command. Do not proceed to step 5. The user (or autopilot) invokes `/dw-plan` or `/dw-autopilot --from-prd` next.
|
|
@@ -424,7 +424,8 @@
|
|
|
424
424
|
|
|
425
425
|
Option B (hand off to autopilot):
|
|
426
426
|
1. Run: `/dw-autopilot --from-prd prd-bugfix-<slug>`
|
|
427
|
-
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.
|
|
428
429
|
|
|
429
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.
|
|
430
431
|
```
|
|
@@ -114,7 +114,7 @@ Minimum files:
|
|
|
114
114
|
- `case-matrix.md`
|
|
115
115
|
- `e2e-runbook.md`
|
|
116
116
|
- `manifest.json`
|
|
117
|
-
- `scripts/*.
|
|
117
|
+
- `scripts/*.flow.mjs`
|
|
118
118
|
- `captions/*.srt`
|
|
119
119
|
|
|
120
120
|
If there is execution:
|
|
@@ -291,8 +291,16 @@ If a previous flow in the workspace already has a working shell script (e.g., `r
|
|
|
291
291
|
## Utility Scripts
|
|
292
292
|
|
|
293
293
|
Use the workspace utilities when appropriate:
|
|
294
|
-
- `node .dw/scripts/
|
|
295
|
-
- `node .dw/scripts/
|
|
294
|
+
- `node .dw/scripts/functional-doc/generate-dossier.mjs --target <URL> [--lang en|pt-br] [--project <name>] [--base-url <url>]`
|
|
295
|
+
- `node .dw/scripts/functional-doc/run-playwright-flow.mjs --flow-dir <path> [--video-resolution fullhd|1920x1080] [--list-only]`
|
|
296
|
+
|
|
297
|
+
The runner drives Playwright via the Node API and records video with `page.screencast` (the only
|
|
298
|
+
mechanism that works over CDP). It generates `scripts/<slug>.flow.mjs` — a plain ESM module exporting
|
|
299
|
+
`async function flow({ page, context, expect, baseURL, step, shot })` — not a `@playwright/test` spec,
|
|
300
|
+
so it needs no project `playwright.config.*`. The browser is chosen by `.dw/scripts/lib/resolve-browser.mjs`
|
|
301
|
+
(WSL-resilient: full headless Chromium by default; set `BROWSER_TEST` to a Windows browser exe to drive it over CDP — in NAT run `npx @brunosps00/dev-workflow setup-wsl-browser` once for the cdp-relay.exe + Hyper-V rule, mirrored networking works directly);
|
|
302
|
+
see the "Browser on WSL" section of `dw-testing-discipline/references/playwright-recipes.md`. Chromium
|
|
303
|
+
only — `screencast`/CDP do not support Firefox/WebKit.
|
|
296
304
|
|
|
297
305
|
## Completion Criteria
|
|
298
306
|
|
|
@@ -15,11 +15,11 @@ You are an assistant specialized in creating well-documented Pull Requests. Your
|
|
|
15
15
|
|-------|---------|
|
|
16
16
|
| `dw-verify` | **ALWAYS** — invoked before `git push`. Without a VERIFICATION REPORT PASS in the current session AFTER the last code edit, the PR **CANNOT** be created. |
|
|
17
17
|
| `dw-git-discipline` | **ALWAYS** — validates branch naming (`<type>/<scope>` kebab-case), atomic-commit history (each commit single-intent, conventional message), branch lifetime (flag if >7 days old), and PR scope (suggest split if diff > ~400 lines). PR description follows summary + test plan structure, not a `git log` dump. |
|
|
18
|
-
| `/dw-secure-audit` | **ALWAYS for TS/Python/C#/Rust projects** —
|
|
18
|
+
| `/dw-secure-audit` | **ALWAYS for TS/Python/C#/Rust projects** — a fresh `.dw/secure-audit/audit-summary.md` with status ≠ REJECTED is required for supported-language projects. |
|
|
19
19
|
|
|
20
20
|
<critical>Hard gate 1 (verify): if the current session has no VERIFICATION REPORT PASS from `dw-verify` produced AFTER the last edit/commit, STOP and invoke `dw-verify` before proceeding. A PR is a permanent artifact — it demands the highest verification standard.</critical>
|
|
21
21
|
|
|
22
|
-
<critical>Hard gate 2 (security): for TS/Python/C#/Rust projects, if
|
|
22
|
+
<critical>Hard gate 2 (security): for TS/Python/C#/Rust projects, if `.dw/secure-audit/audit-summary.md` is missing, stale (predates the last edit), OR has REJECTED status, STOP and invoke `/dw-secure-audit` before proceeding. SECRET findings and HIGH/CRITICAL vulnerabilities CANNOT reach the PR. For other languages (Go, Java, etc.), this gate is skipped with a note.</critical>
|
|
23
23
|
|
|
24
24
|
## Usage
|
|
25
25
|
|