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,444 @@
1
+ ---
2
+ name: doc-manager
3
+ description: "Use when creating, modifying, or navigating V-Bounce Engine planning documents. Trigger on any request to create a charter, roadmap, epic, story, delivery plan, sprint plan, or risk registry — or when the user asks to update, refine, decompose, or transition documents between phases. Also trigger when the user asks about work status, backlog, what's next, what's blocked, or wants to plan/start a sprint. This skill manages the full document lifecycle from Charter through Sprint Planning and execution."
4
+ ---
5
+
6
+ # Document Hierarchy Manager
7
+
8
+ ## Purpose
9
+
10
+ This skill is the navigation system for V-Bounce Engine planning documents. It knows the full document hierarchy, what each template contains, where to find templates, and the rules for creating, modifying, and transitioning documents between phases.
11
+
12
+ **Core principle:** No document exists in isolation. Every document inherits context from upstream and feeds downstream consumers. YOU MUST read upstream documents before creating any new document.
13
+
14
+ ## Trigger
15
+
16
+ `/doc-manager` OR `/doc [document-type]` OR when any planning document needs to be created, modified, or transitioned.
17
+
18
+ ## Announcement
19
+
20
+ When using this skill, state: "Using doc-manager to handle document operations."
21
+
22
+ ## The Document Hierarchy
23
+
24
+ ```
25
+ LEVEL 1: Charter — WHY are we building this?
26
+ LEVEL 2: Roadmap — WHAT are we shipping strategically and WHAT bets are we making?
27
+ LEVEL 3: Epic — WHAT exactly is each feature?
28
+ LEVEL 4: Story — HOW does each piece get built?
29
+ LEVEL 5: Delivery Plan — WHEN and in what ORDER do stories execute?
30
+ LEVEL 6: Risk Registry — WHAT could go wrong? (cross-cutting, fed by all levels)
31
+
32
+ ***HOTFIX PATH (L1 Trivial Tasks Only)***
33
+ Hotfixes bypass LEVELS 3 and 4 directly into the Delivery Plan execution.
34
+ ```
35
+
36
+ ### Information Flow
37
+
38
+ ```
39
+ Charter §1.1 (What It Is) ──→ Roadmap §1 (Strategic Context)
40
+ Charter §2 (Design Principles) ──→ ALL agents (decision tiebreaker)
41
+ Charter §3 (Architecture) ──→ Roadmap §3 (ADRs)
42
+ Charter §5 (Key Workflows) ──→ Epic §1 (Problem & Value)
43
+ Charter §6 (Constraints) ──→ Roadmap §5 (Strategic Constraints)
44
+
45
+ Roadmap §2 (Release Plan) ──→ Epic Metadata (Release field)
46
+ Roadmap §3 (ADRs) ──→ Story §3.1 (ADR References)
47
+ Roadmap §4 (Dependencies) ──→ Risk Registry §1 (Active Risks)
48
+ Roadmap §5 (Constraints) ──→ Delivery Plan (sprint capacity)
49
+
50
+ Epic §2 (Scope Boundaries) ──→ Story §1 (The Spec)
51
+ Epic §4 (Technical Context) ──→ Story §3 (Implementation Guide)
52
+ Epic §5 (Decomposition) ──→ Codebase research scope + Story creation sequence
53
+ Epic §6 (Risks) ──→ Risk Registry §1 (Active Risks)
54
+ Epic §7 (Acceptance Criteria) ──→ Story §2 (The Truth)
55
+ Epic §9 (Artifact Links) ──→ Delivery Plan §3 (Backlog)
56
+
57
+ Story §1 (The Spec) ──→ Developer Agent
58
+ Story §2 (The Truth) ──→ QA Agent
59
+ Story §3 (Implementation Guide) ──→ Developer Agent
60
+ Story status ──→ Sprint Plan §1 (V-Bounce State) [NOT Delivery Plan — see delivery-sync.md]
61
+
62
+ Sprint Plan §1 (Active Scope) ──→ Team Lead Agent (source of truth during sprint)
63
+ Sprint Plan §1 (Context Pack Readiness) ──→ Ready to Bounce gate
64
+ Delivery Plan ──→ Updated at sprint boundaries ONLY (never mid-sprint)
65
+
66
+ Risk Registry ←── ALL levels (cross-cutting input)
67
+
68
+ Epic §8 (Open Questions) ──→ Spike §1 (Question)
69
+ Epic §4 (Technical Context) ──→ Spike §3 (Approach)
70
+ Spike §4 (Findings) ──→ Epic §4 (Technical Context) [update]
71
+ Spike §5 (Decision) ──→ Roadmap §3 (ADRs) [if architectural]
72
+ Spike §6 (Residual Risk) ──→ Risk Registry §1 (Active Risks)
73
+ ```
74
+
75
+ ## Template Locations
76
+
77
+ | Document | Template Path | Output Location |
78
+ |----------|---------------|-----------------|
79
+ | Charter | `.vbounce/templates/charter.md` | `product_plans/strategy/{project}_charter.md` |
80
+ | Roadmap | `.vbounce/templates/roadmap.md` | `product_plans/strategy/{project}_roadmap.md` |
81
+ | Risk Registry | `.vbounce/templates/risk_registry.md` | `product_plans/strategy/RISK_REGISTRY.md` |
82
+ | Delivery Plan | `.vbounce/templates/delivery_plan.md` | `product_plans/strategy/{delivery}_delivery_plan.md` |
83
+ | Sprint Plan | `.vbounce/templates/sprint.md` | `product_plans/sprints/sprint-{XX}/sprint-{XX}.md` |
84
+ | Epic | `.vbounce/templates/epic.md` | `product_plans/backlog/EPIC-{NNN}_{name}/EPIC-{NNN}_{name}.md` |
85
+ | Story | `.vbounce/templates/story.md` | `product_plans/backlog/EPIC-{NNN}_{name}/STORY-{EpicID}-{StoryID}-{StoryName}.md` |
86
+ | Spike | `.vbounce/templates/spike.md` | `product_plans/backlog/EPIC-{NNN}_{name}/SPIKE-{EpicID}-{NNN}-{topic}.md` |
87
+ | Hotfix | `.vbounce/templates/hotfix.md` | `product_plans/hotfixes/HOTFIX-{Date}-{Name}.md` |
88
+ | Bug Report | `.vbounce/templates/bug.md` | `product_plans/sprints/sprint-{XX}/BUG-{Date}-{Name}.md` |
89
+ | Change Request | `.vbounce/templates/change_request.md` | `product_plans/sprints/sprint-{XX}/CR-{Date}-{Name}.md` |
90
+ | Sprint Report | `.vbounce/templates/sprint_report.md` | `product_plans/sprints/sprint-{XX}/sprint-report.md` |
91
+
92
+ ### Product Plans Folder Structure (State-Based)
93
+
94
+ ```
95
+ product_plans/
96
+ ├── strategy/ ← high-level, frozen during sprints
97
+ │ ├── charter.md
98
+ │ ├── roadmap.md
99
+ │ ├── delivery_plan.md ← release timelines
100
+ │ └── risk_registry.md
101
+
102
+ ├── backlog/ ← planned but NOT active
103
+ │ ├── EPIC-001_authentication/
104
+ │ │ ├── EPIC-001_authentication.md
105
+ │ │ ├── STORY-001-01-login_ui.md
106
+ │ │ ├── STORY-001-02-auth_api.md
107
+ │ │ └── SPIKE-001-001-auth-provider.md
108
+
109
+ ├── sprints/ ← active execution workspace
110
+ │ ├── sprint-01/ ← active sprint boundary
111
+ │ │ ├── sprint-01.md ← Sprint Plan
112
+ │ │ └── STORY-001-01-login_ui.md ← (moved here during sprint setup)
113
+
114
+ ├── hotfixes/ ← emergency tasks bypassing sprints
115
+ │ └── HOTFIX-20260306-db_crash.md
116
+
117
+ └── archive/ ← immutable history
118
+ ├── sprints/
119
+ │ └── sprint-01/ ← (whole sprint folder moved here when closed)
120
+ │ ├── sprint-01.md
121
+ │ ├── STORY-001-01-login_ui.md
122
+ │ └── sprint-report.md
123
+ └── epics/
124
+ └── EPIC-001_authentication/ ← (moved here only when 100% complete)
125
+ ```
126
+
127
+ **Key rules:**
128
+ - `strategy/` documents are project-level and frozen while a sprint is active.
129
+ - `backlog/` contains Epics and their unassigned child Stories.
130
+ - `sprints/` contains active 1-week execution boundaries. A Story file physically moves here when a sprint begins.
131
+ - `archive/` is where finished Sprints and finished Epics are moved for permanent record keeping.
132
+
133
+ ### V-Bounce Engine Framework Structure
134
+
135
+ ```
136
+ Project Root/
137
+ ├── CLAUDE.md — Claude Code brain (deployed to root)
138
+ ├── AGENTS.md — Codex CLI brain (deployed to root)
139
+ ├── GEMINI.md — Gemini CLI brain (deployed to root)
140
+ ├── .claude/agents/ — Claude Code subagent configs
141
+ ├── .vbounce/templates/ — Document templates (immutable during execution)
142
+ ├── .vbounce/skills/ — Agent skills (SKILL.md files + references)
143
+ ├── .vbounce/scripts/ — Automation scripts (e.g., hotfix_manager.sh)
144
+ ├── .vbounce/CHANGELOG.md — Framework modification log
145
+ └── VBOUNCE_MANIFEST.md — Framework file registry
146
+ ```
147
+
148
+ ### Brain File Deployment
149
+
150
+ When initializing a new project, deploy the correct brain file for the AI coding tool in use:
151
+
152
+ | Tool | Installed Location |
153
+ |------|-------------------|
154
+ | Claude Code | `CLAUDE.md` (project root) + `.claude/agents/` (subagents) |
155
+ | Codex CLI | `AGENTS.md` (project root) |
156
+ | Cursor | `.cursor/rules/*.mdc` |
157
+ | Gemini CLI | `GEMINI.md` (project root) |
158
+ | Antigravity | `GEMINI.md` (project root) + `.agents/skills/` |
159
+
160
+ Brain files contain the V-Bounce process, critical rules, and skill references. Each tool's brain file is self-contained and authoritative. When updating V-Bounce Engine rules, update each brain file and keep them in sync. Log changes to `.vbounce/CHANGELOG.md`.
161
+
162
+ ## Document Operations
163
+
164
+ ### Ambiguity Assessment Rubric
165
+
166
+ When creating or reviewing an Epic or Story, assess ambiguity using these signals:
167
+
168
+ **🔴 High — Discovery Required (any ONE triggers 🔴):**
169
+ - Epic §4 Technical Context has "TBD" or "unknown" in dependencies or affected areas
170
+ - Epic §8 Open Questions has items marked blocking
171
+ - Multiple competing approaches mentioned with no ADR deciding between them
172
+ - Unknown external dependencies or integrations
173
+ - No acceptance criteria defined (Epic §7 empty)
174
+ - Vague scope language in §2 ("various", "possibly", "might", "somehow", "rethink")
175
+
176
+ **🟡 Medium — Conditional Progress:**
177
+ - Technical Context partially filled (some areas known, others TBD)
178
+ - Open Questions exist but are non-blocking
179
+ - Dependencies listed but unconfirmed
180
+
181
+ **🟢 Low — Ready to Proceed:**
182
+ - All sections filled with specific, concrete content
183
+ - All Open Questions resolved or non-blocking
184
+ - ADRs exist for every major technical choice
185
+ - Acceptance criteria are concrete Gherkin scenarios
186
+
187
+ **When 🔴 is detected:**
188
+ 1. Set `ambiguity: 🔴 High` in frontmatter
189
+ 2. Identify which signals triggered it
190
+ 3. For each signal, recommend a spike with a one-sentence question
191
+ 4. Create spike documents from `.vbounce/templates/spike.md`
192
+ 5. Block downstream transitions until spikes reach Validated or Closed
193
+
194
+ ### CREATE — Making a New Document
195
+
196
+ Before creating any document, YOU MUST:
197
+
198
+ 1. Identify the document type and its level in the hierarchy
199
+ 2. Read ALL upstream documents that feed into it
200
+ 3. Copy the template from the template location
201
+ 4. Fill sections by pulling from upstream sources (see Information Flow above)
202
+ 5. Set the Ambiguity Score based on completeness
203
+ 6. Verify all cross-references are valid
204
+ 7. **Present edge cases and open questions to the human** (see below)
205
+
206
+ **After creating an Epic — mandatory discussion step:**
207
+
208
+ After writing the Epic document, you MUST present §6 (Risks & Edge Cases) and §8 (Open Questions) to the human in chat. Do not silently file them — the human needs to see what's uncertain to make good decisions.
209
+
210
+ Format your presentation like this:
211
+ 1. Summarize the epic in 1-2 sentences
212
+ 2. List each edge case from §6 with its proposed mitigation — ask the human if the mitigation is adequate or if they see other risks
213
+ 3. List each open question from §8 — present the options, explain the impact, and ask the human to decide or delegate
214
+ 4. State the current ambiguity score and what must be resolved before decomposition into stories
215
+
216
+ The epic is NOT ready for decomposition until:
217
+ - All **blocking** questions in §8 are resolved (status = "Decided")
218
+ - All edge cases in §6 have either a decided mitigation or are explicitly accepted as known risk by the human
219
+ - Ambiguity is 🟡 or 🟢
220
+
221
+ If the human resolves questions during discussion, update the epic document immediately (change §8 status to "Decided", update §6 mitigations, adjust ambiguity score).
222
+
223
+ **Pre-read requirements by document type:**
224
+
225
+ | Creating | MUST read first |
226
+ |----------|-----------------|
227
+ | Charter | Nothing — Charter is root. Gather from user input. |
228
+ | Roadmap | Charter (full document) |
229
+ | Epic | Charter §1, §2, §5 + Roadmap §2, §3, §5 + **Codebase** (explore affected areas for §4) |
230
+ | Story | Parent Epic (full document) + Roadmap §3 (ADRs) + Codebase (affected files) |
231
+ | Spike | Parent Epic (full document) + Roadmap §3 (ADRs) + Risk Registry |
232
+ | Sprint Plan | All candidate stories + Risk Registry + Archive (completed work) + Backlog state |
233
+ | Delivery Plan | Roadmap §2 (Release Plan) + All Stories in scope |
234
+ | Risk Registry | Charter §6 + Roadmap §4, §5 + All Epic §6 sections |
235
+
236
+ ### MODIFY — Updating an Existing Document
237
+
238
+ When modifying a document:
239
+
240
+ 1. **Sprint Freeze Check:** Read `sprint-XX.md` (if one exists in `product_plans/sprints/`). If a sprint is currently Active, the Charter and Roadmap are **FROZEN**. DO NOT modify them directly.
241
+ - ***Emergency Impact Analysis Protocol:*** If a human insists on modifying a frozen strategic document mid-sprint, you MUST pause active bouncing and write a Sprint Impact Analysis Report. Evaluate the active stories in `sprint-{XX}.md` against the new strategy to determine if they are: Unaffected, Require Scope Adjustment, or Invalidated. Only Invalidated stories are aborted. Update the documents only after the human approves the Impact Analysis.
242
+ 2. Read the document being modified
243
+ 3. Read upstream documents if the change affects inherited fields
244
+ 4. Make the change
245
+ 5. Check if the change cascades downstream — if so, flag affected documents
246
+ 6. Append to the document's Change Log
247
+
248
+ **Cascade rules:**
249
+
250
+ | If you change... | Then also update... |
251
+ |------------------|---------------------|
252
+ | Charter §1 (Identity) | Roadmap §1 (Strategic Context) |
253
+ | Charter §2 (Design Principles) | Nothing — but notify all agents |
254
+ | Charter §3 (Tech Stack) | Roadmap §3 (ADRs) |
255
+ | Roadmap §2 (Release Plan) | Delivery Plan sprint goals |
256
+ | Roadmap §3 (ADR) | All Stories referencing that ADR in §3.1 |
257
+ | Epic §2 (Scope) | All child Stories §1 (The Spec) |
258
+ | Epic §4 (Technical Context) | All child Stories §3 (Implementation Guide) |
259
+ | Story status (V-Bounce State) | Delivery Plan §3 (Active Sprint table) |
260
+ | Story — new risk discovered | Risk Registry §1 (new row) |
261
+ | Spike §4/§5 (Findings/Decision) | Epic §4 Technical Context, Epic §8 Open Questions, Risk Registry §1 |
262
+ | Spike §5 (Decision — architectural) | Roadmap §3 ADRs (new row) |
263
+
264
+ **After any cascade:** Run `vbounce graph` to regenerate the product graph so downstream consumers have current state.
265
+
266
+ ### DECOMPOSE — Breaking Down Documents
267
+
268
+ **Epic → Stories:**
269
+
270
+ Stories are NOT created by mechanically splitting epic sections by category. The AI must analyze the epic, research the actual codebase, and produce small, focused stories — each delivering a tangible, independently verifiable result.
271
+
272
+ #### Phase 1: Analyze & Research
273
+
274
+ 1. Read the full Epic document (all sections)
275
+ 2. Read Roadmap §3 (ADRs) for architecture constraints
276
+ 3. **Research the codebase** — this is mandatory, not optional:
277
+ - Read every file listed in Epic §4 Affected Areas
278
+ - Explore the surrounding code to understand current architecture, patterns, and conventions
279
+ - Identify actual dependencies, imports, and integration points in the code
280
+ - Note existing tests, utilities, and shared modules that stories will interact with
281
+ 4. Build a mental model of what needs to change and in what order
282
+
283
+ #### Phase 2: Draft Stories by Deliverable, Not by Category
284
+
285
+ Do NOT create stories by layer (one for schema, one for API, one for UI). Instead, create stories by **tangible outcome** — each story should deliver a small, specific, working result that can be verified.
286
+
287
+ **Story sizing rules:**
288
+ - Each story has **one clear goal** expressible in a single sentence
289
+ - Each story touches **1-3 files** (if more, it needs splitting)
290
+ - Each story produces a **verifiable result** — something you can see, test, or demonstrate
291
+ - Each story is **independently meaningful** — it delivers value or unlocks the next story, not just "part of a layer"
292
+ - Prefer vertical slices (thin end-to-end) over horizontal slices (full layer)
293
+
294
+ **If a drafted story exceeds size:**
295
+ - Ask: "Can this be split into two stories that each produce a tangible result?"
296
+ - If yes → split it. Each sub-story must still have its own clear goal.
297
+ - If no (the work is inherently atomic) → keep it as one story, label it L3, and document why it can't be smaller.
298
+
299
+ #### Phase 3: Write Stories with Codebase-Informed Detail
300
+
301
+ For each story, use what you learned from codebase research:
302
+ - §1 The Spec: Write requirements informed by actual code state (not just epic abstractions)
303
+ - §2 The Truth: Write Gherkin scenarios that reference real components, routes, and data shapes found in the code
304
+ - §3 Implementation Guide: Reference actual file paths, existing patterns, real function signatures — not placeholders. The developer should be able to start coding immediately.
305
+ - Set Complexity Label (L1-L4) based on actual code complexity discovered during research
306
+
307
+ #### Phase 4: Link & Update
308
+
309
+ 1. Link all created Stories back in Epic §9 Artifact Links
310
+ 2. Update Delivery Plan §3 High-Level Backlog with new stories
311
+
312
+ ### SPRINT PLANNING — Preparing a Sprint
313
+
314
+ Sprint Planning is a collaborative process between AI and human. No sprint starts without a confirmed Sprint Plan.
315
+
316
+ **Workflow:**
317
+
318
+ 1. **Read current state:**
319
+ - Scan `product_plans/backlog/` — read all epic and story frontmatter (status, priority, ambiguity, complexity_label, open questions)
320
+ - Scan `product_plans/archive/` — understand what's already shipped and what context carries forward
321
+ - Read `product_plans/strategy/RISK_REGISTRY.md` — identify risks affecting candidate stories
322
+ - If `vdocs/_manifest.json` exists, read it for documentation context
323
+
324
+ 2. **Propose sprint scope:**
325
+ - Select stories based on priority, dependencies, and capacity
326
+ - Identify dependency chains — stories with `Depends On:` must be sequenced
327
+ - Group parallel-safe stories into phases
328
+ - Flag stories with 🔴 High ambiguity — these CANNOT enter the sprint without completed spikes
329
+
330
+ 3. **Surface blockers to the human:**
331
+ - Open questions from epics (§8) and stories that haven't been resolved
332
+ - Environment prerequisites missing from stories
333
+ - Risks from Risk Registry that affect planned stories
334
+ - Edge cases or ambiguity the human may not have considered
335
+ - Dependencies on incomplete work
336
+
337
+ 4. **Collaborate with the human:**
338
+ - Present proposed scope, risks, and blockers
339
+ - Discuss and adjust — add/remove stories, resolve open questions
340
+ - Agree on execution mode per story (Full Bounce vs Fast Track)
341
+
342
+ 5. **Create Sprint Plan:**
343
+ - Create `product_plans/sprints/sprint-{XX}/sprint-{XX}.md` from `.vbounce/templates/sprint.md`
344
+ - Fill §0 Sprint Readiness Gate checklist
345
+ - Fill §1 Active Scope with confirmed stories + Context Pack Readiness
346
+ - Fill §2 Execution Strategy (phases, dependencies, risk flags)
347
+ - Fill §3 Sprint Open Questions (all must be resolved or non-blocking)
348
+ - Set status: `Planning`
349
+
350
+ 6. **Gate — Human confirms:**
351
+ - Present finalized plan to human
352
+ - Explicitly ask for confirmation
353
+ - On confirmation: set `status: Confirmed`, fill `confirmed_by` and `confirmed_at`
354
+ - Move story files from `product_plans/backlog/EPIC-{NNN}/` to `product_plans/sprints/sprint-{XX}/`
355
+ - Sprint is now ready for Phase 3 (Execution)
356
+
357
+ ### TRANSITION — Moving Documents Between Phases
358
+
359
+ **Ambiguity gates (must pass before transitioning):**
360
+
361
+ | Transition | Gate |
362
+ |------------|------|
363
+ | Charter → Ready for Roadmap | Ambiguity 🟡 or 🟢 (§1 and §5 filled) |
364
+ | Roadmap → Ready for Epics | Charter Ambiguity 🟢 + Roadmap §2 and §3 filled |
365
+ | Epic → Ready for Stories | Ambiguity 🟡 or 🟢 + §2 Scope filled + §4 Tech Context filled + §8 all blocking questions Decided + §6 each edge case has a decided mitigation OR is explicitly accepted as known risk |
366
+ | Story → Ready to Bounce | Ambiguity 🟢 + ALL Context Pack items checked (Sprint Plan §1) |
367
+ | Sprint Plan → Confirmed | §0 Readiness Gate checklist complete + Human explicitly confirms |
368
+ | Sprint Plan → Active | Status is Confirmed (human approval obtained) |
369
+ | Story (Probing/Spiking) → Refinement | All linked spikes are Validated or Closed |
370
+ | Spike → Validated | Architect confirms findings against Safe Zone |
371
+ | Spike → Closed | All items in §7 Affected Documents are checked off |
372
+ | Hotfix → Bouncing | Complexity strictly L1 + Targets 1-2 files |
373
+
374
+ **Physical Move Rules for State Transitions:**
375
+
376
+ - **Sprint Setup Phase**: The Team Lead physically MOVES the `STORY-XXX.md` file from `product_plans/backlog/EPIC-XXX/` to `product_plans/sprints/sprint-{XX}/`.
377
+ - **Sprint Closure Phase**: The Team Lead physically MOVES the entire sprint folder (`sprints/sprint-{XX}/`) to `product_plans/archive/sprints/sprint-{XX}/`.
378
+ - **Epic Closure**: Once every story attached to an Epic has been archived, the Epic folder itself is moved from `backlog/` to `archive/epics/`.
379
+
380
+ **Complexity Labels:**
381
+
382
+ - **L1**: Trivial — Single file, <1hr, known pattern. → Hotfix Path
383
+ - **L2**: Standard — 2-3 files, known pattern, ~2-4hr. *(default)* → Full Bounce
384
+ - **L3**: Complex — Cross-cutting, spike may be needed, ~1-2 days. → Full Bounce
385
+ - **L4**: Uncertain — Requires spikes before Bounce, >2 days. → Discovery first
386
+
387
+ **V-Bounce State transitions for Stories:**
388
+
389
+ ```
390
+ Draft → Refinement: Story template created, being filled
391
+ Refinement → Probing/Spiking: L4 stories only, spike needed
392
+ Probing/Spiking → Refinement: Spike complete, back to refinement
393
+ Refinement → Ready to Bounce: Ambiguity 🟢, Context Pack complete
394
+ Ready to Bounce → Bouncing: Team Lead activates Dev Agent
395
+ Bouncing → QA Passed: QA Validation Report passes
396
+ QA Passed → Architect Passed: Architect Audit Report passes
397
+ Architect Passed → Sprint Review: DevOps merges story, all gates clear
398
+ Sprint Review → Done: Human review accepted
399
+ Bouncing → Escalated: 3+ bounce failures
400
+ Any → Parking Lot: Deferred by decision
401
+
402
+ ***HOTFIX TRANSITIONS***
403
+ Draft → Bouncing: Hotfix template created + Triage confirmed L1
404
+ Bouncing → Done: Dev implements + Human manually verifies + DevOps runs `hotfix_manager.sh sync`
405
+ ```
406
+
407
+ ## Agent Integration
408
+
409
+ | Agent | Documents Owned | Documents Read |
410
+ |-------|----------------|----------------|
411
+ | **Team Lead** | Delivery Plan, Sprint Report, Delivery archive | Charter, Roadmap, ALL Stories (for context packs) |
412
+ | **Developer** | Story §3 updates (during implementation), Spike §4 Findings (during investigation) | Story §1 + §3, Spike §1 + §2 + §3, LESSONS.md |
413
+ | **QA** | QA Validation Report | Story §2, Dev Implementation Report |
414
+ | **Architect** | Architectural Audit Report, Risk flags (in report — Lead writes to Registry), Spike validation (Findings Ready → Validated) | Full Story, Spike §4 + §5, Roadmap §3 ADRs, Risk Registry |
415
+ | **DevOps** | DevOps Reports (merge + release) | Delivery Plan, LESSONS.md, gate reports |
416
+ | **Scribe** | Product documentation, _manifest.json | Sprint Report, Dev Reports, codebase |
417
+ | **PM/BA (Human)** | Charter, Roadmap, Epic, Story §1 + §2 | Everything |
418
+
419
+ ## Sprint Archiving
420
+
421
+ When a sprint is complete:
422
+
423
+ 1. Team Lead moves the entire sprint folder to the archive:
424
+ ```bash
425
+ mv product_plans/sprints/sprint-{XX}/ product_plans/archive/sprints/sprint-{XX}/
426
+ ```
427
+ 2. Team Lead checks the parent Epics of the completed stories. If an Epic is now 100% complete (all its stories are in the archive), the Team Lead moves the Epic folder:
428
+ ```bash
429
+ mv product_plans/backlog/EPIC-{NNN}_{name}/ product_plans/archive/epics/EPIC-{NNN}_{name}/
430
+ ```
431
+ 3. Team Lead updates the Epic tracking checklists to reflect the newly archived states.
432
+
433
+ ## Critical Rules
434
+
435
+ - **Read before write.** ALWAYS read upstream documents before creating or modifying any document. No exceptions.
436
+ - **Cascade before closing.** When modifying a document, check cascade rules before marking the change complete.
437
+ - **Ambiguity gates are hard.** Do NOT allow a document to transition to the next phase if its Ambiguity Score doesn't meet the gate threshold.
438
+ - **Templates are immutable.** Never modify the template files themselves during project execution. Use write-skill for template evolution during retrospectives.
439
+ - **One source of truth.** If information exists in an upstream document, reference it — do not duplicate it. Duplication creates drift.
440
+ - **Change Logs are mandatory.** Every modification to any document MUST be recorded in that document's Change Log section.
441
+
442
+ ## Keywords
443
+
444
+ charter, roadmap, epic, story, delivery plan, risk registry, sprint plan, sprint planning, document hierarchy, template, create document, update document, decompose epic, story breakdown, ambiguity score, context pack, V-Bounce state, phase transition, cascade update, planning documents, backlog, what's next, what's blocked, start sprint
@@ -0,0 +1,146 @@
1
+ ---
2
+ name: file-organization
3
+ description: "**Codebase Cleanliness Standard**: Enforces clean file organization in any codebase. Before creating ANY file, classify it by intent—deliverables go to the project tree, working artifacts go to `/temporary/`. Before committing, review `git diff` to catch misplaced files. Use this skill whenever creating, moving, or committing files. Works with all languages and frameworks. The `/temporary/` folder is git-ignored so working artifacts never get merged. ALWAYS consult this skill when writing files to the repo—it prevents clutter from debug scripts, scratch analysis, throwaway tests, and other AI working artifacts from polluting the codebase."
4
+ compatibility: "Git required. Works with any language or framework."
5
+ ---
6
+
7
+ ## Core Principle
8
+
9
+ Every file you create has an **intent**. You always know why you're creating it. Use that knowledge.
10
+
11
+ - **"I'm creating this because the user asked for it / it solves the task"** → Project tree (root, src/, etc.)
12
+ - **"I'm creating this to help me work — debug, analyze, test an idea"** → `/temporary/`
13
+
14
+ This is not about file types or extensions. A `.test.js` file might be a critical part of the test suite, or it might be a throwaway script you wrote to check a theory. The difference is intent.
15
+
16
+ ## Layer 1: Proactive — Decide at Creation Time
17
+
18
+ Before writing any file, run this mental check:
19
+
20
+ ```
21
+ WHY am I creating this file?
22
+
23
+ ├─ DELIVERABLE — The user asked for this, or it directly fulfills the task
24
+ │ Examples:
25
+ │ - "Add input validation" → validation.ts (deliverable)
26
+ │ - "Write unit tests for auth" → auth.test.ts (deliverable)
27
+ │ - "Create a migration for the new table" → 003_add_users.sql (deliverable)
28
+ │ - "Update the README" → README.md (deliverable)
29
+ │ → CREATE IN PROJECT TREE
30
+
31
+ └─ WORKING ARTIFACT — I need this to help me understand, debug, or explore
32
+ Examples:
33
+ - Script to reproduce a bug → debug-repro.py (working artifact)
34
+ - Markdown notes analyzing the codebase → analysis.md (working artifact)
35
+ - Quick test to verify an assumption → check-behavior.js (working artifact)
36
+ - Output log from a test run → output.txt (working artifact)
37
+ → CREATE IN /temporary/
38
+ ```
39
+
40
+ The question is never "what type of file is this?" — it's **"does this file exist to serve the project, or to serve my working process?"**
41
+
42
+ ## Layer 2: Reactive — Safety Net Before Commit
43
+
44
+ Before committing, review what you've changed. This catches anything that slipped through Layer 1.
45
+
46
+ ```bash
47
+ git diff --name-only
48
+ git status
49
+ ```
50
+
51
+ For each file in the diff, ask:
52
+
53
+ 1. **Did the user's task require this file?** If no → move to `/temporary/`
54
+ 2. **Does this file exist in the project already?** If yes, you're editing existing code — that's fine, leave it
55
+ 3. **Is this a new file I created to help myself work?** If yes → move to `/temporary/`
56
+
57
+ ### Example: "Fix the login bug"
58
+
59
+ ```bash
60
+ $ git status
61
+ modified: src/auth/login.ts # ← The actual fix. Commit this.
62
+ new file: debug-login.py # ← Script I wrote to reproduce the bug. Move to /temporary/
63
+ new file: test-output.log # ← Output from my debugging. Move to /temporary/
64
+ modified: src/auth/login.test.ts # ← Updated existing test. Commit this.
65
+ ```
66
+
67
+ After cleanup:
68
+ ```bash
69
+ $ git status
70
+ modified: src/auth/login.ts # ✅ commit
71
+ modified: src/auth/login.test.ts # ✅ commit
72
+ ```
73
+
74
+ The debug script and log are now safely in `/temporary/`, out of the commit.
75
+
76
+ ### Example: "Add user validation with tests"
77
+
78
+ ```bash
79
+ $ git status
80
+ new file: src/validation/validate.ts # ← Deliverable. Commit.
81
+ new file: src/validation/validate.test.ts # ← User asked for tests. Commit.
82
+ new file: scratch-regex-test.js # ← I wrote this to test regex patterns. /temporary/
83
+ ```
84
+
85
+ Notice how `validate.test.ts` stays because the user asked for tests — it's a deliverable. But `scratch-regex-test.js` was a working artifact.
86
+
87
+ ## Language-Agnostic — Why Intent Beats File Types
88
+
89
+ Static file-type rules break across languages:
90
+
91
+ - Python's `__pycache__/` is already gitignored — don't touch it
92
+ - Java's `target/` is a build artifact — handled by existing `.gitignore`
93
+ - A Go `vendor/` directory might be intentionally committed
94
+ - Database migrations are generated but absolutely committed
95
+ - Protocol buffer outputs, GraphQL codegen — generated but part of the codebase
96
+ - `dist/` and `build/` directories vary by project
97
+
98
+ Trying to categorize by extension or directory name is fragile. Instead, the intent check works universally:
99
+
100
+ **"Did I create this to deliver the task, or to help myself work?"**
101
+
102
+ This one question works whether you're writing Python, TypeScript, Rust, Go, Java, C#, or anything else.
103
+
104
+ ## Things That Are NEVER Working Artifacts
105
+
106
+ Don't accidentally move these to `/temporary/`:
107
+
108
+ - Existing files you modified (they're already tracked in git)
109
+ - Test suites the project already has (`tests/`, `__tests__/`, `spec/`)
110
+ - CI/CD configs (`.github/workflows/`, `Dockerfile`, etc.)
111
+ - Lock files (`package-lock.json`, `Cargo.lock`, `poetry.lock`)
112
+ - Migration files (database schema changes)
113
+ - Generated code that the project commits (codegen output, protobuf, etc.)
114
+ - Config files (`.eslintrc`, `tsconfig.json`, `pyproject.toml`)
115
+
116
+ If a file already exists in the git tree, it belongs there. Your job is only to route **new files you create** during your working process.
117
+
118
+ ## Git Setup
119
+
120
+ Add `/temporary/` to `.gitignore` if it's not there already:
121
+
122
+ ```gitignore
123
+ # AI/developer working artifacts (never commit)
124
+ /temporary/
125
+ ```
126
+
127
+ This is a one-time setup. After this, anything in `/temporary/` is invisible to git.
128
+
129
+ ## Quick Reference
130
+
131
+ ```
132
+ BEFORE CREATING A FILE:
133
+ "Is this a deliverable?" → YES → project tree
134
+ → NO → /temporary/
135
+
136
+ BEFORE COMMITTING:
137
+ Run: git diff --name-only
138
+ For each NEW file: "Did the task require this?" → NO → mv to /temporary/
139
+ For MODIFIED files: leave them (they're already tracked)
140
+ ```
141
+
142
+ ## Why This Matters
143
+
144
+ Working artifacts in the root folder create real problems: teammates see debug scripts and think they're production code, CI might pick up stray test files, code review gets cluttered with irrelevant changes, and over time the repo becomes a mess of half-finished experiments mixed with real code.
145
+
146
+ The `/temporary/` folder gives you a safe space to work freely. Use it for anything and everything you need during your process — it never touches the git history and never confuses anyone.