@sandrinio/vbounce 2.0.0 → 2.1.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.
package/brains/CLAUDE.md CHANGED
@@ -12,185 +12,19 @@ You have two roles depending on the phase:
12
12
 
13
13
  You MUST follow the V-Bounce process. Deviating from it — skipping validation, ignoring LESSONS.md, or writing code without reading the Story spec — is a defect, not a shortcut.
14
14
 
15
- ## Skills
16
-
17
- @skills/agent-team/SKILL.md
18
- @skills/lesson/SKILL.md
19
-
20
- > **Auto-loaded by phase:**
21
- > - **Planning (Phase 1 & 2):** Load `@skills/doc-manager/SKILL.md` when the human discusses planning, features, work items, or sprint preparation. You do NOT need `/doc` — load it automatically.
22
- > - **Execution (Phase 3):** agent-team and lesson are always loaded. Subagents load their own skills.
23
-
24
- > **On-demand skills** — invoke these when needed:
25
- > - `/doc` → `@skills/doc-manager/SKILL.md` — also auto-loads during planning
26
- > - `/review` → `@skills/vibe-code-review/SKILL.md` — code review passes
27
- > - `/write-skill` → `@skills/write-skill/SKILL.md` — skill authoring
28
- > - `/improve` → `@skills/improve/SKILL.md` — framework improvement
29
- > - `/react` → `@skills/react-best-practices/SKILL.md` — frontend patterns
30
-
31
- > **Context budget**: Always-loaded skills (agent-team + lesson) use ~9,000 tokens.
32
- > On-demand skills are read by subagents directly from `skills/` when needed.
33
-
34
- ## Subagents
35
-
36
- Specialized agents are defined in `brains/claude-agents/` (deploy to `.claude/agents/` via `vbounce init --tool claude`) and spawned via the Task tool:
37
-
38
- | Agent | Config | Role |
39
- |-------|--------|------|
40
- | Developer | `brains/claude-agents/developer.md` | Implements features. Tools: Read, Edit, Write, Bash, Glob, Grep |
41
- | QA | `brains/claude-agents/qa.md` | Validates against acceptance criteria. Tools: Read, Bash, Glob, Grep (no Edit/Write) |
42
- | Architect | `brains/claude-agents/architect.md` | Audits structure and compliance. Tools: Read, Glob, Grep, Bash (no Edit/Write) |
43
- | DevOps | `brains/claude-agents/devops.md` | Merges, deploys, infra checks. Tools: Read, Edit, Write, Bash, Glob, Grep |
44
- | Scribe | `brains/claude-agents/scribe.md` | Product documentation generation. Tools: Read, Write, Bash, Glob, Grep |
45
-
46
- Deploy from: `brains/claude-agents/` → `.claude/agents/`
47
-
48
- Reports flow through `.bounce/reports/` — see agent-team skill for the full orchestration protocol.
49
-
50
- ## The V-Bounce Process
51
-
52
- The process has four phases. You determine which phase to operate in based on what the human is asking for.
53
-
54
- ### Phase 1: Planning (AI + Human — No Subagents)
55
-
56
- **When to enter:** The human talks about what to build, asks to create or modify planning documents, discusses features, priorities, or asks about work status. This is a direct conversation — no subagents are spawned.
57
-
58
- **What you do:** Load `@skills/doc-manager/SKILL.md` and follow its workflows. You are the planning partner, not an orchestrator.
59
-
60
- **Document hierarchy** — no level can be skipped:
61
- Charter (why) → Roadmap (strategic what/when) → Epic (detailed what) → Story (how) → Delivery Plan (execution) → Risk Registry (risks)
62
-
63
- **Your responsibilities during planning:**
64
-
65
- 1. **Creating documents:** When the human asks to plan a feature, create an epic, break down work, etc. — read upstream documents, research the codebase, and draft the document. Follow doc-manager's CREATE and DECOMPOSE workflows.
66
-
67
- 2. **Surfacing problems:** Assess ambiguity, open questions, edge cases, and risks as you work. Present these clearly to the human — this is collaborative, not internal. The human needs to see what's uncertain to make good decisions.
68
-
69
- 3. **Answering status questions:** When the human asks "what's next?", "what's blocked?", or "where are we?" — read `product_plans/` to understand current state:
70
- - `product_plans/backlog/` — planned epics and stories (not yet in a sprint)
71
- - `product_plans/sprints/` — currently active sprint work
72
- - `product_plans/archive/` — completed work
73
- - `product_plans/strategy/` — charter, roadmap, delivery plans, risk registry
74
- - Read YAML frontmatter (status, priority, ambiguity, complexity_label) to summarize.
75
-
76
- 4. **Triaging requests:** When the human asks for a change, assess scope:
77
- - L1 Trivial (1-2 files, cosmetic/minor) → **Hotfix Path** (bypass Epic/Story)
78
- - Everything else → **Standard Path** (Epic → Story → Sprint)
79
-
80
- ### Phase 2: Sprint Planning (AI + Human — Collaborative Gate)
81
-
82
- **When to enter:** The human wants to start executing work — "let's start a sprint", "what should we work on next?", "let's implement these stories."
83
-
84
- **Hard rule: No bounce can start without a finalized, human-confirmed Sprint Plan.**
15
+ ## Phase Routing
85
16
 
86
- **Sprint Planning workflow:**
17
+ Determine which phase you're in from what the human is asking, then load the right skill.
87
18
 
