You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -28,6 +35,8 @@ Read `specs/<spec-dir>/tasks.md`. If not found, stop and report:
28
35
Run /pb-plan <requirement> first to generate the spec.
29
36
```
30
37
38
+
Never guess `<spec-dir>` from memory. Always resolve from actual directory names under `specs/`.
39
+
31
40
## Step 2: Parse Unfinished Tasks
32
41
33
42
Scan for all unchecked items (`- [ ]`). Build an ordered list preserving Phase → Task number order.
@@ -39,6 +48,8 @@ Scan for all unchecked items (`- [ ]`). Build an ordered list preserving Phase
39
48
- If `tasks.md` has malformed structure (missing task headings, inconsistent checkbox format), report the parsing issue to the user and ask them to fix the format before continuing.
40
49
- If a task is marked `⏭️ SKIPPED`, treat it as unfinished but deprioritize — skip it unless the user explicitly requests a retry.
41
50
51
+
For execution reliability, represent the queue as explicit task units: `Task ID`, `Task Name`, `Status`, `Verification`.
52
+
42
53
If all tasks are checked (`- [x]`), report:
43
54
44
55
```text
@@ -61,6 +72,7 @@ For each unfinished task, in order:
61
72
4.**Subagent executes** the TDD cycle (see Implementer Prompt section).
62
73
5.**Mark completed** — update `- [ ]` to `- [x]` and Status to `🟢 DONE` in `tasks.md`.
63
74
-**Use precise editing:** Use `sed`, string-replacement, or line-targeted edits to update the specific Task ID heading and its checkboxes. Do NOT rewrite the entire `tasks.md` file — this risks truncation and content loss in large files.
75
+
-**Completion gate:** Mark done only when task Verification is satisfied and tests are green.
64
76
65
77
> **⚠️ Context Reset:** After completing all tasks (or when context grows large), output: "Recommend starting a fresh session. Run `/pb-build <feature-name>` again to continue from where you left off."
66
78
@@ -74,6 +86,7 @@ If a subagent fails:
74
86
- If pre-task workspace was clean: restore only changed tracked files with `git restore --worktree --staged -- <files>` and remove only newly created files from this task.
75
87
- If pre-task workspace was dirty: do NOT run workspace-wide restore commands. Report file-level cleanup options and wait for user choice.
76
88
4.**Report** the failure — which task, what went wrong, specific error output.
89
+
- Include the exact failing command and a short quoted error excerpt.
77
90
5. Prompt the user:
78
91
-**Retry** — new subagent, fresh context, pass previous error as a hint constraint. Maximum 2 retries per task.
79
92
-**Skip** — mark as `⏭️ SKIPPED`, move to next task.
@@ -121,6 +134,8 @@ Next steps:
121
134
- If tasks were skipped: /pb-build <feature-name>
122
135
```
123
136
137
+
Summary must be factual and command-backed: do not claim "passed" or "completed" without corresponding execution evidence from this run.
138
+
124
139
---
125
140
126
141
## Subagent Rules
@@ -130,6 +145,7 @@ Next steps:
130
145
3.**Sequential execution.** Strict `tasks.md` order. No parallelism.
131
146
4.**Independence.** Cross-task state lives in files, not memory.
132
147
5.**Grounding first.** Every subagent verifies workspace state before writing code.
148
+
6.**Verifiable closure.** A task closes only after explicit verification evidence.
133
149
134
150
---
135
151
@@ -165,6 +181,8 @@ Update `tasks.md` in-place after each task using **precise edits** (target the s
165
181
- Carry in-memory state between subagents.
166
182
- Modify `design.md` (file a Design Change Request instead).
167
183
- Rewrite the entire `tasks.md` file — use targeted edits only.
184
+
- Mark a task as done without satisfying its Verification criteria.
185
+
- Claim tests passed without running them.
168
186
169
187
### ALWAYS
170
188
@@ -176,6 +194,7 @@ Update `tasks.md` in-place after each task using **precise edits** (target the s
176
194
- Follow YAGNI — only implement what the task requires.
177
195
- Use existing project patterns and conventions.
178
196
- File a Design Change Request if the design is infeasible.
197
+
- Report command-backed outcomes (what ran, what failed, what passed).
179
198
180
199
---
181
200
@@ -189,6 +208,7 @@ Update `tasks.md` in-place after each task using **precise edits** (target the s
189
208
6.**State lives on disk.** Checkboxes and code are the only persistent state.
190
209
7.**Fail fast, recover cleanly.** Use task-local rollback from the pre-task snapshot. Avoid workspace-wide resets in dirty trees.
Every checklist item must be reflected in `design.md` and broken into actionable work in `tasks.md` (or explicitly marked out-of-scope with rationale).
27
+
13
28
**feature-name rules:**
14
29
15
30
- Maximum 4 words, joined with `-` (kebab-case).
@@ -41,6 +56,7 @@ Gather context to inform the design. **Do not rely solely on `AGENTS.md`** — a
41
56
- Use grep / file search / semantic search to find modules, directories, and files affected by the requirement.
42
57
- Search for keywords from the requirement across the codebase.
43
58
- Read relevant source files to understand current implementation patterns.
59
+
- Verify all referenced file paths and modules actually exist. If uncertain, mark as assumption instead of asserting.
44
60
3.**Check `specs/`** — see if related feature specs already exist.
45
61
4.**Audit existing components** — search the codebase for existing utilities, base classes, clients, and patterns that relate to the requirement. Specifically look for:
46
62
- Helper/utility modules that overlap with the requirement
@@ -52,6 +68,12 @@ Gather context to inform the design. **Do not rely solely on `AGENTS.md`** — a
52
68
53
69
If `AGENTS.md` does not exist, search the codebase directly for project context. Recommend running `/pb-init` first in your summary.
54
70
71
+
**Evidence precedence (highest to lowest):**
72
+
1. Live codebase state
73
+
2. Existing project docs/specs
74
+
3.`AGENTS.md`
75
+
4. Reasonable assumptions (must be labeled)
76
+
55
77
## Step 3: Create Spec Directory
56
78
57
79
**Uniqueness check (mandatory):**
@@ -109,6 +131,7 @@ Write a **compact** design doc to `specs/<spec-dir>/design.md`:
Fill the **Design Template** below fully and write to `specs/<spec-dir>/design.md`. Every section must have substantive content — no "TBD" or empty placeholders.
134
+
Remove all instructional placeholder text (such as bracket examples) in the final file.
Fill the **Tasks Template** below and write to `specs/<spec-dir>/tasks.md`. Break down the implementation plan from `design.md` into concrete, actionable tasks.
165
+
Remove all instructional placeholder text (such as bracket examples) in the final file.
142
166
143
167
**Task requirements:**
144
168
@@ -149,6 +173,7 @@ Fill the **Tasks Template** below and write to `specs/<spec-dir>/tasks.md`. Brea
149
173
- Ordered by dependency — no task references work from a later task.
150
174
- Every task has a concrete **Verification** criterion.
151
175
-**Reference reusable components** in task Context when the task should extend or use existing code.
176
+
- Ensure every requirement from the Step 1 checklist is covered by at least one task or explicitly marked out-of-scope.
152
177
153
178
## Step 6: Prompt Developer Review
154
179
@@ -179,6 +204,9 @@ Please review the design and tasks. When ready, run /pb-build <feature-name> to
179
204
6.**Verification per task.** Every task defines how to prove it is done.
180
205
7.**Dependency order.** Phases and tasks flow foundational → dependent.
181
206
8.**Project-aware.** Use existing conventions, patterns, and tech stack. Reuse existing components — do not reinvent.
207
+
9.**Requirements coverage.** Track every requirement from input to design sections and tasks.
208
+
10.**Truthfulness over fluency.** If information is missing, state assumptions explicitly instead of fabricating specifics.
209
+
11.**Deterministic output quality.** Final docs should be implementation-ready, with no template artifacts left behind.
182
210
183
211
---
184
212
@@ -189,6 +217,8 @@ Please review the design and tasks. When ready, run /pb-build <feature-name> to
189
217
-**No code implementation.** Design docs and task lists only.
190
218
-**Scope-appropriate templates.** In lightweight mode, only fill the compact template. In full mode, fill the complete template. Every included section must have substantive content.
191
219
-**Write only to `specs/<spec-dir>/`.** Do not modify project source code.
220
+
-**No invented references.** Do not fabricate file paths, APIs, module names, commands, or dependencies.
221
+
-**No unresolved placeholders.** Final `design.md` and `tasks.md` must not contain template example markers like `[Goal A]` or `[Task Name]`.
192
222
193
223
---
194
224
@@ -202,6 +232,7 @@ Please review the design and tasks. When ready, run /pb-build <feature-name> to
202
232
-**External systems/APIs:** Document assumptions about external interfaces in design.
203
233
-**Borderline word count (~50 words):** Use lightweight mode. Developer can run `/pb-refine` to expand.
204
234
-**Short requirement but complex domain:** If <50 words but clearly complex (e.g., "refactor the entire auth system"), use full mode. Word count is a heuristic, not a hard rule.
235
+
-**Conflicting signals between docs and code:** Trust current codebase state first; document any mismatch in Assumptions or Risks.
Copy file name to clipboardExpand all lines: src/pb_spec/templates/skills/pb-build/SKILL.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,13 @@ You are the **pb-build** agent. Your job is to read a feature's `tasks.md`, then
4
4
5
5
**Trigger:** The user invokes `/pb-build <feature-name>`.
6
6
7
+
**Execution contract:**
8
+
9
+
- Complete unfinished tasks in `tasks.md` sequentially until done or explicitly blocked.
10
+
- Use one fresh subagent per task with minimal, task-relevant context only.
11
+
- Mark a task as done only after verification passes and task-scoped requirements are satisfied.
12
+
- If blocked, fail clearly with exact task ID, failed command, and concrete next options (retry/skip/abort or DCR).
13
+
7
14
---
8
15
9
16
## Workflow
@@ -32,6 +39,8 @@ Read `specs/<spec-dir>/tasks.md`. If the file does not exist, stop and report:
32
39
Run /pb-plan <requirement> first to generate the spec.
33
40
```
34
41
42
+
Never guess `<spec-dir>` from memory. Always resolve from actual directory names under `specs/`.
43
+
35
44
### Step 2: Parse Unfinished Tasks
36
45
37
46
Scan `tasks.md` for all unchecked task items (`- [ ]`). Build an ordered list of tasks preserving their original Phase → Task number order (e.g., Task 1.1, Task 1.2, Task 2.1, …).
@@ -43,6 +52,8 @@ Scan `tasks.md` for all unchecked task items (`- [ ]`). Build an ordered list of
43
52
- If `tasks.md` has malformed structure (missing task headings, inconsistent checkbox format), report the parsing issue to the user and ask them to fix the format before continuing.
44
53
- If a task is marked `⏭️ SKIPPED`, treat it as unfinished but deprioritize — skip it unless the user explicitly requests a retry.
45
54
55
+
For execution reliability, represent the queue as explicit task units: `Task ID`, `Task Name`, `Status`, `Verification`.
56
+
46
57
If all tasks are already checked (`- [x]`), report:
47
58
48
59
```text
@@ -103,6 +114,7 @@ After the subagent succeeds, update `tasks.md`:
103
114
- Change `- [ ]` to `- [x]` for every step in the completed task.
104
115
- Update the task's Status from `🔴 TODO` to `🟢 DONE`.
105
116
-**Use precise editing:** Use `sed`, string-replacement, or line-targeted edits to update the specific `### Task X.Y` block. Do NOT rewrite the entire `tasks.md` file — this risks truncation and content loss in large files.
117
+
-**Completion gate:** Mark done only when task Verification is satisfied and tests are green.
106
118
107
119
> **⚠️ Context Reset:** After completing all tasks (or when context grows large), output: "Recommend starting a fresh session. Run `/pb-build <feature-name>` again to continue from where you left off."
108
120
@@ -116,6 +128,7 @@ If a subagent fails (tests don't pass, implementation blocked, etc.):
116
128
- If the pre-task workspace was clean: restore only the task-local changed tracked files with `git restore --worktree --staged -- <files>` and remove only the new files created by this task.
117
129
- If the pre-task workspace was dirty: **do not run any workspace-wide restore command**. Report file-level cleanup steps and ask the user before reverting anything.
118
130
4.**Report** the failure with details — which task, what went wrong, the specific error output.
131
+
- Include the exact failing command and a short quoted error excerpt.
119
132
5.**Prompt the user** to choose:
120
133
-**Retry** — Spawn a new subagent with fresh context. Pass the previous failure's error message as a "Constraint" hint (e.g., "Previous attempt failed with 'circular import in auth.py'. Avoid importing types directly — use string annotations or TYPE_CHECKING block."). Maximum 2 retries per task.
121
134
-**Skip** — Mark the task as skipped (`⏭️ SKIPPED`) and continue to the next task.
@@ -169,6 +182,8 @@ Next steps:
169
182
- If tasks were skipped, fix and re-run: /pb-build <feature-name>
170
183
```
171
184
185
+
Summary must be factual and command-backed: do not claim "passed" or "completed" without corresponding execution evidence from this run.
186
+
172
187
---
173
188
174
189
## Subagent Assignment Rules
@@ -178,6 +193,7 @@ Next steps:
178
193
3.**Sequential execution.** Tasks are executed strictly in `tasks.md` order. No parallelism.
179
194
4.**Independence.** A subagent must not depend on in-memory state from a previous subagent. All cross-task communication happens through files on disk.
180
195
5.**Grounding first.** Every subagent must verify the workspace state (file paths, existing code) before writing any code. This is enforced by the implementer prompt.
196
+
6.**Verifiable closure.** A task closes only after explicit verification evidence.
181
197
182
198
---
183
199
@@ -218,6 +234,8 @@ While executing, display progress after each task:
218
234
-**NEVER** carry in-memory state between subagents.
219
235
-**NEVER** modify `design.md` — file a Design Change Request instead.
220
236
-**NEVER** rewrite the entire `tasks.md` file — use targeted edits only.
237
+
-**NEVER** mark a task as done without satisfying its Verification criteria.
238
+
-**NEVER** claim tests passed without running them.
221
239
222
240
### ALWAYS
223
241
@@ -229,6 +247,7 @@ While executing, display progress after each task:
229
247
-**ALWAYS** follow YAGNI — implement only what the task requires.
230
248
-**ALWAYS** use existing project patterns and conventions.
231
249
-**ALWAYS** file a Design Change Request if the design is infeasible.
250
+
-**ALWAYS** report command-backed outcomes (what ran, what failed, what passed).
232
251
233
252
---
234
253
@@ -242,6 +261,7 @@ While executing, display progress after each task:
242
261
6.**State lives on disk.**`tasks.md` checkboxes and committed code are the only persistent state.
243
262
7.**Fail fast, recover cleanly.** Failures trigger task-local rollback using the pre-task snapshot. Never run workspace-wide reset commands in a dirty tree.
244
263
8.**Context hygiene.** Only pass relevant, minimal context to subagents. Error logs from failed attempts are summarized as hints, not passed verbatim.
264
+
9.**Evidence over assertion.** Status updates and completion claims must map to actual command output.
0 commit comments