vbounce-engine 2.5.1

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.
Files changed (165) hide show
  1. package/README.md +142 -0
  2. package/VBOUNCE_MANIFEST.md +404 -0
  3. package/bin/vbounce.mjs +882 -0
  4. package/brains/AGENTS.md +71 -0
  5. package/brains/CHANGELOG.md +398 -0
  6. package/brains/CLAUDE.md +90 -0
  7. package/brains/GEMINI.md +102 -0
  8. package/brains/SETUP.md +195 -0
  9. package/brains/claude-agents/architect.md +226 -0
  10. package/brains/claude-agents/developer.md +133 -0
  11. package/brains/claude-agents/devops.md +267 -0
  12. package/brains/claude-agents/explorer.md +157 -0
  13. package/brains/claude-agents/qa.md +225 -0
  14. package/brains/claude-agents/scribe.md +171 -0
  15. package/brains/copilot/copilot-instructions.md +54 -0
  16. package/brains/cursor-rules/vbounce-docs.mdc +45 -0
  17. package/brains/cursor-rules/vbounce-process.mdc +51 -0
  18. package/brains/cursor-rules/vbounce-rules.mdc +29 -0
  19. package/brains/windsurf/.windsurfrules +35 -0
  20. package/docs/HOTFIX_EDGE_CASES.md +37 -0
  21. package/docs/IMPROVEMENT.md +46 -0
  22. package/docs/agent-skill-profiles.docx +0 -0
  23. package/docs/icons/alert.svg +1 -0
  24. package/docs/icons/beaker.svg +1 -0
  25. package/docs/icons/book.svg +1 -0
  26. package/docs/icons/git-branch.svg +1 -0
  27. package/docs/icons/git-merge.svg +1 -0
  28. package/docs/icons/graph.svg +1 -0
  29. package/docs/icons/light-bulb.svg +1 -0
  30. package/docs/icons/logo.svg +9 -0
  31. package/docs/icons/pencil.svg +1 -0
  32. package/docs/icons/rocket.svg +1 -0
  33. package/docs/icons/shield.svg +1 -0
  34. package/docs/icons/sync.svg +1 -0
  35. package/docs/icons/terminal.svg +1 -0
  36. package/docs/icons/tools.svg +1 -0
  37. package/docs/icons/zap.svg +1 -0
  38. package/docs/images/bounce_loop_diagram.png +0 -0
  39. package/docs/vbounce-os-manual.docx +0 -0
  40. package/package.json +48 -0
  41. package/scripts/close_sprint.mjs +134 -0
  42. package/scripts/complete_story.mjs +121 -0
  43. package/scripts/count_tokens.mjs +494 -0
  44. package/scripts/doctor.mjs +144 -0
  45. package/scripts/hotfix_manager.sh +157 -0
  46. package/scripts/init_gate_config.sh +151 -0
  47. package/scripts/init_sprint.mjs +129 -0
  48. package/scripts/post_sprint_improve.mjs +486 -0
  49. package/scripts/pre_gate_common.sh +576 -0
  50. package/scripts/pre_gate_runner.sh +176 -0
  51. package/scripts/prep_arch_context.mjs +178 -0
  52. package/scripts/prep_qa_context.mjs +152 -0
  53. package/scripts/prep_sprint_context.mjs +141 -0
  54. package/scripts/prep_sprint_summary.mjs +154 -0
  55. package/scripts/product_graph.mjs +387 -0
  56. package/scripts/product_impact.mjs +167 -0
  57. package/scripts/sprint_trends.mjs +160 -0
  58. package/scripts/suggest_improvements.mjs +363 -0
  59. package/scripts/update_state.mjs +132 -0
  60. package/scripts/validate_bounce_readiness.mjs +152 -0
  61. package/scripts/validate_report.mjs +165 -0
  62. package/scripts/validate_sprint_plan.mjs +117 -0
  63. package/scripts/validate_state.mjs +99 -0
  64. package/scripts/vdoc_match.mjs +269 -0
  65. package/scripts/vdoc_staleness.mjs +199 -0
  66. package/scripts/verify_framework.mjs +122 -0
  67. package/scripts/verify_framework.sh +13 -0
  68. package/skills/agent-team/SKILL.md +579 -0
  69. package/skills/agent-team/references/cleanup.md +42 -0
  70. package/skills/agent-team/references/delivery-sync.md +43 -0
  71. package/skills/agent-team/references/discovery.md +97 -0
  72. package/skills/agent-team/references/git-strategy.md +52 -0
  73. package/skills/agent-team/references/mid-sprint-triage.md +85 -0
  74. package/skills/agent-team/references/report-naming.md +34 -0
  75. package/skills/doc-manager/SKILL.md +444 -0
  76. package/skills/file-organization/SKILL.md +146 -0
  77. package/skills/file-organization/TEST-RESULTS.md +193 -0
  78. package/skills/file-organization/evals/evals.json +41 -0
  79. package/skills/file-organization/references/gitignore-template.md +53 -0
  80. package/skills/file-organization/references/quick-checklist.md +48 -0
  81. package/skills/improve/SKILL.md +296 -0
  82. package/skills/lesson/SKILL.md +136 -0
  83. package/skills/product-graph/SKILL.md +102 -0
  84. package/skills/react-best-practices/SKILL.md +3014 -0
  85. package/skills/react-best-practices/rules/_sections.md +46 -0
  86. package/skills/react-best-practices/rules/_template.md +28 -0
  87. package/skills/react-best-practices/rules/advanced-event-handler-refs.md +55 -0
  88. package/skills/react-best-practices/rules/advanced-init-once.md +42 -0
  89. package/skills/react-best-practices/rules/advanced-use-latest.md +39 -0
  90. package/skills/react-best-practices/rules/async-api-routes.md +38 -0
  91. package/skills/react-best-practices/rules/async-defer-await.md +80 -0
  92. package/skills/react-best-practices/rules/async-dependencies.md +51 -0
  93. package/skills/react-best-practices/rules/async-parallel.md +28 -0
  94. package/skills/react-best-practices/rules/async-suspense-boundaries.md +99 -0
  95. package/skills/react-best-practices/rules/bundle-barrel-imports.md +59 -0
  96. package/skills/react-best-practices/rules/bundle-conditional.md +31 -0
  97. package/skills/react-best-practices/rules/bundle-defer-third-party.md +49 -0
  98. package/skills/react-best-practices/rules/bundle-dynamic-imports.md +35 -0
  99. package/skills/react-best-practices/rules/bundle-preload.md +50 -0
  100. package/skills/react-best-practices/rules/client-event-listeners.md +74 -0
  101. package/skills/react-best-practices/rules/client-localstorage-schema.md +71 -0
  102. package/skills/react-best-practices/rules/client-passive-event-listeners.md +48 -0
  103. package/skills/react-best-practices/rules/client-swr-dedup.md +56 -0
  104. package/skills/react-best-practices/rules/js-batch-dom-css.md +107 -0
  105. package/skills/react-best-practices/rules/js-cache-function-results.md +80 -0
  106. package/skills/react-best-practices/rules/js-cache-property-access.md +28 -0
  107. package/skills/react-best-practices/rules/js-cache-storage.md +70 -0
  108. package/skills/react-best-practices/rules/js-combine-iterations.md +32 -0
  109. package/skills/react-best-practices/rules/js-early-exit.md +50 -0
  110. package/skills/react-best-practices/rules/js-hoist-regexp.md +45 -0
  111. package/skills/react-best-practices/rules/js-index-maps.md +37 -0
  112. package/skills/react-best-practices/rules/js-length-check-first.md +49 -0
  113. package/skills/react-best-practices/rules/js-min-max-loop.md +82 -0
  114. package/skills/react-best-practices/rules/js-set-map-lookups.md +24 -0
  115. package/skills/react-best-practices/rules/js-tosorted-immutable.md +57 -0
  116. package/skills/react-best-practices/rules/rendering-activity.md +26 -0
  117. package/skills/react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
  118. package/skills/react-best-practices/rules/rendering-conditional-render.md +40 -0
  119. package/skills/react-best-practices/rules/rendering-content-visibility.md +38 -0
  120. package/skills/react-best-practices/rules/rendering-hoist-jsx.md +46 -0
  121. package/skills/react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
  122. package/skills/react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
  123. package/skills/react-best-practices/rules/rendering-svg-precision.md +28 -0
  124. package/skills/react-best-practices/rules/rendering-usetransition-loading.md +75 -0
  125. package/skills/react-best-practices/rules/rerender-defer-reads.md +39 -0
  126. package/skills/react-best-practices/rules/rerender-dependencies.md +45 -0
  127. package/skills/react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
  128. package/skills/react-best-practices/rules/rerender-derived-state.md +29 -0
  129. package/skills/react-best-practices/rules/rerender-functional-setstate.md +74 -0
  130. package/skills/react-best-practices/rules/rerender-lazy-state-init.md +58 -0
  131. package/skills/react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
  132. package/skills/react-best-practices/rules/rerender-memo.md +44 -0
  133. package/skills/react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
  134. package/skills/react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
  135. package/skills/react-best-practices/rules/rerender-transitions.md +40 -0
  136. package/skills/react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
  137. package/skills/react-best-practices/rules/server-after-nonblocking.md +73 -0
  138. package/skills/react-best-practices/rules/server-auth-actions.md +96 -0
  139. package/skills/react-best-practices/rules/server-cache-lru.md +41 -0
  140. package/skills/react-best-practices/rules/server-cache-react.md +76 -0
  141. package/skills/react-best-practices/rules/server-dedup-props.md +65 -0
  142. package/skills/react-best-practices/rules/server-parallel-fetching.md +83 -0
  143. package/skills/react-best-practices/rules/server-serialization.md +38 -0
  144. package/skills/vibe-code-review/SKILL.md +70 -0
  145. package/skills/vibe-code-review/references/deep-audit.md +259 -0
  146. package/skills/vibe-code-review/references/pr-review.md +234 -0
  147. package/skills/vibe-code-review/references/quick-scan.md +178 -0
  148. package/skills/vibe-code-review/references/report-template.md +189 -0
  149. package/skills/vibe-code-review/references/trend-check.md +224 -0
  150. package/skills/vibe-code-review/scripts/generate-snapshot.sh +89 -0
  151. package/skills/vibe-code-review/scripts/pr-analyze.sh +180 -0
  152. package/skills/write-skill/SKILL.md +133 -0
  153. package/templates/bug.md +100 -0
  154. package/templates/change_request.md +105 -0
  155. package/templates/charter.md +144 -0
  156. package/templates/delivery_plan.md +44 -0
  157. package/templates/epic.md +203 -0
  158. package/templates/hotfix.md +58 -0
  159. package/templates/risk_registry.md +87 -0
  160. package/templates/roadmap.md +174 -0
  161. package/templates/spike.md +143 -0
  162. package/templates/sprint.md +134 -0
  163. package/templates/sprint_context.md +61 -0
  164. package/templates/sprint_report.md +215 -0
  165. package/templates/story.md +193 -0