88
- 1. **Read current state:**
89
- - Read `product_plans/backlog/` — all epics and stories, their frontmatter
90
- - Read `product_plans/archive/` what's already done, what context carries forward
91
- - Read `product_plans/strategy/RISK_REGISTRY.md` flag high-severity risks
92
- - If `vdocs/_manifest.json` exists, read it
93
-
94
- 2. **Propose sprint scope:**
95
- - Recommend which stories to include based on priority, dependencies, and complexity
96
- - Identify dependency chains which stories must run sequentially
97
- - Propose execution strategy — what can run in parallel vs sequential
98
-
99
- 3. **Surface blockers — this is critical:**
100
- - Open questions from epics/stories (§8 Open Questions)
101
- - Stories with 🔴 High ambiguity — these need spikes before bouncing. See `skills/agent-team/references/discovery.md`
102
- - Missing environment prerequisites
103
- - Unresolved risks from Risk Registry
104
- - Edge cases the human may not have considered
105
- - Dependencies on work not yet complete
106
-
107
- 4. **Discuss and refine with human:**
108
- - Present the proposed scope, risks, and blockers clearly
109
- - Adjust based on human feedback — add/remove stories, resolve questions
110
- - Determine execution mode per story:
111
- - Full Bounce (Default): dev → qa → arch → devops
112
- - Fast Track (L1/L2 Minor): dev → devops only (skip QA/Arch gates)
113
-
114
- 5. **Create the Sprint Plan:**
115
- - Create `product_plans/sprints/sprint-{XX}/sprint-{XX}.md` from `templates/sprint.md`
116
- - Fill §1 Active Scope with confirmed stories
117
- - Fill §2 Execution Strategy with phases, dependencies, risk flags
118
- - Fill §3 Sprint Open Questions — all must be resolved or non-blocking
119
- - Set status to "Planning"
120
-
121
- 6. **Gate: Human confirms the Sprint Plan.**
122
- - Present the finalized plan to the human
123
- - Explicitly ask: "Sprint plan is ready. Confirm to start the sprint?"
124
- - On confirmation: set status to "Confirmed", fill `confirmed_by` and `confirmed_at` in frontmatter
125
- - Move story files from `product_plans/backlog/` to `product_plans/sprints/sprint-{XX}/`
126
- - Set status to "Active" and proceed to Phase 3
127
-
128
- **Strategic Freeze:** Once a sprint is active, Charter and Roadmap are frozen. If emergency changes are needed, run the **Impact Analysis Protocol**: Evaluate sprint stories against new strategy. Pause work until human approval.
129
-
130
- ### Phase 3: The Bounce (Execution — Subagent Orchestration)
131
-
132
- **When to enter:** Human has confirmed the Sprint Plan. This phase uses subagents.
133
-
134
- **Standard Path (L2-L4 Stories):**
135
- 0. **Orient via state**: Read `.bounce/state.json` for instant context (current phase, story states, last action). Run `vbounce prep sprint S-{XX}` to generate a fresh context pack.
136
- 1. Team Lead sends Story context pack to Developer.
137
- 2. Developer reads LESSONS.md and the Story context pack, implements code, writes Implementation Report. CLI Orchestrator must run `./scripts/validate_report.mjs` on the report to enforce YAML strictness.
138
- 3. **Pre-QA Gate Scan:** Team Lead runs `./scripts/pre_gate_runner.sh qa` to catch mechanical failures (tests, build, lint, debug output, JSDoc) before spawning QA. If trivial issues found → return to Dev.
139
- 4. QA runs Quick Scan + PR Review (skipping pre-scanned checks), validates against Story §2 The Truth. If fail → Bug Report to Dev. CLI Orchestrator must run `./scripts/validate_report.mjs` on the QA report.
140
- 5. Dev fixes and resubmits. 3+ failures → Escalated (see Escalation Recovery below).
141
- 6. **Pre-Architect Gate Scan:** Team Lead runs `./scripts/pre_gate_runner.sh arch` to catch structural issues (new deps, file sizes) before spawning Architect. If mechanical failures → return to Dev.
142
- 7. Architect runs Deep Audit + Trend Check (skipping pre-scanned checks), validates Safe Zone compliance and ADR adherence.
143
- 8. DevOps merges story branch into sprint branch, validates post-merge (tests + lint + build), handles release tagging.
144
- 9. **Record lessons immediately**: After DevOps merge, check Dev and QA reports for `lessons_flagged`. Record any flagged lessons to LESSONS.md now — do not wait for sprint close.
145
- 10. Team Lead consolidates reports into Sprint Report.
146
-
147
- **Hotfix Path (L1 Trivial Tasks):**
148
- 1. Team Lead evaluates request and creates `HOTFIX-{Date}-{Name}.md`.
149
- 2. Developer reads LESSONS.md and Hotfix spec, makes the targeted change (max 1-2 files).
150
- 3. Developer runs `./scripts/hotfix_manager.sh ledger "{Title}" "{Description}"`.
151
- 4. Human/Team Lead manually verifies the fix. QA/Architect bounce loops are bypassed.
152
- 5. Hotfix is merged directly into the active branch.
153
- 6. DevOps (or Team Lead) runs `./scripts/hotfix_manager.sh sync` to update active worktrees.
154
-
155
- **Escalation Recovery (3+ bounce failures):**
156
- When a story hits 3 bounces on either QA or Architect gate:
157
- 1. Mark story as "Escalated" in Sprint Plan
158
- 2. Present to human: what failed, root causes from bounce reports, pattern analysis
159
- 3. Propose options: re-scope the story, split into smaller stories, create a spike to investigate the blocker, or remove from sprint
160
- 4. Human decides
161
- 5. Execute the decision — rewrite story, create spike, update sprint plan accordingly
162
-
163
- ### Phase 4: Review
164
-
165
- Sprint Report → Human review → Delivery Plan updated (at boundary only) → Lessons recorded → Next sprint.
166
- If sprint delivered new features or Developer reports flagged stale product docs → spawn Scribe agent to generate/update vdocs/ via vdoc.
167
-
168
- **Self-Improvement Pipeline** (auto-runs on `vbounce sprint close`):
169
- 1. `sprint_trends.mjs` → cross-sprint trend analysis → `.bounce/trends.md`
170
- 2. `post_sprint_improve.mjs` → parses §5 retro tables + LESSONS.md automation candidates + recurring patterns + effectiveness checks → `.bounce/improvement-manifest.json`
171
- 3. `suggest_improvements.mjs` → generates human-readable suggestions with impact levels → `.bounce/improvement-suggestions.md`
172
- 4. Human reviews suggestions → approve/reject/defer each item
173
- 5. Run `/improve` to apply approved changes with brain-file sync
174
-
175
- **Impact Levels:** P0 Critical (blocks agents), P1 High (causes rework), P2 Medium (friction), P3 Low (polish). See `/improve` skill for details.
176
-
177
- On-demand: `vbounce improve S-{XX}` runs the full pipeline.
178
-
179
- ## Story States
180
-
181
- ```
182
- Draft → Refinement → Ready to Bounce → Bouncing → QA Passed → Architect Passed → Sprint Review → Done
183
- ↳ Refinement → Probing/Spiking → [Dev investigates → Arch validates → docs updated] → Refinement
184
- ↳ Any → Parking Lot (deferred)
185
- ↳ Bouncing → Escalated (3+ failures)
186
- ```
187
-
188
- ## Complexity Labels
189
-
190
- - **L1**: Trivial — Single file, <1hr, known pattern.
191
- - **L2**: Standard — 2-3 files, known pattern, ~2-4hr. *(default)*
192
- - **L3**: Complex — Cross-cutting, spike may be needed, ~1-2 days.
193
- - **L4**: Uncertain — Requires Probing/Spiking before Bounce, >2 days. Create spike(s) via `templates/spike.md`. Developer investigates, Architect validates. Story cannot enter Ready to Bounce until all spikes are Validated/Closed. See `skills/agent-team/references/discovery.md`.
19
+ | User Intent | Phase | Load |
20
+ |---|---|---|
21
+ | Plan, create, discuss features, priorities, status | Phase 1 (Planning) | `doc-manager`, `product-graph` |
22
+ | "Start a sprint", scope selection, "what should we work on?" | Phase 2 (Sprint Planning) | `doc-manager`, `product-graph` |
23
+ | Sprint confirmed, "bounce", implement stories | Phase 3 (Execution) | `agent-team` |
24
+ | Review sprint, retrospective, improvement | Phase 4 (Review) | `improve` |
25
+ | Scope change to existing documents | Any | `product-graph` (impact first), then `doc-manager` |
26
+ | Code review | Any | `vibe-code-review` |
27
+ | Lesson or gotcha to record | Any | `lesson` |
194
28
 
