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
Analyzes your project and generates an `AGENTS.md`file at the project root. This file captures the tech stack, directory structure, conventions, and testing patterns. **Preserves user-added context**so manual notes aren't lost on re-runs.
116
+
Audits your project and produces an **extremely minimal**`AGENTS.md` at the project root. Instead of dumping project overview info that agents can discover themselves, it applies a strict three-part filter: each entry must be (1) not inferrable from code, (2) operationally decisive, and (3) not guessable from industry conventions. Every entry in AGENTS.md represents a codebase smell — the goal is to fix root causes and drive AGENTS.md toward zero entries over time. **Preserves user-added context**across re-runs.
@@ -156,14 +157,14 @@ pb-spec's prompt design is inspired by Anthropic's research on [Effective Harnes
156
157
|**Context Hygiene**| Orchestrator passes only minimal, relevant context to each subagent — preventing context window pollution |
157
158
|**Recovery Loop**| Failed tasks trigger `git checkout .` (workspace revert) before retry — ensuring each attempt starts from a known-good state |
158
159
|**Verification Harness**| Design docs define explicit verification commands at planning time — subagents execute, not invent, verification |
159
-
|**Agent Rules**|`AGENTS.md`embeds project-specific "laws of physics" that all subagents inherit as system-level constraints|
160
+
|**Agent Rules**|`AGENTS.md`contains only undiscoverable gotchas and hard constraints — not project overview info that agents can infer from code|
160
161
161
162
### Where Each Principle Lives
162
163
163
164
-**Worker (Implementer):**`implementer_prompt.md` enforces grounding-first workflow and error quoting
164
165
-**Architect (Planner):**`design_template.md` includes Critical Path Verification table
165
166
-**Orchestrator (Builder):**`pb-build` SKILL enforces context hygiene and workspace revert on failure
166
-
-**Foundation (Init):**`AGENTS.md`template includes Agent Harness Rules as global conventions
167
+
-**Foundation (Init):**`AGENTS.md`captures only non-obvious gotchas, hard constraints, and traps that agents cannot infer from code — not a full project overview
Copy file name to clipboardExpand all lines: docs/design.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -101,7 +101,7 @@ Behavior guarantees:
101
101
102
102
### 6.1 pb-init
103
103
104
-
Generates/merges `AGENTS.md` from live repository state. It preserves user-authored sections while refreshing generated sections.
104
+
Audits the repository and produces a **minimal**`AGENTS.md`containing only information that agents cannot discover from the codebase itself. Applies a strict three-part filter: each entry must be (1) not inferrable from code, (2) operationally decisive, and (3) not guessable from industry conventions. The ideal AGENTS.md is empty — every entry represents a codebase smell that should eventually be fixed at the root cause. Re-runs audit existing entries and flag any that are now discoverable.
Copy file name to clipboardExpand all lines: src/pb_spec/templates/prompts/pb-build.prompt.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,12 +61,12 @@ If all tasks are checked (`- [x]`), report:
61
61
For each unfinished task, in order:
62
62
63
63
1.**Extract** the full task block (Context, Steps, Verification).
64
-
2.**Gather context** — read `design.md` and `AGENTS.md`.
64
+
2.**Gather context** — read `design.md` and `AGENTS.md` (if it exists).
65
65
- Record a pre-task workspace snapshot (`git status --porcelain` + tracked/untracked file lists) for safe rollback.
66
66
3.**Spawn a fresh subagent** with the Implementer Prompt (below), filled in with the task content and project context.
67
67
**Context Hygiene:** Do NOT pass the entire chat history. Pass ONLY:
68
68
- The specific Task Description from `tasks.md`.
69
-
- The `AGENTS.md` (Project Rules & Conventions).
69
+
- The `AGENTS.md` (non-obvious gotchas and hard constraints — intentionally minimal).
70
70
- The `design.md` (Feature Spec).
71
71
-**Summary of previous tasks** — a one-line-per-task summary (e.g., "Task 1.1 created `models.py` with `User` class."). Do NOT pass raw logs or full outputs.
72
72
4.**Subagent executes** the TDD cycle (see Implementer Prompt section).
@@ -141,7 +141,7 @@ Summary must be factual and command-backed: do not claim "passed" or "completed"
141
141
## Subagent Rules
142
142
143
143
1.**One subagent per task.** Never combine tasks.
144
-
2.**Fresh context per subagent.** Only: task description, project context (AGENTS.md + design.md), summary of completed tasks, files on disk.
144
+
2.**Fresh context per subagent.** Only: task description, non-obvious constraints (AGENTS.md) + design (design.md), summary of completed tasks, files on disk.
145
145
3.**Sequential execution.** Strict `tasks.md` order. No parallelism.
146
146
4.**Independence.** Cross-task state lives in files, not memory.
147
147
5.**Grounding first.** Every subagent verifies workspace state before writing code.
@@ -230,7 +230,7 @@ You are implementing **Task {{TASK_NUMBER}}: {{TASK_NAME}}**.
230
230
231
231
{{PROJECT_CONTEXT}}
232
232
233
-
> From `AGENTS.md` and `design.md`— tech stack, conventions, design decisions.
233
+
> From `AGENTS.md`(non-obvious gotchas and constraints) and `design.md`(feature design decisions).
234
234
235
235
### Your Job
236
236
@@ -268,7 +268,7 @@ Before writing any code, verify the current workspace state:
268
268
269
269
-[ ] Completeness — everything the task requires is implemented
270
270
-[ ] Nothing extra — no work beyond this task
271
-
-[ ] Conventions — code follows project style from `AGENTS.md`
271
+
-[ ] Conventions — code follows project style (discover from codebase; check `AGENTS.md` for non-obvious constraints)
272
272
-[ ] Test coverage — tests meaningfully verify requirements
Copy file name to clipboardExpand all lines: src/pb_spec/templates/prompts/pb-plan.prompt.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,9 +49,9 @@ Count the words in the requirement description (excluding the `/pb-plan` trigger
49
49
50
50
## Step 2: Collect Project Context
51
51
52
-
Gather context to inform the design. **Do not rely solely on `AGENTS.md`** — always perform live codebase analysis.
52
+
Gather context to inform the design. **Always perform live codebase analysis** — do not rely on any static file.
53
53
54
-
1.**Read `AGENTS.md`** (if it exists) — use as a starting reference. **Treat as supplementary, not authoritative** — verify against actual project state.
54
+
1.**Read `AGENTS.md`** (if it exists) — check for non-obvious gotchas, hard constraints, and traps that you cannot infer from code. AGENTS.md intentionally omits discoverable info (language, structure, test commands) — you must find those yourself.
55
55
2.**Search the live codebase directly** — this is **mandatory** regardless of whether `AGENTS.md` exists:
56
56
- Use grep / file search / semantic search to find modules, directories, and files affected by the requirement.
57
57
- Search for keywords from the requirement across the codebase.
@@ -66,7 +66,7 @@ Gather context to inform the design. **Do not rely solely on `AGENTS.md`** — a
66
66
67
67
**This audit is mandatory.** List reusable components in `design.md` Section 3.3 and reference them in `tasks.md` task context.
68
68
69
-
If `AGENTS.md` does not exist, search the codebase directly for project context. Recommend running `/pb-init`first in your summary.
69
+
If `AGENTS.md` does not exist, that's fine — scan the project root directly (config files, directory structure) to infer project context. You can recommend running `/pb-init`to surface any hidden gotchas, but its absence should not block planning.
70
70
71
71
**Evidence precedence (highest to lowest):**
72
72
@@ -200,7 +200,7 @@ Please review the design and tasks. When ready, run /pb-build <feature-name> to
200
200
1.**One-shot output.** Complete design + tasks in a single pass. No mid-way confirmation.
201
201
2.**Optimal solution first.** Output the best design. Developer requests changes after review if needed.
202
202
3.**Right-sized output (YAGNI).** Match output detail to requirement complexity. Simple changes get compact specs; complex features get full specs.
203
-
4.**Live codebase analysis.** Always search the actual codebase — never rely solely on `AGENTS.md`which may be stale.
203
+
4.**Live codebase analysis.** Always search the actual codebase — `AGENTS.md`contains only non-obvious gotchas, not project overview info.
204
204
5.**Task granularity: Logical Unit of Work.** Each task is a self-contained, meaningful change. Do not split based on arbitrary time estimates.
205
205
6.**Verification per task.** Every task defines how to prove it is done.
206
206
7.**Dependency order.** Phases and tasks flow foundational → dependent.
@@ -228,7 +228,7 @@ Please review the design and tasks. When ready, run /pb-build <feature-name> to
228
228
-**Ambiguous requirements:** Make reasonable assumptions. State them in the design's Assumptions section.
229
229
-**Large scope (>40h of tasks):** Split into phases. First phase = viable MVP. Note in summary.
230
230
-**Same feature-name exists:** The uniqueness check in Step 3 prevents creating a spec with a feature-name that already exists in `specs/`. Stop and report the conflict. The developer should choose a different name or use `/pb-refine` to update the existing spec.
Copy file name to clipboardExpand all lines: src/pb_spec/templates/skills/pb-build/SKILL.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,7 @@ Extract the full task block from `tasks.md` — including Context, Steps, and Ve
71
71
#### 3b. Gather Project Context
72
72
73
73
- Read `specs/<spec-dir>/design.md` for design context.
74
-
- Read `AGENTS.md` (if it exists) for project conventions.
74
+
- Read `AGENTS.md` (if it exists) for non-obvious gotchas and hard constraints.
75
75
- Identify files most relevant to this task.
76
76
- Record a pre-task workspace snapshot (`git status --porcelain` + tracked/untracked file lists). This baseline is used for safe recovery if the task fails.
77
77
@@ -80,14 +80,14 @@ Extract the full task block from `tasks.md` — including Context, Steps, and Ve
80
80
Create a **fresh subagent** for this task. Pass it the implementer prompt template from `references/implementer_prompt.md`, filled with:
81
81
82
82
- The full task description from `tasks.md`.
83
-
-Project context from `AGENTS.md` and `design.md`.
83
+
-Non-obvious constraints from `AGENTS.md` and design context from`design.md`.
84
84
- The task number and name.
85
85
86
86
**Context Hygiene (Critical):**
87
87
When spawning the subagent, do NOT pass the entire chat history. Pass ONLY:
88
88
89
89
1. The specific Task Description from `tasks.md`.
90
-
2. The `AGENTS.md` (Project Rules & Conventions).
90
+
2. The `AGENTS.md` (non-obvious gotchas and hard constraints — intentionally minimal).
91
91
3. The `design.md` (Feature Spec).
92
92
4.**Summary of previous tasks** — a one-line-per-task summary of what was done (e.g., "Task 1.1 created `models.py` with `User` and `Session` classes which you should now use."). Do NOT pass raw logs or full outputs from previous subagents.
Copy file name to clipboardExpand all lines: src/pb_spec/templates/skills/pb-build/references/implementer_prompt.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ You are implementing **Task {{TASK_NUMBER}}: {{TASK_NAME}}**.
16
16
17
17
{{PROJECT_CONTEXT}}
18
18
19
-
> The above is assembled from `AGENTS.md` (project conventions) and `design.md` (feature design). Use it to understand the tech stack, coding style, project structure, and design decisions.
19
+
> The above is assembled from `AGENTS.md` (non-obvious gotchas and hard constraints) and `design.md` (feature design). AGENTS.md is intentionally minimal — discover tech stack, structure, and conventions directly from the codebase.
20
20
21
21
---
22
22
@@ -104,7 +104,7 @@ Before submitting, answer each question honestly:
104
104
105
105
-[ ]**Completeness:** Did I implement everything the task requires?
106
106
-[ ]**Nothing extra:** Did I avoid implementing things not in this task?
107
-
-[ ]**Conventions:** Does the code follow project conventions from `AGENTS.md`?
107
+
-[ ]**Conventions:** Does the code follow project conventions (discovered from codebase; `AGENTS.md` for non-obvious constraints)?
108
108
-[ ]**Test coverage:** Do the tests meaningfully verify the task's requirements?
109
109
-[ ]**No regressions:** Do all pre-existing tests still pass?
110
110
-[ ]**YAGNI:** Is there any over-engineering I should remove?
Copy file name to clipboardExpand all lines: src/pb_spec/templates/skills/pb-plan/SKILL.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,9 +53,9 @@ Count the words in the requirement description (excluding the `/pb-plan` trigger
53
53
54
54
### Step 2: Collect Project Context
55
55
56
-
Gather context to inform the design. **Do not rely solely on `AGENTS.md`** — always perform live codebase analysis.
56
+
Gather context to inform the design. **Always perform live codebase analysis** — do not rely on any static file.
57
57
58
-
1.**Read `AGENTS.md`** (if it exists at project root) — use as a starting reference for language, framework, build tool, project structure, and conventions. **Treat as supplementary, not authoritative** — verify against actual project state.
58
+
1.**Read `AGENTS.md`** (if it exists at project root) — check for non-obvious gotchas, hard constraints, and traps that you cannot infer from code. AGENTS.md intentionally omits discoverable info (language, structure, test commands) — you must find those yourself.
59
59
2.**Search the live codebase directly** — this is **mandatory** regardless of whether `AGENTS.md` exists:
60
60
- Use grep / file search / semantic search to find modules, directories, and files affected by the requirement.
61
61
- Search for keywords from the requirement across the codebase (function names, class names, module names, config keys).
@@ -70,7 +70,7 @@ Gather context to inform the design. **Do not rely solely on `AGENTS.md`** — a
70
70
71
71
**This audit is mandatory.** List reusable components in `design.md` Section 3.3 and reference them in `tasks.md` task context.
72
72
73
-
If `AGENTS.md` does not exist, scan the project root directly (config files, directory structure) to infer project context. Recommend running `/pb-init`first in your summary.
73
+
If `AGENTS.md` does not exist, that's fine — scan the project root directly (config files, directory structure) to infer project context. You can recommend running `/pb-init`to surface any hidden gotchas, but its absence should not block planning.
0 commit comments