@sandrinio/vbounce 1.9.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/templates/epic.md CHANGED
@@ -21,10 +21,12 @@ Output location: `product_plans/backlog/EPIC-{NNN}_{epic_name}/EPIC-{NNN}_{epic_
21
21
 
22
22
  Document Hierarchy Position: LEVEL 3 (Charter → Roadmap → **Epic** → Story)
23
23
 
24
+ **Codebase research is mandatory when filling §4 Technical Context.** Do NOT guess at affected files, dependencies, or integration points. Read the actual codebase — explore directories, read files listed in upstream documents, understand current architecture — then fill §4 with real file paths and verified dependencies.
25
+
24
26
  Upstream sources:
25
27
  - §1 Problem & Value traces to Charter §1.1 (What It Is) and §5 (Key Workflows)
26
28
  - §3.3 Constraints inherits from Charter §6 and Roadmap §5 Strategic Constraints
27
- - §4 Technical Context references Roadmap §3 ADRs for architecture decisions
29
+ - §4 Technical Context references Roadmap §3 ADRs for architecture decisions AND actual codebase exploration
28
30
  - Metadata.Priority aligns with Roadmap §2 Release Plan epic priorities
29
31
 
30
32
  Downstream consumers:
@@ -132,21 +134,22 @@ flowchart LR
132
134
  ---
133
135
 
134
136
  ## 5. Decomposition Guidance
135
- > Hints for AI story breakdown. Check all that apply.
136
-
137
- - [ ] **Schema/Migration** - Database changes, new tables/fields
138
- - [ ] **API Work** - New/modified endpoints
139
- - [ ] **UI Work** - New screens or components
140
- - [ ] **Integration** - External service connection
141
- - [ ] **Infrastructure** - Config, env vars, deployment
142
- - [ ] **Testing** - E2E, integration tests
143
- - [ ] **Documentation** - User-facing or API docs
144
-
145
- ### Suggested Story Sequence
146
- 1. {First: usually schema/data layer}
147
- 2. {Then: API/backend layer}
148
- 3. {Then: UI/frontend layer}
149
- 4. {Finally: integration + E2E tests}
137
+ > The AI agent will analyze this epic and research the codebase to create small, focused stories. Each story must deliver a tangible, verifiable result — not just a layer of work.
138
+
139
+ ### Affected Areas (for codebase research)
140
+ - [ ] {Area 1: e.g., "Authentication flow in `src/auth/`"}
141
+ - [ ] {Area 2: e.g., "User profile API in `src/api/users.ts`"}
142
+ - [ ] {Area 3: e.g., "Dashboard component in `src/components/Dashboard/`"}
143
+
144
+ ### Key Constraints for Story Sizing
145
+ - Each story should touch 1-3 files and have one clear goal
146
+ - Prefer vertical slices (thin end-to-end) over horizontal layers
147
+ - Stories must be independently verifiable
148
+
149
+ ### Suggested Sequencing Hints
150
+ 1. {What must exist first for other work to build on}
151
+ 2. {What depends on #1}
152
+ 3. {What can run in parallel}
150
153
 
151
154
  ---
152
155
 
@@ -0,0 +1,143 @@
1
+ <instructions>
2
+ FOLLOW THIS EXACT STRUCTURE. Output sections in order 1-8.
3
+
4
+ 1. **YAML Frontmatter**: Spike ID, Parent Epic, Parent Story (optional), Status, Ambiguity Before, Time Box, Owner, Tags, Created
5
+ 2. **§1 Question**: The specific unknown to resolve
6
+ 3. **§2 Constraints**: Time box, scope limits, what is NOT being investigated
7
+ 4. **§3 Approach**: Investigation method
8
+ 5. **§4 Findings**: Evidence, data, observations discovered
9
+ 6. **§5 Decision**: Choice made + rationale + alternatives rejected
10
+ 7. **§6 Residual Risk**: What's still uncertain after the spike
11
+ 8. **§7 Affected Documents**: Checklist of upstream/downstream docs to update on close
12
+ 9. **§8 Change Log**: Modification history
13
+
14
+ Spike Statuses: Open → Investigating → Findings Ready → Validated → Closed
15
+
16
+ Output location: `product_plans/backlog/EPIC-{NNN}_{name}/SPIKE-{EpicID}-{NNN}-{topic}.md`
17
+
18
+ Document Hierarchy Position: LEVEL 3.5 (Charter → Roadmap → Epic → **Spike** / Story)
19
+ Spikes are children of Epics, siblings of Stories. They travel with their Epic folder (archiving is automatic).
20
+
21
+ Upstream sources:
22
+ - §1 Question derives from parent Epic §8 Open Questions (blocking items)
23
+ - §3 Approach references parent Epic §4 Technical Context
24
+ - Roadmap §3 ADRs informs existing architectural decisions
25
+
26
+ Downstream consumers:
27
+ - §4 Findings → parent Epic §4 Technical Context (update with new knowledge)
28
+ - §5 Decision → Roadmap §3 ADRs (if architectural decision)
29
+ - §6 Residual Risk → Risk Registry §1 Active Risks (if new risk identified)
30
+ - §5 Decision → parent Story §3 Implementation Guide (if story-level spike)
31
+
32
+ Agent handoff:
33
+ - Team Lead creates the spike from template, links to Epic §9
34
+ - Developer investigates (fills §4 Findings and §5 Decision)
35
+ - Architect validates findings against Safe Zone (Findings Ready → Validated)
36
+ - Team Lead propagates findings to affected documents (Validated → Closed)
37
+
38
+ Do NOT output these instructions.
39
+ </instructions>
40
+
41
+ ---
42
+ spike_id: "SPIKE-{EpicID}-{NNN}-{topic}"
43
+ parent_epic_ref: "EPIC-{ID}"
44
+ parent_story_ref: "(optional — omit for epic-level spikes)"
45
+ status: "Open / Investigating / Findings Ready / Validated / Closed"
46
+ ambiguity_before: "🔴 High / 🟡 Medium"
47
+ time_box: "e.g., 4 hours / 1 day"
48
+ owner: "Developer / Architect"
49
+ tags: []
50
+ created: "YYYY-MM-DD"
51
+ ---
52
+
53
+ # SPIKE-{EpicID}-{NNN}: {Topic}
54
+
55
+ ## 1. Question
56
+ > The specific unknown to resolve. Derived from Epic §8 Open Questions.
57
+
58
+ {What exactly do we need to find out? Frame as a single, concrete question.}
59
+
60
+ ---
61
+
62
+ ## 2. Constraints
63
+ > What boundaries apply to this investigation.
64
+
65
+ | Constraint | Value |
66
+ |------------|-------|
67
+ | **Time Box** | {e.g., 4 hours / 1 day} |
68
+ | **Scope Limit** | {What IS being investigated} |
69
+ | **Out of Scope** | {What is NOT being investigated — prevents scope creep} |
70
+
71
+ ---
72
+
73
+ ## 3. Approach
74
+ > How the investigation will be conducted.
75
+
76
+ **Method:** {Code exploration / Prototyping / Benchmarks / Doc research / Proof of concept}
77
+
78
+ ### Steps
79
+ 1. {First investigation step}
80
+ 2. {Second investigation step}
81
+ 3. {Third investigation step}
82
+
83
+ ---
84
+
85
+ ## 4. Findings
86
+ > Evidence, data, and observations discovered during investigation.
87
+ > Filled by the Developer during the Investigating phase.
88
+
89
+ ### Evidence
90
+ - {Observation 1 — with data or code references}
91
+ - {Observation 2}
92
+
93
+ ### Data
94
+ | Metric | Value | Notes |
95
+ |--------|-------|-------|
96
+ | {e.g., Response time} | {value} | {context} |
97
+
98
+ ---
99
+
100
+ ## 5. Decision
101
+ > Choice made based on findings. Becomes an ADR if architectural.
102
+
103
+ ### Chosen Approach
104
+ {What we decided to do and why.}
105
+
106
+ ### Alternatives Rejected
107
+ | Alternative | Why Rejected |
108
+ |-------------|--------------|
109
+ | {Option A} | {Reason} |
110
+ | {Option B} | {Reason} |
111
+
112
+ ### ADR Required?
113
+ - [ ] Yes — create ADR in Roadmap §3 (decision affects architecture)
114
+ - [ ] No — decision is implementation-level only
115
+
116
+ ---
117
+
118
+ ## 6. Residual Risk
119
+ > What's still uncertain after the spike. Feeds Risk Registry if non-trivial.
120
+
121
+ | Risk | Likelihood | Impact | Mitigation |
122
+ |------|------------|--------|------------|
123
+ | {Remaining unknown} | {Low/Medium/High} | {description} | {how to manage} |
124
+
125
+ ---
126
+
127
+ ## 7. Affected Documents
128
+ > Checklist of upstream/downstream docs to update when closing this spike.
129
+ > ALL items must be checked before spike status can move to Closed.
130
+
131
+ - [ ] Epic §4 Technical Context — update with findings
132
+ - [ ] Epic §8 Open Questions — mark resolved
133
+ - [ ] Epic §9 Artifact Links — add spike reference
134
+ - [ ] Roadmap §3 ADRs — if architectural decision (see §5)
135
+ - [ ] Risk Registry §1 — if new risk identified (see §6)
136
+ - [ ] Story §3 Implementation Guide — if story-level spike
137
+
138
+ ---
139
+
140
+ ## 8. Change Log
141
+ | Date | Author | Change |
142
+ |------|--------|--------|
143
+ | {YYYY-MM-DD} | {name} | Created spike |
@@ -1,11 +1,12 @@
1
1
  <instructions>
2
- FOLLOW THIS EXACT STRUCTURE. Output sections in order 1-4.
2
+ FOLLOW THIS EXACT STRUCTURE. Output sections in order 0-4.
3
3
 
4
- 1. **YAML Frontmatter**: Sprint ID, Goal, Dates, Status, Delivery ref
5
- 2. **§1 Active Scope**: Table of stories + Context Pack Readiness checklists
6
- 3. **§2 Execution Strategy**: Parallel phases, dependencies, risk flags
7
- 4. **§3 Sprint Open Questions**: Unresolved items blocking this sprint
8
- 5. **§4 Execution Log**: Accumulated story results (populated during sprint, becomes Sprint Report §2 source)
4
+ 1. **YAML Frontmatter**: Sprint ID, Goal, Dates, Status (Planning/Confirmed/Active/Completed), Delivery ref, Confirmed by/at
5
+ 2. **§0 Sprint Readiness Gate**: Pre-sprint checklist ALL items must be checked before human confirms
6
+ 3. **§1 Active Scope**: Table of stories + Context Pack Readiness checklists
7
+ 4. **§2 Execution Strategy**: Parallel phases, dependencies, risk flags
8
+ 5. **§3 Sprint Open Questions**: Unresolved items blocking this sprint
9
+ 6. **§4 Execution Log**: Accumulated story results (populated during sprint, becomes Sprint Report §2 source)
9
10
 
10
11
  Output location: `product_plans/sprints/sprint-{XX}/sprint-{XX}.md`
11
12
 
@@ -15,8 +16,11 @@ Role of this document:
15
16
  - The Delivery Plan is only updated at sprint boundaries (start and end).
16
17
 
17
18
  Document Lifecycle:
18
- - Created by the Team Lead at Sprint Setup (Step 0) via `vbounce sprint init`.
19
- - §1 V-Bounce States updated at every story transition.
19
+ - Created during Sprint Planning (Phase 2) as a collaborative document between AI and human.
20
+ - Status flow: Planning Confirmed (human approves) → Active (execution begins) → Completed.
21
+ - **Sprint CANNOT move to Active without human confirmation.** This is a hard gate.
22
+ - §0 Readiness Gate must be fully checked before requesting human confirmation.
23
+ - §1 V-Bounce States updated at every story transition during execution.
20
24
  - §4 Execution Log gets one row per completed story (via `vbounce story complete`).
21
25
  - At sprint end, §4 becomes the skeleton for Sprint Report §2 — no reconstruction needed.
22
26
  - When the sprint completes, this document moves to `product_plans/archive/sprints/sprint-{XX}/`.
@@ -28,12 +32,28 @@ Do NOT output these instructions.
28
32
  sprint_id: "sprint-{XX}"
29
33
  sprint_goal: "{One-sentence North Star}"
30
34
  dates: "{MM/DD - MM/DD}"
31
- status: "Planning / Active / Completed"
35
+ status: "Planning / Confirmed / Active / Completed"
32
36
  delivery: "D-{NN}"
37
+ confirmed_by: ""
38
+ confirmed_at: ""
33
39
  ---
34
40
 
35
41
  # Sprint S-{XX} Plan
36
42
 
43
+ ## 0. Sprint Readiness Gate
44
+ > This sprint CANNOT start until the human confirms this plan.
45
+ > AI sets status to "Planning" when drafting. Human confirmation moves it to "Confirmed". Execution moves it to "Active".
46
+
47
+ ### Pre-Sprint Checklist
48
+ - [ ] All stories below have been reviewed with the human
49
+ - [ ] Open questions (§3) are resolved or non-blocking
50
+ - [ ] No stories have 🔴 High ambiguity (spike first)
51
+ - [ ] Dependencies identified and sequencing agreed
52
+ - [ ] Risk flags reviewed from Risk Registry
53
+ - [ ] **Human has confirmed this sprint plan**
54
+
55
+ ---
56
+
37
57
  ## 1. Active Scope
38
58
  > Stories pulled from the backlog for execution during this sprint window.
39
59
  > V-Bounce State is the ONLY authoritative source for story status during the sprint.
@@ -66,16 +86,30 @@ V-Bounce State: Draft / Refinement / Ready to Bounce
66
86
  - **Phase 1 (parallel)**: {Story IDs that can run simultaneously}
67
87
  - **Phase 2 (sequential)**: {Story IDs with dependencies — run in order}
68
88
 
69
- ### Risk Flags
70
- - {Which stories touch shared modules coordinate access}
71
- - {Sprint-specific risks pulled from Risk Registry}
89
+ ### Execution Mode
90
+ > L1 Fast Track (Dev DevOps, skip QA/Arch). L2 → Fast Track only with human approval below. L3/L4 → Full Bounce always.
91
+
92
+ | Story | Label | Mode | Human Approved? |
93
+ |-------|-------|------|-----------------|
94
+ | STORY-XXX-YY | L2 | Full Bounce / Fast Track | — / Yes |
95
+
96
+ ### Shared File Map
97
+ > Stories touching the same files MUST merge sequentially (first-in wins). Flag these during planning.
98
+
99
+ | File / Module | Stories Touching It | Merge Order |
100
+ |---------------|--------------------:|-------------|
101
+ | `{src/path/file.ts}` | STORY-A, STORY-B | A before B |
72
102
 
73
103
  ### Dependency Chain
74
- > Stories that MUST run sequentially (depends_on relationships).
104
+ > Stories that MUST run sequentially (depends_on OR shared files).
75
105
 
76
106
  | Story | Depends On | Reason |
77
107
  |-------|-----------|--------|
78
- | STORY-XXX-YY | STORY-XXX-YY | {why sequential} |
108
+ | STORY-XXX-YY | STORY-XXX-YY | {depends_on / shared file / data dependency} |
109
+
110
+ ### Risk Flags
111
+ - {Sprint-specific risks pulled from Risk Registry}
112
+ - {External dependency risks}
79
113
 
80
114
  ---
81
115
 
@@ -94,7 +128,7 @@ V-Bounce State: Draft / Refinement / Ready to Bounce
94
128
  > Updated by the Lead after each story completes via `vbounce story complete STORY-ID`.
95
129
  > This table becomes Sprint Report §2 at sprint end — no reconstruction needed.
96
130
 
97
- | Story | Final State | QA Bounces | Arch Bounces | Correction Tax | Notes |
98
- |-------|-------------|------------|--------------|----------------|-------|
99
- | STORY-XXX-YY | Done | 0 | 0 | 0% | {brief note} |
131
+ | Story | Final State | QA Bounces | Arch Bounces | Tests Written | Correction Tax | Notes |
132
+ |-------|-------------|------------|--------------|---------------|----------------|-------|
133
+ | STORY-XXX-YY | Done | 0 | 0 | {N} | 0% | {brief note} |
100
134
  <!-- EXECUTION_LOG_END -->
@@ -110,6 +110,8 @@ delivery_plan_ref: "product_plans/{delivery}/DELIVERY_PLAN.md"
110
110
  | **Bounce Ratio** | {X}% | (total bounces / total stories) |
111
111
  | **Average Correction Tax** | {X}% | 🟢 0-5% · 🟡 6-15% · 🔴 16%+ requires process review |
112
112
  | **First-Pass Success Rate** | {X}% | stories that passed QA on first try |
113
+ | **Total Tests Written** | {N} | across all stories (from Dev report `tests_written`) |
114
+ | **Tests per Story (avg)** | {N} | |
113
115
  | **Merge Conflicts** | {N} simple, {N} complex | |
114
116
 
115
117
  ### Per-Story Breakdown
@@ -128,11 +130,11 @@ delivery_plan_ref: "product_plans/{delivery}/DELIVERY_PLAN.md"
128
130
 
129
131
  ## 4. Lessons Learned
130
132
 
131
- > Flagged by agents during the sprint. Each needs user approval before recording to LESSONS.md.
133
+ > Lessons are recorded to LESSONS.md **immediately after each story merge** (Step 5.5), not deferred to sprint close. This table is a review of what was already captured.
132
134
 
133
- | Source | Lesson | Approved? |
134
- |--------|--------|-----------|
135
- | STORY-{ID}-{story_name} Dev Report | {What happened and proposed rule} | Pending / Yes / No |
135
+ | Source | Lesson | Recorded? | When |
136
+ |--------|--------|-----------|------|
137
+ | STORY-{ID}-{story_name} Dev Report | {What happened and proposed rule} | Yes / No / Missed | {After story merge / Sprint close} |
136
138
 
137
139
  ---
138
140
 
@@ -30,8 +30,8 @@ Downstream consumers:
30
30
  - Developer Agent reads §1 The Spec and §3 Implementation Guide (with react-best-practices skill)
31
31
  - QA Agent reads §2 The Truth to validate implementation (with vibe-code-review skill)
32
32
  - Architect Agent reads full story context for Safe Zone compliance audit
33
- - Delivery Plan §3 Active Sprint tracks story V-Bounce state
34
- - Delivery Plan §5 Context Pack Status tracks per-story readiness using this template's sections
33
+ - Sprint Plan §1 Active Scope tracks story V-Bounce state during the sprint
34
+ - Sprint Plan §1 Context Pack Readiness tracks per-story readiness using this template's sections
35
35
 
36
36
  Agent handoff sections:
37
37
  - §1 The Spec → Human contract (PM/BA writes, Dev reads)
@@ -111,10 +111,23 @@ Feature: {Story Name}
111
111
  > Instructions for the Developer Agent. The "How".
112
112
  > Target Audience: Developer Agent (with react-best-practices + lesson skills).
113
113
 
114
- ### 3.0 Test Implementation
115
- - {Identify which test suites need to be created or modified to cover the Acceptance Criteria from §2.1. e.g. "Create `AuthComponent.test.tsx`"}
114
+ ### 3.0 Environment Prerequisites
115
+ > Verify these before starting. Do NOT waste a bounce cycle on setup failures.
116
116
 
117
- ### 3.1 Context & Files
117
+ | Prerequisite | Value | Verified? |
118
+ |-------------|-------|-----------|
119
+ | **Env Vars** | {e.g., `DATABASE_URL`, `API_KEY`} | [ ] |
120
+ | **Services Running** | {e.g., "PostgreSQL on localhost:5432"} | [ ] |
121
+ | **Migrations** | {e.g., "Run `npx prisma migrate dev`"} | [ ] |
122
+ | **Seed Data** | {e.g., "Run `npm run seed`" or "None"} | [ ] |
123
+ | **Dependencies** | {e.g., "`npm install` after pulling latest"} | [ ] |
124
+
125
+ ### 3.1 Test Implementation
126
+ - {Identify which test suites need to be created or modified to cover the Acceptance Criteria from §2.1}
127
+ - {Include E2E/acceptance tests — not just unit tests. Every Gherkin scenario in §2.1 must have a corresponding test}
128
+ - {e.g., "Create `AuthComponent.test.tsx` (unit) + `auth.e2e.test.ts` (acceptance)"}
129
+
130
+ ### 3.2 Context & Files
118
131
  | Item | Value |
119
132
  |------|-------|
120
133
  | **Primary File** | `{filepath/to/main/component.ts}` |
@@ -122,11 +135,11 @@ Feature: {Story Name}
122
135
  | **New Files Needed** | Yes/No — `{Name of file}` |
123
136
  | **ADR References** | ADR-{NNN} from Roadmap §3 |
124
137
 
125
- ### 3.2 Technical Logic
138
+ ### 3.3 Technical Logic
126
139
  - {Describe the logic flow, e.g., "Use the existing useAuth hook to check permissions."}
127
140
  - {Describe state management, e.g., "Store the result in the global Zustand store."}
128
141
 
129
- ### 3.3 API Contract (If applicable)
142
+ ### 3.4 API Contract (If applicable)
130
143
  ```json
131
144
  // Expected Request
132
145
  POST /api/resource
@@ -146,8 +159,10 @@ POST /api/resource
146
159
  ---
147
160
 
148
161
  ## 4. Definition of Done (The Gate)
162
+ - [ ] Environment prerequisites (§3.0) verified before starting.
149
163
  - [ ] Code compiles without errors.
150
- - [ ] Unit/Integration Tests were written FIRST (Red), and now pass (Green).
164
+ - [ ] Unit tests were written FIRST (Red), and now pass (Green).
165
+ - [ ] E2E/acceptance tests cover all Gherkin scenarios from §2.1 and pass.
151
166
  - [ ] All Acceptance Criteria (§2.1) pass.
152
167
  - [ ] Linting rules passed.
153
168
  - [ ] LESSONS.md consulted before implementation.