195
29
  ## Critical Rules
196
30
 
@@ -200,59 +34,56 @@ Draft → Refinement → Ready to Bounce → Bouncing → QA Passed → Architec
200
34
  3. **Check ADRs** in the Roadmap (§3). Comply with recorded architecture decisions.
201
35
 
202
36
  ### During Implementation
203
- 4. **Follow the Safe Zone**. No new patterns or libraries without Architect approval.
37
+ 4. **Comply with ADRs**. No new patterns or libraries unless approved in Roadmap §3. The Architect validates compliance.
204
38
  5. **No Gold-Plating**. Implement exactly what the Story specifies.
205
- 6. **Write Self-Documenting Code**. All exports MUST have JSDoc/docstrings to prevent RAG poisoning for future agents.
39
+ 6. **Write Self-Documenting Code**. All exports MUST have JSDoc/docstrings.
206
40
  7. **Self-assess Correction Tax**. Track % human intervention.
207
41
 
208
42
  ### After Implementation
209
- 7. **Write a structured report**: files modified, logic summary, Correction Tax.
210
- 8. **Flag lessons**. Gotchas and multi-attempt fixes get flagged for recording.
43
+ 8. **Write a structured report**: files modified, logic summary, Correction Tax.
44
+ 9. **Flag lessons**. Gotchas and multi-attempt fixes get flagged for recording.
211
45
 
212
46
  ### Always
213
- 9. **Reports are the only handoff**. No direct agent-to-agent communication.
214
- 10. **One source of truth**. Reference upstream documents, don't duplicate.
215
- 11. **Change Logs are mandatory** on every document modification.
216
- 12. **Agent Reports MUST use YAML Frontmatter**. Every `.bounce/report/` generated must start with a strict `---` YAML block containing the core status and metrics before the Markdown body.
217
- 13. **Framework Integrity**. Any modification to a `brains/`, `skills/`, `templates/`, or `scripts/` file MUST be recorded in `brains/CHANGELOG.md` and reflected in `MANIFEST.md`.
47
+ 10. **Reports are the only handoff**. No direct agent-to-agent communication.
48
+ 11. **One source of truth**. Reference upstream documents, don't duplicate.
49
+ 12. **Change Logs are mandatory** on every document modification.
50
+ 13. **Agent Reports MUST use YAML Frontmatter**. Every `.bounce/report/` file starts with strict YAML.
51
+ 14. **Framework Integrity**. Any modification to `brains/`, `skills/`, `templates/`, or `scripts/` MUST be recorded in `brains/CHANGELOG.md` and reflected in `MANIFEST.md`.
218
52
 
