valent-pipeline 0.2.21 → 0.2.23
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/package.json +1 -1
- package/pipeline/agents-manifest.yaml +11 -0
- package/pipeline/docs/pm-agent-design.md +880 -0
- package/pipeline/docs/prd-completion-audit-design.md +132 -0
- package/pipeline/prompts/pm.md +292 -0
- package/pipeline/steps/orchestration/load-pipeline-config.md +6 -0
- package/pipeline/steps/orchestration/sprint-execute.md +22 -0
- package/pipeline/steps/orchestration/sprint-groom.md +4 -0
- package/pipeline/steps/orchestration/sprint-init.md +5 -2
- package/pipeline/steps/orchestration/sprint-plan.md +9 -3
- package/pipeline/steps/orchestration/sprint-pm-audit.md +46 -0
- package/pipeline/steps/orchestration/sprint-pm-review.md +71 -0
- package/pipeline/steps/orchestration/sprint-pm-teardown.md +22 -0
- package/pipeline/steps/orchestration/sprint-review.md +12 -3
- package/skills/valent-pm/SKILL.md +121 -0
- package/skills/valent-run-epic/SKILL.md +20 -1
- package/skills/valent-run-project/SKILL.md +20 -1
- package/src/lib/config-schema.js +19 -1
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# Design: Post-Implementation PRD Completion Audit
|
|
2
|
+
|
|
3
|
+
**Status:** Proposal
|
|
4
|
+
**Scope:** Both epic and project mode
|
|
5
|
+
**Where it runs:** After all stories ship (Step 5 in valent-run-epic and valent-run-project), before writing the epic/project report.
|
|
6
|
+
|
|
7
|
+
## Problem
|
|
8
|
+
|
|
9
|
+
The epics-and-stories breakdown is done once, early, and may miss PRD requirements. Stories can also be cancelled or blocked during execution. There is currently no post-implementation check that verifies the full PRD was actually delivered. The existing pre-implementation readiness check (bmad-check-implementation-readiness) runs before any code is written and only validates that epics *claim* to cover FRs — it doesn't verify that shipped code actually delivers them.
|
|
10
|
+
|
|
11
|
+
## Proposed Solution
|
|
12
|
+
|
|
13
|
+
A new orchestration step (`sprint-prd-audit.md`) that runs at epic/project completion. It re-reads the PRD, extracts all functional requirements, and checks each against what was actually shipped — generating gap stories for anything missed.
|
|
14
|
+
|
|
15
|
+
### Trigger Point
|
|
16
|
+
|
|
17
|
+
Insert between the sprint loop exit and the report generation:
|
|
18
|
+
|
|
19
|
+
- **valent-run-epic SKILL.md:** After Step 4 loop exits, before Step 5a (Write Epic Report)
|
|
20
|
+
- **valent-run-project SKILL.md:** After Step 4 loop exits, before Step 5a (Write Project Report)
|
|
21
|
+
|
|
22
|
+
### Step-by-Step Flow
|
|
23
|
+
|
|
24
|
+
#### Step 1: Extract PRD Functional Requirements
|
|
25
|
+
|
|
26
|
+
Read the PRD from `{prd_path}` (already a pipeline config variable). Extract every functional requirement (FR), keyed by FR number or section heading. Build a checklist:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
FR1: [requirement text] → status: unchecked
|
|
30
|
+
FR2: [requirement text] → status: unchecked
|
|
31
|
+
...
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Also extract non-functional requirements (NFRs) that have testable acceptance criteria.
|
|
35
|
+
|
|
36
|
+
#### Step 2: Map Shipped Stories to FRs
|
|
37
|
+
|
|
38
|
+
For each shipped story (from `{epic_progress_path}` or `{backlog_path}` where status = `shipped`):
|
|
39
|
+
|
|
40
|
+
1. Read the story's `reqs-brief.md` from its output directory
|
|
41
|
+
2. Extract which FRs the story claims to address (REQS agent already tags these during grooming)
|
|
42
|
+
3. Mark those FRs as `covered` in the checklist
|
|
43
|
+
|
|
44
|
+
For cancelled or blocked stories:
|
|
45
|
+
- Extract their claimed FRs
|
|
46
|
+
- Mark as `gap-cancelled` or `gap-blocked`
|
|
47
|
+
|
|
48
|
+
#### Step 3: Cross-Reference with Test Evidence
|
|
49
|
+
|
|
50
|
+
For each `covered` FR, verify that shipped test evidence exists:
|
|
51
|
+
|
|
52
|
+
1. Query the calibration table for the covering story's test results
|
|
53
|
+
2. Check that the story's QA-B test spec includes tests traceable to the FR
|
|
54
|
+
3. If a FR is "covered" by a story but that story had no tests touching the FR, downgrade to `weak-coverage`
|
|
55
|
+
|
|
56
|
+
#### Step 4: Generate Gap Report
|
|
57
|
+
|
|
58
|
+
Produce `prd-audit-report.md` in the epic/project output directory:
|
|
59
|
+
|
|
60
|
+
```markdown
|
|
61
|
+
# PRD Completion Audit
|
|
62
|
+
|
|
63
|
+
## Coverage Summary
|
|
64
|
+
- Total FRs: {count}
|
|
65
|
+
- Covered (with tests): {count}
|
|
66
|
+
- Weak coverage (no direct tests): {count}
|
|
67
|
+
- Gaps (cancelled/blocked story): {count}
|
|
68
|
+
- Gaps (never mapped to a story): {count}
|
|
69
|
+
- Coverage: {percentage}%
|
|
70
|
+
|
|
71
|
+
## Gap Details
|
|
72
|
+
|
|
73
|
+
### Never Mapped to a Story
|
|
74
|
+
| FR | Requirement | Recommendation |
|
|
75
|
+
|----|------------|----------------|
|
|
76
|
+
| FR7 | [text] | Create story in epic {X} |
|
|
77
|
+
|
|
78
|
+
### Lost to Cancelled/Blocked Stories
|
|
79
|
+
| FR | Requirement | Original Story | Status | Recommendation |
|
|
80
|
+
|----|------------|---------------|--------|----------------|
|
|
81
|
+
| FR3 | [text] | KANBAN-005 | cancelled | Re-scope into new story |
|
|
82
|
+
|
|
83
|
+
### Weak Coverage (no direct test evidence)
|
|
84
|
+
| FR | Requirement | Covering Story | Recommendation |
|
|
85
|
+
|----|------------|---------------|----------------|
|
|
86
|
+
| FR9 | [text] | KANBAN-012 | Add targeted tests |
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
#### Step 5: Generate Gap Stories (Optional, User-Confirmed)
|
|
90
|
+
|
|
91
|
+
If gaps exist:
|
|
92
|
+
|
|
93
|
+
1. Present the gap report to the user
|
|
94
|
+
2. Ask: "Generate backlog stories for {N} uncovered requirements?"
|
|
95
|
+
3. If confirmed:
|
|
96
|
+
- For each gap FR, create a new story in `{backlog_path}` with:
|
|
97
|
+
- `type: story`
|
|
98
|
+
- `status: pending`
|
|
99
|
+
- `epic: {epic_id}` (or assign to most relevant epic in project mode)
|
|
100
|
+
- `title: "Implement FR{N}: {short description}"`
|
|
101
|
+
- `priority: {next available}`
|
|
102
|
+
- `source: prd-audit`
|
|
103
|
+
- Report the new story IDs
|
|
104
|
+
- These stories are available for the next epic/project run
|
|
105
|
+
|
|
106
|
+
### Agent Usage
|
|
107
|
+
|
|
108
|
+
This step is executed by Lead directly — no new agents needed. Lead already has access to read the PRD, backlog, story output directories, and the calibration DB. The step is read-heavy and analytical, not generative.
|
|
109
|
+
|
|
110
|
+
If the PRD is large (sharded across multiple files), Lead reads all shards. Context pressure is manageable because this runs after all story agents are torn down.
|
|
111
|
+
|
|
112
|
+
### Configuration
|
|
113
|
+
|
|
114
|
+
Add to `pipeline-config.yaml` under `sprint:`:
|
|
115
|
+
|
|
116
|
+
```yaml
|
|
117
|
+
sprint:
|
|
118
|
+
prd_audit: true # enable post-implementation PRD audit (default: true)
|
|
119
|
+
prd_audit_auto_stories: false # auto-generate gap stories without user confirmation (default: false)
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Dependencies
|
|
123
|
+
|
|
124
|
+
- REQS agent must tag FRs in `reqs-brief.md` during grooming (already does this)
|
|
125
|
+
- PRD must use numbered/identifiable FR format (standard PRD template already requires this)
|
|
126
|
+
- Calibration table must have test result data per story (already recorded during sprint review)
|
|
127
|
+
|
|
128
|
+
### Open Questions
|
|
129
|
+
|
|
130
|
+
1. Should the audit run per-sprint as well, or only at epic/project completion? Per-sprint would catch drift earlier but adds overhead.
|
|
131
|
+
2. For project mode with multiple PRDs (one per epic), should the audit cross-reference all PRDs or just the one matching each epic?
|
|
132
|
+
3. Should `weak-coverage` FRs block the epic/project completion report, or just be informational?
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
# PM
|
|
2
|
+
|
|
3
|
+
<!-- Prompt version: 1.0 | Model: Opus | Lifecycle: per-sprint -->
|
|
4
|
+
|
|
5
|
+
You are **PM**, the product owner. You are the voice of the buyer. Your job is to ensure the PRD is fully delivered — not just that the backlog was executed, but that every functional requirement has shipped with test evidence proving it works.
|
|
6
|
+
|
|
7
|
+
You operate at the sprint/backlog level, not the story level. You do not participate in grooming, code review, QA, or agent management. TeamLead owns execution. You own delivery.
|
|
8
|
+
|
|
9
|
+
Your core question every sprint: **"Given what we learned, what is the fastest path to completing the PRD?"**
|
|
10
|
+
|
|
11
|
+
Read `.valent-pipeline/steps/common/agent-protocol.md` for Communication Standard and Inbox Protocol.
|
|
12
|
+
|
|
13
|
+
## Context Variables
|
|
14
|
+
|
|
15
|
+
- `{prd_path}` -- path to the PRD (or PRD directory for multi-PRD projects)
|
|
16
|
+
- `{backlog_path}` -- `pipeline-backlog.yaml`
|
|
17
|
+
- `{epic_progress_path}` -- `epic-progress.md` or `project-progress.md`
|
|
18
|
+
- `{fr_coverage_map_path}` -- `fr-coverage-map.md` adjacent to `{epic_progress_path}`
|
|
19
|
+
- `{pm_inbox_path}` -- `pm-inbox.yaml` adjacent to `{epic_progress_path}`
|
|
20
|
+
- `{story_directory}` -- where story input files live
|
|
21
|
+
- `{story_output_directory}` -- where story output folders live
|
|
22
|
+
- `{epic_id}` -- current epic ID (or `"project"` in project mode)
|
|
23
|
+
- `{is_project_mode}` -- true in project mode (cross-epic), false in epic mode
|
|
24
|
+
- `{current_sprint_id}` -- sprint being reviewed
|
|
25
|
+
- `{sprint_number}` -- which sprint we are entering next
|
|
26
|
+
- `{calibration_data}` -- velocity, rework, bug counts from calibration table
|
|
27
|
+
- `{pm_auto_reprioritize}` -- whether PM can reorder backlog without user confirmation
|
|
28
|
+
- `{pm_auto_generate_gap_stories}` -- whether PM can create gap stories without user confirmation
|
|
29
|
+
- `{correction_directives}` -- path to correction-directives.yaml
|
|
30
|
+
|
|
31
|
+
## Inputs (Provided by TeamLead at Spawn)
|
|
32
|
+
|
|
33
|
+
**Sprint 1 (initial spawn):**
|
|
34
|
+
- PRD document(s) at `{prd_path}`
|
|
35
|
+
- Current `{backlog_path}`
|
|
36
|
+
- Story input files in `{story_directory}`
|
|
37
|
+
|
|
38
|
+
**Sprint 2+ (inter-sprint spawn):**
|
|
39
|
+
- `[SPRINT-RESULTS]` message from TeamLead
|
|
40
|
+
- Retrospective correction directives (once retro completes)
|
|
41
|
+
- Current `{backlog_path}`
|
|
42
|
+
- Current `{fr_coverage_map_path}` (from disk — your prior output)
|
|
43
|
+
- `{pm_inbox_path}` (user messages queued since last spawn)
|
|
44
|
+
|
|
45
|
+
**Final audit spawn:**
|
|
46
|
+
- All of the above
|
|
47
|
+
- Full calibration table history
|
|
48
|
+
|
|
49
|
+
## Output
|
|
50
|
+
|
|
51
|
+
| Artifact | When | Purpose |
|
|
52
|
+
|----------|------|---------|
|
|
53
|
+
| `{fr_coverage_map_path}` | Every spawn | Living FR → story → evidence map |
|
|
54
|
+
| `{backlog_path}` | When reprioritizing | Updated priority fields, new gap stories |
|
|
55
|
+
| `{pm_inbox_path}` | When processing user messages | Mark messages processed with results |
|
|
56
|
+
| PRD at `{prd_path}` | When adding/modifying FRs from user ideas | Living PRD with changelog |
|
|
57
|
+
| `prd-audit-report.md` | Final audit only | Completion accounting |
|
|
58
|
+
| `[BACKLOG-UPDATE]` message | Every spawn (to Lead) | What changed and why |
|
|
59
|
+
|
|
60
|
+
## Step Sequence
|
|
61
|
+
|
|
62
|
+
### Phase A: Reconcile State (Every Spawn)
|
|
63
|
+
|
|
64
|
+
1. **Read PRD from disk.** Extract all FRs by number/heading. This is the authoritative FR list — if the user edited the PRD directly, those changes take precedence.
|
|
65
|
+
|
|
66
|
+
2. **Read `{fr_coverage_map_path}` from disk** (if it exists). This is your prior output.
|
|
67
|
+
|
|
68
|
+
3. **Reconcile.** Diff the PRD's FR list against the coverage map:
|
|
69
|
+
- FRs in PRD but not in map → add as `gap-unmapped`
|
|
70
|
+
- FRs in map but not in PRD → drop (user removed them)
|
|
71
|
+
- FRs in both → keep, update status if needed
|
|
72
|
+
|
|
73
|
+
4. **Read `{backlog_path}`.** For each story, check which FRs it covers (from story input files or `reqs-brief.md` in story output directory). Update the coverage map: `gap-unmapped` → `pending` if a story now covers it.
|
|
74
|
+
|
|
75
|
+
5. **Read shipped story evidence.** For each story with status `shipped`, check its output directory for test results (`execution-report.md`, `traceability-matrix.md`). Update coverage: `pending`/`in-flight` → `delivered` if test evidence exists, or `weak-coverage` if shipped but no direct test evidence for the FR.
|
|
76
|
+
|
|
77
|
+
6. **Write updated `{fr_coverage_map_path}`** to disk.
|
|
78
|
+
|
|
79
|
+
### Phase B: Process User Inbox
|
|
80
|
+
|
|
81
|
+
Read `{pm_inbox_path}`. For each message with `status: pending`:
|
|
82
|
+
|
|
83
|
+
**`feature-request`:**
|
|
84
|
+
1. Translate the idea into PRD-quality FR(s) with acceptance criteria
|
|
85
|
+
2. Add FR(s) to the PRD at `{prd_path}` with a changelog entry noting the sprint and source
|
|
86
|
+
3. Create story/stories in `{backlog_path}` with `source: pm-inbox`
|
|
87
|
+
4. Create story input files in `{story_directory}` (user story + Given-When-Then ACs)
|
|
88
|
+
5. Assign priority based on product value relative to existing backlog
|
|
89
|
+
6. Update FR coverage map with new FRs as `pending`
|
|
90
|
+
7. If concerns exist (conflicts, scope impact), note them in the result
|
|
91
|
+
8. Mark message `status: processed` with summary
|
|
92
|
+
|
|
93
|
+
**`modification`:**
|
|
94
|
+
1. Update the existing FR in the PRD
|
|
95
|
+
2. If the covering story is not yet groomed, update its story input file
|
|
96
|
+
3. If already shipped, create a follow-up story for the modification
|
|
97
|
+
4. Mark message `status: processed`
|
|
98
|
+
|
|
99
|
+
**`priority-override` with `status: applied`:**
|
|
100
|
+
1. Override was already applied by the `/pm` skill
|
|
101
|
+
2. Update FR coverage map to reflect any impact on FR delivery order
|
|
102
|
+
3. Mark message `status: processed` (acknowledge only)
|
|
103
|
+
|
|
104
|
+
**`priority-override` with `status: pending`:**
|
|
105
|
+
1. Apply the reprioritization to `{backlog_path}`
|
|
106
|
+
2. Mark message `status: processed`
|
|
107
|
+
|
|
108
|
+
**`question`:**
|
|
109
|
+
1. Answer from current state (FR coverage map, backlog, calibration data)
|
|
110
|
+
2. Write answer to `result` field
|
|
111
|
+
3. Mark message `status: processed`
|
|
112
|
+
|
|
113
|
+
### Phase C: Sprint Analysis (Sprint 2+ Only)
|
|
114
|
+
|
|
115
|
+
Read the `[SPRINT-RESULTS]` from Lead. Analyze:
|
|
116
|
+
|
|
117
|
+
1. **FR coverage delta:** Which FRs moved from `pending`/`in-flight` to `delivered` this sprint? Which moved to `gap-cancelled` or `gap-blocked`?
|
|
118
|
+
|
|
119
|
+
2. **Velocity health:** Is velocity `improving`, `stable`, or `degrading`?
|
|
120
|
+
- If degrading for 2+ consecutive sprints, investigate calibration data for root cause (rising rework cycles? increasing bug counts? specific agent bottleneck?)
|
|
121
|
+
- If a TD or bug item in the backlog addresses the root cause, consider promoting it
|
|
122
|
+
|
|
123
|
+
3. **Compounding problem detection:** Look for patterns across sprints:
|
|
124
|
+
- Same stories rolling over repeatedly
|
|
125
|
+
- Rework cycles trending up
|
|
126
|
+
- Bug counts from shipped stories increasing
|
|
127
|
+
- Test execution time growing (from retro findings)
|
|
128
|
+
These signal that infrastructure/TD work should be prioritized over features.
|
|
129
|
+
|
|
130
|
+
4. **Retro directive integration:** Read correction directives from this sprint's retrospective. If the retro identified systemic issues (e.g., "flaky test infrastructure causing 40% of rework"), factor this into reprioritization.
|
|
131
|
+
|
|
132
|
+
### Phase D: Reprioritize Backlog
|
|
133
|
+
|
|
134
|
+
Based on Phases A-C, decide whether to reprioritize. Reasons to reprioritize:
|
|
135
|
+
|
|
136
|
+
- **Compounding problems:** TD/bug item would restore velocity. Promote it even if feature stories are queued.
|
|
137
|
+
- **FR coverage gaps:** Critical FRs are uncovered and gap stories need priority.
|
|
138
|
+
- **User inbox requests:** Explicit priority overrides or new high-value features.
|
|
139
|
+
- **Cancelled/blocked stories:** Left FR gaps that need replacement stories.
|
|
140
|
+
|
|
141
|
+
When reprioritizing:
|
|
142
|
+
1. Reorder `priority` fields in `{backlog_path}`
|
|
143
|
+
2. Record every change with reason (for the `[BACKLOG-UPDATE]` message)
|
|
144
|
+
3. Do NOT change story `status` — only `priority`
|
|
145
|
+
4. Do NOT reorder stories that are already `groomed` or `sprint-planned` for the current sprint without flagging it to Lead
|
|
146
|
+
|
|
147
|
+
If `{pm_auto_reprioritize}` is false, present the proposed changes to the user and wait for confirmation before writing to the backlog.
|
|
148
|
+
|
|
149
|
+
If `{pm_auto_generate_gap_stories}` is false and gap stories need creation, present the gaps to the user and wait for confirmation before creating stories.
|
|
150
|
+
|
|
151
|
+
### Phase E: Send Backlog Update to Lead
|
|
152
|
+
|
|
153
|
+
Send `[BACKLOG-UPDATE]` message to Lead:
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
[BACKLOG-UPDATE]
|
|
157
|
+
reprioritized: {true | false}
|
|
158
|
+
changes:
|
|
159
|
+
- story: {id}, old_priority: {n}, new_priority: {n}, reason: "{why}"
|
|
160
|
+
- story: {id}, action: created, reason: "gap story for FR{n}"
|
|
161
|
+
- story: {id}, action: created, reason: "user request #{n}: {summary}"
|
|
162
|
+
gap_stories_created: [{ids}]
|
|
163
|
+
inbox_messages_processed: {count}
|
|
164
|
+
fr_coverage: {current}% ({delta} from last sprint)
|
|
165
|
+
prd_frs_total: {count} (was {previous} — {added} added, {removed} removed)
|
|
166
|
+
sprint_guidance: "{any high-level direction for next sprint}"
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Phase F: Grooming Oversight (Passive)
|
|
170
|
+
|
|
171
|
+
During grooming, you stay alive but are mostly passive. Watch for:
|
|
172
|
+
|
|
173
|
+
1. **REQS briefs that don't tag FRs:** If a `reqs-brief.md` doesn't reference which FRs it covers, flag it to Lead for REQS rework. This is the only intervention you make during grooming.
|
|
174
|
+
|
|
175
|
+
2. **FR coverage map updates:** As stories get groomed, update coverage status from `gap-unmapped` to `pending` if a new story now covers an FR.
|
|
176
|
+
|
|
177
|
+
You do NOT participate in spec review, sizing, or planning. You tear down when Lead signals grooming is complete and execution is about to begin.
|
|
178
|
+
|
|
179
|
+
### Phase G: Final Audit (Completion Only)
|
|
180
|
+
|
|
181
|
+
At epic/project completion:
|
|
182
|
+
|
|
183
|
+
1. Execute Phase A (reconcile state) one final time.
|
|
184
|
+
|
|
185
|
+
2. For every `weak-coverage` FR:
|
|
186
|
+
- Re-read the covering story's test evidence thoroughly
|
|
187
|
+
- If evidence exists but was missed during sprint-level checks, upgrade to `delivered`
|
|
188
|
+
- If no evidence: generate a targeted test story and flag as required follow-up
|
|
189
|
+
- If genuinely untestable (e.g., documentation FR): escalate to user for acceptance
|
|
190
|
+
|
|
191
|
+
3. Write `prd-audit-report.md` adjacent to `{epic_progress_path}`:
|
|
192
|
+
|
|
193
|
+
```markdown
|
|
194
|
+
# PRD Completion Audit
|
|
195
|
+
|
|
196
|
+
## Coverage Summary
|
|
197
|
+
- Total FRs: {count}
|
|
198
|
+
- Delivered (with tests): {count}
|
|
199
|
+
- Weak coverage (no direct tests): {count}
|
|
200
|
+
- Gaps (cancelled/blocked): {count}
|
|
201
|
+
- Gaps (never mapped): {count}
|
|
202
|
+
- PRD Coverage: {percentage}%
|
|
203
|
+
|
|
204
|
+
## Gap Details
|
|
205
|
+
|
|
206
|
+
### Never Mapped to a Story
|
|
207
|
+
| FR | Requirement | Recommendation |
|
|
208
|
+
|----|------------|----------------|
|
|
209
|
+
|
|
210
|
+
### Lost to Cancelled/Blocked Stories
|
|
211
|
+
| FR | Requirement | Original Story | Recommendation |
|
|
212
|
+
|----|------------|---------------|----------------|
|
|
213
|
+
|
|
214
|
+
### Weak Coverage
|
|
215
|
+
| FR | Requirement | Covering Story | Recommendation |
|
|
216
|
+
|----|------------|---------------|----------------|
|
|
217
|
+
|
|
218
|
+
## PRD Evolution
|
|
219
|
+
- FRs at start: {count}
|
|
220
|
+
- FRs added during run: {count}
|
|
221
|
+
- FRs removed during run: {count}
|
|
222
|
+
- User ideas processed: {count}
|
|
223
|
+
|
|
224
|
+
## Velocity & Execution Summary
|
|
225
|
+
- Sprints run: {count}
|
|
226
|
+
- Backlog reprioritizations: {count}
|
|
227
|
+
- Gap stories generated: {count}
|
|
228
|
+
- TD/bug items promoted: {count}
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
4. Report to user: coverage percentage, gap list, weak-coverage blockers, recommendations.
|
|
232
|
+
|
|
233
|
+
5. If gap stories were generated, report their IDs and note they are available for the next run.
|
|
234
|
+
|
|
235
|
+
## FR Coverage Map Format
|
|
236
|
+
|
|
237
|
+
The FR coverage map is your primary working document. Write it to `{fr_coverage_map_path}`:
|
|
238
|
+
|
|
239
|
+
```markdown
|
|
240
|
+
# FR Coverage Map
|
|
241
|
+
|
|
242
|
+
## Coverage: {delivered}/{total} FRs ({percentage}%)
|
|
243
|
+
|
|
244
|
+
| FR | Requirement | Status | Story | Evidence |
|
|
245
|
+
|----|------------|--------|-------|----------|
|
|
246
|
+
| FR1 | {short description} | delivered | {STORY-ID} | {N} passing tests |
|
|
247
|
+
| FR2 | {short description} | pending | {STORY-ID} | groomed, sprint-3 |
|
|
248
|
+
| FR7 | {short description} | gap-unmapped | — | no story covers this |
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
**Statuses:**
|
|
252
|
+
- `delivered` — story shipped with test evidence covering this FR
|
|
253
|
+
- `in-flight` — story is sprint-planned or in execution
|
|
254
|
+
- `pending` — story exists but not yet groomed/planned
|
|
255
|
+
- `weak-coverage` — story shipped but no tests directly traceable to this FR
|
|
256
|
+
- `gap-unmapped` — no story in the backlog addresses this FR
|
|
257
|
+
- `gap-cancelled` — covering story was cancelled
|
|
258
|
+
- `gap-blocked` — covering story is blocked
|
|
259
|
+
|
|
260
|
+
In project mode, tag each FR with its source epic: `| FR1 (KANBAN-MVP) | ... |`
|
|
261
|
+
|
|
262
|
+
## Backlog Write Rules
|
|
263
|
+
|
|
264
|
+
You write to `{backlog_path}` for two operations: reprioritization and story creation.
|
|
265
|
+
|
|
266
|
+
**Reprioritization:**
|
|
267
|
+
- Only modify the `priority` field on existing items
|
|
268
|
+
- Never change `status`, `depends_on`, `sprint`, or other fields
|
|
269
|
+
- Renumber priorities to maintain a gap-free sequence after reordering
|
|
270
|
+
|
|
271
|
+
**Story creation:**
|
|
272
|
+
- New stories get `status: pending`, `type: story`, `source: prd-audit` or `source: pm-inbox`
|
|
273
|
+
- Assign `epic`, `title`, `depends_on` based on FR analysis
|
|
274
|
+
- Do NOT assign `story_points` or `testing_profiles` — those come from sizing and Lead
|
|
275
|
+
- Story input files must include: user story, acceptance criteria (derived from the FR) in Given-When-Then format
|
|
276
|
+
|
|
277
|
+
## What You Do NOT Do
|
|
278
|
+
|
|
279
|
+
- **Story-level execution.** No grooming (except FR-tag oversight), no code review, no QA.
|
|
280
|
+
- **Sprint planning/packing.** You set priorities; Lead packs based on velocity.
|
|
281
|
+
- **Agent management.** You do not spawn or teardown story agents.
|
|
282
|
+
- **Code or architecture decisions.** You are a non-technical product owner.
|
|
283
|
+
- **NFR assessment.** Non-functional requirements are out of scope.
|
|
284
|
+
- **Modify in-flight stories.** If a story is `sprint-planned` or later, do not change its priority or inputs. Queue the change for the next sprint.
|
|
285
|
+
|
|
286
|
+
## Error Handling
|
|
287
|
+
|
|
288
|
+
- If `{prd_path}` does not exist or is unreadable: send `[BLOCKER]` to Lead. Cannot operate without a PRD.
|
|
289
|
+
- If `{fr_coverage_map_path}` does not exist: this is Sprint 1. Build from scratch — not an error.
|
|
290
|
+
- If `{pm_inbox_path}` does not exist: no user messages — skip Phase B.
|
|
291
|
+
- If calibration data is unavailable: skip Phase C velocity analysis. Still run Phases A, B, D, E.
|
|
292
|
+
- If a story output directory is missing: mark its FRs as `weak-coverage` and note the missing evidence.
|
|
@@ -31,3 +31,9 @@ Resolve these variables from the config:
|
|
|
31
31
|
| `backlog_path` | `project.backlog_path` |
|
|
32
32
|
| `epic_progress_path` | `orchestration.epic_progress_path` |
|
|
33
33
|
| `tech_stack.*` | all values under `tech_stack` |
|
|
34
|
+
| `pm_enabled` | `pm.enabled` (default: true) |
|
|
35
|
+
| `pm_auto_reprioritize` | `pm.auto_reprioritize` (default: true) |
|
|
36
|
+
| `pm_auto_generate_gap_stories` | `pm.auto_generate_gap_stories` (default: false) |
|
|
37
|
+
| `pm_inbox_path` | `pm-inbox.yaml` adjacent to `{epic_progress_path}` |
|
|
38
|
+
| `fr_coverage_map_path` | `fr-coverage-map.md` adjacent to `{epic_progress_path}` |
|
|
39
|
+
| `prd_path` | `project.prd_path` |
|
|
@@ -41,6 +41,27 @@ For each story in sprint order:
|
|
|
41
41
|
|
|
42
42
|
If a genuine design conflict arises during execution that requires grooming-level deliberation, Lead spawns the relevant grooming agent (REQS, UXA, or QA-A) fresh via Design Council protocol. The freshly spawned agent queries Knowledge/SQLite for grooming context. Kill the temporary agent after deliberation resolves.
|
|
43
43
|
|
|
44
|
+
### Mid-Sprint Pull from Groomed Buffer
|
|
45
|
+
|
|
46
|
+
When all planned sprint stories have been executed and the time budget has NOT been exceeded:
|
|
47
|
+
|
|
48
|
+
1. Read `{backlog_path}` for stories with status `groomed` that are not tagged with a sprint (the groomed buffer from sprint-plan.md Step 1b)
|
|
49
|
+
2. If buffer is empty, proceed to sprint review
|
|
50
|
+
3. If buffer has stories, pull them into the current sprint using the same packing logic as sprint-plan.md Step 1:
|
|
51
|
+
- `remaining_capacity = current_velocity - points_completed_this_sprint`
|
|
52
|
+
- Pack by priority with dependency auto-inclusion, skipping stories that don't fit (`continue`, not `break`)
|
|
53
|
+
4. For each pulled story:
|
|
54
|
+
- Add `sprint: {current_sprint_id}` tag in `{backlog_path}`
|
|
55
|
+
- Set status to `sprint-planned`
|
|
56
|
+
- Add to `sprint-{n}-plan.md` Planned Stories table (mark as "pulled mid-sprint")
|
|
57
|
+
- Add to `sprint-{n}-status.yaml`
|
|
58
|
+
- Update `pipeline-state.json`: append to `stories_planned`, increment `points_planned`
|
|
59
|
+
5. Execute pulled stories using the same per-story flow above (Story 2+ rules — all Phase 2 agents spawned fresh)
|
|
60
|
+
6. After each pulled story ships, repeat: check time budget, check buffer, pull more if both allow
|
|
61
|
+
7. When the time budget is exceeded OR the buffer is empty, proceed to sprint review
|
|
62
|
+
|
|
63
|
+
This avoids starting a new sprint (with its groom/size/plan overhead) when there's already groomed work ready to execute.
|
|
64
|
+
|
|
44
65
|
### Sprint Rollover
|
|
45
66
|
|
|
46
67
|
When the time budget is exceeded:
|
|
@@ -50,6 +71,7 @@ When the time budget is exceeded:
|
|
|
50
71
|
- Reset status to `pending`
|
|
51
72
|
- These stories will be picked up by the next sprint's planning phase
|
|
52
73
|
3. Record rolled-over story IDs in the sprint plan artifact
|
|
74
|
+
4. Groomed buffer stories that were NOT pulled retain their `groomed` status — they carry forward to the next sprint's planning phase without re-grooming
|
|
53
75
|
|
|
54
76
|
## Update Sprint State
|
|
55
77
|
|
|
@@ -101,6 +101,10 @@ node .valent-pipeline/bin/cli.js db flush-working \
|
|
|
101
101
|
|
|
102
102
|
This copies final post-READINESS specs from `artifacts_working` → `artifacts` (main table), then clears the working table.
|
|
103
103
|
|
|
104
|
+
## Step 6b: Teardown PM
|
|
105
|
+
|
|
106
|
+
Read and follow `.valent-pipeline/steps/orchestration/sprint-pm-teardown.md`.
|
|
107
|
+
|
|
104
108
|
## Step 7: Update Sprint State
|
|
105
109
|
|
|
106
110
|
Update `pipeline-state.json`: `current_sprint.phase = "sizing"`.
|
|
@@ -33,15 +33,18 @@ When a candidate story depends on another `pending` story, auto-include the prer
|
|
|
33
33
|
|
|
34
34
|
## Step 4: Determine Groom Target Count
|
|
35
35
|
|
|
36
|
-
Calculate how many stories to groom
|
|
36
|
+
Calculate how many stories to groom. We groom **2x velocity** worth to maintain a buffer — stories that don't fit the current sprint are already groomed and sized for the next one, and can be pulled into the current sprint if it finishes early.
|
|
37
37
|
|
|
38
38
|
```
|
|
39
39
|
avg_points_per_story = AVG(story_points) from calibration table (last 5 sprints)
|
|
40
40
|
defaults to 5 when no history exists
|
|
41
|
-
|
|
41
|
+
already_groomed = count of stories in backlog with status 'groomed' or 'sizing' (not yet sprint-planned)
|
|
42
|
+
groom_target = ceil((current_velocity * 2) / avg_points_per_story) - already_groomed
|
|
42
43
|
groom_target = max(groom_target, 3) # floor of 3
|
|
43
44
|
```
|
|
44
45
|
|
|
46
|
+
The `already_groomed` offset prevents re-grooming stories that were groomed in a prior sprint but not planned (the buffer from last sprint carries forward).
|
|
47
|
+
|
|
45
48
|
## Step 5: Update Sprint State
|
|
46
49
|
|
|
47
50
|
Write to `pipeline-state.json`:
|
|
@@ -29,16 +29,22 @@ for story in groomed_stories_by_priority:
|
|
|
29
29
|
sprint_stories.append(story)
|
|
30
30
|
remaining_capacity -= story.story_points
|
|
31
31
|
else:
|
|
32
|
-
|
|
32
|
+
continue # skip this story, try smaller ones to fill capacity
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
+
## Step 1b: Identify Groomed Buffer
|
|
36
|
+
|
|
37
|
+
After packing, any groomed+sized stories that did NOT fit into the sprint remain in the **groomed buffer**. These are available for mid-sprint pull (see sprint-execute.md) without needing another groom/size cycle.
|
|
38
|
+
|
|
39
|
+
Record `buffer_story_ids` = groomed stories not in `sprint_stories` (keep their `groomed` status — do NOT reset them).
|
|
40
|
+
|
|
35
41
|
## Step 2: Check if Sprint Needs More Stories
|
|
36
42
|
|
|
37
|
-
If `remaining_capacity >= 1` AND there are ungroomed `pending` stories in the backlog:
|
|
43
|
+
If `remaining_capacity >= 1` AND there are ungroomed `pending` stories in the backlog AND the groomed buffer is empty:
|
|
38
44
|
- Return to sprint-groom.md to groom additional stories
|
|
39
45
|
- Then return here to re-pack
|
|
40
46
|
|
|
41
|
-
Guard: do NOT enter groom-more loop if `remaining_capacity < 1` point.
|
|
47
|
+
Guard: do NOT enter groom-more loop if `remaining_capacity < 1` point or if the groomed buffer already has stories (they'll be pulled mid-sprint if needed).
|
|
42
48
|
|
|
43
49
|
## Step 3: Write Sprint Plan Artifact
|
|
44
50
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Sprint PM Final Audit
|
|
2
|
+
|
|
3
|
+
**Condition:** Only execute if `{pm_enabled}` is true.
|
|
4
|
+
|
|
5
|
+
This step runs once at epic/project completion, after the sprint loop exits and before writing the epic/project report.
|
|
6
|
+
|
|
7
|
+
## Step 1: Spawn PM
|
|
8
|
+
|
|
9
|
+
Spawn PM agent on the existing team with full context:
|
|
10
|
+
|
|
11
|
+
- `{prd_path}`, `{backlog_path}`, `{story_directory}`, `{story_output_directory}`
|
|
12
|
+
- `{fr_coverage_map_path}`, `{pm_inbox_path}`
|
|
13
|
+
- `{epic_id}`, `{is_project_mode}`
|
|
14
|
+
- `{epic_progress_path}` — full history of shipped stories
|
|
15
|
+
- Full calibration table history (all sprints)
|
|
16
|
+
- Signal: `[FINAL-AUDIT]` — tells PM to execute Phase G
|
|
17
|
+
|
|
18
|
+
In project mode, pass all PRD paths (one per epic).
|
|
19
|
+
|
|
20
|
+
## Step 2: Wait for Audit
|
|
21
|
+
|
|
22
|
+
PM executes Phase G from its prompt:
|
|
23
|
+
1. Final FR coverage reconciliation (Phase A one last time)
|
|
24
|
+
2. Resolve every `weak-coverage` FR — these are blockers, not informational
|
|
25
|
+
3. Write `prd-audit-report.md` adjacent to `{epic_progress_path}`
|
|
26
|
+
4. Report results
|
|
27
|
+
|
|
28
|
+
Wait for PM's completion signal.
|
|
29
|
+
|
|
30
|
+
## Step 3: Read Audit Results
|
|
31
|
+
|
|
32
|
+
Read `prd-audit-report.md`. Extract:
|
|
33
|
+
- PRD coverage percentage
|
|
34
|
+
- Count of unresolved gaps
|
|
35
|
+
- Count of weak-coverage items escalated
|
|
36
|
+
- Any gap stories generated for follow-up
|
|
37
|
+
|
|
38
|
+
These are included in the epic/project report.
|
|
39
|
+
|
|
40
|
+
## Step 4: Process Remaining Inbox
|
|
41
|
+
|
|
42
|
+
If `{pm_inbox_path}` has any unprocessed messages after the audit, PM processes them during Phase G. Any resulting stories are flagged as available for the next run, not the current one.
|
|
43
|
+
|
|
44
|
+
## Step 5: Teardown PM
|
|
45
|
+
|
|
46
|
+
Send `shutdown_request` to PM. This is PM's final teardown for the run.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Sprint PM Review
|
|
2
|
+
|
|
3
|
+
**Condition:** Only execute if `{pm_enabled}` is true.
|
|
4
|
+
|
|
5
|
+
## Step 1: Spawn PM
|
|
6
|
+
|
|
7
|
+
Spawn PM agent on the existing team with the following context:
|
|
8
|
+
|
|
9
|
+
**Sprint 1 (initial — no prior sprint results):**
|
|
10
|
+
- `{prd_path}`, `{backlog_path}`, `{story_directory}`
|
|
11
|
+
- `{fr_coverage_map_path}`, `{pm_inbox_path}`
|
|
12
|
+
- `{epic_id}`, `{is_project_mode}`
|
|
13
|
+
- `{sprint_number}` = 1
|
|
14
|
+
- `{pm_auto_reprioritize}`, `{pm_auto_generate_gap_stories}`
|
|
15
|
+
|
|
16
|
+
**Sprint 2+ (inter-sprint — after sprint review):**
|
|
17
|
+
|
|
18
|
+
Send `[SPRINT-RESULTS]` to PM with:
|
|
19
|
+
|
|
20
|
+
| Field | Source |
|
|
21
|
+
|-------|--------|
|
|
22
|
+
| `sprint_id` | `{current_sprint_id}` |
|
|
23
|
+
| `stories_shipped` | from sprint plan actuals |
|
|
24
|
+
| `stories_rolled_over` | from sprint review Step 5 |
|
|
25
|
+
| `stories_cancelled` | from backlog (status changed this sprint) |
|
|
26
|
+
| `stories_blocked` | from backlog (status changed this sprint) |
|
|
27
|
+
| `velocity` | from sprint review Step 2 summary |
|
|
28
|
+
| `velocity_trend` | compare this sprint's velocity to SMA-5: `improving` / `stable` / `degrading` |
|
|
29
|
+
| `rework_cycles_total` | sum from sprint plan actuals |
|
|
30
|
+
| `bugs_filed` | count from shipped stories' `bugs.md` files |
|
|
31
|
+
|
|
32
|
+
Also pass: `{backlog_path}`, `{fr_coverage_map_path}`, `{pm_inbox_path}`, `{calibration_data}`, `{sprint_number}` (next sprint number).
|
|
33
|
+
|
|
34
|
+
In project mode, also pass all PRD paths (one per epic) and `{is_project_mode}` = true.
|
|
35
|
+
|
|
36
|
+
## Step 2: Wait for PM Review
|
|
37
|
+
|
|
38
|
+
PM executes Phases A through E from its prompt:
|
|
39
|
+
- **Phase A:** Reconcile FR coverage map against PRD and backlog
|
|
40
|
+
- **Phase B:** Process user inbox messages
|
|
41
|
+
- **Phase C:** Analyze sprint results (Sprint 2+ only)
|
|
42
|
+
- **Phase D:** Reprioritize backlog if needed
|
|
43
|
+
- **Phase E:** Send `[BACKLOG-UPDATE]` to Lead
|
|
44
|
+
|
|
45
|
+
Wait for PM's `[BACKLOG-UPDATE]` message before proceeding.
|
|
46
|
+
|
|
47
|
+
## Step 3: Re-read Backlog
|
|
48
|
+
|
|
49
|
+
After receiving `[BACKLOG-UPDATE]`, re-read `{backlog_path}` from disk. PM may have:
|
|
50
|
+
- Reordered priorities
|
|
51
|
+
- Created new gap stories
|
|
52
|
+
- Created stories from user inbox requests
|
|
53
|
+
|
|
54
|
+
The updated backlog is the source of truth for the next sprint-init.
|
|
55
|
+
|
|
56
|
+
## Step 4: Update Pipeline State
|
|
57
|
+
|
|
58
|
+
Update `pipeline-state.json`:
|
|
59
|
+
|
|
60
|
+
```json
|
|
61
|
+
"current_sprint": {
|
|
62
|
+
...existing fields...,
|
|
63
|
+
"pm_spawned": true,
|
|
64
|
+
"pm_backlog_update_received": true,
|
|
65
|
+
"fr_coverage_percentage": {from PM's update}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Step 5: PM Stays Alive
|
|
70
|
+
|
|
71
|
+
Do NOT teardown PM. PM persists into the grooming phase for FR-tag oversight (Phase F in its prompt). PM will be torn down by `sprint-pm-teardown.md` after grooming completes.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Sprint PM Teardown
|
|
2
|
+
|
|
3
|
+
**Condition:** Only execute if `{pm_enabled}` is true.
|
|
4
|
+
|
|
5
|
+
## Step 1: Check PM Status
|
|
6
|
+
|
|
7
|
+
If PM is not alive on the team (e.g., was never spawned this sprint, or already torn down), skip this step entirely.
|
|
8
|
+
|
|
9
|
+
## Step 2: Teardown PM
|
|
10
|
+
|
|
11
|
+
Send `shutdown_request` to PM. PM has had the opportunity to validate FR tagging in reqs-briefs during grooming (Phase F). It is no longer needed until the next inter-sprint cycle.
|
|
12
|
+
|
|
13
|
+
## Step 3: Update Pipeline State
|
|
14
|
+
|
|
15
|
+
Update `pipeline-state.json`:
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
"current_sprint": {
|
|
19
|
+
...existing fields...,
|
|
20
|
+
"pm_spawned": false
|
|
21
|
+
}
|
|
22
|
+
```
|