@sandrinio/vbounce 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/README.md +107 -0
  2. package/bin/vbounce.mjs +165 -0
  3. package/brains/AGENTS.md +129 -0
  4. package/brains/CLAUDE.md +146 -0
  5. package/brains/GEMINI.md +134 -0
  6. package/brains/SETUP.md +180 -0
  7. package/brains/claude-agents/architect.md +140 -0
  8. package/brains/claude-agents/developer.md +69 -0
  9. package/brains/claude-agents/devops.md +219 -0
  10. package/brains/claude-agents/qa.md +112 -0
  11. package/brains/claude-agents/scribe.md +141 -0
  12. package/brains/cursor-rules/vbounce-docs.mdc +41 -0
  13. package/brains/cursor-rules/vbounce-process.mdc +45 -0
  14. package/brains/cursor-rules/vbounce-rules.mdc +26 -0
  15. package/package.json +40 -0
  16. package/skills/agent-team/SKILL.md +425 -0
  17. package/skills/doc-manager/SKILL.md +278 -0
  18. package/skills/lesson/SKILL.md +90 -0
  19. package/skills/react-best-practices/SKILL.md +3014 -0
  20. package/skills/react-best-practices/rules/_sections.md +46 -0
  21. package/skills/react-best-practices/rules/_template.md +28 -0
  22. package/skills/react-best-practices/rules/advanced-event-handler-refs.md +55 -0
  23. package/skills/react-best-practices/rules/advanced-init-once.md +42 -0
  24. package/skills/react-best-practices/rules/advanced-use-latest.md +39 -0
  25. package/skills/react-best-practices/rules/async-api-routes.md +38 -0
  26. package/skills/react-best-practices/rules/async-defer-await.md +80 -0
  27. package/skills/react-best-practices/rules/async-dependencies.md +51 -0
  28. package/skills/react-best-practices/rules/async-parallel.md +28 -0
  29. package/skills/react-best-practices/rules/async-suspense-boundaries.md +99 -0
  30. package/skills/react-best-practices/rules/bundle-barrel-imports.md +59 -0
  31. package/skills/react-best-practices/rules/bundle-conditional.md +31 -0
  32. package/skills/react-best-practices/rules/bundle-defer-third-party.md +49 -0
  33. package/skills/react-best-practices/rules/bundle-dynamic-imports.md +35 -0
  34. package/skills/react-best-practices/rules/bundle-preload.md +50 -0
  35. package/skills/react-best-practices/rules/client-event-listeners.md +74 -0
  36. package/skills/react-best-practices/rules/client-localstorage-schema.md +71 -0
  37. package/skills/react-best-practices/rules/client-passive-event-listeners.md +48 -0
  38. package/skills/react-best-practices/rules/client-swr-dedup.md +56 -0
  39. package/skills/react-best-practices/rules/js-batch-dom-css.md +107 -0
  40. package/skills/react-best-practices/rules/js-cache-function-results.md +80 -0
  41. package/skills/react-best-practices/rules/js-cache-property-access.md +28 -0
  42. package/skills/react-best-practices/rules/js-cache-storage.md +70 -0
  43. package/skills/react-best-practices/rules/js-combine-iterations.md +32 -0
  44. package/skills/react-best-practices/rules/js-early-exit.md +50 -0
  45. package/skills/react-best-practices/rules/js-hoist-regexp.md +45 -0
  46. package/skills/react-best-practices/rules/js-index-maps.md +37 -0
  47. package/skills/react-best-practices/rules/js-length-check-first.md +49 -0
  48. package/skills/react-best-practices/rules/js-min-max-loop.md +82 -0
  49. package/skills/react-best-practices/rules/js-set-map-lookups.md +24 -0
  50. package/skills/react-best-practices/rules/js-tosorted-immutable.md +57 -0
  51. package/skills/react-best-practices/rules/rendering-activity.md +26 -0
  52. package/skills/react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
  53. package/skills/react-best-practices/rules/rendering-conditional-render.md +40 -0
  54. package/skills/react-best-practices/rules/rendering-content-visibility.md +38 -0
  55. package/skills/react-best-practices/rules/rendering-hoist-jsx.md +46 -0
  56. package/skills/react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
  57. package/skills/react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
  58. package/skills/react-best-practices/rules/rendering-svg-precision.md +28 -0
  59. package/skills/react-best-practices/rules/rendering-usetransition-loading.md +75 -0
  60. package/skills/react-best-practices/rules/rerender-defer-reads.md +39 -0
  61. package/skills/react-best-practices/rules/rerender-dependencies.md +45 -0
  62. package/skills/react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
  63. package/skills/react-best-practices/rules/rerender-derived-state.md +29 -0
  64. package/skills/react-best-practices/rules/rerender-functional-setstate.md +74 -0
  65. package/skills/react-best-practices/rules/rerender-lazy-state-init.md +58 -0
  66. package/skills/react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
  67. package/skills/react-best-practices/rules/rerender-memo.md +44 -0
  68. package/skills/react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
  69. package/skills/react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
  70. package/skills/react-best-practices/rules/rerender-transitions.md +40 -0
  71. package/skills/react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
  72. package/skills/react-best-practices/rules/server-after-nonblocking.md +73 -0
  73. package/skills/react-best-practices/rules/server-auth-actions.md +96 -0
  74. package/skills/react-best-practices/rules/server-cache-lru.md +41 -0
  75. package/skills/react-best-practices/rules/server-cache-react.md +76 -0
  76. package/skills/react-best-practices/rules/server-dedup-props.md +65 -0
  77. package/skills/react-best-practices/rules/server-parallel-fetching.md +83 -0
  78. package/skills/react-best-practices/rules/server-serialization.md +38 -0
  79. package/skills/vibe-code-review/SKILL.md +70 -0
  80. package/skills/vibe-code-review/references/deep-audit.md +259 -0
  81. package/skills/vibe-code-review/references/pr-review.md +234 -0
  82. package/skills/vibe-code-review/references/quick-scan.md +178 -0
  83. package/skills/vibe-code-review/references/report-template.md +189 -0
  84. package/skills/vibe-code-review/references/trend-check.md +224 -0
  85. package/skills/vibe-code-review/scripts/generate-snapshot.sh +89 -0
  86. package/skills/vibe-code-review/scripts/pr-analyze.sh +180 -0
  87. package/skills/write-skill/SKILL.md +133 -0
  88. package/templates/charter.md +144 -0
  89. package/templates/delivery_plan.md +188 -0
  90. package/templates/epic.md +200 -0
  91. package/templates/hotfix.md +57 -0
  92. package/templates/risk_registry.md +89 -0
  93. package/templates/roadmap.md +176 -0
  94. package/templates/sprint_report.md +151 -0
  95. package/templates/story.md +150 -0