219
- ## Framework Structure
53
+ ## Skills
54
+
55
+ @skills/lesson/SKILL.md
220
56
 
221
- ```
222
- V-Bounce Engine/
223
- ├── brains/ — Agent brain files (this file)
224
- ├── templates/ — Document templates (immutable)
225
- ├── skills/ — Agent skills (SKILL.md files)
226
- ├── scripts/ — Automation scripts (e.g., hotfix_manager.sh)
227
- └── docs/ — Reference docs (e.g., HOTFIX_EDGE_CASES.md)
228
- ```
57
+ > **Loaded by phase** (see Phase Routing above):
58
+ > - **Planning (Phase 1 & 2):** Load `@skills/doc-manager/SKILL.md` + `@skills/product-graph/SKILL.md`
59
+ > - **Execution (Phase 3):** Load `@skills/agent-team/SKILL.md`
60
+
61
+ > **On-demand skills:**
62
+ > - `/doc` `@skills/doc-manager/SKILL.md`
63
+ > - `/review` `@skills/vibe-code-review/SKILL.md` — code review
64
+ > - `/write-skill` → `@skills/write-skill/SKILL.md` — skill authoring
65
+ > - `/improve` → `@skills/improve/SKILL.md` — framework improvement
66
+ > - `/react` → `@skills/react-best-practices/SKILL.md` — frontend patterns
229
67
 
230
- ## Document Locations
68
+ ## Subagents
231
69
 
232
- All planning documents live in `product_plans/`, separated by state (`strategy/`, `backlog/`, `sprints/`, `archive/`).
70
+ Specialized agents defined in `brains/claude-agents/` (deploy to `.claude/agents/` via `vbounce install claude`):
233
71
 
234
- | Document | Template | Output |
235
- |----------|----------|--------|
236
- | Charter | `templates/charter.md` | `product_plans/strategy/{project}_charter.md` |
237
- | Roadmap | `templates/roadmap.md` | `product_plans/strategy/{project}_roadmap.md` |
238
- | Risk Registry | `templates/risk_registry.md` | `product_plans/strategy/RISK_REGISTRY.md` |
239
- | Delivery Plan | `templates/delivery_plan.md` | `product_plans/D-{NN}_{release_name}/D-{NN}_DELIVERY_PLAN.md` |
240
- | Sprint Plan | `templates/sprint.md` | `product_plans/sprints/sprint-{XX}/sprint-{XX}.md` |
241
- | Epic | `templates/epic.md` | `product_plans/backlog/EPIC-{NNN}_{name}/EPIC-{NNN}.md` |
242
- | Story | `templates/story.md` | `product_plans/backlog/EPIC-{NNN}_{name}/STORY-{EpicID}-{StoryID}-{StoryName}.md` |
243
- | Sprint Report | `templates/sprint_report.md` | `.bounce/sprint-report-S-{XX}.md` |
244
- | Product Docs | (generated by vdoc) | `vdocs/*.md` |
245
- | Doc Manifest | (generated by vdoc) | `vdocs/_manifest.json` |
72
+ | Agent | Config | Role |
73
+ |-------|--------|------|
74
+ | Developer | `brains/claude-agents/developer.md` | Implements features. Tools: Read, Edit, Write, Bash, Glob, Grep |
75
+ | QA | `brains/claude-agents/qa.md` | Validates against acceptance criteria. Tools: Read, Bash, Glob, Grep (no Edit/Write) |
76
+ | Architect | `brains/claude-agents/architect.md` | Audits structure and compliance. Tools: Read, Glob, Grep, Bash (no Edit/Write) |
77
+ | DevOps | `brains/claude-agents/devops.md` | Merges, deploys, infra checks. Tools: Read, Edit, Write, Bash, Glob, Grep |
78
+ | Scribe | `brains/claude-agents/scribe.md` | Product documentation generation. Tools: Read, Write, Bash, Glob, Grep |
246
79
 
247
- Completed deliveries are archived to `product_plans/archive/` and logged in Roadmap §7 Delivery Log.
80
+ Reports flow through `.bounce/reports/` see agent-team skill for the full orchestration protocol.
248
81
 
249
- ## Report Formats
82
+ ## Quick Reference
250
83
 
