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,136 @@
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
+ ## Timing: Record Immediately, Not at Sprint Close
35
+
36
+ **Lessons MUST be recorded as soon as the story that produced them is merged** — not deferred to sprint close. Context decays fast.
37
+
38
+ **Flow:**
39
+ 1. During execution, agents flag lessons in their reports (`lessons_flagged` field)
40
+ 2. After DevOps merges a story (Phase 3, Step 9), the Team Lead immediately:
41
+ - Reads `lessons_flagged` from Dev and QA reports
42
+ - Presents each lesson to the human for approval
43
+ - Records approved lessons to LESSONS.md right away
44
+ 3. At sprint close (Sprint Report §4), the lesson table serves as a **review of what was already recorded** — not a first-time approval step. This is a confirmation, not a gate.
45
+
46
+ **Why this matters:** A lesson recorded 5 minutes after the problem is specific and actionable. A lesson recorded 3 days later at sprint close is vague and often forgotten.
47
+
48
+ ## Recording: The `/lesson` Command
49
+
50
+ ### Step 1: Gather Context
51
+
52
+ If the user provides a description (`/lesson [description]`), use it. Otherwise:
53
+ - Review the current session for what went wrong or what was learned
54
+ - Ask the user: *"What's the lesson here — what should we never do again?"*
55
+
56
+ **WAIT** for user input if context is unclear.
57
+
58
+ ### Step 2: Format the Entry
59
+
60
+ Use this exact format — no deviations:
61
+
62
+ ```markdown
63
+ ### [YYYY-MM-DD] Short descriptive title
64
+ **What happened:** One or two sentences describing the problem or mistake.
65
+ **Rule:** The actionable rule to follow going forward. Write as an imperative.
66
+ ```
67
+
68
+ Rules for formatting:
69
+ - Date is today's date
70
+ - Title is a short phrase, not a sentence
71
+ - "What happened" is factual — what you tried and what went wrong
72
+ - "Rule" is a direct command — "Always...", "Never...", "Use X instead of Y"
73
+
74
+ ### Step 3: Append to LESSONS.md
75
+
76
+ 1. Read `LESSONS.md` at the project root
77
+ 2. If the file does not exist, create it with the header `# Lessons Learned`
78
+ 3. Append the new entry at the bottom of the file
79
+ 4. Confirm to the user: *"Recorded. This lesson is now active for all future sessions."*
80
+
81
+ ## File Format
82
+
83
+ `LESSONS.md` lives at the project root. Flat, chronological, no categories.
84
+
85
+ ```markdown
86
+ # Lessons Learned
87
+
88
+ ### [2026-02-18] RLS policies break cascade deletes
89
+ **What happened:** Tried cascade delete on projects table, silently failed due to RLS.
90
+ **Rule:** Always use soft deletes with RLS. Never cascade.
91
+
92
+ ### [2026-02-15] Vercel preview URLs break CORS
93
+ **What happened:** OAuth failed on every preview deploy because preview URLs weren't in the CORS allowlist.
94
+ **Rule:** Use wildcard pattern for Vercel preview branch origins in CORS config.
95
+ ```
96
+
97
+ ## Critical Rules
98
+
99
+ - **Read before write.** ALWAYS read `LESSONS.md` before modifying project code. No exceptions.
100
+ - **Ask before recording.** Never append a lesson without user approval.
101
+ - **One lesson per entry.** Do not combine multiple learnings into one entry.
102
+ - **Rules are imperatives.** Write rules as direct commands, not suggestions.
103
+ - **No duplicates.** Before recording, check if a similar lesson already exists. If so, update it instead of creating a new one.
104
+ - **Keep it flat.** No categories, no tags, no metadata beyond the entry format. Simplicity is the feature.
105
+
106
+ ## Lesson Graduation
107
+
108
+ Lessons that have been proven effective across 3+ sprints become permanent agent config rules.
109
+
110
+ ### Graduation Criteria
111
+
112
+ A lesson is a **graduation candidate** when:
113
+ - It has been active for 3+ sprints
114
+ - It has been triggered (prevented a recurrence) at least once
115
+ - No bounce in the last 3 sprints matches its root cause
116
+
117
+ #### Accelerated Graduation
118
+
119
+ A lesson qualifies for **accelerated graduation** (after 1 sprint instead of 3) when:
120
+ - It affected 5+ files across multiple stories, OR
121
+ - It caused a bounce (QA or Architect failure directly attributable to the lesson's root cause), OR
122
+ - It describes a cross-cutting concern (UI consistency, naming conventions, shared patterns) that will recur every sprint
123
+
124
+ Accelerated candidates are flagged by `suggest_improvements.mjs` with impact level P1. The human still approves — the only difference is the 3-sprint waiting period is waived.
125
+
126
+ ### Graduation Process
127
+
128
+ 1. `.vbounce/scripts/suggest_improvements.mjs` flags graduation candidates in improvement suggestions
129
+ 2. Human approves graduation
130
+ 3. Lead adds the rule to the relevant agent config (`.claude/agents/developer.md`, etc.)
131
+ 4. Lead removes or archives the lesson from `LESSONS.md` with a note: `[Graduated to {agent} config on {date}]`
132
+ 5. Record in `.vbounce/improvement-log.md` under "Applied"
133
+
134
+ ### Why Graduation Matters
135
+
136
+ `LESSONS.md` is a staging area, not a permanent rule store. Lessons that graduate become enforced constraints in the agent's core instructions — they can't be forgotten or overlooked. Lessons that stay in `LESSONS.md` are read on every session but are softer guidance. Keep `LESSONS.md` lean — stale lessons dilute the signal.
@@ -0,0 +1,102 @@
1
+ ---
2
+ name: product-graph
3
+ description: "Use when you need to understand document relationships, check what's affected by a change, find blocked documents, or assess the state of planning documents. Provides structured awareness of the full product document graph without reading every file. Auto-loaded during planning sessions."
4
+ ---
5
+
6
+ # Product Graph — Document Relationship Intelligence
7
+
8
+ ## Purpose
9
+
10
+ This skill gives you instant awareness of all product planning documents and their relationships. Instead of globbing and reading every file in `product_plans/`, you read a single JSON graph that maps every document, its status, and how it connects to other documents.
11
+
12
+ ## Three-Tier Loading Protocol
13
+
14
+ When you need to understand the product document landscape, load information in tiers — stop at the tier that answers your question:
15
+
16
+ ### Tier 1: Graph JSON (~400-1000 tokens)
17
+ Read `.vbounce/product-graph.json` for a bird's-eye view.
18
+ - All document IDs, types, statuses, and paths
19
+ - All edges (dependencies, parent relationships, feeds)
20
+ - **Use when:** answering "what exists?", "what's blocked?", "what depends on X?"
21
+
22
+ ### Tier 2: Specific Frontmatter (~200-500 tokens per doc)
23
+ Read the YAML frontmatter of specific documents identified in Tier 1.
24
+ - Ambiguity scores, priorities, tags, owners, dates
25
+ - **Use when:** you need details about specific documents (not the full set)
26
+
27
+ ### Tier 3: Full Documents (~500-3000 tokens per doc)
28
+ Read the complete document body.
29
+ - Full specs, scope boundaries, acceptance criteria, open questions
30
+ - **Use when:** creating or modifying documents, decomposing epics, or resolving ambiguity
31
+
32
+ ## Edge Type Semantics
33
+
34
+ | Edge Type | Meaning | Direction |
35
+ |-----------|---------|-----------|
36
+ | `parent` | Document is a child of another (Story → Epic) | parent → child |
37
+ | `depends-on` | Document cannot proceed until dependency is done | dependency → dependent |
38
+ | `unlocks` | Completing this document enables another | source → unlocked |
39
+ | `context-source` | Document draws context from another | source → consumer |
40
+ | `feeds` | Document contributes to a delivery/release | document → delivery |
41
+
42
+ ## When to Regenerate the Graph
43
+
44
+ Run `vbounce graph` (or `node .vbounce/scripts/product_graph.mjs`) after:
45
+ - **Any document edit** that changes status, dependencies, or relationships
46
+ - **Sprint lifecycle events** (sprint init, story complete, sprint close)
47
+ - **Planning session start** — ensure graph reflects current state
48
+ - **Document creation or archival** — new nodes or removed nodes
49
+
50
+ The graph is a cache — it's cheap to regenerate and stale data is worse than no data.
51
+
52
+ ## Blocked Document Detection
53
+
54
+ A document is **blocked** when:
55
+ 1. It has incoming `depends-on` edges from documents with status != "Done"/"Implemented"/"Completed"
56
+ 2. It has `ambiguity: 🔴 High` and linked spikes are not Validated/Closed
57
+ 3. Its parent document has status "Parking Lot" or "Escalated"
58
+
59
+ To find blocked documents:
60
+ 1. Read the graph (Tier 1)
61
+ 2. For each node, check its incoming `depends-on` edges
62
+ 3. Look up the source node's status
63
+ 4. If any source is not in a terminal state → document is blocked
64
+
65
+ ## Impact Analysis
66
+
67
+ To understand what changes when you modify a document:
68
+ ```bash
69
+ vbounce graph impact <DOC-ID> # human-readable
70
+ vbounce graph impact <DOC-ID> --json # machine-readable
71
+ ```
72
+
73
+ This runs BFS traversal and returns:
74
+ - **Direct dependents** — documents immediately affected
75
+ - **Transitive dependents** — documents affected through cascading dependencies
76
+ - **Upstream feeders** — documents that feed into the changed document
77
+
78
+ ## Graph JSON Schema
79
+
80
+ ```json
81
+ {
82
+ "generated_at": "ISO-8601 timestamp",
83
+ "node_count": 5,
84
+ "edge_count": 12,
85
+ "nodes": {
86
+ "EPIC-002": {
87
+ "type": "epic|story|spike|charter|roadmap|delivery-plan|sprint-plan|risk-registry|hotfix",
88
+ "status": "Draft|Refinement|Ready to Bounce|Bouncing|Done|Implemented|...",
89
+ "ambiguity": "🔴 High|🟡 Medium|🟢 Low|null",
90
+ "path": "product_plans/backlog/EPIC-002_.../EPIC-002_....md",
91
+ "title": "Human-readable title from first heading"
92
+ }
93
+ },
94
+ "edges": [
95
+ { "from": "EPIC-002", "to": "D-02", "type": "feeds" }
96
+ ]
97
+ }
98
+ ```
99
+
100
+ ## Keywords
101
+
102
+ product graph, document graph, dependency, impact analysis, what's affected, what's blocked, document relationships, planning state