@@ -0,0 +1,579 @@
1
+ ---
2
+ name: agent-team
3
+ description: "Use when you need to delegate implementation tasks to specialized agents (Developer, QA, Architect, DevOps, Scribe) as the Team Lead. Activates when orchestrating the Bounce phase — delegating stories, monitoring reports, merging completed work, consolidating sprint results, and generating product documentation. Uses git worktrees for story isolation. Works with Claude Code subagents natively; file-based handoffs for other tools."
4
+ ---
5
+
6
+ # Agent Team Orchestration
7
+
8
+ ## Overview
9
+
10
+ This skill defines how the Team Lead delegates work to specialized agents during Phase 2: The Bounce. Each story is isolated in a **git worktree** to prevent cross-contamination. Agents communicate exclusively through structured report files.
11
+
12
+ **Core principle:** The Team Lead plans and coordinates. It never writes implementation code itself.
13
+
14
+ ## When to Use
15
+
16
+ - When executing the Bounce phase of a sprint.
17
+ - When delegating stories to Developer, QA, Architect, or DevOps agents.
18
+ - When consolidating agent reports into a Sprint Report.
19
+ - When a story needs to be bounced between agents.
20
+ - When merging completed stories or releasing sprints (delegate to DevOps).
21
+ - When generating or updating product documentation (delegate to Scribe).
22
+
23
+ ## Agent Roster
24
+
25
+ | Agent | Config File | Role | Tools | Skills |
26
+ |-------|------------|------|-------|--------|
27
+ | Developer | `.claude/agents/developer.md` | Feature implementation and debugging | Read, Edit, Write, Bash, Glob, Grep | react-best-practices, lesson |
28
+ | QA | `.claude/agents/qa.md` | Adversarial testing and validation | Read, Bash, Glob, Grep | vibe-code-review (Quick Scan, PR Review), lesson |
29
+ | Architect | `.claude/agents/architect.md` | Structural integrity and standards | Read, Glob, Grep, Bash | vibe-code-review (Deep Audit, Trend Check), lesson |
30
+ | DevOps | `.claude/agents/devops.md` | Git operations, merges, deploys, infra | Read, Edit, Write, Bash, Glob, Grep | lesson |
31
+ | Scribe | `.claude/agents/scribe.md` | Product documentation generation | Read, Write, Bash, Glob, Grep | lesson |
32
+
33
+ ---
34
+
35
+ ## Git Worktree Strategy
36
+
37
+ Every story gets its own worktree. This isolates code changes so a failed fix on Story 01 never contaminates Story 02.
38
+
39
+ ### Branch Model
40
+
41
+ ```
42
+ main ← production
43
+ └── sprint/S-01 ← sprint branch (cut from main)
44
+ ├── story/STORY-001-01-login ← story branch (worktree)
45
+ ├── story/STORY-001-02-auth ← story branch (worktree)
46
+ └── story/STORY-001-03-api ← story branch (worktree)
47
+ ```
48
+
49
+ ### Directory Layout
50
+
51
+ ```
52
+ repo/ ← main working directory
53
+ ├── .worktrees/ ← worktree root (GITIGNORED)
54
+ │ ├── STORY-001-01-login/ ← isolated worktree for story
55
+ │ │ ├── (full codebase checkout)
56
+ │ │ └── .vbounce/ ← reports live here during bounce
57
+ │ │ ├── tasks/
58
+ │ │ └── reports/
59
+ │ └── STORY-001-02-auth/
60
+ │ └── ...
61
+
62
+ └── .vbounce/
63
+ ├── reports/ ← active working reports (GITIGNORED)
64
+ ├── sprint-report-S-{XX}.md ← current sprint report (GITIGNORED)
65
+ └── archive/ ← completed sprint history (COMMITTED TO GIT)
66
+ └── S-01/
67
+ ├── STORY-001-01/ ← all agent reports for this story
68
+ ├── sprint-report-S-{XX}.md ← final sprint report
69
+ └── sprint-S-{XX}-devops.md ← release report
70
+ ```
71
+
72
+ ### V-Bounce State → Git Operations
73
+
74
+ | V-Bounce State | Git Operation |
75
+ |---------------|---------------|
76
+ | Sprint starts | `git checkout -b sprint/S-01 main` |
77
+ | Ready to Bounce | `git worktree add .worktrees/STORY-{ID}-{StoryName} -b story/STORY-{ID}-{StoryName} sprint/S-01` |
78
+ | Bouncing | All work happens inside `.worktrees/STORY-{ID}-{StoryName}/` |
79
+ | Done | Merge story branch → sprint branch, `git worktree remove` |
80
+ | Sprint Review → Done | Merge sprint branch → main |
81
+ | Escalated | Worktree kept but frozen (no new commits) |
82
+ | Parking Lot | Worktree removed, branch preserved unmerged |
83
+
84
+ ### Worktree Commands
85
+
86
+ ```bash
87
+ # Sprint initialization
88
+ git checkout -b sprint/S-01 main
89
+
90
+ # Create worktree for a story
91
+ git worktree add .worktrees/STORY-001-01-login -b story/STORY-001-01-login sprint/S-01
92
+ mkdir -p .worktrees/STORY-001-01-login/.vbounce/{tasks,reports}
93
+
94
+ # List active worktrees
95
+ git worktree list
96
+
97
+ # Merge completed story into sprint branch
98
+ git checkout sprint/S-01
99
+ git merge story/STORY-001-01-login --no-ff -m "Merge STORY-001-01: {Story Name}"
100
+
101
+ # Remove worktree after merge
102
+ git worktree remove .worktrees/STORY-001-01-login
103
+ git branch -d story/STORY-001-01-login
104
+
105
+ # Merge sprint into main
106
+ git checkout main
107
+ git merge sprint/S-01 --no-ff -m "Sprint S-01: {Sprint Goal}"
108
+ ```
109
+
110
+ ---
111
+
112
+ ## Orchestration Patterns
113
+
114
+ ### Pattern 1: Claude Code Subagents (Primary)
115
+
116
+ The Team Lead spawns agents using Claude Code's Task tool. Each subagent works inside the story's worktree.
117
+
118
+ **Critical:** Always set the working directory to the worktree when delegating:
119
+ ```
120
+ Lead: "Use the developer subagent. Working directory: .worktrees/STORY-001-01-login/
121
+ Read the story spec at product_plans/sprints/sprint-{XX}/STORY-001-01-login.md
122
+ and implement it.
123
+ Write the implementation report to .vbounce/reports/STORY-001-01-login-dev.md"
124
+ ```
125
+
126
+ **Parallel delegation (independent stories in separate worktrees):**
127
+ ```
128
+ Lead: "Use the developer subagent in .worktrees/STORY-001-01-login/"
129
+ AND "Use the developer subagent in .worktrees/STORY-001-02-auth/"
130
+ (safe — each worktree is fully isolated)
131
+ ```
132
+
133
+ **Background delegation:**
134
+ Press Ctrl+B for long-running agent tasks. Background agents auto-deny unknown permissions.
135
+
136
+ ### Pattern 2: Agent Teams (Experimental)
137
+
138
+ For sustained parallel coordination with inter-agent messaging. Enable with `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`. Each teammate works in a dedicated worktree.
139
+
140
+ ### Pattern 3: File-Based Handoffs (Cross-Tool Fallback)
141
+
142
+ For tools without native subagent support (Cursor, Codex, Gemini, Antigravity):
143
+
144
+ 1. Lead writes a task file to `.worktrees/STORY-{ID}-{StoryName}/.vbounce/tasks/STORY-{ID}-{StoryName}-{agent}.md`
145
+ 2. Open the worktree directory in the target tool (Cursor, Antigravity, etc.)
146
+ 3. Agent reads the task file, executes, writes report to `.vbounce/reports/`
147
+ 4. Lead monitors reports from the main repo
148
+
149
+ ---
150
+
151
+ ## The Report Buffer (Hybrid Model)
152
+
153
+ **During bounce:** Reports live INSIDE the story's worktree at `.worktrees/STORY-{ID}-{StoryName}/.vbounce/reports/`. This keeps reports co-located with the code they describe.
154
+
155
+ **After story completes:** Reports are archived to the shared `.vbounce/archive/S-{XX}/STORY-{ID}-{StoryName}/` in the main repo before the worktree is removed.
156
+
157
+ **Sprint Report:** Always written to `.vbounce/sprint-report-S-{XX}.md` in the main repo (not in any worktree).
158
+
159
+ ### Report File Naming
160
+
161
+ `STORY-{EpicID}-{StoryID}-{agent}[-bounce{N}].md`
162
+
163
+ Examples:
164
+ - `STORY-001-01-login-dev.md` — first Dev report
165
+ - `STORY-001-01-login-qa-bounce1.md` — first QA report (found bugs)
166
+ - `STORY-001-01-login-dev-bounce2.md` — Dev's fix after QA bounce
167
+ - `STORY-001-01-login-qa-bounce2.md` — second QA report (passed)
168
+ - `STORY-001-01-login-arch.md` — Architect audit
169
+ - `STORY-001-01-login-devops.md` — DevOps merge report
170
+ - `STORY-001-01-login-conflict.md` — Spec conflict (if any)
171
+ - `sprint-S-01-devops.md` — Sprint release report
172
+ - `sprint-S-01-scribe.md` — Documentation generation report
173
+
174
+ ---
175
+
176
+ ## The Bounce Sequence
177
+
178
+ ### Step 0: Sprint Setup
179
+
180
+ **Prerequisite:** Sprint Planning (Phase 2) must be complete. The Sprint Plan must be in "Confirmed" status with human approval before proceeding.
181
+
182
+ ```
183
+ 1. Cut sprint branch from main:
184
+ git checkout -b sprint/S-01 main
185
+ mkdir -p .vbounce/archive
186
+
187
+ 2. Verify Sprint Plan:
188
+ - Sprint Plan status must be "Confirmed" (human-approved in Phase 2)
189
+ - §0 Sprint Readiness Gate must be fully checked
190
+ - §3 Sprint Open Questions must have no unresolved blocking items
191
+ If any check fails, return to Phase 2 (Sprint Planning).
192
+
193
+ 3. If vdocs/_manifest.json exists, read it.
194
+ Understand what's already documented — this informs which stories
195
+ may require doc updates after the sprint.
196
+
197
+ 4. **Hotfix Path** (L1 Trivial tasks only — triaged during Phase 1):
198
+ a. Create `HOTFIX-{Date}-{Name}.md` using the template.
199
+ b. Delegate to Developer (no worktree needed if acting on active branch).
200
+ c. Developer runs `hotfix_manager.sh ledger "{Title}" "{Description}"` after implementation.
201
+ d. Human/Lead verifies manually.
202
+ e. DevOps runs `hotfix_manager.sh sync` to update any active story worktrees.
203
+ f. Update Delivery Plan Status to "Done".
204
+
205
+ 5. **Gate Config Check**:
206
+ - If `.vbounce/gate-checks.json` does not exist, run `./.vbounce/scripts/init_gate_config.sh` to auto-detect the project stack and generate default gate checks.
207
+ - If it exists, verify it's current (stack detection may have changed).
208
+
209
+ 6. **Parallel Readiness Check** (before bouncing multiple stories simultaneously):
210
+ - Verify test runner config excludes `.worktrees/` (vitest, jest, pytest, etc.)
211
+ - Verify no shared mutable state between worktrees (e.g., shared temp files, singletons writing to same path)
212
+ - Verify `.gitignore` includes `.worktrees/`
213
+ If any check fails, fix before spawning parallel stories. Intermittent test failures from worktree cross-contamination erode trust in the test suite fast.
214
+
215
+ 7. **Sprint Context File** — create `.vbounce/sprint-context-S-{XX}.md` using the sprint context template (`.vbounce/templates/sprint_context.md`):
216
+ - Populate with cross-cutting rules that ALL agents must follow during this sprint
217
+ - Include: design tokens, UI conventions, shared patterns, locked dependency versions, any active LESSONS.md rules that apply broadly
218
+ - This file is included in EVERY agent task file for this sprint
219
+ - Update it when mid-sprint decisions affect all stories (e.g., "we decided to use X pattern everywhere")
220
+
221
+ 8. Update sprint-{XX}.md: Status → "Active"
222
+ ```
223
+
224
+ **Note:** Risk assessment, dependency checks, scope selection, and execution mode decisions all happen during Sprint Planning (Phase 2), not here. Step 0 executes the confirmed plan.
225
+
226
+ ### Step 0.5: Discovery Check (L4 / 🔴 Stories Only)
227
+
228
+ Before moving any story to Ready to Bounce:
229
+
230
+ 1. For each story with `complexity_label: L4` or `ambiguity: 🔴 High`:
231
+ - Check for linked spikes in `product_plans/backlog/EPIC-{NNN}_{name}/SPIKE-*.md`
232
+ - If no spikes exist → create them (invoke doc-manager ambiguity rubric)
233
+ - If spikes exist but are not Validated/Closed → execute discovery sub-flow
234
+ - See `.vbounce/skills/agent-team/references/discovery.md`
235
+
236
+ 2. Once all spikes are Validated/Closed:
237
+ - Update story `ambiguity` frontmatter (should now be 🟡 or 🟢)
238
+ - Transition: Probing/Spiking → Refinement → Ready to Bounce
239
+
240
+ ### Step 1: Story Initialization
241
+ For each story with V-Bounce State "Ready to Bounce":
242
+ ```bash
243
+ # Create isolated worktree
244
+ git worktree add .worktrees/STORY-{ID}-{StoryName} -b story/STORY-{ID}-{StoryName} sprint/S-01
245
+ mkdir -p .worktrees/STORY-{ID}-{StoryName}/.vbounce/{tasks,reports}
246
+ ```
247
+ - Read the full Story spec
248
+ - Read LESSONS.md
249
+ - Check RISK_REGISTRY.md for risks tagged to this story or its Epic
250
+ - If `vdocs/_manifest.json` exists, identify docs relevant to this story's scope (match against manifest descriptions/tags). Include relevant doc references in the task file so the Developer has product context.
251
+ - **Adjacent implementation check:** For stories that modify or extend modules touched by earlier stories in this sprint, identify existing implementations the Developer should reuse. Add to the task file: `"Reuse these existing modules: {list with file paths and brief description of what each provides}"`. This prevents agents from independently re-implementing logic that already exists — a common source of duplication when stories run in parallel.
252
+ - **Include Sprint Context:** Copy `.vbounce/sprint-context-S-{XX}.md` into the task file or reference it. Every agent must read the sprint context before starting work.
253
+ - Create task file in `.worktrees/STORY-{ID}-{StoryName}/.vbounce/tasks/`
254
+ - Update sprint-{XX}.md: V-Bounce State → "Bouncing"
255
+
256
+ ### Step 2: Developer Pass
257
+ ```
258
+ 1. Spawn developer subagent in .worktrees/STORY-{ID}-{StoryName}/ with:
259
+ - Story §1 The Spec + §3 Implementation Guide
260
+ - LESSONS.md
261
+ - Relevant react-best-practices rules
262
+ - Adjacent module references (if any — "reuse src/core/X.ts for Y")
263
+ 2. Developer writes code and Implementation Report to .vbounce/reports/
264
+ 3. Lead reads report, verifies completeness
265
+ ```
266
+
267
+ ### Step 3: QA Pass
268
+ ```
269
+ 0. Run pre-QA gate scan:
270
+ ./.vbounce/scripts/pre_gate_runner.sh qa .worktrees/STORY-{ID}-{StoryName}/ sprint/S-{XX}
271
+ - If scan FAILS on trivial issues (debug statements, missing JSDoc, TODOs):
272
+ Return to Developer for quick fix. Do NOT spawn QA for mechanical failures.
273
+ If pre-gate scan fails 3+ times → Escalate: present failures to human with options:
274
+ a) Human fixes manually, b) Descope the story, c) Re-assign to a different approach.
275
+ - If scan PASSES: Include scan output path in the QA task file.
276
+ 1. Spawn qa subagent in .worktrees/STORY-{ID}-{StoryName}/ with:
277
+ - Developer Implementation Report
278
+ - Pre-QA scan results (.vbounce/reports/pre-qa-scan.txt)
279
+ - Story §2 The Truth (acceptance criteria)
280
+ - LESSONS.md
281
+ 2. QA validates against Gherkin scenarios, runs vibe-code-review
282
+ (skipping checks already covered by pre-qa-scan.txt)
283
+ 3. If FAIL:
284
+ - QA writes Bug Report (STORY-{ID}-{StoryName}-qa-bounce{N}.md)
285
+ - Increment bounce counter
286
+ - If QA bounce count >= 3 → V-Bounce State → "Escalated", STOP
287
+ - Else → Return to Step 2 with Bug Report as input
288
+ 4. If PASS:
289
+ - QA writes Validation Report
290
+ - V-Bounce State → "QA Passed"
291
+ ```
292
+
293
+ ### Step 4: Architect Pass
294
+ ```
295
+ 0. Run pre-Architect gate scan:
296
+ ./.vbounce/scripts/pre_gate_runner.sh arch .worktrees/STORY-{ID}-{StoryName}/ sprint/S-{XX}
297
+ - If scan reveals new dependencies or structural violations:
298
+ Return to Developer for resolution. Do NOT spawn Architect for mechanical failures.
299
+ If pre-gate scan fails 3+ times → Escalate to human (same options as pre-QA escalation).
300
+ - If scan PASSES: Include scan output path in the Architect task file.
301
+ 1. Spawn architect subagent in .worktrees/STORY-{ID}-{StoryName}/ with:
302
+ - All reports for this story
303
+ - Pre-Architect scan results (.vbounce/reports/pre-arch-scan.txt)
304
+ - Full Story spec + Roadmap §3 ADRs
305
+ - LESSONS.md
306
+ 2. If FAIL:
307
+ - Increment Architect bounce counter
308
+ - If Architect bounce count >= 3 → V-Bounce State → "Escalated", STOP
309
+ - Else → Return to Step 2 with Architect feedback as input
310
+ 3. If PASS:
311
+ - V-Bounce State → "Architect Passed"
312
+
313
+ *(Note: If the Team Lead assigned this story to the "Fast Track" execution mode, skip Steps 3 and 4 entirely. The Developer passes directly to Step 5: DevOps Story Merge.)*
314
+ ```
315
+
316
+ ### Step 5: Story Merge (DevOps)
317
+ ```
318
+ 1. Spawn devops subagent with:
319
+ - Story ID and sprint branch name
320
+ - All gate reports (QA PASS + Architect PASS)
321
+ - LESSONS.md
322
+ 2. DevOps performs:
323
+ - Pre-merge checks (worktree clean, gate reports verified)
324
+ - Archive reports to .vbounce/archive/S-{XX}/STORY-{ID}-{StoryName}/
325
+ - Merge story branch into sprint branch (--no-ff)
326
+ - Post-merge validation (tests + lint + build on sprint branch)
327
+ - Worktree removal and story branch cleanup
328
+ 3. DevOps writes Merge Report to .vbounce/archive/S-{XX}/STORY-{ID}-{StoryName}/STORY-{ID}-{StoryName}-devops.md
329
+ 4. If merge conflicts:
330
+ - Simple (imports, whitespace): DevOps resolves directly
331
+ - Complex (logic): DevOps writes Conflict Report, Lead creates fix story
332
+ 5. If post-merge tests fail:
333
+ - DevOps reverts the merge and writes a Post-Merge Failure Report (what failed, which tests, suspected cause)
334
+ - Lead returns story to Developer with the failure report as input
335
+ - Developer fixes in the original worktree (which is preserved until merge succeeds)
336
+ - Story re-enters the bounce at Step 2 (Dev pass). QA/Arch bounce counts are NOT reset — this is a merge issue, not a gate failure.
337
+ - If post-merge fails 3+ times → Escalate to human
338
+ ```
339
+ Update sprint-{XX}.md: V-Bounce State → "Done"
340
+
341
+ ### Step 5.5: Immediate Lesson Recording
342
+ After each story merge, before proceeding to the next story:
343
+ ```
344
+ 1. Read Dev report — check `lessons_flagged` field
345
+ 2. Read QA report — check for lessons flagged during validation
346
+ 3. For each flagged lesson:
347
+ - Present to the human for approval
348
+ - If approved → record to LESSONS.md immediately (follow lesson skill format)
349
+ - If rejected → note as "No" in Sprint Report §4
350
+ 4. Do NOT defer this to Step 7 — context decays fast
351
+ ```
352
+
353
+ ### Step 5.7: User Walkthrough (Post-Delivery Review)
354
+ After all stories are merged but BEFORE Sprint Integration Audit:
355
+ ```
356
+ 1. Present the user with a summary of what was built (from Dev reports)
357
+ 2. Ask the user to test the running app and provide feedback
358
+ 3. Track feedback as one of:
359
+ - "Review Feedback" — UI tweaks, copy changes, minor adjustments
360
+ - "Bug" — something broken that should have been caught
361
+ 4. Review Feedback items:
362
+ - Do NOT count toward Correction Tax — this is healthy iteration
363
+ - Create quick-fix tasks delegated to Developer on the sprint branch
364
+ - Each fix gets a mini Dev→QA cycle (no Architect pass needed)
365
+ 5. Bug items:
366
+ - Count toward Correction Tax as "Bug Fix" sub-category
367
+ - Route through normal bounce flow (Dev→QA→Arch if needed)
368
+ 6. Log all walkthrough items in sprint-{XX}.md §4 Execution Log with event type `UR` (User Review)
369
+ 7. When user confirms "looks good" or no more feedback → proceed to Step 6
370
+ ```
371
+
372
+ This phase gives ad-hoc post-delivery feedback a proper home. Without it, users give feedback after sprint close, which gets tracked as correction tax and skews metrics.
373
+
374
+ ### Step 6: Sprint Integration Audit
375
+ After ALL stories are merged into `sprint/S-01`:
376
+ ```
377
+ 1. Spawn architect subagent on sprint/S-01 branch
378
+ 2. First, Architect runs `./.vbounce/scripts/hotfix_manager.sh audit` to check for hotfix drift. If it fails, perform deep audit on flagged files.
379
+ 3. Run Sprint Integration Audit — Deep Audit on combined changes
380
+ 4. Check for: duplicate routes, competing state, overlapping migrations
381
+ 5. If issues found:
382
+ - Present findings to human with severity assessment
383
+ - AI suggests which epic the fix story should belong to
384
+ - Fix stories are added to the BACKLOG (not the current sprint) — they enter the next sprint through normal planning
385
+ - Exception: if the issue blocks the sprint release (e.g., broken build), fix inline on the sprint branch without creating a story
386
+ ```
387
+
388
+ ### Step 7: Sprint Consolidation
389
+ ```
390
+ 1. Read all archived reports in .vbounce/archive/S-{XX}/
391
+ 2. **Aggregate token usage** from every agent report:
392
+ - Sum `input_tokens`, `output_tokens`, and `total_tokens` fields separately from all agent report YAML frontmatter.
393
+ - If an agent report has `total_tokens: 0` (script failed), use the task notification `total_tokens` from when that agent completed. Task notification totals are the authoritative LLM usage numbers. Note: task notifications only provide a single total — record it as `total_tokens` with input/output marked as "unknown".
394
+ - Cross-check: if `count_tokens.mjs` totals and task notification totals diverge by >20%, prefer task notification totals (they reflect actual API consumption).
395
+ - Also run `vbounce tokens --sprint S-{XX} --json` to get per-story aggregates from story document Token Usage tables as a third data source.
396
+ 3. Generate Sprint Report to .vbounce/sprint-report-S-{XX}.md:
397
+ - Ensure the Sprint Report starts with a YAML frontmatter block containing:
398
+ ```yaml
399
+ ---
400
+ total_input_tokens: {sum of input tokens}
401
+ total_output_tokens: {sum of output tokens}
402
+ total_tokens_used: {sum of all agent tokens}
403
+ ---
404
+ ```
405
+ 4. V-Bounce State → "Sprint Review" for all stories
406
+ 4. Present Sprint Report to human
407
+ 5. **Lesson Review (non-blocking):**
408
+ Most lessons should already be recorded to LESSONS.md during Step 5.5.
409
+ Review §4 of the Sprint Report — confirm all flagged lessons have a status.
410
+ If any lessons were missed during Step 5.5, present them now and record approved ones.
411
+ This is a review step, not a first-time approval gate.
412
+ 6. After review → Spawn devops subagent for Sprint Release:
413
+ - Merge sprint/S-01 → main (--no-ff)
414
+ - Tag release: v{VERSION}
415
+ - Run full test suite + build + lint on main
416
+ - Sprint branch cleanup
417
+ - Environment verification (if applicable)
418
+ - DevOps writes Sprint Release Report to .vbounce/archive/S-{XX}/sprint-S-{XX}-devops.md
419
+ 6. Lead finalizes:
420
+ - Move sprint-report-S-{XX}.md to .vbounce/archive/S-{XX}/
421
+ - Record lessons (with user approval)
422
+ - Update delivery_plan.md to reflect the completed sprint.
423
+ 7. **Framework Self-Assessment** (aggregated from agent reports):
424
+ - Collect all `## Process Feedback` sections from agent reports in `.vbounce/archive/S-{XX}/`
425
+ - Populate §5 Framework Self-Assessment tables in the Sprint Report by category
426
+ - **Always run** `suggest_improvements.mjs` — every sprint, unconditionally. First sprints generate the most friction.
427
+ - **Verbally present** the top improvement suggestions to the user. Do NOT just embed them in the report — tell the user directly:
428
+ - Summarize each P0/P1 suggestion in plain language (what's broken, why it matters, what to change)
429
+ - For P2/P3 suggestions, give a brief list and note they're in `.vbounce/improvement-suggestions.md`
430
+ - Ask the user: *"Want me to run `/improve` to apply any of these?"*
431
+ - If user approves → read `.vbounce/skills/improve/SKILL.md` and execute the improvement process
432
+ 8. Product Documentation check (runs on `main` after sprint merge):
433
+ a. **Staleness Detection** — run `./.vbounce/scripts/vdoc_staleness.mjs S-{XX}`
434
+ - Cross-references all Dev Reports' `files_modified` against manifest key files
435
+ - Generates `.vbounce/scribe-task-S-{XX}.md` with targeted list of stale docs
436
+ - Populates Sprint Report §1 "Product Docs Affected" table
437
+ - If no `vdocs/_manifest.json` exists → skip silently (graceful no-op)
438
+ b. **Scribe Task Decision:**
439
+ - If staleness detection found stale docs → offer targeted Scribe task
440
+ - If sprint delivered 3+ features and no vdocs exist → offer vdoc init
441
+ - If any Developer report flagged stale product docs → offer Scribe update
442
+ c. If user approves → spawn scribe subagent on `main` branch with:
443
+ - `.vbounce/scribe-task-S-{XX}.md` (targeted task — when available)
444
+ - Sprint Report (what was built)
445
+ - Dev reports that flagged affected product docs
446
+ - Current _manifest.json (if exists)
447
+ - Mode: "audit" (if docs exist) or "init" (if first time)
448
+ d. Scribe generates/updates docs and writes Scribe Report
449
+ - Documentation is post-implementation — it reflects what was built
450
+ - Scribe commits documentation as a follow-up commit on `main`
451
+ ```
452
+
453
+ ---
454
+
455
+ ## Cleanup Process
456
+
457
+ ### After Each Story Completes (DevOps handles via Step 5)
458
+ 1. Archive reports to `.vbounce/archive/S-{XX}/STORY-{ID}-{StoryName}/`
459
+ 2. Merge story branch into sprint branch (--no-ff)
460
+ 3. Validate tests/build on sprint branch
461
+ 4. Remove worktree: `git worktree remove .worktrees/STORY-{ID}-{StoryName}`
462
+ 5. Delete story branch: `git branch -d story/STORY-{ID}-{StoryName}`
463
+ 6. Write DevOps Merge Report
464
+
465
+ ### After Sprint Completes (DevOps handles via Step 7)
466
+ 1. Merge sprint branch into main (--no-ff)
467
+ 2. Tag release: `git tag -a v{VERSION}`
468
+ 3. Run full validation (tests + build + lint)
469
+ 4. Delete sprint branch: `git branch -d sprint/S-{XX}`
470
+ 5. Verify `.worktrees/` is empty (all worktrees removed)
471
+ 6. Write Sprint Release Report
472
+ 7. Lead archives the sprint folder to `archive/` according to doc-manager physical move rules.
473
+
474
+ ### After Delivery Completes (Team Lead handles)
475
+ When ALL sprints in a delivery (release) are done:
476
+ 1. Verify all stories in the delivery are "Done" in the Delivery Plan
477
+ 2. Move the entire delivery folder to archive:
478
+ ```bash
479
+ mv product_plans/D-{NN}_{release_name}/ product_plans/archive/D-{NN}_{release_name}/
480
+ ```
481
+ 3. Add a **Delivery Log** entry to the Roadmap (§7):
482
+ - Delivery ID, date, release tag
483
+ - Release Notes — summarize all sprint reports from this delivery
484
+ - Key metrics (stories delivered, bounce ratio, correction tax averages)
485
+ 4. Update Roadmap §2 Release Plan: set the release status to "Delivered"
486
+
487
+ ### Retention
488
+ - `.vbounce/archive/` is **committed to git** — full sprint history, all agent reports, audit trail
489
+ - `.vbounce/reports/` and `.vbounce/sprint-report.md` are **gitignored** — active working files only
490
+ - `product_plans/archive/` retains completed deliveries with all their epics, stories, and delivery plans
491
+ - `.worktrees/` is **gitignored** — ephemeral, exists only during active bouncing
492
+ - Story branches are deleted after merge
493
+ - Sprint branches are deleted after merge to main
494
+
495
+ ---
496
+
497
+ ## Sprint Plan Sync
498
+
499
+ The Team Lead MUST update the active `sprint-{XX}.md` at every state transition. This is the source of truth for execution.
500
+
501
+ | Action | Sprint Plan Update | Delivery Plan Update |
502
+ |--------|-------------------|--------------------|
503
+ | Worktree created | §1: V-Bounce State → "Bouncing" | **Nothing** — Sprint Plan is source of truth |
504
+ | Dev report written | No update (still "Bouncing") | **Nothing** |
505
+ | QA passes | §1: V-Bounce State → "QA Passed" | **Nothing** |
506
+ | Architect passes | §1: V-Bounce State → "Architect Passed" | **Nothing** |
507
+ | DevOps merges story | §1: V-Bounce State → "Done". §4: Add Execution Log row (via `vbounce story complete`) | **Nothing** |
508
+ | Escalated | §1: Move story to Escalated section | **Nothing** |
509
+ | Sprint CLOSES | Status → "Completed" in frontmatter | §2: sprint → Completed. §4: add summary. §3: remove delivered stories. **This is the ONLY time Delivery Plan updates.** |
510
+
511
+ > **Key rule**: The Delivery Plan is updated ONLY at sprint close, never during active bouncing.
512
+ > See `.vbounce/skills/agent-team/references/delivery-sync.md` for full sync rules.
513
+
514
+ ---
515
+
516
+ ## Edge Case Handling
517
+
518
+ ### Spec Conflict
519
+ Developer writes a Spec Conflict Report. Lead pauses the bounce:
520
+ - Remove worktree (preserve branch for reference)
521
+ - Return story to Refinement in sprint-{XX}.md and copy it back to backlog/
522
+ - After spec is fixed, recreate worktree and restart bounce
523
+
524
+ ### Escalated Stories
525
+ When QA bounce count >= 3 OR Architect bounce count >= 3:
526
+ - Worktree is kept but frozen (no new work)
527
+ - Lead writes Escalation Report to `.vbounce/archive/S-{XX}/STORY-{ID}-{StoryName}/escalation.md`
528
+ - Human decides: rewrite spec → Refinement, descope → split, kill → Parking Lot
529
+ - **If returned to Refinement:** The spec has been rewritten. You MUST reset the QA and Architect bounce counters to 0 for this story.
530
+ - If killed: `git worktree remove`, branch preserved unmerged
531
+
532
+ ### Mid-Sprint Change Requests
533
+ When the user provides input mid-bounce that isn't a direct answer to an agent question (e.g., "this is broken", "change the approach", "I meant X not Y"), the Team Lead MUST triage it before acting.
534
+
535
+ > See `.vbounce/skills/agent-team/references/mid-sprint-triage.md` for the full triage flow, routing rules, and logging requirements.
536
+
537
+ **Quick reference — categories:**
538
+ | Category | Route | Bounce Impact |
539
+ |----------|-------|---------------|
540
+ | **Bug** | Hotfix or bug-fix task in current story | No bounce increment |
541
+ | **Spec Clarification** | Update Story spec, continue bounce | No impact |
542
+ | **Scope Change** | Pause, update spec, confirm with user | Resets Dev pass |
543
+ | **Approach Change** | Update §3 Implementation Guide, re-delegate | Resets Dev pass |
544
+
545
+ Every change request is logged in `sprint-{XX}.md` §4 Execution Log with event type `CR` and reported in Sprint Report §2.1.
546
+
547
+ ### Mid-Sprint Strategic Changes
548
+ Charter and Roadmap are typically **frozen** during active sprints. However, if an emergency requires modifying them:
549
+ 1. You MUST pause active bouncing across all stories.
550
+ 2. Delegate to doc-manager to run the **Sprint Impact Analysis Protocol**.
551
+ 3. Evaluate the active stories in `sprint-{XX}.md` against the new strategy to determine if they are: Unaffected, Require Scope Adjustment, or Invalidated.
552
+ 4. Only abort stories that are explicitly Invalidated by the human. Unaffected stories may resume bouncing.
553
+
554
+ ### Merge Conflicts
555
+ If merging story branch into sprint branch creates conflicts:
556
+ - DevOps resolves simple conflicts (import ordering, adjacent edits, whitespace)
557
+ - Complex conflicts (logic changes, competing implementations): DevOps writes a Merge Conflict Report, Lead creates a new story to resolve through the normal bounce flow
558
+
559
+ ---
560
+
561
+ ## Critical Rules
562
+
563
+ - **The Lead never writes code.** It plans, delegates, monitors, and consolidates.
564
+ - **Enforce Sequential Dependencies.** Never parallelize stories where one depends on the other. Wait for merge.
565
+ - **One story = one worktree.** Never mix stories in a single worktree.
566
+ - **Reports are the only handoff.** No agent communicates with another directly.
567
+ - **One bounce = one report.** Every agent pass produces exactly one report file.
568
+ - **Archive before remove.** Always copy reports to shared archive before removing a worktree.
569
+ - **Sync the Sprint Plan.** Update V-Bounce State in sprint-{XX}.md §1 at EVERY transition. The Sprint Plan is the source of truth DURING the sprint. The Delivery Plan is updated at sprint boundaries only — see `.vbounce/skills/agent-team/references/delivery-sync.md`.
570
+ - **Track bounce counts.** QA and Architect bounces are tracked separately per story.
571
+ - **Git tracking rules.** `.worktrees/`, `.vbounce/reports/`, and `.vbounce/sprint-report.md` are gitignored (ephemeral). `.vbounce/archive/` is **committed to git** (permanent audit trail).
572
+ - **Check risks before bouncing.** Read RISK_REGISTRY.md at sprint start. Flag high-severity risks that affect planned stories.
573
+ - **Resolve open questions first.** Read the active `sprint-{XX}.md` §2 Sprint Open Questions at sprint start. Do not bounce stories with unresolved blocking questions.
574
+ - **Know what's documented.** If `vdocs/_manifest.json` exists, read it at sprint start. Pass relevant doc references to agents. Offer documentation updates after sprints that deliver new features.
575
+ - **Resolve discovery before bouncing.** L4 stories and 🔴 ambiguity stories MUST complete spikes before entering the bounce sequence. See `.vbounce/skills/agent-team/references/discovery.md`.
576
+
577
+ ## Keywords
578
+
579
+ delegate, orchestrate, subagent, agent team, bounce, sprint, report, worktree, git, isolation, merge, branch, cleanup, archive, delivery plan
@@ -0,0 +1,42 @@
1
+ # Cleanup & Archive Rules
2
+
3
+ > On-demand reference from agent-team/SKILL.md. Read during sprint close or when archiving.
4
+
5
+ ## After Each Story Completes (DevOps Step 5)
6
+
7
+ 1. Archive all reports to `.vbounce/archive/S-{XX}/STORY-{ID}-{StoryName}/`
8
+ 2. Merge story branch into sprint branch (--no-ff)
9
+ 3. Validate tests/build on sprint branch
10
+ 4. Remove worktree: `git worktree remove .worktrees/STORY-{ID}-{StoryName}`
11
+ 5. Delete story branch: `git branch -d story/STORY-{ID}-{StoryName}`
12
+ 6. Write DevOps Merge Report to `.vbounce/archive/S-{XX}/STORY-{ID}-{StoryName}/`
13
+
14
+ ## After Sprint Completes (DevOps Step 7)
15
+
16
+ 1. Merge sprint branch into main (--no-ff)
17
+ 2. Tag release: `git tag -a v{VERSION}`
18
+ 3. Run full validation (tests + build + lint)
19
+ 4. Delete sprint branch: `git branch -d sprint/S-{XX}`
20
+ 5. Verify `.worktrees/` is empty
21
+ 6. Write Sprint Release Report to `.vbounce/archive/S-{XX}/sprint-S-{XX}-devops.md`
22
+ 7. Lead archives Sprint Plan: `mv product_plans/sprints/sprint-{XX}/ product_plans/archive/sprints/sprint-{XX}/`
23
+ 8. Lead archives sprint report: `mv .vbounce/sprint-report-S-{XX}.md .vbounce/archive/S-{XX}/`
24
+ 9. Run: `vbounce trends && vbounce suggest S-{XX}` — generates improvement recommendations
25
+
26
+ ## Retention Policy
27
+
28
+ | Location | Status | Rule |
29
+ |----------|--------|------|
30
+ | `.vbounce/archive/` | **Committed to git** | Permanent audit trail — never delete |
31
+ | `.vbounce/reports/` | **Gitignored** | Active working files only — ephemeral |
32
+ | `.vbounce/sprint-report-S-{XX}.md` | **Gitignored** | Active sprint report — archived on close |
33
+ | `.vbounce/sprint-context-*.md` | **Gitignored** | Regenerated each session |
34
+ | `.worktrees/` | **Gitignored** | Ephemeral — exists only during active bouncing |
35
+ | `product_plans/archive/` | **Committed** | Completed deliveries with all docs |
36
+
37
+ ## After Delivery Completes (Team Lead)
38
+
39
+ 1. Verify all stories in delivery are "Done" in Delivery Plan §4
40
+ 2. Move delivery folder: `mv product_plans/D-{NN}_{name}/ product_plans/archive/D-{NN}_{name}/`
41
+ 3. Add Delivery Log entry to Roadmap §7
42
+ 4. Update Roadmap §2 Release Plan: status → "Delivered"
@@ -0,0 +1,43 @@
1
+ # Delivery Plan Sync Rules
2
+
3
+ > On-demand reference from agent-team/SKILL.md. When and how to update the Delivery Plan.
4
+
5
+ ## Core Rule
6
+
7
+ **The Delivery Plan is updated ONLY at sprint boundaries — not during active bouncing.**
8
+
9
+ Story state changes are tracked in the Sprint Plan (sprint-{XX}.md) §1 ONLY.
10
+ The Delivery Plan is a strategic document — it does not track story states.
11
+
12
+ ## Sync Table
13
+
14
+ | Action | Sprint Plan Update | Delivery Plan Update |
15
+ |--------|-------------------|---------------------|
16
+ | Sprint starts | Status → "Active" (frontmatter) | §2: sprint status → Active |
17
+ | Story state changes | §1 V-Bounce State ONLY | **Nothing** |
18
+ | Story completes | §1 state → Done, §4 Execution Log row added | **Nothing** |
19
+ | Sprint ends | Status → "Completed" (frontmatter) | §2: sprint → Completed, §4: add summary row, §3: remove delivered stories |
20
+ | Hotfix applied | No sprint plan change | **Nothing** |
21
+
22
+ ## What Each Document Owns
23
+
24
+ **Sprint Plan** (sprint-{XX}.md):
25
+ - Story states (§1 V-Bounce State column)
26
+ - Context Pack Readiness (§1)
27
+ - Execution Strategy and phases (§2)
28
+ - Sprint open questions (§3)
29
+ - Execution Log accumulation (§4)
30
+
31
+ **Delivery Plan** (D-{NN}_DELIVERY_PLAN.md):
32
+ - Epic-level status (§2)
33
+ - Unassigned backlog stories (§3)
34
+ - Completed sprint history (§4)
35
+ - Project window and team (§1)
36
+
37
+ ## Never Do This
38
+
39
+ - ❌ Update Delivery Plan §2/§3 when a story bounces
40
+ - ❌ Update Delivery Plan §2/§3 when QA passes
41
+ - ❌ Update Delivery Plan §2/§3 when Architect passes
42
+ - ✅ Update Sprint Plan §1 for ALL state transitions during the sprint
43
+ - ✅ Update Delivery Plan §4 only when a sprint CLOSES