@@ -0,0 +1,278 @@
1
+ ---
2
+ name: doc-manager
3
+ description: "Use when creating, modifying, or navigating V-Bounce OS planning documents. Trigger on any request to create a charter, roadmap, epic, story, delivery plan, or risk registry โ€” or when the user asks to update, refine, decompose, or transition documents between phases. Also trigger when an agent needs to know which template to use, where a document fits in the hierarchy, or what upstream/downstream documents to read before writing. This skill manages the full document lifecycle from Charter through Sprint execution."
4
+ ---
5
+
6
+ # Document Hierarchy Manager
7
+
8
+ ## Purpose
9
+
10
+ This skill is the navigation system for V-Bounce OS 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) โ”€โ”€โ†’ 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 (Active Sprint)
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 โ”€โ”€โ†’ Delivery Plan ยง3 (V-Bounce State)
61
+
62
+ Delivery Plan ยง3 (Active Sprint) โ”€โ”€โ†’ Team Lead Agent (initialization)
63
+ Delivery Plan ยง5 (Context Pack) โ”€โ”€โ†’ Ready to Bounce gate
64
+
65
+ Risk Registry โ†โ”€โ”€ ALL levels (cross-cutting input)
66
+ ```
67
+
68
+ ## Template Locations
69
+
70
+ | Document | Template Path | Output Location |
71
+ |----------|---------------|-----------------|
72
+ | Charter | `templates/charter.md` | `product_plans/{project}_charter.md` |
73
+ | Roadmap | `templates/roadmap.md` | `product_plans/{project}_roadmap.md` |
74
+ | Risk Registry | `templates/risk_registry.md` | `product_plans/RISK_REGISTRY.md` |
75
+ | Delivery Plan | `templates/delivery_plan.md` | `product_plans/{delivery}/DELIVERY_PLAN.md` |
76
+ | Epic | `templates/epic.md` | `product_plans/{delivery}/EPIC-{NNN}_{name}/EPIC-{NNN}.md` |
77
+ | Story | `templates/story.md` | `product_plans/{delivery}/EPIC-{NNN}_{name}/STORY-{EpicID}-{StoryID}.md` |
78
+ | Hotfix | `templates/hotfix.md` | `product_plans/{delivery}/HOTFIX-{Date}-{Name}.md` |
79
+ | Sprint Report | `templates/sprint_report.md` | `.bounce/sprint-report.md` (archived after sprint) |
80
+
81
+ ### Product Plans Folder Structure
82
+
83
+ ```
84
+ product_plans/
85
+ โ”œโ”€โ”€ {project}_charter.md โ† project-level (root)
86
+ โ”œโ”€โ”€ {project}_roadmap.md โ† project-level (root)
87
+ โ”œโ”€โ”€ RISK_REGISTRY.md โ† project-level (root)
88
+ โ”‚
89
+ โ”œโ”€โ”€ D-01_{release_name}/ โ† delivery folder (1 per release)
90
+ โ”‚ โ”œโ”€โ”€ DELIVERY_PLAN.md โ† at delivery root
91
+ โ”‚ โ”œโ”€โ”€ EPIC-001_{epic_name}/ โ† epic folder
92
+ โ”‚ โ”‚ โ”œโ”€โ”€ EPIC-001.md โ† epic document
93
+ โ”‚ โ”‚ โ”œโ”€โ”€ STORY-001-01.md โ† stories live with their epic
94
+ โ”‚ โ”‚ โ””โ”€โ”€ STORY-001-02.md
95
+ โ”‚ โ””โ”€โ”€ EPIC-002_{epic_name}/
96
+ โ”‚ โ”œโ”€โ”€ EPIC-002.md
97
+ โ”‚ โ””โ”€โ”€ STORY-002-01.md
98
+ โ”‚
99
+ โ”œโ”€โ”€ D-02_{release_name}/ โ† next delivery
100
+ โ”‚ โ”œโ”€โ”€ DELIVERY_PLAN.md
101
+ โ”‚ โ””โ”€โ”€ ...
102
+ โ”‚
103
+ โ””โ”€โ”€ archive/ โ† completed deliveries
104
+ โ””โ”€โ”€ D-01_{release_name}/ โ† whole folder moved here
105
+ ```
106
+
107
+ **Key rules:**
108
+ - Charter, Roadmap, Risk Registry live at `product_plans/` root (project-level, shared across deliveries)
109
+ - Each delivery (= Roadmap Release) gets a folder: `D-{NN}_{release_name}/`
110
+ - Each Epic gets a subfolder named `EPIC-{NNN}_{epic_name}/`
111
+ - Stories live inside their parent Epic's folder โ€” a Story never exists without an Epic
112
+ - Delivery Plan lives at the root of its delivery folder
113
+ - When a delivery completes: Team Lead moves the entire delivery folder to `product_plans/archive/` and adds a Delivery Log entry to the Roadmap (ยง7)
114
+
115
+ ### V-Bounce OS Framework Structure
116
+
117
+ ```
118
+ V-Bounce OS/
119
+ โ”œโ”€โ”€ brains/ โ€” Agent brain files for each AI coding tool
120
+ โ”‚ โ”œโ”€โ”€ CLAUDE.md โ€” Claude Code brain
121
+ โ”‚ โ”œโ”€โ”€ AGENTS.md โ€” Codex CLI brain
122
+ โ”‚ โ”œโ”€โ”€ GEMINI.md โ€” Gemini CLI / Antigravity brain
123
+ โ”‚ โ”œโ”€โ”€ cursor-rules/ โ€” Cursor modular .mdc rules
124
+ โ”‚ โ””โ”€โ”€ SETUP.md โ€” Deployment guide
125
+ โ”œโ”€โ”€ templates/ โ€” Document templates (immutable during execution)
126
+ โ”œโ”€โ”€ skills/ โ€” Agent skills (SKILL.md files + references)
127
+ โ”œโ”€โ”€ scripts/ โ€” Automation scripts (e.g., hotfix_manager.sh)
128
+ โ””โ”€โ”€ docs/ โ€” Reference docs (e.g., HOTFIX_EDGE_CASES.md)
129
+ ```
130
+
131
+ ### Brain File Deployment
132
+
133
+ When initializing a new project, deploy the correct brain file for the AI coding tool in use:
134
+
135
+ | Tool | Source | Deploy To |
136
+ |------|--------|-----------|
137
+ | Claude Code | `brains/CLAUDE.md` | Project root as `CLAUDE.md` |
138
+ | Codex CLI | `brains/AGENTS.md` | Project root as `AGENTS.md` |
139
+ | Cursor | `brains/cursor-rules/*.mdc` | `.cursor/rules/` |
140
+ | Gemini CLI | `brains/GEMINI.md` | Project root as `GEMINI.md` |
141
+ | Antigravity | `brains/GEMINI.md` | Project root + copy `skills/` to `.agents/skills/` |
142
+
143
+ 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 OS rules, update each brain file directly and keep them in sync.
144
+
145
+ ## Document Operations
146
+
147
+ ### CREATE โ€” Making a New Document
148
+
149
+ Before creating any document, YOU MUST:
150
+
151
+ 1. Identify the document type and its level in the hierarchy
152
+ 2. Read ALL upstream documents that feed into it
153
+ 3. Copy the template from the template location
154
+ 4. Fill sections by pulling from upstream sources (see Information Flow above)
155
+ 5. Set the Ambiguity Score based on completeness
156
+ 6. Verify all cross-references are valid
157
+
158
+ **Pre-read requirements by document type:**
159
+
160
+ | Creating | MUST read first |
161
+ |----------|-----------------|
162
+ | Charter | Nothing โ€” Charter is root. Gather from user input. |
163
+ | Roadmap | Charter (full document) |
164
+ | Epic | Charter ยง1, ยง2, ยง5 + Roadmap ยง2, ยง3, ยง5 |
165
+ | Story | Parent Epic (full document) + Roadmap ยง3 (ADRs) |
166
+ | Delivery Plan | Roadmap ยง2 (Release Plan) + All Stories in scope |
167
+ | Risk Registry | Charter ยง6 + Roadmap ยง4, ยง5 + All Epic ยง6 sections |
168
+
169
+ ### MODIFY โ€” Updating an Existing Document
170
+
171
+ When modifying a document:
172
+
173
+ 1. **Sprint Freeze Check:** Read `DELIVERY_PLAN.md`. If a sprint is currently Active, the Charter and Roadmap are **FROZEN**. DO NOT modify them directly. Instead, append the requested change to `CHANGE_QUEUE.md` at the project root.
174
+ 2. Read the document being modified
175
+ 3. Read upstream documents if the change affects inherited fields
176
+ 4. Make the change
177
+ 5. Check if the change cascades downstream โ€” if so, flag affected documents
178
+ 6. Append to the document's Change Log
179
+
180
+ **Cascade rules:**
181
+
182
+ | If you change... | Then also update... |
183
+ |------------------|---------------------|
184
+ | Charter ยง1 (Identity) | Roadmap ยง1 (Strategic Context) |
185
+ | Charter ยง2 (Design Principles) | Nothing โ€” but notify all agents |
186
+ | Charter ยง3 (Tech Stack) | Roadmap ยง3 (ADRs) |
187
+ | Roadmap ยง2 (Release Plan) | Delivery Plan sprint goals |
188
+ | Roadmap ยง3 (ADR) | All Stories referencing that ADR in ยง3.1 |
189
+ | Epic ยง2 (Scope) | All child Stories ยง1 (The Spec) |
190
+ | Epic ยง4 (Technical Context) | All child Stories ยง3 (Implementation Guide) |
191
+ | Story status (V-Bounce State) | Delivery Plan ยง3 (Active Sprint table) |
192
+ | Story โ€” new risk discovered | Risk Registry ยง1 (new row) |
193
+
194
+ ### DECOMPOSE โ€” Breaking Down Documents
195
+
196
+ **Epic โ†’ Stories:**
197
+
198
+ 1. Read Epic ยง5 (Decomposition Guidance) for the checklist and suggested sequence
199
+ 2. Create one Story per checked category (Schema, API, UI, Integration, etc.)
200
+ 3. For each Story:
201
+ - Pull ยง1 The Spec from Epic ยง2 Scope Boundaries (relevant items only)
202
+ - Pull ยง2 The Truth from Epic ยง7 Acceptance Criteria (decomposed per story)
203
+ - Pull ยง3 Implementation Guide from Epic ยง4 Technical Context
204
+ - Set Complexity Label (L1-L4) based on file count and pattern familiarity
205
+ 4. Link all created Stories back in Epic ยง9 Artifact Links
206
+ 5. Update Delivery Plan ยง4 Backlog with new stories
207
+
208
+ ### TRANSITION โ€” Moving Documents Between Phases
209
+
210
+ **Ambiguity gates (must pass before transitioning):**
211
+
212
+ | Transition | Gate |
213
+ |------------|------|
214
+ | Charter โ†’ Ready for Roadmap | Ambiguity ๐ŸŸก or ๐ŸŸข (ยง1 and ยง5 filled) |
215
+ | Roadmap โ†’ Ready for Epics | Charter Ambiguity ๐ŸŸข + Roadmap ยง2 and ยง3 filled |
216
+ | Epic โ†’ Ready for Stories | Ambiguity ๐ŸŸก or ๐ŸŸข (ยง2 Scope and ยง4 Tech Context filled) |
217
+ | Story โ†’ Ready to Bounce | Ambiguity ๐ŸŸข + ALL Context Pack items checked (Delivery Plan ยง5) |
218
+ | Hotfix โ†’ Bouncing | Complexity strictly L1 + Targets 1-2 files |
219
+
220
+ **V-Bounce State transitions for Stories:**
221
+
222
+ ```
223
+ Draft โ†’ Refinement: Story template created, being filled
224
+ Refinement โ†’ Probing/Spiking: L4 stories only, spike needed
225
+ Probing/Spiking โ†’ Refinement: Spike complete, back to refinement
226
+ Refinement โ†’ Ready to Bounce: Ambiguity ๐ŸŸข, Context Pack complete
227
+ Ready to Bounce โ†’ Bouncing: Team Lead activates Dev Agent
228
+ Bouncing โ†’ QA Passed: QA Validation Report passes
229
+ QA Passed โ†’ Architect Passed: Architect Audit Report passes
230
+ Architect Passed โ†’ Sprint Review: DevOps merges story, all gates clear
231
+ Sprint Review โ†’ Done: Human review accepted
232
+ Bouncing โ†’ Escalated: 3+ bounce failures
233
+ Any โ†’ Parking Lot: Deferred by decision
234
+
235
+ ***HOTFIX TRANSITIONS***
236
+ Draft โ†’ Bouncing: Hotfix template created + Triage confirmed L1
237
+ Bouncing โ†’ Done: Dev implements + Human manually verifies
238
+ Done โ†’ Sync: `hotfix_manager.sh sync` run to update other worktrees
239
+ ```
240
+
241
+ ## Agent Integration
242
+
243
+ | Agent | Documents Owned | Documents Read |
244
+ |-------|----------------|----------------|
245
+ | **Team Lead** | Delivery Plan, Sprint Report, Delivery archive | Charter, Roadmap, ALL Stories (for context packs) |
246
+ | **Developer** | Story ยง3 updates (during implementation) | Story ยง1 + ยง3, LESSONS.md |
247
+ | **QA** | QA Validation Report | Story ยง2, Dev Implementation Report |
248
+ | **Architect** | Architectural Audit Report, Risk flags (in report โ€” Lead writes to Registry) | Full Story, Roadmap ยง3 ADRs, Risk Registry |
249
+ | **DevOps** | DevOps Reports (merge + release) | Delivery Plan, LESSONS.md, gate reports |
250
+ | **Scribe** | Product documentation, _manifest.json | Sprint Report, Dev Reports, codebase |
251
+ | **PM/BA (Human)** | Charter, Roadmap, Epic, Story ยง1 + ยง2 | Everything |
252
+
253
+ ## Delivery Archiving
254
+
255
+ When a delivery (release) is complete:
256
+
257
+ 1. Team Lead moves the entire delivery folder to `product_plans/archive/`:
258
+ ```bash
259
+ mv product_plans/D-01_foundation/ product_plans/archive/D-01_foundation/
260
+ ```
261
+ 2. Team Lead adds a **Delivery Log** entry to Roadmap ยง7 with:
262
+ - Delivery ID, date, release tag
263
+ - Release Notes (summary of sprint reports from this delivery)
264
+ - Key metrics (stories delivered, bounce ratio, correction tax averages)
265
+ 3. Update Roadmap ยง2 Release Plan: set the release status to "Delivered"
266
+
267
+ ## Critical Rules
268
+
269
+ - **Read before write.** ALWAYS read upstream documents before creating or modifying any document. No exceptions.
270
+ - **Cascade before closing.** When modifying a document, check cascade rules before marking the change complete.
271
+ - **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.
272
+ - **Templates are immutable.** Never modify the template files themselves during project execution. Use write-skill for template evolution during retrospectives.
273
+ - **One source of truth.** If information exists in an upstream document, reference it โ€” do not duplicate it. Duplication creates drift.
274
+ - **Change Logs are mandatory.** Every modification to any document MUST be recorded in that document's Change Log section.
275
+
276
+ ## Keywords
277
+
278
+ charter, roadmap, epic, story, delivery plan, risk registry, document hierarchy, template, create document, update document, decompose epic, story breakdown, ambiguity score, context pack, V-Bounce state, phase transition, cascade update, planning documents
@@ -0,0 +1,90 @@
1
+ ---
2
+ name: lesson
3
+ description: Use when recording project-specific mistakes, gotchas, or hard-won knowledge. Also activates proactively when a mistake pattern is detected during work.
4
+ ---
5
+
6
+ # Lessons Learned
7
+
8
+ Captures project-specific mistakes and rules into `LESSONS.md` so they are never repeated. YOU MUST read `LESSONS.md` before modifying code in any session.
9
+
10
+ **Core principle:** Every mistake is an investment โ€” but only if you record it.
11
+
12
+ ## Trigger
13
+
14
+ `/lesson` OR `/lesson [description]` OR proactively when a mistake or gotcha is detected during work.
15
+
16
+ ## Announcement
17
+
18
+ When using this skill, state: "Recording a lesson learned."
19
+
20
+ ## Awareness: Always-On Behavior
21
+
22
+ This is NOT just a command โ€” it is a standing directive:
23
+
24
+ 1. **Before modifying code**, read `LESSONS.md` at the project root. Treat recorded rules as hard constraints.
25
+ 2. **During work**, if you encounter any of these signals, offer to record a lesson:
26
+ - A bug caused by a non-obvious platform behavior (Supabase, Vercel, Next.js, etc.)
27
+ - A fix that took multiple attempts to get right
28
+ - A pattern that silently fails or produces unexpected results
29
+ - A deployment or environment gotcha
30
+ - An approach that was abandoned after significant effort
31
+ 3. **When offering**, say: *"This looks like a lesson worth recording โ€” want me to capture it?"*
32
+ 4. **Never record without the user's approval.** Always ask first.
33
+
34
+ ## Recording: The `/lesson` Command
35
+
36
+ ### Step 1: Gather Context
37
+
38
+ If the user provides a description (`/lesson [description]`), use it. Otherwise:
39
+ - Review the current session for what went wrong or what was learned
40
+ - Ask the user: *"What's the lesson here โ€” what should we never do again?"*
41
+
42
+ **WAIT** for user input if context is unclear.
43
+
44
+ ### Step 2: Format the Entry
45
+
46
+ Use this exact format โ€” no deviations:
47
+
48
+ ```markdown
49
+ ### [YYYY-MM-DD] Short descriptive title
50
+ **What happened:** One or two sentences describing the problem or mistake.
51
+ **Rule:** The actionable rule to follow going forward. Write as an imperative.
52
+ ```
53
+
54
+ Rules for formatting:
55
+ - Date is today's date
56
+ - Title is a short phrase, not a sentence
57
+ - "What happened" is factual โ€” what you tried and what went wrong
58
+ - "Rule" is a direct command โ€” "Always...", "Never...", "Use X instead of Y"
59
+
60
+ ### Step 3: Append to LESSONS.md
61
+
62
+ 1. Read `LESSONS.md` at the project root
63
+ 2. If the file does not exist, create it with the header `# Lessons Learned`
64
+ 3. Append the new entry at the bottom of the file
65
+ 4. Confirm to the user: *"Recorded. This lesson is now active for all future sessions."*
66
+
67
+ ## File Format
68
+
69
+ `LESSONS.md` lives at the project root. Flat, chronological, no categories.
70
+
71
+ ```markdown
72
+ # Lessons Learned
73
+
74
+ ### [2026-02-18] RLS policies break cascade deletes
75
+ **What happened:** Tried cascade delete on projects table, silently failed due to RLS.
76
+ **Rule:** Always use soft deletes with RLS. Never cascade.
77
+
78
+ ### [2026-02-15] Vercel preview URLs break CORS
79
+ **What happened:** OAuth failed on every preview deploy because preview URLs weren't in the CORS allowlist.
80
+ **Rule:** Use wildcard pattern for Vercel preview branch origins in CORS config.
81
+ ```
82
+
83
+ ## Critical Rules
84
+
85
+ - **Read before write.** ALWAYS read `LESSONS.md` before modifying project code. No exceptions.
86
+ - **Ask before recording.** Never append a lesson without user approval.
87
+ - **One lesson per entry.** Do not combine multiple learnings into one entry.
88
+ - **Rules are imperatives.** Write rules as direct commands, not suggestions.
89
+ - **No duplicates.** Before recording, check if a similar lesson already exists. If so, update it instead of creating a new one.
90
+ - **Keep it flat.** No categories, no tags, no metadata beyond the entry format. Simplicity is the feature.