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,134 @@
1
+ <instructions>
2
+ FOLLOW THIS EXACT STRUCTURE. Output sections in order 0-4.
3
+
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)
10
+
11
+ Output location: `product_plans/sprints/sprint-{XX}/sprint-{XX}.md`
12
+
13
+ Role of this document:
14
+ - This is the SINGLE SOURCE OF TRUTH during active sprint execution.
15
+ - The Team Lead updates this file at every state transition — NOT the Delivery Plan.
16
+ - The Delivery Plan is only updated at sprint boundaries (start and end).
17
+
18
+ Document Lifecycle:
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.
24
+ - §4 Execution Log gets one row per completed story (via `vbounce story complete`).
25
+ - At sprint end, §4 becomes the skeleton for Sprint Report §2 — no reconstruction needed.
26
+ - When the sprint completes, this document moves to `product_plans/archive/sprints/sprint-{XX}/`.
27
+
28
+ Do NOT output these instructions.
29
+ </instructions>
30
+
31
+ ---
32
+ sprint_id: "sprint-{XX}"
33
+ sprint_goal: "{One-sentence North Star}"
34
+ dates: "{MM/DD - MM/DD}"
35
+ status: "Planning / Confirmed / Active / Completed"
36
+ delivery: "D-{NN}"
37
+ confirmed_by: ""
38
+ confirmed_at: ""
39
+ ---
40
+
41
+ # Sprint S-{XX} Plan
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
+
57
+ ## 1. Active Scope
58
+ > Stories pulled from the backlog for execution during this sprint window.
59
+ > V-Bounce State is the ONLY authoritative source for story status during the sprint.
60
+
61
+ | Priority | Story | Epic | Label | V-Bounce State | Blocker |
62
+ |----------|-------|------|-------|----------------|---------|
63
+ | 1 | [STORY-XXX-YY: name](./STORY-XXX-YY-name.md) | EPIC-XXX | L2 | Draft | — |
64
+
65
+ ### Context Pack Readiness
66
+ > Check before moving story to "Ready to Bounce". All items must be ✅.
67
+ > Run `vbounce validate ready STORY-ID` to verify programmatically.
68
+
69
+ **STORY-{ID}: {name}**
70
+ - [ ] Story spec complete (§1)
71
+ - [ ] Acceptance criteria defined (§2)
72
+ - [ ] Implementation guide written (§3)
73
+ - [ ] Ambiguity: Low / Medium (if High → back to Refinement)
74
+
75
+ V-Bounce State: Draft / Refinement / Ready to Bounce
76
+
77
+ ### Escalated / Parking Lot
78
+ - STORY-XXX-YY: {name} — Reason: {escalated / deferred}
79
+
80
+ ---
81
+
82
+ ## 2. Execution Strategy
83
+ > Written during sprint planning. Guides the Lead's delegation order.
84
+
85
+ ### Phase Plan
86
+ - **Phase 1 (parallel)**: {Story IDs that can run simultaneously}
87
+ - **Phase 2 (sequential)**: {Story IDs with dependencies — run in order}
88
+
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 |
102
+
103
+ ### Dependency Chain
104
+ > Stories that MUST run sequentially (depends_on OR shared files).
105
+
106
+ | Story | Depends On | Reason |
107
+ |-------|-----------|--------|
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}
113
+
114
+ ---
115
+
116
+ ## 3. Sprint Open Questions
117
+ > Unresolved items that affect this specific sprint execution window.
118
+ > Strategic questions belong in the Delivery Plan, not here.
119
+
120
+ | Question | Options | Impact | Owner | Status |
121
+ |----------|---------|--------|-------|--------|
122
+ | {question} | A: {x}, B: {y} | Blocks {stories} | {name} | Open / Decided |
123
+
124
+ ---
125
+
126
+ <!-- EXECUTION_LOG_START -->
127
+ ## 4. Execution Log
128
+ > Updated by the Lead after each story completes via `vbounce story complete STORY-ID`.
129
+ > This table becomes Sprint Report §2 at sprint end — no reconstruction needed.
130
+
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} |
134
+ <!-- EXECUTION_LOG_END -->
@@ -0,0 +1,61 @@
1
+ <instructions>
2
+ This template is used by the Team Lead at Sprint Setup (Step 0.7) to create a shared context file
3
+ for all agents in the sprint. Every agent task file must reference this file.
4
+
5
+ Purpose: Reduce divergence between parallel agents by giving them a single source of cross-cutting rules.
6
+
7
+ Written to `.vbounce/sprint-context-S-{XX}.md`.
8
+ Updated mid-sprint when cross-cutting decisions change.
9
+
10
+ Do NOT output these instructions.
11
+ </instructions>
12
+
13
+ ---
14
+ sprint_id: "S-{XX}"
15
+ created: "{YYYY-MM-DD}"
16
+ last_updated: "{YYYY-MM-DD}"
17
+ ---
18
+
19
+ # Sprint Context: S-{XX}
20
+
21
+ > Cross-cutting rules for ALL agents in this sprint. Read this before starting any work.
22
+
23
+ ## Design Tokens & UI Conventions
24
+ > Visual rules that apply across all UI stories. Omit if sprint has no UI work.
25
+
26
+ - **Color palette**: {e.g., "Primary: #1A1A2E, Accent: #E94560, Background: #F5F5F5"}
27
+ - **Typography**: {e.g., "Headings: Inter 600, Body: Inter 400, Mono: JetBrains Mono"}
28
+ - **Spacing rhythm**: {e.g., "4px base unit, 8/16/24/32px scale"}
29
+ - **Component patterns**: {e.g., "Use existing Button component from src/components/ui/Button.tsx"}
30
+
31
+ ## Shared Patterns & Conventions
32
+ > Technical patterns all agents must follow. Derived from ADRs, LESSONS.md, and sprint planning.
33
+
34
+ - {e.g., "All API calls go through src/lib/api-client.ts — do not use fetch directly"}
35
+ - {e.g., "Error boundaries must wrap every route-level component"}
36
+ - {e.g., "Use Zod for all input validation — do not write manual validators"}
37
+
38
+ ## Locked Dependencies
39
+ > Versions that must not be changed during this sprint.
40
+
41
+ | Package | Version | Reason |
42
+ |---------|---------|--------|
43
+ | {e.g., "react"} | {e.g., "18.2.0"} | {e.g., "Upgrade planned for S-04"} |
44
+
45
+ ## Active Lessons (Broad Impact)
46
+ > LESSONS.md entries that affect multiple stories in this sprint. Copied here for visibility.
47
+
48
+ - {e.g., "[2026-03-10] Always use soft deletes with RLS — never cascade"}
49
+ - {e.g., "[2026-03-15] Run `npm run typecheck` before committing — tsc catches what ESLint misses"}
50
+
51
+ ## Sprint-Specific Rules
52
+ > Decisions made during sprint planning or mid-sprint that all agents must follow.
53
+
54
+ - {e.g., "All new components must include a Storybook story"}
55
+ - {e.g., "No new dependencies without Team Lead approval — we're near the bundle size limit"}
56
+
57
+ ## Change Log
58
+
59
+ | Date | Change | By |
60
+ |------|--------|-----|
61
+ | {YYYY-MM-DD} | Sprint context created | Team Lead |
@@ -0,0 +1,215 @@
1
+ <instructions>
2
+ FOLLOW THIS EXACT STRUCTURE. Output sections in order 1-6.
3
+
4
+ 1. **YAML Frontmatter**: Sprint ID, Goal, Dates, Status, Delivery Ref, Delivery Plan Ref
5
+ 2. **§1 What Was Delivered**: User-facing summary — what's accessible/usable vs what's internal/backend
6
+ 3. **§2 Story Results**: Table of all stories with final status and per-story metrics. §2.1 Change Requests logs any mid-sprint user interventions (bugs, spec clarifications, scope/approach changes)
7
+ 4. **§3 Execution Metrics**: AI performance metrics — tokens, duration, bounces, correction tax
8
+ 5. **§4 Lessons Learned**: Flagged from agent reports, pending user approval to record
9
+ 6. **§5 Retrospective**: What went well, what didn't, and what to change — covers both project and delivery process
10
+
11
+ This template is used by the Team Lead at Sprint Consolidation (Step 7).
12
+ Written to `.vbounce/sprint-report.md`, then archived to `.vbounce/archive/S-{XX}/`.
13
+
14
+ When the delivery completes, sprint reports are summarized into the Roadmap §7 Delivery Log
15
+ as Release Notes.
16
+
17
+ The §1 section is critical — the user wants to know what they can see, touch, and use NOW
18
+ versus what was built under the hood. Write it from the user's perspective, not the developer's.
19
+
20
+ Do NOT output these instructions.
21
+ </instructions>
22
+
23
+ ---
24
+ sprint_id: "S-{XX}"
25
+ sprint_goal: "{One-sentence North Star}"
26
+ dates: "{MM/DD - MM/DD}"
27
+ status: "Achieved / Partially Achieved / Failed"
28
+ total_input_tokens: {N}
29
+ total_output_tokens: {N}
30
+ total_tokens_used: {N}
31
+ delivery_ref: "D-{NN}_{release_name}"
32
+ delivery_plan_ref: "product_plans/{delivery}/DELIVERY_PLAN.md"
33
+ ---
34
+
35
+ # Sprint Report: S-{XX}
36
+
37
+ ## 1. What Was Delivered
38
+
39
+ ### User-Facing (Accessible Now)
40
+ > Features, screens, or workflows the user can see, interact with, or test right now.
41
+
42
+ - {e.g., "Login page with email/password authentication — accessible at /login"}
43
+ - {e.g., "Dashboard with project overview cards — accessible at /dashboard"}
44
+ - {e.g., "Settings page with profile editing — accessible at /settings"}
45
+
46
+ ### Internal / Backend (Not Directly Visible)
47
+ > Infrastructure, APIs, database changes, or plumbing that supports future features.
48
+
49
+ - {e.g., "User roles and permissions system — API endpoints ready, no UI yet"}
50
+ - {e.g., "Database migration for notifications table — schema deployed"}
51
+ - {e.g., "Rate limiting middleware on all API routes"}
52
+
53
+ ### Not Completed
54
+ > Stories that were planned but didn't make it (escalated, deferred, or partially done).
55
+
56
+ - {e.g., "STORY-001-03-email_notifications — Escalated (template integration failed 3x)"}
57
+
58
+ ### Product Docs Affected
59
+ > Auto-populated from staleness detection (`vbounce docs check S-{XX}`). Shows which vdocs were impacted by this sprint's code changes. Scribe agent receives a targeted task from `.vbounce/scribe-task-S-{XX}.md`.
60
+
61
+ | Doc | Stale Key Files | Touched By | Priority | Scribe Action |
62
+ |-----|----------------|------------|----------|---------------|
63
+ | {e.g., `AUTHENTICATION_DOC.md`} | {e.g., `src/auth/index.ts`} | {e.g., `STORY-001-02`} | {HIGH/MEDIUM/LOW} | {Update / Quality Fix / New} |
64
+
65
+ > If no `vdocs/_manifest.json` exists, write "N/A — vdoc not installed".
66
+
67
+ ---
68
+
69
+ ## 2. Story Results
70
+
71
+ | Story | Epic | Label | Final State | Bounces (QA) | Bounces (Arch) | Correction Tax | Tax Type |
72
+ |-------|------|-------|-------------|--------------|----------------|----------------|----------|
73
+ | STORY-{ID}-{story_name} | EPIC-{ID} | L{N} | Done / Escalated / Parking Lot | {N} | {N} | {X}% | Bug Fix / Enhancement / Mixed |
74
+
75
+ ### Story Highlights
76
+ - **STORY-{ID}-{story_name}**: {1-sentence summary of what was built and notable decisions}
77
+
78
+ ### Escalated Stories (if any)
79
+ - **STORY-{ID}-{story_name}**: Escalated after {N} bounces. Root cause: {why}. Recommendation: {rewrite spec / descope / kill}.
80
+
81
+ ### 2.1 Change Requests
82
+ > Mid-sprint user interventions — bugs found, spec clarifications, scope or approach changes. Tracked separately from agent-driven bounces so metrics aren't skewed. Omit this section if no CRs occurred.
83
+
84
+ | Story | Category | Description | Impact |
85
+ |-------|----------|-------------|--------|
86
+ | STORY-{ID} | Bug / Spec Clarification / Scope Change / Approach Change | {One-line description} | {e.g., No bounce reset / Dev pass reset / +1 session} |
87
+
88
+ ---
89
+
90
+ ## 3. Execution Metrics
91
+
92
+ > Run `vbounce tokens --sprint S-{XX} --json` to get per-story and sprint-total token data from story documents. Use the output to populate the tables below.
93
+
94
+ ### AI Performance
95
+
96
+ | Metric | Value | Notes |
97
+ |--------|-------|-------|
98
+ | **Total Tokens Used** | {N} | input + output across all agents |
99
+ | **Output Tokens** | {N} | tokens generated by agents |
100
+ | **Input Tokens** | {N} | context fed to agents |
101
+ | **Total Execution Duration** | {X}h {Y}m | wall-clock time from sprint start to completion |
102
+ | **Agent Sessions** | {N} | total subagent spawns (Dev + QA + Arch + DevOps + Scribe) |
103
+ | **Estimated Cost** | ${X.XX} | based on model pricing at time of execution |
104
+
105
+ ### V-Bounce Quality
106
+
107
+ | Metric | Value | Notes |
108
+ |--------|-------|-------|
109
+ | **Stories Planned** | {X} | |
110
+ | **Stories Delivered** | {Y} | |
111
+ | **Stories Escalated** | {Z} | |
112
+ | **Total QA Bounces** | {N} | across all stories |
113
+ | **Total Architect Bounces** | {N} | across all stories |
114
+ | **Bounce Ratio** | {X}% | (total bounces / total stories) |
115
+ | **Average Correction Tax** | {X}% | 🟢 0-5% · 🟡 6-15% · 🔴 16%+ requires process review |
116
+ | **— Bug Fix Tax** | {X}% | Quality failures — bugs that should have been caught by agents |
117
+ | **— Enhancement Tax** | {X}% | Healthy iteration — user feedback, UX tweaks, spec refinements |
118
+ | **First-Pass Success Rate** | {X}% | stories that passed QA on first try |
119
+ | **Total Tests Written** | {N} | across all stories (from Dev report `tests_written`) |
120
+ | **Tests per Story (avg)** | {N} | |
121
+ | **Merge Conflicts** | {N} simple, {N} complex | |
122
+
123
+ ### Per-Story Breakdown
124
+
125
+ | Story | Tokens | Duration | Agent Sessions | Bounces | Cost |
126
+ |-------|--------|----------|----------------|---------|------|
127
+ | STORY-{ID}-{story_name} | {N} | {Xh Ym} | {N} | {N} | ${X.XX} |
128
+
129
+ ### Threshold Alerts
130
+ > Flag any metrics that crossed warning or critical thresholds. If none, write "No threshold alerts."
131
+ > **Only Bug Fix Tax triggers threshold alerts.** Enhancement Tax (user-driven iteration) is healthy and expected.
132
+
133
+ - {e.g., "STORY-001-05-test_arch: Bug Fix Tax 10% (🟡) — root cause: test architecture rework due to ESM timer conflict"}
134
+ - {e.g., "STORY-002-03-edge_cases: 2 QA bounces — spec ambiguity in edge case handling"}
135
+
136
+ ---
137
+
138
+ ## 4. Lessons Learned
139
+
140
+ > 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.
141
+
142
+ | Source | Lesson | Recorded? | When |
143
+ |--------|--------|-----------|------|
144
+ | STORY-{ID}-{story_name} Dev Report | {What happened and proposed rule} | Yes / No / Missed | {After story merge / Sprint close} |
145
+
146
+ ---
147
+
148
+ ## 5. Retrospective
149
+
150
+ ### What Went Well
151
+ > Practices, patterns, or decisions that worked and should be repeated.
152
+
153
+ - {e.g., "Splitting EPIC-001 into small L2 stories kept bounces low — 80% first-pass success"}
154
+ - {e.g., "Reading _manifest.json upfront saved Dev from duplicating existing API docs"}
155
+
156
+ ### What Didn't Go Well
157
+ > Problems encountered, root causes, and impact on the sprint.
158
+
159
+ - {e.g., "STORY-001-03-api_spec escalated because the spec was ambiguous — 3 QA bounces wasted"}
160
+ - {e.g., "Merge conflict on STORY-002-01-database required a fix story — cost an extra half-day"}
161
+
162
+ ### Framework Self-Assessment
163
+ > Aggregated from agent Process Feedback sections. Categorized by area of the V-Bounce framework.
164
+ > Severity: **Friction** (slowed work) or **Blocker** (required workaround).
165
+ > These feed the `improve` skill for framework evolution.
166
+
167
+ #### Templates
168
+ > Template sections that were confusing, incomplete, had unused fields, or were missing critical information.
169
+
170
+ | Finding | Source Agent | Severity | Suggested Fix |
171
+ |---------|-------------|----------|---------------|
172
+ | {e.g., "Story §3 missing 'existing modules to reuse' field"} | Developer | Friction | {Add a reuse checklist to the story template} |
173
+
174
+ #### Agent Handoffs
175
+ > Information that was missing, redundant, or unclear when passed between agents via reports.
176
+
177
+ | Finding | Source Agent | Severity | Suggested Fix |
178
+ |---------|-------------|----------|---------------|
179
+ | {e.g., "Dev report didn't specify test runner — QA had to discover it"} | QA | Friction | {Add 'test_runner' to Dev report YAML frontmatter} |
180
+
181
+ #### RAG Pipeline
182
+ > Context quality issues — irrelevant results, missing critical context, stale embeddings.
183
+
184
+ | Finding | Source Agent | Severity | Suggested Fix |
185
+ |---------|-------------|----------|---------------|
186
+ | {e.g., "Query for 'auth constraints' returned old sprint results"} | Developer | Friction | {Add date-weighted ranking to vbounce_ask.mjs} |
187
+
188
+ #### Skills
189
+ > Skill instructions that were unclear, had gaps, or could be improved for better agent performance.
190
+
191
+ | Finding | Source Agent | Severity | Suggested Fix |
192
+ |---------|-------------|----------|---------------|
193
+ | {e.g., "vibe-code-review Deep Audit missing accessibility dimension"} | Architect | Friction | {Add dimension 7 to deep-audit.md} |
194
+
195
+ #### Process Flow
196
+ > Steps that were unnecessary, wrongly ordered, or missing for this type of work.
197
+
198
+ | Finding | Source Agent | Severity | Suggested Fix |
199
+ |---------|-------------|----------|---------------|
200
+ | {e.g., "Fast Track stories still triggered Architect pass in the checklist"} | Team Lead | Blocker | {Update agent-team SKILL.md Step 4 skip logic} |
201
+
202
+ #### Tooling & Scripts
203
+ > Script failures, validation gaps, or automation opportunities.
204
+
205
+ | Finding | Source Agent | Severity | Suggested Fix |
206
+ |---------|-------------|----------|---------------|
207
+ | {e.g., "validate_report.mjs doesn't check for Process Feedback section"} | Team Lead | Friction | {Add optional section validation} |
208
+
209
+ ---
210
+
211
+ ## 6. Change Log
212
+
213
+ | Date | Change | By |
214
+ |------|--------|-----|
215
+ | {YYYY-MM-DD} | Sprint Report generated | Team Lead |
@@ -0,0 +1,193 @@
1
+ <instructions>
2
+ FOLLOW THIS EXACT STRUCTURE. Output sections in order 1-4.
3
+
4
+ 1. **YAML Frontmatter**: Story ID, Parent Epic, Status, Ambiguity, Context Source, Actor, Complexity Label
5
+ 2. **§1 The Spec**: Problem Statement or User Story + Detailed Requirements + Out of Scope
6
+ 3. **§2 The Truth**: Gherkin acceptance criteria + verification steps
7
+ 4. **§3 Implementation Guide**: Files to modify, technical logic, API contract
8
+ 5. **§4 Quality Gates**: Minimum test expectations + Definition of Done checklist
9
+ 6. **Token Usage**: Table auto-populated by agents — each agent appends their row via `count_tokens.mjs --self --append`
10
+
11
+ Ambiguity Score:
12
+ - 🔴 High: Requirements unclear
13
+ - 🟡 Medium: Logic clear, files TBD
14
+ - 🟢 Low: Ready for coding
15
+
16
+ Complexity Labels:
17
+ - **L1**: Trivial — Single file, <1hr vibe time, known pattern
18
+ - **L2**: Standard — 2-3 files, known pattern, ~2-4hr vibe time *(default)*
19
+ - **L3**: Complex — Cross-cutting, spike may be needed, ~1-2 days
20
+ - **L4**: Uncertain — Requires Probing/Spiking before Bounce, >2 days
21
+
22
+ Output the complexity as a single line: **Complexity: L{N}** — {brief description from above}. Do NOT output the full legend.
23
+
24
+ §1.1 Format:
25
+ - For user-facing stories, use: "As a {Persona}, I want to {Action}, So that {Benefit}."
26
+ - For infrastructure/framework stories, a direct problem statement is acceptable: "This story {does X} because {reason}."
27
+
28
+ §3.4 API Contract: Document EXISTING API contracts the implementation must comply with (current request/response shapes, auth requirements, rate limits). If this story creates a NEW API, describe the required contract. Remove this section entirely if no API changes.
29
+
30
+ Output location (Draft/Refinement): `product_plans/backlog/EPIC-{NNN}_{epic_name}/STORY-{EpicID}-{StoryID}-{StoryName}.md`
31
+
32
+ Sprint Lifecycle Rule:
33
+ - When a sprint starts, this Story file is MOVED to `product_plans/sprints/sprint-{XX}/`.
34
+ - When the sprint completes, this Story file is MOVED to `product_plans/archive/sprints/sprint-{XX}/`.
35
+
36
+ Document Hierarchy Position: LEVEL 4 (Charter → Roadmap → Epic → **Story**)
37
+
38
+ Upstream sources:
39
+ - §1 The Spec inherits from parent Epic §2 Scope Boundaries
40
+ - §3 Implementation Guide references Epic §4 Technical Context and Roadmap §3 ADRs
41
+ - Acceptance criteria (§2) refine Epic §7 Acceptance Criteria into per-story scenarios
42
+ - Complexity Label aligns with Delivery Plan story label definitions (L1-L4)
43
+
44
+ Downstream consumers:
45
+ - Developer Agent reads §1 The Spec and §3 Implementation Guide (with react-best-practices skill)
46
+ - QA Agent reads §2 The Truth to validate implementation (with vibe-code-review skill)
47
+ - Architect Agent reads full story context for Safe Zone compliance audit
48
+ - Sprint Plan §1 Active Scope tracks story V-Bounce state during the sprint
49
+ - Sprint Plan §1 Context Pack Readiness tracks per-story readiness using this template's sections
50
+
51
+ Agent handoff sections:
52
+ - §1 The Spec → Human contract (PM/BA writes, Dev reads)
53
+ - §2 The Truth → QA contract (BA writes, QA Agent executes)
54
+ - §3 Implementation Guide → AI-to-AI instructions (Architect writes, Dev Agent executes)
55
+
56
+ Do NOT output these instructions.
57
+ </instructions>
58
+
59
+ ---
60
+ story_id: "STORY-{EpicID}-{StoryID}-{StoryName}"
61
+ parent_epic_ref: "EPIC-{ID}"
62
+ status: "Draft / Refinement / Probing/Spiking / Ready to Bounce / Bouncing / QA Passed / Architect Passed / Sprint Review / Done / Escalated / Parking Lot"
63
+ ambiguity: "🔴 High / 🟡 Medium / 🟢 Low"
64
+ context_source: "Epic §{section} / Codebase / User Input"
65
+ actor: "{Persona Name}"
66
+ complexity_label: "L1 / L2 / L3 / L4 (default: L2)"
67
+ ---
68
+
69
+ # STORY-{EpicID}-{StoryID}: {Story Name}
70
+
71
+ **Complexity: {L1/L2/L3/L4}** — {brief description}
72
+
73
+ ---
74
+
75
+ ## 1. The Spec (The Contract)
76
+ > Human-Readable Requirements. The "What".
77
+ > Target Audience: PM, BA, Stakeholders, Developer Agent.
78
+
79
+ ### 1.1 User Story
80
+ > As a **{Persona}**,
81
+ > I want to **{Action}**,
82
+ > So that **{Benefit}**.
83
+
84
+ ### 1.2 Detailed Requirements
85
+ - **Requirement 1**: {Specific behavior}
86
+ - **Requirement 2**: {Specific data or constraint}
87
+ - **Requirement 3**: {Expected state or outcome}
88
+
89
+ ### 1.3 Out of Scope
90
+ - {What this story explicitly does NOT do}
91
+ - {Deferred to STORY-XXX or future work}
92
+
93
+ ---
94
+
95
+ ## 2. The Truth (Executable Tests)
96
+ > The QA Agent uses this to verify the work. If these don't pass, the Bounce failed.
97
+ > Target Audience: QA Agent (with vibe-code-review skill).
98
+
99
+ ### 2.1 Acceptance Criteria (Gherkin/Pseudocode)
100
+ ```gherkin
101
+ Feature: {Story Name}
102
+
103
+ Scenario: {Happy Path}
104
+ Given {precondition}
105
+ When {user action}
106
+ Then {system response}
107
+ And {database state change}
108
+
109
+ Scenario: {Edge Case / Error}
110
+ Given {precondition}
111
+ When {invalid action}
112
+ Then {error message}
113
+ ```
114
+
115
+ ### 2.2 Verification Steps (Manual)
116
+ - [ ] {Story-specific manual checks — adapt to story type}
117
+ - [ ] {e.g., "Verify API returns 200 for valid input" or "Verify UI renders correctly on mobile"}
118
+
119
+ ---
120
+
121
+ ## 3. The Implementation Guide (AI-to-AI)
122
+ > Instructions for the Developer Agent. The "How".
123
+ > Target Audience: Developer Agent (with react-best-practices + lesson skills).
124
+
125
+ ### 3.0 Environment Prerequisites
126
+ > Verify these before starting. Do NOT waste a bounce cycle on setup failures.
127
+
128
+ | Prerequisite | Value | Verified? |
129
+ |-------------|-------|-----------|
130
+ | **Env Vars** | {e.g., `DATABASE_URL`, `API_KEY`} | [ ] |
131
+ | **Services Running** | {e.g., "PostgreSQL on localhost:5432"} | [ ] |
132
+ | **Migrations** | {e.g., "Run `npx prisma migrate dev`"} | [ ] |
133
+ | **Seed Data** | {e.g., "Run `npm run seed`" or "None"} | [ ] |
134
+ | **Dependencies** | {e.g., "`npm install` after pulling latest"} | [ ] |
135
+
136
+ ### 3.1 Test Implementation
137
+ - {Identify which test suites need to be created or modified to cover the Acceptance Criteria from §2.1}
138
+ - {Include E2E/acceptance tests — not just unit tests. Every Gherkin scenario in §2.1 must have a corresponding test}
139
+ - {e.g., "Create `AuthComponent.test.tsx` (unit) + `auth.e2e.test.ts` (acceptance)"}
140
+
141
+ ### 3.2 Context & Files
142
+ | Item | Value |
143
+ |------|-------|
144
+ | **Primary File** | `{filepath/to/main/component.ts}` |
145
+ | **Related Files** | `{filepath/to/api/service.ts}`, `{filepath/to/types.ts}` |
146
+ | **New Files Needed** | Yes/No — `{Name of file}` |
147
+ | **ADR References** | ADR-{NNN} from Roadmap §3 |
148
+
149
+ ### 3.3 Technical Logic
150
+ - {Describe the logic flow, e.g., "Use the existing useAuth hook to check permissions."}
151
+ - {Describe state management, e.g., "Store the result in the global Zustand store."}
152
+
153
+ ### 3.4 API Contract (If applicable)
154
+ > Document existing API contracts the implementation must comply with.
155
+ > If this story creates a new API, describe the required contract.
156
+ > Remove this section if no API changes.
157
+
158
+ | Endpoint | Method | Auth | Request Shape | Response Shape |
159
+ |----------|--------|------|---------------|----------------|
160
+ | {`/api/resource`} | {GET/POST} | {Bearer/None} | {`{ id: string }`} | {`{ status: string }`} |
161
+
162
+ ---
163
+
164
+ ## 4. Quality Gates
165
+
166
+ ### 4.1 Minimum Test Expectations
167
+ > Defined during sprint planning. Sets the minimum test bar for this story. QA validates against these.
168
+
169
+ | Test Type | Minimum Count | Notes |
170
+ |-----------|--------------|-------|
171
+ | Unit tests | {N} | {e.g., "1 per exported function"} |
172
+ | Component tests | {N} | {e.g., "render, interaction, edge case" — for UI stories} |
173
+ | E2E / acceptance tests | {N} | {e.g., "1 per Gherkin scenario in §2.1"} |
174
+ | Integration tests | {N} | {e.g., "1 per API endpoint" — for backend stories} |
175
+
176
+ > Guidelines: L1 stories ≥2 tests. L2 stories ≥5 tests. L3/L4 stories: planner defines based on scope.
177
+ > If "N/A" for a test type, write "0 — N/A (no {type} in scope)".
178
+
179
+ ### 4.2 Definition of Done (The Gate)
180
+ - [ ] Tests written FIRST (Red → Green → Refactor). All Gherkin scenarios from §2.1 covered.
181
+ - [ ] Minimum test expectations (§4.1) met.
182
+ - [ ] LESSONS.md + Sprint Context consulted before implementation.
183
+ - [ ] No violations of Roadmap ADRs.
184
+ - [ ] Environment prerequisites (§3.0) verified before starting.
185
+ - [ ] **Framework Integrity**: If `.claude/agents/`, `.vbounce/skills/`, `.vbounce/templates/`, or `.vbounce/scripts/` were modified, log to `.vbounce/CHANGELOG.md`.
186
+
187
+ ---
188
+
189
+ ## Token Usage
190
+ > Auto-populated by agents. Each agent runs `node .vbounce/scripts/count_tokens.mjs --self --append <this-file> --name <Agent>` before writing their report.
191
+
192
+ | Agent | Input | Output | Total |
193
+ |-------|-------|--------|-------|