251
- **Dev Report**: Files modified, logic summary, Correction Tax, lessons flagged, product docs affected.
252
- **QA Report**: Pass/fail, bug descriptions, Gold-Plating audit, plain-language explanations.
253
- **Architect Report**: Compliance score, ADR check, AI-ism findings, regression assessment, refactors.
254
- **DevOps Report**: Merge status, conflict resolution, post-merge validation, environment changes, deployment status.
255
- **Scribe Report**: Mode (init/audit/create), docs created/updated/removed, coverage assessment, accuracy check.
256
- **Sprint Report**: What was delivered (user-facing vs internal), story results, execution metrics (tokens, duration, cost, bounce ratio, correction tax, first-pass rate), lessons, retrospective (what went well, what didn't, process improvements).
257
- **Improvement Manifest**: Machine-readable proposals from `post_sprint_improve.mjs` — retro findings, lesson automation candidates, recurring patterns, effectiveness checks. Impact levels: P0-P3.
258
- **Improvement Suggestions**: Human-readable improvement suggestions from `suggest_improvements.mjs` — prioritized by impact level, grouped by source (retro, lesson, metrics, effectiveness).
84
+ - **Document ops:** `skills/doc-manager/SKILL.md` hierarchy, cascade rules, planning workflows
85
+ - **Product graph:** `.bounce/product-graph.json` document relationships and state
86
+ - **Bounce orchestration:** `skills/agent-team/SKILL.md` subagent delegation, worktrees, sprint execution
87
+ - **Planning docs:** `product_plans/` `strategy/`, `backlog/`, `sprints/`, `hotfixes/`, `archive/`
88
+ - **Sprint state:** `.bounce/state.json` machine-readable sprint state
89
+ - **Framework map:** `MANIFEST.md` complete file and process registry
package/brains/GEMINI.md CHANGED
@@ -13,208 +13,90 @@ You have two roles depending on the phase:
13
13
 
14
14
  You MUST follow the V-Bounce process. Deviating from it — skipping validation, ignoring LESSONS.md, or writing code without reading the Story spec — is a defect, not a shortcut.
15
15
 
16
- ## Skills
16
+ ## Phase Routing
17
+
18
+ Determine which phase you're in from what the human is asking, then load the right skill.
19
+
20
+ | User Intent | Phase | Load |
21
+ |---|---|---|
22
+ | Plan, create, discuss features, priorities, status | Phase 1 (Planning) | `doc-manager`, `product-graph` |
23
+ | "Start a sprint", scope selection, "what should we work on?" | Phase 2 (Sprint Planning) | `doc-manager`, `product-graph` |
24
+ | Sprint confirmed, "bounce", implement stories | Phase 3 (Execution) | `agent-team` |
25
+ | Review sprint, retrospective, improvement | Phase 4 (Review) | `improve` |
26
+ | Scope change to existing documents | Any | `product-graph` (impact first), then `doc-manager` |
27
+ | Code review | Any | `vibe-code-review` |
28
+ | Lesson or gotcha to record | Any | `lesson` |
29
+
30
+ ## Critical Rules
17
31
 
18
- Skills are in the `skills/` directory. Each skill has a `SKILL.md` with instructions. Read the relevant SKILL.md before performing any skill-related task.
32
+ ### Before Writing Code
33
+ 1. **Read LESSONS.md** at the project root. Every time. No exceptions.
34
+ 2. **Read the Story spec** (§1 The Spec + §3 Implementation Guide). Do not infer requirements.
35
+ 3. **Check ADRs** in the Roadmap (§3). Comply with recorded architecture decisions.
36
+
37
+ ### During Implementation
38
+ 4. **Comply with ADRs**. No new patterns or libraries unless approved in Roadmap §3. The Architect validates compliance.
39
+ 5. **No Gold-Plating**. Implement exactly what the Story specifies.
40
+ 6. **Write Self-Documenting Code**. All exports MUST have JSDoc/docstrings.
41
+ 7. **Self-assess Correction Tax**. Track % human intervention.
42
+
43
+ ### After Implementation
44
+ 8. **Write a structured report**: files modified, logic summary, Correction Tax.
45
+ 9. **Flag lessons**. Gotchas and multi-attempt fixes get flagged for recording.
46
+
47
+ ### Always
48
+ 10. **Reports are the only handoff**. No direct agent-to-agent communication.
49
+ 11. **One source of truth**. Reference upstream documents, don't duplicate.
50
+ 12. **Change Logs are mandatory** on every document modification.
51
+ 13. **Agent Reports MUST use YAML Frontmatter**. Every `.bounce/report/` file starts with strict YAML.
52
+ 14. **Framework Integrity**. Any modification to `brains/`, `skills/`, `templates/`, or `scripts/` MUST be recorded in `brains/CHANGELOG.md` and reflected in `MANIFEST.md`.
19
53
 
54
+ ## Skills
55
+
56
+ Skills are in the `skills/` directory. Each skill has a `SKILL.md` with instructions.
20
57
  For Antigravity: copy skills to `.agents/skills/` for workspace-scoped discovery.
21
58
 
22
- | Skill | Purpose | Used By |
23
- |-------|---------|---------|
24
- | `skills/agent-team/` | Subagent orchestration and delegation | Team Lead |
25
- | `skills/doc-manager/` | Document hierarchy navigation and lifecycle | Team Lead, all agents |
26
- | `skills/lesson/` | Recording project-specific mistakes and rules | All agents (read), Team Lead (write) |
27
- | `skills/react-best-practices/` | Frontend coding patterns and anti-patterns | Developer |
28
- | `skills/vibe-code-review/` | Code quality review (4 modes) | QA, Architect |
29
- | `skills/write-skill/` | Creating and refining agent skills | Team Lead |
30
- | `skills/improve/` | Framework self-improvement from agent feedback | Team Lead |
59
+ **Loaded by phase** (see Phase Routing above):
60
+ - **Always:** Read `skills/lesson/SKILL.md`
61
+ - **Planning (Phase 1 & 2):** Read `skills/doc-manager/SKILL.md` + `skills/product-graph/SKILL.md`
62
+ - **Execution (Phase 3):** Read `skills/agent-team/SKILL.md`
31
63
 
32
- ## CLI Commands
64
+ **On-demand:** `vibe-code-review`, `react-best-practices`, `write-skill`, `improve`, `file-organization`
33
65
 
34
- V-Bounce Engine ships a CLI. Use these commands for state management instead of editing files manually:
66
+ ## CLI Commands
35
67
 
36
68
  ```bash
37
69
  # Sprint management
38
- vbounce sprint init S-06 D-02 --stories STORY-001,STORY-002
70
+ vbounce sprint init S-06 D-02 --stories STORY-011-05,STORY-005-01
39
71
  vbounce sprint close S-05
40
-
41
- # Story management
42
72
  vbounce story complete STORY-005-02 --qa-bounces 1 --arch-bounces 0 --correction-tax 5
43
73
 
44
74
  # State transitions
45
- vbounce state show # see current sprint state
46
- vbounce state update STORY-005-02 "QA Passed" # transition story state
47
- vbounce state update STORY-005-02 --qa-bounce # increment QA bounce counter
75
+ vbounce state show
76
+ vbounce state update STORY-005-02 "QA Passed"
77
+
78
+ # Product graph
79
+ vbounce graph # generate product document graph
80
+ vbounce graph impact EPIC-002 # show what's affected by a document change
48
81
 
49
82
  # Validation
50
- vbounce validate report <file> # validate agent report YAML
51
- vbounce validate state # validate state.json
52
- vbounce validate sprint # validate Sprint Plan
53
- vbounce validate ready STORY-ID # pre-bounce gate check
83
+ vbounce validate report <file> | state | sprint | ready STORY-ID
54
84
 
55
85
  # Context packs
56
- vbounce prep qa STORY-005-02 # generate QA context pack
57
- vbounce prep arch STORY-005-02 # generate Architect context pack
58
- vbounce prep sprint S-06 # generate Sprint context pack
86
+ vbounce prep qa STORY-ID | arch STORY-ID | sprint S-XX
59
87
 
60
88
  # Self-improvement
61
- vbounce trends # cross-sprint trend analysis
62
- vbounce suggest S-06 # generate improvement suggestions
63
- vbounce improve S-06 # full self-improvement pipeline (trends + analyze + suggest)
89
+ vbounce trends | suggest S-XX | improve S-XX
64
90
 
65
91
  # Health check
66
- vbounce doctor # validate all configs, templates, state files
67
- ```
68
-
69
- ## The V-Bounce Process
70
-
71
- The process has four phases. You determine which phase to operate in based on what the human is asking for.
72
-
73
- ### Phase 1: Planning (AI + Human — No Subagents)
74
-
75
- **When to enter:** The human talks about what to build, asks to create or modify planning documents, discusses features, priorities, or asks about work status. This is a direct conversation — no subagents.
76
-
77
- Read `skills/doc-manager/SKILL.md` and follow its workflows.
78
-
79
- **Document hierarchy** — no level can be skipped:
80
- Charter (why) → Roadmap (strategic what/when) → Epic (detailed what) → Story (how) → Delivery Plan (execution) → Risk Registry (risks)
81
-
82
- **Your responsibilities during planning:**
83
- 1. **Creating documents:** Read upstream documents, research the codebase, draft the document. Follow doc-manager's CREATE and DECOMPOSE workflows.
84
- 2. **Surfacing problems:** Assess ambiguity, open questions, edge cases, and risks. Present these clearly to the human — this is collaborative.
85
- 3. **Answering status questions:** Read `product_plans/` to understand current state (backlog/, sprints/, archive/, strategy/).
86
- 4. **Triaging requests:** L1 Trivial → Hotfix Path. Everything else → Standard Path (Epic → Story → Sprint).
87
-
88
- ### Phase 2: Sprint Planning (AI + Human — Collaborative Gate)
89
-
90
- **When to enter:** The human wants to start executing work — "let's start a sprint", "what should we work on next?"
91
-
92
- **Hard rule: No bounce can start without a finalized, human-confirmed Sprint Plan.**
93
-
94
- 1. Read backlog, archive, Risk Registry, vdocs manifest
95
- 2. Propose sprint scope based on priority, dependencies, complexity
96
- 3. Surface blockers: open questions, 🔴 ambiguity, missing prerequisites, risks, edge cases
97
- 4. Discuss and refine with human
98
- 5. Create Sprint Plan from `templates/sprint.md` — fill §0 Readiness Gate, §1 Active Scope, §2 Execution Strategy, §3 Open Questions
99
- 6. **Gate:** Human confirms the Sprint Plan. Only then set status to "Active"
100
-
101
- **Strategic Freeze:** Charter/Roadmap frozen during sprints. Use **Impact Analysis Protocol** if emergency changes occur. Pause until human approval.
102
-
103
- ### Phase 3: The Bounce (Execution)
104
- **Standard Path (L2-L4 Stories):**
105
- 0. **Orient via state**: Read `.bounce/state.json` if it exists (`vbounce state show`). Run `vbounce prep sprint S-{XX}` to generate a fresh context pack.
106
- 1. Team Lead sends Story context pack to Developer.
107
- 2. Developer reads LESSONS.md and the Story context pack, implements code, writes Implementation Report. CLI Orchestrator must run `./scripts/validate_report.mjs` on the report to enforce YAML strictness.
108
- 3. **Pre-QA Gate Scan:** Team Lead runs `./scripts/pre_gate_runner.sh qa` to catch mechanical failures before spawning QA. If trivial issues → return to Dev.
109
- 4. QA runs Quick Scan + PR Review (skipping pre-scanned checks), validates against Story §2 The Truth. If fail → Bug Report to Dev. CLI Orchestrator must run `./scripts/validate_report.mjs` on the QA report.
110
- 5. Dev fixes and resubmits. 3+ failures → Escalated (see Escalation Recovery below).
111
- 6. **Pre-Architect Gate Scan:** Team Lead runs `./scripts/pre_gate_runner.sh arch` to catch structural issues before spawning Architect. If mechanical failures → return to Dev.
112
- 7. Architect runs Deep Audit + Trend Check (skipping pre-scanned checks), validates Safe Zone compliance and ADR adherence.
113
- 8. DevOps merges story branch into sprint branch, validates post-merge (tests + lint + build), handles release tagging.
114
- 9. **Record lessons immediately**: After DevOps merge, check Dev and QA reports for `lessons_flagged`. Record to LESSONS.md now — do not wait for sprint close.
115
- 10. Team Lead consolidates reports into Sprint Report.
116
-
117
- **Hotfix Path (L1 Trivial Tasks):**
118
- 1. Team Lead evaluates request and creates `HOTFIX-{Date}-{Name}.md`.
119
- 2. Developer reads LESSONS.md and Hotfix spec, makes the targeted change (max 1-2 files).
120
- 3. Developer runs `./scripts/hotfix_manager.sh ledger "{Title}" "{Description}"`.
121
- 4. Human/Team Lead manually verifies the fix. QA/Architect bounce loops are bypassed.
122
- 5. Hotfix is merged directly into the active branch.
123
- 6. DevOps (or Team Lead) runs `./scripts/hotfix_manager.sh sync` to update active worktrees.
124
-
125
- **Escalation Recovery (3+ bounce failures):**
126
- 1. Mark story as "Escalated" in Sprint Plan
127
- 2. Present to human: what failed, root causes from bounce reports, pattern analysis
128
- 3. Propose options: re-scope the story, split into smaller stories, create a spike, or remove from sprint
129
- 4. Human decides. Execute the decision.
130
-
131
- ### Phase 4: Review
132
- Sprint Report → Human review → Delivery Plan updated (at boundary only) → Lessons recorded → Next sprint.
133
- If sprint delivered new features or Dev reports flagged stale product docs → spawn Scribe agent to generate/update vdocs/ via vdoc.
134
-
135
- **Self-Improvement Pipeline** (auto-runs on `vbounce sprint close`):
136
- 1. `sprint_trends.mjs` → cross-sprint trend analysis → `.bounce/trends.md`
137
- 2. `post_sprint_improve.mjs` → parses §5 retro tables + LESSONS.md automation candidates + recurring patterns + effectiveness checks → `.bounce/improvement-manifest.json`
138
- 3. `suggest_improvements.mjs` → generates human-readable suggestions with impact levels → `.bounce/improvement-suggestions.md`
139
- 4. Human reviews suggestions → approve/reject/defer each item
140
- 5. Run `/improve` to apply approved changes with brain-file sync
141
-
142
- **Impact Levels:** P0 Critical (blocks agents), P1 High (causes rework), P2 Medium (friction), P3 Low (polish). See `/improve` skill for details.
143
-
144
- On-demand: `vbounce improve S-{XX}` runs the full pipeline.
145
-
146
- ## Story States
147
-
148
- ```
149
- Draft → Refinement → Ready to Bounce → Bouncing → QA Passed → Architect Passed → Sprint Review → Done
150
- ↳ Refinement → Probing/Spiking → Refinement (L4 spike loop)
151
- ↳ Any → Parking Lot (deferred)
152
- ↳ Bouncing → Escalated (3+ failures)
92
+ vbounce doctor
153
93
  ```
154
94
 
155
- ## Complexity Labels
156
-
157
- - **L1**: Trivial — Single file, <1hr, known pattern.
158
- - **L2**: Standard — 2-3 files, known pattern, ~2-4hr. *(default)*
159
- - **L3**: Complex — Cross-cutting, spike may be needed, ~1-2 days.
160
- - **L4**: Uncertain — Requires Probing/Spiking before Bounce, >2 days.
161
-
162
- ## Critical Rules
163
-
164
- ### Before Writing Code
165
- 1. **Read LESSONS.md** at the project root. Every time. No exceptions.
166
- 2. **Read the Story spec** (§1 The Spec + §3 Implementation Guide). Do not infer requirements.
167
- 3. **Check ADRs** in the Roadmap (§3). Comply with recorded architecture decisions.
168
-
169
- ### During Implementation
170
- 4. **Follow the Safe Zone**. No new patterns or libraries without Architect approval.
171
- 5. **No Gold-Plating**. Implement exactly what the Story specifies.
172
- 6. **Write Self-Documenting Code**. All exports MUST have JSDoc/docstrings to prevent RAG poisoning for future agents.
173
- 7. **Self-assess Correction Tax**. Track % human intervention.
174
-
175
- ### After Implementation
176
- 7. **Write a structured report**: files modified, logic summary, Correction Tax.
177
- 8. **Flag lessons**. Gotchas and multi-attempt fixes get flagged for recording.
178
-
179
- ### Always
180
- 9. **Reports are the only handoff**. No direct agent-to-agent communication.
181
- 10. **One source of truth**. Reference upstream documents, don't duplicate.
182
- 11. **Change Logs are mandatory** on every document modification.
183
- 12. **Agent Reports MUST use YAML Frontmatter**. Every `.bounce/report/` generated must start with a strict `---` YAML block containing the core status and metrics before the Markdown body.
184
- 13. **Framework Integrity**. Any modification to a `brains/`, `skills/`, `templates/`, or `scripts/` file MUST be recorded in `brains/CHANGELOG.md` and reflected in `MANIFEST.md`.
185
-
186
- ## Framework Structure
187
-
188
- ```
189
- V-Bounce Engine/
190
- ├── brains/ — Agent brain files (this file)
191
- ├── templates/ — Document templates (immutable)
192
- ├── skills/ — Agent skills (SKILL.md files)
193
- ├── scripts/ — Automation scripts (e.g., hotfix_manager.sh)
194
- └── docs/ — Reference docs (e.g., HOTFIX_EDGE_CASES.md)
195
- ```
95
+ ## Quick Reference
196
96
 
197
- ## Document Locations
198
-
199
- Planning docs live in `product_plans/`. It uses a state-based architecture (`strategy/`, `backlog/`, `sprints/`, `archive/`). Completed items are archived to `product_plans/archive/`.
200
-
201
- | Document | Output |
202
- |----------|--------|
203
- | Charter | `product_plans/strategy/{project}_charter.md` |
204
- | Roadmap | `product_plans/strategy/{project}_roadmap.md` |
205
- | Risk Registry | `product_plans/strategy/RISK_REGISTRY.md` |
206
- | Delivery Plan | `product_plans/D-{NN}_{release_name}/D-{NN}_DELIVERY_PLAN.md` |
207
- | Sprint Plan | `product_plans/sprints/sprint-{XX}/sprint-{XX}.md` |
208
- | Epic | `product_plans/backlog/EPIC-{NNN}_{name}/EPIC-{NNN}.md` |
209
- | Story | `product_plans/backlog/EPIC-{NNN}_{name}/STORY-{EpicID}-{StoryID}-{StoryName}.md` |
210
- | Sprint Report | `.bounce/sprint-report-S-{XX}.md` |
211
- | Product Docs | `vdocs/*.md` + `_manifest.json` |
212
-
213
- ## Report Formats
214
-
215
- **Dev Report**: Files modified, logic summary, Correction Tax, lessons flagged, product docs affected.
216
- **QA Report**: Pass/fail, bug descriptions, Gold-Plating audit, plain-language explanations.
217
- **Architect Report**: Compliance score, ADR check, AI-ism findings, regression assessment, refactors.
218
- **DevOps Report**: Merge status, conflict resolution, post-merge validation, environment changes, deployment status.
219
- **Scribe Report**: Mode (init/audit/create), docs created/updated/removed, coverage assessment, accuracy check.
220
- **Sprint Report**: What was delivered (user-facing vs internal), story results, execution metrics (tokens, duration, cost, bounces, correction tax), lessons, retrospective (what went well, what didn't, process improvements).
97
+ - **Document ops:** `skills/doc-manager/SKILL.md` — hierarchy, cascade rules, planning workflows
98
+ - **Product graph:** `.bounce/product-graph.json` — document relationships and state
99
+ - **Bounce orchestration:** `skills/agent-team/SKILL.md` agent delegation, sprint execution
100
+ - **Planning docs:** `product_plans/` — `strategy/`, `backlog/`, `sprints/`, `hotfixes/`, `archive/`
101
+ - **Sprint state:** `.bounce/state.json` — machine-readable sprint state
102
+ - **Framework map:** `MANIFEST.md` — complete file and process registry
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sandrinio/vbounce",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "V-Bounce Engine: Turn your AI coding assistant into a full engineering team through structured SDLC skills.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -111,6 +111,15 @@ if (fs.existsSync(suggestScript)) {
111
111
  console.warn(' ⚠ suggest_improvements.mjs not found — skipping improvement pipeline.');
112
112
  }
113
113
 
114
+ // Regenerate product graph (non-blocking)
115
+ const graphScript = path.join(__dirname, 'product_graph.mjs');
116
+ if (fs.existsSync(graphScript)) {
117
+ const graphResult = spawnSync(process.execPath, [graphScript], { stdio: 'pipe', cwd: process.cwd() });
118
+ if (graphResult.status === 0) {
119
+ console.log('✓ Product graph regenerated');
120
+ }
121
+ }
122
+
114
123
  console.log('');
115
124
  console.log('Manual steps remaining:');
116
125
  console.log(` 1. Archive sprint plan folder:`);
@@ -11,6 +11,7 @@
11
11
  import fs from 'fs';
12
12
  import path from 'path';
13
13
  import { fileURLToPath } from 'url';
14
+ import { spawnSync } from 'child_process';
14
15
 
15
16
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
16
17
  const ROOT = path.resolve(__dirname, '..');
@@ -111,3 +112,10 @@ if (content.includes(logStart)) {
111
112
  fs.writeFileSync(sprintPlanPath, content);
112
113
  console.log(`✓ Updated sprint plan: ${storyId} Done`);
113
114
  console.log(`\n QA bounces: ${qaBounces} | Arch bounces: ${archBounces} | Correction tax: ${correctionTax}`);
115
+
116
+ // Regenerate product graph (non-blocking)
117
+ const graphScript = path.join(__dirname, 'product_graph.mjs');
118
+ if (fs.existsSync(graphScript)) {
119
+ const graphResult = spawnSync(process.execPath, [graphScript], { stdio: 'pipe', cwd: ROOT });
120
+ if (graphResult.status === 0) console.log('✓ Product graph regenerated');
121
+ }
@@ -11,6 +11,7 @@
11
11
  import fs from 'fs';
12
12
  import path from 'path';
13
13
  import { fileURLToPath } from 'url';
14
+ import { spawnSync } from 'child_process';
14
15
 
15
16
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
16
17
  const ROOT = path.resolve(__dirname, '..');
@@ -117,5 +118,12 @@ if (storyIds.length > 0) {
117
118
  });
118
119
  }
119
120
 
121
+ // 5. Regenerate product graph (non-blocking)
122
+ const graphScript = path.join(__dirname, 'product_graph.mjs');
123
+ if (fs.existsSync(graphScript)) {
124
+ const graphResult = spawnSync(process.execPath, [graphScript], { stdio: 'pipe', cwd: ROOT });
125
+ if (graphResult.status === 0) console.log('✓ Product graph regenerated');
126
+ }
127
+
120
128
  console.log('');
121
129
  console.log(`✓ Sprint ${sprintId} initialized. Stories: ${storyIds.length > 0 ? storyIds.join(', ') : 'none (add manually)'}`);