@brunosps00/dev-workflow 0.8.1 → 0.9.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 +16 -12
- package/bin/dev-workflow.js +1 -1
- package/lib/constants.js +8 -2
- package/lib/init.js +6 -0
- package/lib/install-deps.js +0 -5
- package/lib/migrate-gsd.js +164 -0
- package/lib/uninstall.js +2 -2
- package/package.json +1 -1
- package/scaffold/en/commands/dw-analyze-project.md +6 -11
- package/scaffold/en/commands/dw-autopilot.md +6 -13
- package/scaffold/en/commands/dw-brainstorm.md +1 -1
- package/scaffold/en/commands/dw-code-review.md +6 -5
- package/scaffold/en/commands/dw-create-prd.md +5 -4
- package/scaffold/en/commands/dw-create-techspec.md +5 -4
- package/scaffold/en/commands/dw-execute-phase.md +149 -0
- package/scaffold/en/commands/dw-help.md +5 -2
- package/scaffold/en/commands/dw-intel.md +98 -29
- package/scaffold/en/commands/dw-map-codebase.md +125 -0
- package/scaffold/en/commands/dw-new-project.md +1 -1
- package/scaffold/en/commands/dw-plan-checker.md +144 -0
- package/scaffold/en/commands/dw-quick.md +30 -12
- package/scaffold/en/commands/dw-redesign-ui.md +5 -9
- package/scaffold/en/commands/dw-refactoring-analysis.md +6 -5
- package/scaffold/en/commands/dw-resume.md +10 -8
- package/scaffold/en/commands/dw-run-plan.md +14 -20
- package/scaffold/en/commands/dw-run-task.md +5 -4
- package/scaffold/en/commands/dw-update.md +3 -1
- package/scaffold/en/templates/idea-onepager.md +1 -1
- package/scaffold/pt-br/commands/dw-analyze-project.md +6 -11
- package/scaffold/pt-br/commands/dw-autopilot.md +6 -13
- package/scaffold/pt-br/commands/dw-brainstorm.md +1 -1
- package/scaffold/pt-br/commands/dw-code-review.md +6 -5
- package/scaffold/pt-br/commands/dw-create-prd.md +5 -4
- package/scaffold/pt-br/commands/dw-create-techspec.md +5 -4
- package/scaffold/pt-br/commands/dw-execute-phase.md +149 -0
- package/scaffold/pt-br/commands/dw-help.md +5 -2
- package/scaffold/pt-br/commands/dw-intel.md +98 -29
- package/scaffold/pt-br/commands/dw-map-codebase.md +125 -0
- package/scaffold/pt-br/commands/dw-new-project.md +1 -1
- package/scaffold/pt-br/commands/dw-plan-checker.md +144 -0
- package/scaffold/pt-br/commands/dw-quick.md +30 -12
- package/scaffold/pt-br/commands/dw-redesign-ui.md +5 -9
- package/scaffold/pt-br/commands/dw-refactoring-analysis.md +6 -5
- package/scaffold/pt-br/commands/dw-resume.md +10 -8
- package/scaffold/pt-br/commands/dw-run-plan.md +16 -22
- package/scaffold/pt-br/commands/dw-run-task.md +5 -4
- package/scaffold/pt-br/commands/dw-update.md +3 -1
- package/scaffold/pt-br/templates/idea-onepager.md +1 -1
- package/scaffold/skills/dw-codebase-intel/SKILL.md +101 -0
- package/scaffold/skills/dw-codebase-intel/agents/intel-updater.md +318 -0
- package/scaffold/skills/dw-codebase-intel/references/incremental-update.md +79 -0
- package/scaffold/skills/dw-codebase-intel/references/intel-format.md +208 -0
- package/scaffold/skills/dw-codebase-intel/references/query-patterns.md +148 -0
- package/scaffold/skills/dw-execute-phase/SKILL.md +133 -0
- package/scaffold/skills/dw-execute-phase/agents/executor.md +264 -0
- package/scaffold/skills/dw-execute-phase/agents/plan-checker.md +215 -0
- package/scaffold/skills/dw-execute-phase/references/atomic-commits.md +143 -0
- package/scaffold/skills/dw-execute-phase/references/plan-verification.md +156 -0
- package/scaffold/skills/dw-execute-phase/references/wave-coordination.md +102 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
# Intel format — schemas of `.dw/intel/` files
|
|
2
|
+
|
|
3
|
+
Every command that reads `.dw/intel/` depends on these schemas. Treat this file as the contract.
|
|
4
|
+
|
|
5
|
+
## Layout
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
.dw/intel/
|
|
9
|
+
├── stack.json # languages, frameworks, build/test tooling
|
|
10
|
+
├── files.json # per-file imports/exports/type
|
|
11
|
+
├── apis.json # routes, endpoints, CLI commands
|
|
12
|
+
├── deps.json # third-party dependencies + usage
|
|
13
|
+
├── arch.md # architectural overview (markdown)
|
|
14
|
+
└── .last-refresh.json # change detection (timestamps + sha256 hashes)
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Common `_meta` block (all JSON files)
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"_meta": {
|
|
22
|
+
"updated_at": "2026-05-06T12:34:56.789Z",
|
|
23
|
+
"version": 3
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
- `updated_at`: ISO-8601 UTC timestamp, set on every write
|
|
29
|
+
- `version`: integer, starts at 1, increments on every update (full or partial)
|
|
30
|
+
|
|
31
|
+
## `stack.json`
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"_meta": { "updated_at": "...", "version": 1 },
|
|
36
|
+
"languages": ["TypeScript", "JavaScript"],
|
|
37
|
+
"frameworks": ["Express", "React"],
|
|
38
|
+
"tools": ["ESLint", "Jest", "Docker"],
|
|
39
|
+
"build_system": "npm scripts",
|
|
40
|
+
"test_framework": "Jest",
|
|
41
|
+
"package_manager": "npm",
|
|
42
|
+
"content_formats": ["Markdown", "YAML", "EJS"]
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Field rules:
|
|
47
|
+
- `languages`: ordered by line count (most-prevalent first)
|
|
48
|
+
- `frameworks`: full names (no abbreviations) — `"Next.js"` not `"next"`
|
|
49
|
+
- `tools`: dev tooling that affects code shape (linter, formatter, bundler, container runtime)
|
|
50
|
+
- `build_system`: detected from manifest (`npm scripts`, `Vite`, `webpack`, `esbuild`, `dotnet`, `cargo`, etc.)
|
|
51
|
+
- `test_framework`: detected from manifest (`Jest`, `Vitest`, `Pytest`, `xUnit`, `cargo test`, etc.); `"none"` if no test setup detected
|
|
52
|
+
- `package_manager`: from lockfile (`npm`, `pnpm`, `yarn`, `poetry`, `uv`, `dotnet`, `cargo`)
|
|
53
|
+
- `content_formats`: non-code formats with structural significance (markdown for docs/skills, YAML for configs, JSON Schema, OpenAPI, Protobuf, etc.)
|
|
54
|
+
|
|
55
|
+
## `files.json`
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"_meta": { "updated_at": "...", "version": 1 },
|
|
60
|
+
"entries": {
|
|
61
|
+
"src/server.ts": {
|
|
62
|
+
"exports": ["createServer", "default"],
|
|
63
|
+
"imports": ["./config", "express", "./routes/users"],
|
|
64
|
+
"type": "entry-point"
|
|
65
|
+
},
|
|
66
|
+
"src/routes/users.ts": {
|
|
67
|
+
"exports": ["userRouter"],
|
|
68
|
+
"imports": ["express", "../db", "../schemas/user"],
|
|
69
|
+
"type": "module"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Field rules:
|
|
76
|
+
- Key: file path relative to project root, forward slashes
|
|
77
|
+
- `exports`: array of ACTUAL exported symbol names. NOT descriptions. `["createServer", "default"]` is correct; `["server creation"]` is wrong.
|
|
78
|
+
- `imports`: array of import specifiers (relative paths or package names) — preserve as the source code writes them
|
|
79
|
+
- `type`: one of `entry-point`, `module`, `config`, `test`, `script`, `type-def`, `style`, `template`, `data`
|
|
80
|
+
|
|
81
|
+
Coverage: target the most important 50-100 files. Skip generated code, test files (unless they reveal architecture), `node_modules/dist/build`.
|
|
82
|
+
|
|
83
|
+
## `apis.json`
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"_meta": { "updated_at": "...", "version": 1 },
|
|
88
|
+
"entries": {
|
|
89
|
+
"GET /api/users": {
|
|
90
|
+
"method": "GET",
|
|
91
|
+
"path": "/api/users",
|
|
92
|
+
"params": ["page", "limit"],
|
|
93
|
+
"file": "src/routes/users.ts",
|
|
94
|
+
"description": "List users with pagination"
|
|
95
|
+
},
|
|
96
|
+
"CLI: dw-init": {
|
|
97
|
+
"method": "CLI",
|
|
98
|
+
"path": "dev-workflow init",
|
|
99
|
+
"params": ["--lang", "--force"],
|
|
100
|
+
"file": "bin/dev-workflow.js",
|
|
101
|
+
"description": "Scaffold .dw/ structure into a project"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Field rules:
|
|
108
|
+
- Key format: `"<METHOD> <PATH>"` for HTTP, `"CLI: <command>"` for CLI, `"GraphQL: <operation>"`, `"Handler: <event>"`, etc.
|
|
109
|
+
- `method`: HTTP verb, or `"CLI"`, `"GraphQL"`, `"gRPC"`, `"Event"`, `"Subscription"`
|
|
110
|
+
- `path`: the route/command/operation name
|
|
111
|
+
- `params`: query/body/CLI flag names — array of strings
|
|
112
|
+
- `file`: source path
|
|
113
|
+
- `description`: one-line summary derived from the handler's first comment or function name
|
|
114
|
+
|
|
115
|
+
If no API surfaces detected, write `{ "_meta": {...}, "entries": {} }` — never omit the file.
|
|
116
|
+
|
|
117
|
+
## `deps.json`
|
|
118
|
+
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"_meta": { "updated_at": "...", "version": 1 },
|
|
122
|
+
"entries": {
|
|
123
|
+
"express": {
|
|
124
|
+
"version": "^4.18.0",
|
|
125
|
+
"type": "production",
|
|
126
|
+
"used_by": ["src/server.ts", "src/routes/users.ts"],
|
|
127
|
+
"invocation": "require"
|
|
128
|
+
},
|
|
129
|
+
"vitest": {
|
|
130
|
+
"version": "^2.0.0",
|
|
131
|
+
"type": "development",
|
|
132
|
+
"used_by": ["package.json#test"],
|
|
133
|
+
"invocation": "npm test"
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Field rules:
|
|
140
|
+
- Key: package name (npm), distribution name (PyPI), package id (NuGet), crate name (crates.io)
|
|
141
|
+
- `version`: semver range from manifest
|
|
142
|
+
- `type`: `production` | `development` | `peer` | `optional`
|
|
143
|
+
- `used_by`: array of file paths that import the dep (verified by Grep) OR npm-script keys for tooling deps
|
|
144
|
+
- `invocation`:
|
|
145
|
+
- `require` if directly imported in code
|
|
146
|
+
- npm script command (`npm run lint`, `npm test`) if exercised via script
|
|
147
|
+
- `implicit` if a runtime/framework dep that's not directly imported (e.g., `react-dom` in a Next.js project)
|
|
148
|
+
|
|
149
|
+
## `arch.md`
|
|
150
|
+
|
|
151
|
+
```markdown
|
|
152
|
+
---
|
|
153
|
+
updated_at: "2026-05-06T12:34:56.789Z"
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Architecture Overview
|
|
157
|
+
|
|
158
|
+
The project follows a layered architecture: HTTP routes → application services → repository layer → ORM → database.
|
|
159
|
+
|
|
160
|
+
## Key Components
|
|
161
|
+
|
|
162
|
+
| Component | Path | Responsibility |
|
|
163
|
+
|-----------|------|----------------|
|
|
164
|
+
| Server bootstrap | `src/server.ts` | Express app initialization + middleware wiring |
|
|
165
|
+
| Route handlers | `src/routes/` | HTTP request validation and response shaping |
|
|
166
|
+
| Application services | `src/services/` | Business logic, orchestration |
|
|
167
|
+
| Repositories | `src/repositories/` | Data access via Prisma |
|
|
168
|
+
| Schemas | `src/schemas/` | Zod validation schemas, shared with frontend |
|
|
169
|
+
|
|
170
|
+
## Data Flow
|
|
171
|
+
|
|
172
|
+
`HTTP request` → `route handler (validates with Zod)` → `service` → `repository (Prisma)` → `Postgres` → response
|
|
173
|
+
|
|
174
|
+
## Conventions
|
|
175
|
+
|
|
176
|
+
- File naming: kebab-case (`user-routes.ts`, `order-service.ts`)
|
|
177
|
+
- Function naming: camelCase, verb-first (`createOrder`, `findUserById`)
|
|
178
|
+
- Tests: co-located, `.test.ts` suffix
|
|
179
|
+
- Imports: absolute via `@/` alias for cross-module, relative for sibling files
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## `.last-refresh.json`
|
|
183
|
+
|
|
184
|
+
```json
|
|
185
|
+
{
|
|
186
|
+
"updated_at": "2026-05-06T12:34:56.789Z",
|
|
187
|
+
"files": {
|
|
188
|
+
"stack.json": "a3c8b1...",
|
|
189
|
+
"files.json": "f9e2d7...",
|
|
190
|
+
"apis.json": "1b4f8a...",
|
|
191
|
+
"deps.json": "5c2e6b...",
|
|
192
|
+
"arch.md": "9d7c3e..."
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Hashes are SHA-256 of file contents at the moment of refresh. Used by `/dw-map-codebase` to detect drift on the next run and decide whether a partial update is enough.
|
|
198
|
+
|
|
199
|
+
## Validation rules
|
|
200
|
+
|
|
201
|
+
When `intel-updater` finishes, all 5 files MUST satisfy:
|
|
202
|
+
|
|
203
|
+
1. Valid JSON (parseable)
|
|
204
|
+
2. `_meta.updated_at` is ISO-8601
|
|
205
|
+
3. `_meta.version` is a positive integer
|
|
206
|
+
4. All file paths in `files.json`, `apis.json`, `deps.json` exist on disk (or were excluded for known reasons)
|
|
207
|
+
5. `exports` arrays contain only actual symbols (no descriptions, no spaces in entries)
|
|
208
|
+
6. No secrets/credentials/tokens in any file
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# Query patterns — how `/dw-intel` answers different question shapes
|
|
2
|
+
|
|
3
|
+
`/dw-intel "<query>"` reads `.dw/intel/` and returns structured answers with file paths cited. This file describes how the command maps natural-language queries to which intel files to read.
|
|
4
|
+
|
|
5
|
+
## Query shape detection
|
|
6
|
+
|
|
7
|
+
The command classifies the query into one of these shapes before searching:
|
|
8
|
+
|
|
9
|
+
| Shape | Example queries | Primary file | Secondary files |
|
|
10
|
+
|-------|-----------------|--------------|-----------------|
|
|
11
|
+
| **where-is** | "where is the user routes file?", "where is auth defined?" | `files.json` | `apis.json` |
|
|
12
|
+
| **what-uses** | "what uses express?", "where is the redis client called?" | `deps.json` (for libs), `files.json` (for symbols) | grep fallback |
|
|
13
|
+
| **architecture-of** | "what's the architecture?", "how is data flow structured?" | `arch.md` | `stack.json` |
|
|
14
|
+
| **stack** | "what frameworks?", "is this typescript or javascript?" | `stack.json` | — |
|
|
15
|
+
| **dep-info** | "which version of react?", "what's prisma used for here?" | `deps.json` | — |
|
|
16
|
+
| **api-list** | "list endpoints", "what routes exist?" | `apis.json` | — |
|
|
17
|
+
| **find-export** | "where is `createServer` exported from?", "find the `userSchema` symbol" | `files.json` (search `exports` arrays) | grep fallback |
|
|
18
|
+
| **convention** | "what's the file naming convention?", "are tests co-located?" | `arch.md` | `.dw/rules/` if available |
|
|
19
|
+
|
|
20
|
+
## Match algorithm
|
|
21
|
+
|
|
22
|
+
For each shape, the command:
|
|
23
|
+
|
|
24
|
+
1. **Tokenize** the query into keywords (drop stopwords).
|
|
25
|
+
2. **Search the primary file** for matches:
|
|
26
|
+
- JSON files: case-insensitive substring match in keys + descriptions
|
|
27
|
+
- `arch.md`: case-insensitive full-text search
|
|
28
|
+
3. **Rank** matches by:
|
|
29
|
+
- Exact symbol match > substring match > description match
|
|
30
|
+
- Direct deps > indirect (transitive) deps
|
|
31
|
+
4. **Return** top 3-5 matches with file paths cited.
|
|
32
|
+
|
|
33
|
+
If primary file yields zero matches, fall back to secondary files. If still zero, fall back to direct grep over the project (slower but exhaustive).
|
|
34
|
+
|
|
35
|
+
## Examples
|
|
36
|
+
|
|
37
|
+
### Query: "where is auth defined?"
|
|
38
|
+
|
|
39
|
+
**Shape:** where-is
|
|
40
|
+
|
|
41
|
+
**Process:**
|
|
42
|
+
1. Search `files.json` for keys containing `auth` → finds `src/auth/index.ts`, `src/middleware/auth.ts`, `src/routes/auth.ts`
|
|
43
|
+
2. Search `apis.json` for paths containing `auth` → finds `POST /api/auth/login`, `POST /api/auth/logout`
|
|
44
|
+
3. Return top files + endpoints with paths
|
|
45
|
+
|
|
46
|
+
**Output:**
|
|
47
|
+
```
|
|
48
|
+
Auth is defined across 3 files and exposes 2 endpoints:
|
|
49
|
+
|
|
50
|
+
Files:
|
|
51
|
+
- src/auth/index.ts (entry-point) — exports: configureAuth, AuthError
|
|
52
|
+
- src/middleware/auth.ts (module) — exports: requireAuth, optionalAuth
|
|
53
|
+
- src/routes/auth.ts (module) — exports: authRouter
|
|
54
|
+
|
|
55
|
+
Endpoints:
|
|
56
|
+
- POST /api/auth/login (file: src/routes/auth.ts) — Authenticate user
|
|
57
|
+
- POST /api/auth/logout (file: src/routes/auth.ts) — Clear session
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Query: "what uses redis?"
|
|
61
|
+
|
|
62
|
+
**Shape:** what-uses
|
|
63
|
+
|
|
64
|
+
**Process:**
|
|
65
|
+
1. Search `deps.json` for entry `redis` (or `ioredis`, `redis-py`, etc. depending on stack)
|
|
66
|
+
2. Read its `used_by` array
|
|
67
|
+
3. Cross-reference with `files.json` to enrich (which files have this dep imported and what they do)
|
|
68
|
+
|
|
69
|
+
**Output:**
|
|
70
|
+
```
|
|
71
|
+
Redis (ioredis@^5.3.0, production) is used by 3 files:
|
|
72
|
+
|
|
73
|
+
- src/cache/index.ts — exports: cacheGet, cacheSet, cacheDel
|
|
74
|
+
- src/jobs/queue.ts — exports: enqueueJob (uses ioredis as BullMQ backend)
|
|
75
|
+
- src/sessions/store.ts — exports: createSessionStore
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Query: "what frameworks?"
|
|
79
|
+
|
|
80
|
+
**Shape:** stack
|
|
81
|
+
|
|
82
|
+
**Process:**
|
|
83
|
+
1. Read `stack.json` directly
|
|
84
|
+
2. Output the `frameworks` field, with versions if available from `deps.json`
|
|
85
|
+
|
|
86
|
+
**Output:**
|
|
87
|
+
```
|
|
88
|
+
Frameworks detected:
|
|
89
|
+
- Express (^4.18.0, production)
|
|
90
|
+
- React (^18.2.0, production)
|
|
91
|
+
- Prisma (^5.4.0, production)
|
|
92
|
+
|
|
93
|
+
Build system: npm scripts
|
|
94
|
+
Test framework: Jest
|
|
95
|
+
Package manager: npm
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Query: "list endpoints"
|
|
99
|
+
|
|
100
|
+
**Shape:** api-list
|
|
101
|
+
|
|
102
|
+
**Process:**
|
|
103
|
+
1. Read `apis.json`
|
|
104
|
+
2. Group by tag/prefix (`/api/users`, `/api/orders`, `/api/auth` → User Management, Orders, Auth)
|
|
105
|
+
3. Output tabular
|
|
106
|
+
|
|
107
|
+
**Output:**
|
|
108
|
+
```
|
|
109
|
+
12 endpoints across 3 groups:
|
|
110
|
+
|
|
111
|
+
Auth (2)
|
|
112
|
+
- POST /api/auth/login — Authenticate user
|
|
113
|
+
- POST /api/auth/logout — Clear session
|
|
114
|
+
|
|
115
|
+
Users (5)
|
|
116
|
+
- GET /api/users — List users
|
|
117
|
+
- POST /api/users — Create user
|
|
118
|
+
- GET /api/users/:id — Get user by id
|
|
119
|
+
- PATCH /api/users/:id — Update user
|
|
120
|
+
- DELETE /api/users/:id — Delete user
|
|
121
|
+
|
|
122
|
+
Orders (5) ...
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Stale-index handling
|
|
126
|
+
|
|
127
|
+
Before answering, check `.dw/intel/.last-refresh.json`:
|
|
128
|
+
|
|
129
|
+
- If `updated_at` is more than 7 days old → prefix the answer with: `⚠ Index last refreshed YYYY-MM-DD (X days ago). Run /dw-map-codebase to refresh.`
|
|
130
|
+
- If `.last-refresh.json` is absent → prefix with: `⚠ No refresh metadata. Index may be stale; run /dw-map-codebase.`
|
|
131
|
+
|
|
132
|
+
Don't refuse to answer — return the best info available, but flag the staleness so the user can decide whether to trust it.
|
|
133
|
+
|
|
134
|
+
## Fallback path (no `.dw/intel/`)
|
|
135
|
+
|
|
136
|
+
If `.dw/intel/` doesn't exist at all:
|
|
137
|
+
|
|
138
|
+
1. Check `.dw/rules/` (from `/dw-analyze-project` or `/dw-new-project` seeding)
|
|
139
|
+
2. If `.dw/rules/index.md` exists, search there for the query keywords
|
|
140
|
+
3. Otherwise, do a direct `grep -r` over the project source (excluding `node_modules`, `.git`, etc.)
|
|
141
|
+
4. Suggest at the end: `Tip: run /dw-map-codebase to build a queryable index. Subsequent /dw-intel queries will be much faster.`
|
|
142
|
+
|
|
143
|
+
## Don't
|
|
144
|
+
|
|
145
|
+
- Don't fabricate paths or symbols not present in the index
|
|
146
|
+
- Don't return "I don't know" without first trying the secondary file and grep fallback
|
|
147
|
+
- Don't ignore stale-index warnings — surface them prominently
|
|
148
|
+
- Don't dump the entire JSON of an intel file as the answer; synthesize and cite paths
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dw-execute-phase
|
|
3
|
+
description: Phase execution and plan verification for dev-workflow. Two agents (executor for wave-based parallel task dispatch with deviation handling, plan-checker for goal-backward plan verification before execution). Used by /dw-execute-phase, /dw-plan-checker, /dw-run-plan, /dw-autopilot. Adapted from get-shit-done-cc (MIT).
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- Read
|
|
6
|
+
- Write
|
|
7
|
+
- Edit
|
|
8
|
+
- Bash
|
|
9
|
+
- Grep
|
|
10
|
+
- Glob
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# dw-execute-phase
|
|
14
|
+
|
|
15
|
+
Bundled skill providing **phase-level execution discipline** for dev-workflow: parallel task dispatch in waves, atomic commit per task, deviation handling mid-execution, and goal-backward plan verification before any execution burns context.
|
|
16
|
+
|
|
17
|
+
## Why a skill (not inline)
|
|
18
|
+
|
|
19
|
+
- The execution discipline (wave coordination, deviation rules, checkpoint protocol) is a separate concern from the commands that invoke it. Bundling it as a skill lets multiple commands (`/dw-run-plan`, `/dw-autopilot`, `/dw-execute-phase` itself) reuse the same discipline.
|
|
20
|
+
- The plan-checker is a verification GATE — it must run before `/dw-run-plan`/`/dw-execute-phase` mutate code, and bundling it makes that contract visible.
|
|
21
|
+
- The agents own the protocol; the orchestrating commands just wire them up.
|
|
22
|
+
|
|
23
|
+
## When to Use
|
|
24
|
+
|
|
25
|
+
Read this skill when:
|
|
26
|
+
|
|
27
|
+
- `/dw-execute-phase` is invoked to run a batch of tasks in parallel waves.
|
|
28
|
+
- `/dw-plan-checker` is invoked to verify a `tasks.md` file will achieve its PRD goal before execution.
|
|
29
|
+
- `/dw-run-plan` is invoked (it spawns the executor agent for each wave).
|
|
30
|
+
- `/dw-autopilot` enters the execution stage (it gates on plan-checker before invoking the executor).
|
|
31
|
+
|
|
32
|
+
Do NOT use when:
|
|
33
|
+
|
|
34
|
+
- A single one-off change is being made (use `/dw-run-task` directly — no waves needed).
|
|
35
|
+
- The user is exploring/brainstorming, not executing (use `/dw-brainstorm`).
|
|
36
|
+
- The plan hasn't been created yet (use `/dw-create-tasks` first).
|
|
37
|
+
|
|
38
|
+
## Agents
|
|
39
|
+
|
|
40
|
+
| Agent | Responsibility | Spawn from |
|
|
41
|
+
|-------|----------------|------------|
|
|
42
|
+
| `agents/executor.md` | Runs tasks in waves, atomic commit per task, handles deviations (3 deviation rules), respects checkpoint markers, writes `SUMMARY.md` per phase | `/dw-execute-phase`, `/dw-run-plan` |
|
|
43
|
+
| `agents/plan-checker.md` | Goal-backward verification of `tasks.md` before execution. Checks: requirement coverage, task completeness, dependency soundness, artifact wiring, context budget. Returns PASS / REVISE / BLOCK. | `/dw-plan-checker`, `/dw-create-tasks` (auto-gate before declaring tasks ready) |
|
|
44
|
+
|
|
45
|
+
## How the Two Agents Compose
|
|
46
|
+
|
|
47
|
+
The expected flow:
|
|
48
|
+
|
|
49
|
+
1. `/dw-create-tasks` produces `.dw/spec/prd-<slug>/tasks.md` from PRD + TechSpec.
|
|
50
|
+
2. **Plan-checker GATE** — `/dw-plan-checker .dw/spec/prd-<slug>/` spawns the plan-checker agent. The agent reads PRD/TechSpec/tasks.md and verifies tasks WILL achieve the goal. Returns one of: `PASS` (proceed), `REVISE` (issues found, planner re-runs), `BLOCK` (fundamental gap, abort).
|
|
51
|
+
3. `/dw-execute-phase` spawns the executor agent ONLY if plan-checker returned `PASS`. The executor runs tasks in waves, commits atomically, handles deviations.
|
|
52
|
+
4. `/dw-run-qa` runs after all waves complete to validate the implementation against PRD.
|
|
53
|
+
|
|
54
|
+
`/dw-autopilot` orchestrates this entire flow with hard gates between stages.
|
|
55
|
+
|
|
56
|
+
## Wave Concept
|
|
57
|
+
|
|
58
|
+
Tasks in `tasks.md` are grouped into **waves** by their `Depends on:` frontmatter:
|
|
59
|
+
|
|
60
|
+
- Wave 1: tasks with no dependencies → run in parallel
|
|
61
|
+
- Wave 2: tasks that depend on Wave 1 → run after Wave 1 commits land
|
|
62
|
+
- Wave N: ...
|
|
63
|
+
|
|
64
|
+
Within a wave, tasks run in parallel via subagent dispatch. Across waves, sequential.
|
|
65
|
+
|
|
66
|
+
The executor calculates waves automatically by topologically sorting task dependencies. See `references/wave-coordination.md`.
|
|
67
|
+
|
|
68
|
+
## Deviation Rules (during execution)
|
|
69
|
+
|
|
70
|
+
Mid-task, the executor may discover the plan is incomplete or contradicted by reality. Three rules:
|
|
71
|
+
|
|
72
|
+
1. **Auto-add missing critical functionality** — if a task says "create endpoint" but no validation is specified and the project's CLAUDE.md/rules require it, add the validation as part of the same task. Note in the task's commit message.
|
|
73
|
+
2. **Surface ambiguity, don't guess** — if the plan says "use the existing service" and 3 services match, STOP, write a deviation entry to `.dw/spec/prd-<slug>/deviations.md`, and ask the user.
|
|
74
|
+
3. **Block on architectural conflicts** — if the task as planned would violate a locked decision in CONTEXT.md / project rules, abort the task and surface the conflict for re-planning.
|
|
75
|
+
|
|
76
|
+
Detail in `references/atomic-commits.md` (deviation entry format) and `references/plan-verification.md` (what plan-checker should catch BEFORE execution to prevent deviations).
|
|
77
|
+
|
|
78
|
+
## Atomic Commit Protocol
|
|
79
|
+
|
|
80
|
+
Every task ends with exactly one git commit:
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
feat(<scope>): <task title> (RF-XX)
|
|
84
|
+
|
|
85
|
+
<one-line summary of what this commit delivers>
|
|
86
|
+
|
|
87
|
+
- Files added: <list>
|
|
88
|
+
- Files modified: <list>
|
|
89
|
+
- Tests added/updated: <list>
|
|
90
|
+
- Deviations: <link to deviations.md entry, if any>
|
|
91
|
+
|
|
92
|
+
Closes RF-XX (partial — see tasks.md).
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
The commit message format is consistent across waves so `/dw-generate-pr` can build a clean PR body. See `references/atomic-commits.md`.
|
|
96
|
+
|
|
97
|
+
## Checkpoint Protocol
|
|
98
|
+
|
|
99
|
+
If the executor exhausts its context budget mid-phase OR the user signals stop:
|
|
100
|
+
|
|
101
|
+
- Write current progress to `.dw/spec/prd-<slug>/active-session.md` (last completed task, next task, blockers).
|
|
102
|
+
- Exit cleanly with status `CHECKPOINT`.
|
|
103
|
+
- Next invocation of `/dw-resume` reads this file and resumes from the last completed task.
|
|
104
|
+
|
|
105
|
+
## Files in `.dw/spec/prd-<slug>/`
|
|
106
|
+
|
|
107
|
+
| File | Read by | Written by |
|
|
108
|
+
|------|---------|------------|
|
|
109
|
+
| `prd.md` | plan-checker, executor | `/dw-create-prd` |
|
|
110
|
+
| `techspec.md` | plan-checker, executor | `/dw-create-techspec` |
|
|
111
|
+
| `tasks.md` | plan-checker (verifies), executor (executes) | `/dw-create-tasks` |
|
|
112
|
+
| `<NN>_task.md` | executor (per-task detail) | `/dw-create-tasks` |
|
|
113
|
+
| `deviations.md` | plan-checker (next iteration), executor | executor (rule 1/2 deviations) |
|
|
114
|
+
| `active-session.md` | `/dw-resume`, executor (continuation) | executor (checkpoint) |
|
|
115
|
+
| `SUMMARY.md` | `/dw-generate-pr` | executor (after final wave) |
|
|
116
|
+
|
|
117
|
+
## References
|
|
118
|
+
|
|
119
|
+
- `references/wave-coordination.md` — how the executor groups tasks into waves and dispatches them in parallel.
|
|
120
|
+
- `references/plan-verification.md` — the 6-dimension goal-backward analysis the plan-checker performs.
|
|
121
|
+
- `references/atomic-commits.md` — commit message format, deviation entry format, when to use Edit vs Write.
|
|
122
|
+
|
|
123
|
+
## Rules
|
|
124
|
+
|
|
125
|
+
- **No execution without plan-checker PASS.** `/dw-execute-phase` and `/dw-run-plan` must call plan-checker first; if it returns REVISE or BLOCK, abort.
|
|
126
|
+
- **One commit per task, no exceptions.** Even trivial tasks commit. This drives traceability and revert safety.
|
|
127
|
+
- **Deviations are recorded, not silenced.** Every adjustment beyond the plan goes in `deviations.md` with reason.
|
|
128
|
+
- **Checkpoint > timeout.** When context budget is low, checkpoint cleanly rather than running tasks half-way.
|
|
129
|
+
- **Wave order is topological, not user-defined.** The executor computes wave boundaries from `Depends on:` fields; users can't override.
|
|
130
|
+
|
|
131
|
+
## Inspired by
|
|
132
|
+
|
|
133
|
+
Adapted from [`get-shit-done-cc`](https://github.com/gsd-build/get-shit-done) (`gsd-executor`, `gsd-plan-checker`) by gsd-build (MIT license). Core protocols (goal-backward verification, atomic commits, deviation handling, checkpoint resume) preserved. Path conventions changed from `.planning/<phase>/` to `.dw/spec/prd-<slug>/`. SDK CLI calls (`gsd-sdk query init.execute-phase`) replaced by inline operations. The companion `gsd-debugger` agent (1452 lines) was NOT ported — its scope overlaps with the existing `/dw-bugfix` and `/dw-fix-qa` commands.
|