@sandrinio/vbounce 1.4.0 โ†’ 1.6.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/README.md CHANGED
@@ -18,12 +18,24 @@ Instead of treating your AI as a solo developer, V-Bounce OS forces distinct, sp
18
18
 
19
19
  1. **Requirements (`product_plans/`)**: The Team Lead defines standard, immutable templates (Charter, Epic, Story) before a single line of code is written.
20
20
  2. **Bounce Reports (`.bounce/`)**: During implementation, the QA and Architect agents do not edit code. They run deep codebase audits and emit structured "Bounce Reports" summarizing anti-patterns and regressions. The Developer must fix the issues and run the loop again until the code passes validation.
21
- 3. **Product Documentation (`product_documentation/`)**: The Scribe agent explores the *actual* codebase post-merge and uses our integrated `vdoc` tool to update feature-centric documentation and the semantic `_manifest.json` map.
21
+ 3. **Product Documentation (`vdocs/`)**: The Scribe agent explores the *actual* codebase post-merge and uses our integrated `vdoc` tool to update feature-centric documentation and the semantic `_manifest.json` map.
22
22
 
23
23
  The next time an agent writes code, it reads the `_manifest.json` and the `LESSONS.md` file from previous sprints. The context loop closes. Your AI writes better code because it finally understands the reality of your evolving system.
24
24
 
25
25
  ---
26
26
 
27
+ ## ๐Ÿ“‚ State-Based Folder Structure
28
+
29
+ V-Bounce OS organizes planning documents (`product_plans/`) through a strict state machine based on folder location:
30
+
31
+ - **`strategy/`**: High-level context (Charter, Roadmap, Risk Registry, Release Plans). Frozen during active sprints.
32
+ - **`backlog/`**: Where unassigned work lives. Epics and their child Stories are refined here until selected for a sprint.
33
+ - **`sprints/`**: The active execution workspace. A physical `sprint-XX/` boundary is created and Stories are moved in. Only one sprint is "Active" at a time.
34
+ - **`hotfixes/`**: Trivial, emergency tasks that bypass sprint cycles.
35
+ - **`archive/`**: Immutable history. Finished sprint folders and fully completed Epics are permanently moved here.
36
+
37
+ ---
38
+
27
39
  ## ๐Ÿ› ๏ธ The Tech Stack
28
40
 
29
41
  V-Bounce OS is built to be **local-first, privacy-conscious, and blazing fast**.
@@ -71,7 +83,7 @@ npx @sandrinio/vbounce install codex
71
83
  - **Templates:** Markdown templates for your Charter, Roadmap, Epics, and Stories.
72
84
  - **Bundled Scripts:** Our validation pipeline (`validate_report.mjs`) and RAG synchronization engine (`pre_bounce_sync.sh`).
73
85
  - **Autonomous RAG Setup:** The installer automatically runs `npm install` for required libraries and initializes your local LanceDB knowledge base (`.bounce/.lancedb/`).
74
- - **vdoc Integration:** Fully compatible with [`@sandrinio/vdoc`](https://github.com/sandrinio/vdoc) to automatically construct semantic product documentation.
86
+ - **vdoc Integration:** The installer offers to install [`@sandrinio/vdoc`](https://github.com/sandrinio/vdoc) for your platform โ€” enabling automatic semantic product documentation generation via the Scribe agent.
75
87
 
76
88
  ### ๐Ÿงฐ The Bundled Skills
77
89
  V-Bounce OS installs a powerful suite of specialized markdown `skills/` directly into your workspace. These act as modular capabilities you can invoke dynamically or that the Team Lead agent will invoke automatically during the SDLC process:
@@ -84,6 +96,7 @@ V-Bounce OS installs a powerful suite of specialized markdown `skills/` directly
84
96
  | `react-best-practices` | Developer | A strict set of frontend execution rules the Developer must follow during implementation. <mark>*(Note: This skill serves as a template and must be customized by the human according to the specific tech stack being used.)*</mark> |
85
97
  | `vibe-code-review` | QA/Architect | Runs distinct review modes (Quick Scan, Deep Audit) to validate code against Acceptance Criteria and Architecture rules. |
86
98
  | `write-skill` | Lead | Allows the Team Lead to autonomously write and deploy entirely *new* skills if the team repeatedly encounters a novel problem. |
99
+ | `improve` | Lead | The framework's self-improvement loop. Reads agent friction signals from sprint retros and proposes targeted changes to templates, skills, brain files, and scripts โ€” with human approval. |
87
100
 
88
101
  ---
89
102
 
@@ -111,6 +124,19 @@ When a sprint concludes, V-Bounce OS generates structured reports so human revie
111
124
  ### 4. Progressive Learning (`LESSONS.md`)
112
125
  Every time the AI makes a mistake during the Bounce Loop, it flags the issue. During the sprint retrospective, these mistakes are recorded in `LESSONS.md`โ€”a permanent project memory that all agents read *before* writing any future code. **Your AI gets smarter about your specific codebase with every single sprint.**
113
126
 
127
+ ### 5. Self-Improving Framework (`improve` skill)
128
+ V-Bounce OS doesn't just improve your code โ€” it improves *itself*. Every agent report includes a **Process Feedback** section where agents flag friction with the framework: a template missing a critical field, a handoff that lost context, a RAG query that returned irrelevant results, or a skill instruction that was unclear.
129
+
130
+ These signals are aggregated into the Sprint Report's **Framework Self-Assessment** โ€” categorized by area (Templates, Handoffs, RAG Pipeline, Skills, Process Flow, Tooling) with severity ratings and suggested fixes.
131
+
132
+ After every 2-3 sprints, the Team Lead runs the `improve` skill which:
133
+ 1. Reads accumulated friction signals across sprints
134
+ 2. Identifies recurring patterns (same complaint from multiple agents = real problem)
135
+ 3. Proposes specific, targeted changes to templates, skills, brain files, or scripts
136
+ 4. **Applies nothing without your approval** โ€” you review every proposed change
137
+
138
+ The result: templates get sharper, handoffs get cleaner, skills get more precise, and the bounce loop gets tighter โ€” all driven by the agents who actually use the framework every day.
139
+
114
140
  ---
115
141
 
116
142
  ## ๐Ÿ” Keywords for Searchability
package/bin/vbounce.mjs CHANGED
@@ -58,6 +58,16 @@ if (!command || command !== 'install' || !targetPlatform) {
58
58
 
59
59
  const CWD = process.cwd();
60
60
 
61
+ // Map vbounce platform names to vdoc platform names
62
+ const vdocPlatformMap = {
63
+ claude: 'claude',
64
+ cursor: 'cursor',
65
+ gemini: 'gemini',
66
+ codex: 'agents',
67
+ vscode: 'vscode',
68
+ copilot: 'vscode'
69
+ };
70
+
61
71
  const platformMappings = {
62
72
  claude: [
63
73
  { src: 'brains/CLAUDE.md', dest: 'CLAUDE.md' },
@@ -196,5 +206,25 @@ askQuestion('Proceed with installation? [y/N] ').then(async answer => {
196
206
  console.error(' \x1b[31mโœ–\x1b[0m Failed to initialize knowledge base. Run ./scripts/pre_bounce_sync.sh manually.');
197
207
  }
198
208
 
209
+ // vdoc integration
210
+ const vdocPlatform = vdocPlatformMap[targetPlatform];
211
+ if (vdocPlatform) {
212
+ const rl2 = readline.createInterface({ input: process.stdin, output: process.stdout });
213
+ const vdocAnswer = await new Promise(resolve => rl2.question('\n๐Ÿ“ Install vdoc (AI-powered documentation generator)? [y/N] ', resolve));
214
+ rl2.close();
215
+
216
+ if (vdocAnswer.trim().toLowerCase() === 'y' || vdocAnswer.trim().toLowerCase() === 'yes') {
217
+ console.log(`\n๐Ÿ“ Installing vdoc for ${vdocPlatform}...`);
218
+ try {
219
+ execSync(`npx @sandrinio/vdoc install ${vdocPlatform}`, { stdio: 'inherit', cwd: CWD });
220
+ console.log(' \x1b[32mโœ“\x1b[0m vdoc installed.');
221
+ } catch (err) {
222
+ console.error(` \x1b[31mโœ–\x1b[0m Failed to install vdoc. Run manually: npx @sandrinio/vdoc install ${vdocPlatform}`);
223
+ }
224
+ } else {
225
+ console.log(`\n Skipped. You can install later: npx @sandrinio/vdoc install ${vdocPlatform}`);
226
+ }
227
+ }
228
+
199
229
  console.log('\nโœ… V-Bounce OS successfully installed! Welcome to the team.\n');
200
230
  });
package/brains/AGENTS.md CHANGED
@@ -20,6 +20,7 @@ Skills are in the `skills/` directory. Each skill has a `SKILL.md` with instruct
20
20
  | `skills/react-best-practices/` | Frontend coding patterns and anti-patterns | Developer |
21
21
  | `skills/vibe-code-review/` | Code quality review (4 modes) | QA, Architect |
22
22
  | `skills/write-skill/` | Creating and refining agent skills | Team Lead |
23
+ | `skills/improve/` | Framework self-improvement from agent feedback | Team Lead |
23
24
 
24
25
  ## The V-Bounce Process
25
26
 
@@ -32,20 +33,25 @@ Before starting any sprint, the Team Lead MUST:
32
33
  - **Triage the Request**: Is this an L1 Trivial change (1-2 files, cosmetic/minor)?
33
34
  - If YES โ†’ Use the **Hotfix Path** (create a Hotfix document, bypass Epic/Story).
34
35
  - If NO โ†’ Use the **Standard Path** (create/find Epic, Story).
36
+ - **Determine Execution Mode**: Full Bounce vs Fast Track.
37
+ - **Dependency Check**: Stories with `Depends On:` must execute sequentially.
35
38
  - Read RISK_REGISTRY.md โ€” flag high-severity risks that affect planned stories.
36
- - Read DELIVERY_PLAN.md ยง5 Open Questions โ€” do not bounce stories with unresolved blocking questions.
37
- - If product_documentation/_manifest.json exists, read it โ€” understand what's documented, pass relevant doc references to agents.
39
+ - Read `sprint-{XX}.md` ยง2 Sprint Open Questions โ€” do not bounce stories with unresolved blocking questions.
40
+ - If `vdocs/_manifest.json` exists, read it.
41
+ - **Strategic Freeze**: Charter/Roadmap frozen during sprints. Use **Impact Analysis Protocol** if emergency changes occur. Evaluate active stories against new strategy. Pause until human approval.
38
42
 
39
43
  ### Phase 2: The Bounce (Implementation)
40
44
  **Standard Path (L2-L4 Stories):**
41
45
  0. Team Lead runs `./scripts/pre_bounce_sync.sh` to ensure LanceDB RAG context is fresh.
42
46
  1. Team Lead sends Story context pack to Developer.
43
47
  2. Developer queries LanceDB, implements code, writes Implementation Report. CLI Orchestrator must run `./scripts/validate_report.mjs` on the report to enforce YAML strictness.
44
- 3. QA runs Quick Scan + PR Review, validates against Story ยง2 The Truth. If fail โ†’ Bug Report to Dev. CLI Orchestrator must run `./scripts/validate_report.mjs` on the QA report before passing to Architect/Dev.
45
- 4. Dev fixes and resubmits. 3+ failures โ†’ Escalated.
46
- 5. Architect runs Deep Audit + Trend Check, validates Safe Zone compliance and ADR adherence.
47
- 6. DevOps merges story branch into sprint branch, validates post-merge, handles release tagging.
48
- 7. Team Lead consolidates reports into Sprint Report.
48
+ 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.
49
+ 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.
50
+ 5. Dev fixes and resubmits. 3+ failures โ†’ Escalated.
51
+ 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.
52
+ 7. Architect runs Deep Audit + Trend Check (skipping pre-scanned checks), validates Safe Zone compliance and ADR adherence.
53
+ 8. DevOps merges story branch into sprint branch, validates post-merge (tests + lint + build), handles release tagging.
54
+ 9. Team Lead consolidates reports into Sprint Report.
49
55
 
50
56
  **Hotfix Path (L1 Trivial Tasks):**
51
57
  1. Team Lead evaluates request and creates `HOTFIX-{Date}-{Name}.md`.
@@ -57,7 +63,7 @@ Before starting any sprint, the Team Lead MUST:
57
63
 
58
64
  ### Phase 3: Review
59
65
  Sprint Report โ†’ Human review โ†’ Delivery Plan updated โ†’ Lessons recorded โ†’ Next sprint.
60
- If sprint delivered new features or Dev reports flagged stale product docs โ†’ spawn Scribe agent to generate/update product_documentation/ via vdoc.
66
+ If sprint delivered new features or Dev reports flagged stale product docs โ†’ spawn Scribe agent to generate/update vdocs/ via vdoc.
61
67
 
62
68
  ## Story States
63
69
 
@@ -83,7 +89,8 @@ Bouncing โ†’ Escalated (3+ failures)
83
89
  ### During Implementation
84
90
  4. Follow the Safe Zone. No new patterns or libraries without Architect approval.
85
91
  5. No Gold-Plating. Implement exactly what the Story specifies.
86
- 6. Self-assess Correction Tax. Track % human intervention.
92
+ 6. Write Self-Documenting Code. JSDoc/docstrings required on all exports to prevent RAG poisoning.
93
+ 7. Self-assess Correction Tax. Track % human intervention.
87
94
 
88
95
  ### After Implementation
89
96
  7. Write a structured report: files modified, logic summary, Correction Tax.
@@ -109,18 +116,19 @@ V-Bounce OS/
109
116
 
110
117
  ## Document Locations
111
118
 
112
- Planning docs live in `product_plans/`. Each delivery (= release) gets a folder. Epics are subfolders. Stories live with their Epic. Completed deliveries archived to `product_plans/archive/`.
119
+ Planning docs live in `product_plans/`. It uses a state-based architecture (`strategy/`, `backlog/`, `sprints/`, `archive/`). Completed items are archived to `product_plans/archive/`.
113
120
 
114
121
  | Document | Output |
115
122
  |----------|--------|
116
- | Charter | `product_plans/{project}_charter.md` |
117
- | Roadmap | `product_plans/{project}_roadmap.md` |
118
- | Risk Registry | `product_plans/RISK_REGISTRY.md` |
119
- | Delivery Plan | `product_plans/{delivery}/DELIVERY_PLAN.md` |
120
- | Epic | `product_plans/{delivery}/EPIC-{NNN}_{name}/EPIC-{NNN}.md` |
121
- | Story | `product_plans/{delivery}/EPIC-{NNN}_{name}/STORY-{EpicID}-{StoryID}.md` |
122
- | Sprint Report | `.bounce/sprint-report.md` |
123
- | Product Docs | `product_documentation/*.md` + `_manifest.json` |
123
+ | Charter | `product_plans/strategy/{project}_charter.md` |
124
+ | Roadmap | `product_plans/strategy/{project}_roadmap.md` |
125
+ | Risk Registry | `product_plans/strategy/RISK_REGISTRY.md` |
126
+ | Delivery Plan | `product_plans/strategy/{delivery}_delivery_plan.md` |
127
+ | Sprint Plan | `product_plans/sprints/sprint-{XX}/sprint-{XX}.md` |
128
+ | Epic | `product_plans/backlog/EPIC-{NNN}_{name}/EPIC-{NNN}.md` |
129
+ | Story | `product_plans/backlog/EPIC-{NNN}_{name}/STORY-{EpicID}-{StoryID}-{StoryName}.md` |
130
+ | Sprint Report | `product_plans/sprints/sprint-{XX}/sprint-report.md` |
131
+ | Product Docs | `vdocs/*.md` + `_manifest.json` |
124
132
 
125
133
  ## Report Formats
126
134
 
@@ -5,3 +5,38 @@ Per **Rule 13: Framework Integrity**, anytime an entry is made here, the orchest
5
5
 
6
6
  ## [2026-03-02]
7
7
  - **Initialized**: Created strict Framework Integrity tracking, YAML context handoffs, and RAG validation pipeline.
8
+
9
+ ## [2026-03-06] โ€” Pre-Gate Automation
10
+ - **Added**: `scripts/pre_gate_common.sh` โ€” shared gate check functions with auto-detection for JS/TS, Python, Rust, Go stacks.
11
+ - **Added**: `scripts/pre_gate_runner.sh` โ€” universal pre-gate scanner. Reads `.bounce/gate-checks.json` config or falls back to auto-detected defaults. Runs before QA (`qa`) and Architect (`arch`) agents to catch mechanical failures with zero tokens.
12
+ - **Added**: `scripts/init_gate_config.sh` โ€” auto-detects project stack (language, framework, test runner, build/lint commands) and generates `.bounce/gate-checks.json`.
13
+ - **Modified**: `brains/claude-agents/qa.md` โ€” added Pre-Computed Scan Results section. QA skips checks covered by `pre-qa-scan.txt`.
14
+ - **Modified**: `brains/claude-agents/architect.md` โ€” added Pre-Computed Scan Results section. Architect skips mechanical checks covered by `pre-arch-scan.txt`.
15
+ - **Modified**: `brains/claude-agents/devops.md` โ€” added `npm run lint` (tsc --noEmit) to post-merge validation.
16
+ - **Modified**: `skills/agent-team/SKILL.md` โ€” wired pre-gate scans into Steps 3 (QA) and 4 (Architect). Added gate config init to Step 0 sprint setup. Added lint to post-merge validation.
17
+ - **Modified**: All brain files (`CLAUDE.md`, `GEMINI.md`, `AGENTS.md`, `cursor-rules/vbounce-process.mdc`) โ€” updated bounce sequence to include pre-gate scan steps.
18
+ - **Modified**: `skills/improve/SKILL.md` โ€” added Gate Check Proposals section for iteratively growing project-specific checks via `gate-checks.json`.
19
+
20
+ ## [2026-03-06]
21
+ - **Fixed**: All brain files (`CLAUDE.md`, `GEMINI.md`, `AGENTS.md`) incorrectly referenced `DELIVERY_PLAN.md ยง5 Open Questions` or `ACTIVE_SPRINT.md ยง3 Open Questions`. Corrected to `sprint-{XX}.md ยง2 Sprint Open Questions` to match the authoritative `agent-team/SKILL.md` and `sprint.md` template.
22
+ - **Fixed**: Removed duplicate "Product Plans Folder Structure" header in `doc-manager/SKILL.md`.
23
+ - **Fixed**: `cursor-rules/vbounce-process.mdc` was missing Execution Mode, Sequential Dependencies, Impact Analysis Protocol, and Strategic Freeze rules from the 2026-03-05 update. Propagated.
24
+ - **Removed**: `templates/active_sprint.md` โ€” orphaned by the state-based refactor. Superseded by `templates/sprint.md`.
25
+ - **Modified**: `cursor-rules/vbounce-rules.mdc` โ€” added Rule 6 (JSDoc/docstrings), Rule 13 (YAML Frontmatter), Rule 14 (Framework Integrity) to match other brains.
26
+ - **Modified**: `cursor-rules/vbounce-docs.mdc` โ€” added Hotfix and Sprint Report entries to Document Locations table.
27
+ - **Modified**: `cursor-rules/vbounce-process.mdc` โ€” added `pre_bounce_sync.sh` and `validate_report.mjs` steps to Phase 2.
28
+ - **Modified**: Renamed `product_documentation/` โ†’ `vdocs/` across all brains, skills, agents, templates, scripts, diagrams, README, OVERVIEW, and SETUP to align with `@sandrinio/vdoc` output conventions.
29
+ - **Modified**: `bin/vbounce.mjs` โ€” added optional vdoc installation step that auto-maps the user's chosen platform to the corresponding `npx @sandrinio/vdoc install <platform>` command.
30
+ - **Modified**: `brains/SETUP.md` โ€” updated folder structure diagram to reflect state-based `product_plans/` layout.
31
+ - **Added**: `skills/improve/SKILL.md` โ€” framework self-improvement skill. Reads agent Process Feedback from sprint retros, identifies patterns, proposes changes to templates/skills/brains/scripts with human approval.
32
+ - **Modified**: All agent report templates (`developer.md`, `qa.md`, `architect.md`, `devops.md`, `scribe.md`) โ€” added `## Process Feedback` section for framework friction signals.
33
+ - **Modified**: `templates/sprint_report.md` ยง5 Retrospective โ€” restructured into categorized Framework Self-Assessment (Templates, Handoffs, RAG, Skills, Process Flow, Tooling) with severity and suggested fixes.
34
+ - **Modified**: `skills/agent-team/SKILL.md` Step 7 โ€” added Framework Self-Assessment aggregation and `improve` skill trigger.
35
+ - **Modified**: All brain files and `README.md` โ€” added `improve` skill to skill references.
36
+
37
+ ## [2026-03-05]
38
+ - **Modified**: Added `tokens_used` tracking to all agent instructions (`brains/claude-agents/*`).
39
+ - **Modified**: Updated `skills/agent-team/SKILL.md` to consolidate tokens into `sprint_report.md`.
40
+ - **Modified**: Updated `scripts/validate_report.mjs` to enforce `tokens_used` schema presence.
41
+ - **Modified**: Refactored `STORY-{EpicID}-{StoryID}` file naming convention to `STORY-{EpicID}-{StoryID}-{StoryName}` across all templates, agent instructions, skill definitions, and architecture files for better human readability.
42
+ - **Modified**: Refactored the generic `product_plans` folder into a state-based architecture (`strategy/`, `backlog/`, `sprints/`, `hotfixes/`, `archive/`). Separated Sprint tracking logic from `DELIVERY_PLAN.md` into a new `sprint.md` template. Updated `doc-manager` and `agent-team` orchestration to adhere to these physical transition rules.
package/brains/CLAUDE.md CHANGED
@@ -16,6 +16,7 @@ You MUST follow the V-Bounce process. Deviating from it โ€” skipping validation,
16
16
  @skills/react-best-practices/SKILL.md
17
17
  @skills/vibe-code-review/SKILL.md
18
18
  @skills/write-skill/SKILL.md
19
+ @skills/improve/SKILL.md
19
20
 
20
21
  ## Subagents
21
22
 
@@ -44,20 +45,27 @@ Before starting any sprint, the Team Lead MUST:
44
45
  - **Triage the Request**: Is this an L1 Trivial change (1-2 files, cosmetic/minor)?
45
46
  - If YES โ†’ Use the **Hotfix Path** (create a Hotfix document, bypass Epic/Story).
46
47
  - If NO โ†’ Use the **Standard Path** (create/find Epic, Story).
48
+ - **Determine Execution Mode**:
49
+ - Full Bounce (Default): dev โ†’ qa โ†’ arch โ†’ devops.
50
+ - Fast Track (L1/L2 Minor): dev โ†’ devops only (skip QA/Arch gates).
51
+ - **Dependency Check**: Stories with `Depends On:` must execute sequentially. Wait for DevOps merge of Story A before starting Story B.
47
52
  - Read RISK_REGISTRY.md โ€” flag high-severity risks that affect planned stories.
48
- - Read DELIVERY_PLAN.md ยง5 Open Questions โ€” do not bounce stories with unresolved blocking questions.
49
- - If `product_documentation/_manifest.json` exists, read it โ€” understand what's documented, pass relevant doc references to agents, and track what may become stale.
53
+ - Read `sprint-{XX}.md` ยง2 Sprint Open Questions โ€” do not bounce stories with unresolved blocking questions.
54
+ - If `vdocs/_manifest.json` exists, read it.
55
+ - **Strategic Freeze**: Charter and Roadmap are frozen during sprints. If emergency changes are needed, run the **Impact Analysis Protocol**: Evaluate sprint stories against new strategy. Pause work until human approval.
50
56
 
51
57
  ### Phase 2: The Bounce (Implementation)
52
58
  **Standard Path (L2-L4 Stories):**
53
59
  0. Team Lead runs `./scripts/pre_bounce_sync.sh` to ensure LanceDB RAG context is fresh.
54
60
  1. Team Lead sends Story context pack to Developer.
55
61
  2. Developer queries LanceDB, implements code, writes Implementation Report. CLI Orchestrator must run `./scripts/validate_report.mjs` on the report to enforce YAML strictness.
56
- 3. QA runs Quick Scan + PR Review, validates against Story ยง2 The Truth. If fail โ†’ Bug Report to Dev. CLI Orchestrator must run `./scripts/validate_report.mjs` on the QA report before passing to Architect/Dev.
57
- 4. Dev fixes and resubmits. 3+ failures โ†’ Escalated.
58
- 5. Architect runs Deep Audit + Trend Check, validates Safe Zone compliance and ADR adherence.
59
- 6. DevOps merges story branch into sprint branch, validates post-merge, handles release tagging.
60
- 7. Team Lead consolidates reports into Sprint Report.
62
+ 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.
63
+ 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.
64
+ 5. Dev fixes and resubmits. 3+ failures โ†’ Escalated.
65
+ 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.
66
+ 7. Architect runs Deep Audit + Trend Check (skipping pre-scanned checks), validates Safe Zone compliance and ADR adherence.
67
+ 8. DevOps merges story branch into sprint branch, validates post-merge (tests + lint + build), handles release tagging.
68
+ 9. Team Lead consolidates reports into Sprint Report.
61
69
 
62
70
  **Hotfix Path (L1 Trivial Tasks):**
63
71
  1. Team Lead evaluates request and creates `HOTFIX-{Date}-{Name}.md`.
@@ -69,7 +77,7 @@ Before starting any sprint, the Team Lead MUST:
69
77
 
70
78
  ### Phase 3: Review
71
79
  Sprint Report โ†’ Human review โ†’ Delivery Plan updated โ†’ Lessons recorded โ†’ Next sprint.
72
- If sprint delivered new features or Developer reports flagged stale product docs โ†’ spawn Scribe agent to generate/update product_documentation/ via vdoc.
80
+ If sprint delivered new features or Developer reports flagged stale product docs โ†’ spawn Scribe agent to generate/update vdocs/ via vdoc.
73
81
 
74
82
  ## Story States
75
83
 
@@ -97,7 +105,8 @@ Draft โ†’ Refinement โ†’ Ready to Bounce โ†’ Bouncing โ†’ QA Passed โ†’ Architec
97
105
  ### During Implementation
98
106
  4. **Follow the Safe Zone**. No new patterns or libraries without Architect approval.
99
107
  5. **No Gold-Plating**. Implement exactly what the Story specifies.
100
- 6. **Self-assess Correction Tax**. Track % human intervention.
108
+ 6. **Write Self-Documenting Code**. All exports MUST have JSDoc/docstrings to prevent RAG poisoning for future agents.
109
+ 7. **Self-assess Correction Tax**. Track % human intervention.
101
110
 
102
111
  ### After Implementation
103
112
  7. **Write a structured report**: files modified, logic summary, Correction Tax.
@@ -123,19 +132,20 @@ V-Bounce OS/
123
132
 
124
133
  ## Document Locations
125
134
 
126
- All planning documents live in `product_plans/`. Each delivery (= Roadmap Release) gets its own folder. Epics are subfolders. Stories live inside their parent Epic folder.
135
+ All planning documents live in `product_plans/`, separated by state (`strategy/`, `backlog/`, `sprints/`, `archive/`).
127
136
 
128
137
  | Document | Template | Output |
129
138
  |----------|----------|--------|
130
- | Charter | `templates/charter.md` | `product_plans/{project}_charter.md` |
131
- | Roadmap | `templates/roadmap.md` | `product_plans/{project}_roadmap.md` |
132
- | Risk Registry | `templates/risk_registry.md` | `product_plans/RISK_REGISTRY.md` |
133
- | Delivery Plan | `templates/delivery_plan.md` | `product_plans/{delivery}/DELIVERY_PLAN.md` |
134
- | Epic | `templates/epic.md` | `product_plans/{delivery}/EPIC-{NNN}_{name}/EPIC-{NNN}.md` |
135
- | Story | `templates/story.md` | `product_plans/{delivery}/EPIC-{NNN}_{name}/STORY-{EpicID}-{StoryID}.md` |
136
- | Sprint Report | `templates/sprint_report.md` | `.bounce/sprint-report.md` |
137
- | Product Docs | (generated by vdoc) | `product_documentation/*.md` |
138
- | Doc Manifest | (generated by vdoc) | `product_documentation/_manifest.json` |
139
+ | Charter | `templates/charter.md` | `product_plans/strategy/{project}_charter.md` |
140
+ | Roadmap | `templates/roadmap.md` | `product_plans/strategy/{project}_roadmap.md` |
141
+ | Risk Registry | `templates/risk_registry.md` | `product_plans/strategy/RISK_REGISTRY.md` |
142
+ | Delivery Plan | `templates/delivery_plan.md` | `product_plans/strategy/{delivery}_delivery_plan.md` |
143
+ | Sprint Plan | `templates/sprint.md` | `product_plans/sprints/sprint-{XX}/sprint-{XX}.md` |
144
+ | Epic | `templates/epic.md` | `product_plans/backlog/EPIC-{NNN}_{name}/EPIC-{NNN}.md` |
145
+ | Story | `templates/story.md` | `product_plans/backlog/EPIC-{NNN}_{name}/STORY-{EpicID}-{StoryID}-{StoryName}.md` |
146
+ | Sprint Report | `templates/sprint_report.md` | `product_plans/sprints/sprint-{XX}/sprint-report.md` |
147
+ | Product Docs | (generated by vdoc) | `vdocs/*.md` |
148
+ | Doc Manifest | (generated by vdoc) | `vdocs/_manifest.json` |
139
149
 
140
150
  Completed deliveries are archived to `product_plans/archive/` and logged in Roadmap ยง7 Delivery Log.
141
151
 
package/brains/GEMINI.md CHANGED
@@ -23,6 +23,7 @@ For Antigravity: copy skills to `.agents/skills/` for workspace-scoped discovery
23
23
  | `skills/react-best-practices/` | Frontend coding patterns and anti-patterns | Developer |
24
24
  | `skills/vibe-code-review/` | Code quality review (4 modes) | QA, Architect |
25
25
  | `skills/write-skill/` | Creating and refining agent skills | Team Lead |
26
+ | `skills/improve/` | Framework self-improvement from agent feedback | Team Lead |
26
27
 
27
28
  ## The V-Bounce Process
28
29
 
@@ -35,20 +36,27 @@ Before starting any sprint, the Team Lead MUST:
35
36
  - **Triage the Request**: Is this an L1 Trivial change (1-2 files, cosmetic/minor)?
36
37
  - If YES โ†’ Use the **Hotfix Path** (create a Hotfix document, bypass Epic/Story).
37
38
  - If NO โ†’ Use the **Standard Path** (create/find Epic, Story).
39
+ - **Determine Execution Mode**:
40
+ - Full Bounce (Default): dev โ†’ qa โ†’ arch โ†’ devops.
41
+ - Fast Track (L1/L2 Minor): dev โ†’ devops only (skip QA/Arch gates).
42
+ - **Dependency Check**: Stories with `Depends On:` must execute sequentially. Wait for DevOps merge of Story A before starting Story B.
38
43
  - Read RISK_REGISTRY.md โ€” flag high-severity risks that affect planned stories.
39
- - Read DELIVERY_PLAN.md ยง5 Open Questions โ€” do not bounce stories with unresolved blocking questions.
40
- - If `product_documentation/_manifest.json` exists, read it โ€” understand what's documented, pass relevant doc references to agents.
44
+ - Read `sprint-{XX}.md` ยง2 Sprint Open Questions โ€” do not bounce stories with unresolved blocking questions.
45
+ - If `vdocs/_manifest.json` exists, read it.
46
+ - **Strategic Freeze**: Charter and Roadmap are frozen during sprints. If emergency changes are needed, run the **Impact Analysis Protocol**: Evaluate sprint stories against new strategy. Pause work until human approval.
41
47
 
42
48
  ### Phase 2: The Bounce (Implementation)
43
49
  **Standard Path (L2-L4 Stories):**
44
50
  0. Team Lead runs `./scripts/pre_bounce_sync.sh` to ensure LanceDB RAG context is fresh.
45
51
  1. Team Lead sends Story context pack to Developer.
46
52
  2. Developer queries LanceDB, implements code, writes Implementation Report. CLI Orchestrator must run `./scripts/validate_report.mjs` on the report to enforce YAML strictness.
47
- 3. QA runs Quick Scan + PR Review, validates against Story ยง2 The Truth. If fail โ†’ Bug Report to Dev. CLI Orchestrator must run `./scripts/validate_report.mjs` on the QA report before passing to Architect/Dev.
48
- 4. Dev fixes and resubmits. 3+ failures โ†’ Escalated.
49
- 5. Architect runs Deep Audit + Trend Check, validates Safe Zone compliance and ADR adherence.
50
- 6. DevOps merges story branch into sprint branch, validates post-merge, handles release tagging.
51
- 7. Team Lead consolidates reports into Sprint Report.
53
+ 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.
54
+ 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.
55
+ 5. Dev fixes and resubmits. 3+ failures โ†’ Escalated.
56
+ 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.
57
+ 7. Architect runs Deep Audit + Trend Check (skipping pre-scanned checks), validates Safe Zone compliance and ADR adherence.
58
+ 8. DevOps merges story branch into sprint branch, validates post-merge (tests + lint + build), handles release tagging.
59
+ 9. Team Lead consolidates reports into Sprint Report.
52
60
 
53
61
  **Hotfix Path (L1 Trivial Tasks):**
54
62
  1. Team Lead evaluates request and creates `HOTFIX-{Date}-{Name}.md`.
@@ -60,7 +68,7 @@ Before starting any sprint, the Team Lead MUST:
60
68
 
61
69
  ### Phase 3: Review
62
70
  Sprint Report โ†’ Human review โ†’ Delivery Plan updated โ†’ Lessons recorded โ†’ Next sprint.
63
- If sprint delivered new features or Dev reports flagged stale product docs โ†’ spawn Scribe agent to generate/update product_documentation/ via vdoc.
71
+ If sprint delivered new features or Dev reports flagged stale product docs โ†’ spawn Scribe agent to generate/update vdocs/ via vdoc.
64
72
 
65
73
  ## Story States
66
74
 
@@ -88,7 +96,8 @@ Draft โ†’ Refinement โ†’ Ready to Bounce โ†’ Bouncing โ†’ QA Passed โ†’ Architec
88
96
  ### During Implementation
89
97
  4. **Follow the Safe Zone**. No new patterns or libraries without Architect approval.
90
98
  5. **No Gold-Plating**. Implement exactly what the Story specifies.
91
- 6. **Self-assess Correction Tax**. Track % human intervention.
99
+ 6. **Write Self-Documenting Code**. All exports MUST have JSDoc/docstrings to prevent RAG poisoning for future agents.
100
+ 7. **Self-assess Correction Tax**. Track % human intervention.
92
101
 
93
102
  ### After Implementation
94
103
  7. **Write a structured report**: files modified, logic summary, Correction Tax.
@@ -114,18 +123,19 @@ V-Bounce OS/
114
123
 
115
124
  ## Document Locations
116
125
 
117
- Planning docs live in `product_plans/`. Each delivery (= release) gets a folder. Epics are subfolders. Stories live with their Epic. Completed deliveries archived to `product_plans/archive/`.
126
+ Planning docs live in `product_plans/`. It uses a state-based architecture (`strategy/`, `backlog/`, `sprints/`, `archive/`). Completed items are archived to `product_plans/archive/`.
118
127
 
119
128
  | Document | Output |
120
129
  |----------|--------|
121
- | Charter | `product_plans/{project}_charter.md` |
122
- | Roadmap | `product_plans/{project}_roadmap.md` |
123
- | Risk Registry | `product_plans/RISK_REGISTRY.md` |
124
- | Delivery Plan | `product_plans/{delivery}/DELIVERY_PLAN.md` |
125
- | Epic | `product_plans/{delivery}/EPIC-{NNN}_{name}/EPIC-{NNN}.md` |
126
- | Story | `product_plans/{delivery}/EPIC-{NNN}_{name}/STORY-{EpicID}-{StoryID}.md` |
127
- | Sprint Report | `.bounce/sprint-report.md` |
128
- | Product Docs | `product_documentation/*.md` + `_manifest.json` |
130
+ | Charter | `product_plans/strategy/{project}_charter.md` |
131
+ | Roadmap | `product_plans/strategy/{project}_roadmap.md` |
132
+ | Risk Registry | `product_plans/strategy/RISK_REGISTRY.md` |
133
+ | Delivery Plan | `product_plans/strategy/{delivery}_delivery_plan.md` |
134
+ | Sprint Plan | `product_plans/sprints/sprint-{XX}/sprint-{XX}.md` |
135
+ | Epic | `product_plans/backlog/EPIC-{NNN}_{name}/EPIC-{NNN}.md` |
136
+ | Story | `product_plans/backlog/EPIC-{NNN}_{name}/STORY-{EpicID}-{StoryID}-{StoryName}.md` |
137
+ | Sprint Report | `product_plans/sprints/sprint-{XX}/sprint-report.md` |
138
+ | Product Docs | `vdocs/*.md` + `_manifest.json` |
129
139
 
130
140
  ## Report Formats
131
141
 
package/brains/SETUP.md CHANGED
@@ -143,16 +143,13 @@ your-project/
143
143
  โ”‚ โ”œโ”€โ”€ react-best-practices/
144
144
  โ”‚ โ””โ”€โ”€ write-skill/
145
145
  โ”œโ”€โ”€ templates/ โ† document templates
146
- โ”œโ”€โ”€ product_plans/ โ† planning documents
147
- โ”‚ โ”œโ”€โ”€ {project}_charter.md
148
- โ”‚ โ”œโ”€โ”€ {project}_roadmap.md
149
- โ”‚ โ”œโ”€โ”€ RISK_REGISTRY.md
150
- โ”‚ โ””โ”€โ”€ D-01_{release}/
151
- โ”‚ โ”œโ”€โ”€ DELIVERY_PLAN.md
152
- โ”‚ โ””โ”€โ”€ EPIC-001_{name}/
153
- โ”‚ โ”œโ”€โ”€ EPIC-001.md
154
- โ”‚ โ””โ”€โ”€ STORY-001-01.md
155
- โ”œโ”€โ”€ product_documentation/ โ† generated by Scribe (post-sprint)
146
+ โ”œโ”€โ”€ product_plans/ โ† planning documents (state-based)
147
+ โ”‚ โ”œโ”€โ”€ strategy/ โ† charter, roadmap, risk registry, delivery plan
148
+ โ”‚ โ”œโ”€โ”€ backlog/ โ† epics and unassigned stories
149
+ โ”‚ โ”œโ”€โ”€ sprints/ โ† active sprint execution workspace
150
+ โ”‚ โ”œโ”€โ”€ hotfixes/ โ† L1 emergency tasks
151
+ โ”‚ โ””โ”€โ”€ archive/ โ† completed sprints and epics
152
+ โ”œโ”€โ”€ vdocs/ โ† generated by Scribe (post-sprint)
156
153
  โ”œโ”€โ”€ .bounce/ โ† reports & sprint archives (archive/ is committed)
157
154
  โ”‚ โ”œโ”€โ”€ reports/ โ† active reports (gitignored)
158
155
  โ”‚ โ””โ”€โ”€ archive/ โ† completed sprint history (committed to git)
@@ -15,10 +15,19 @@ Audit the codebase for structural integrity, standards compliance, and long-term
15
15
  ## Before Auditing
16
16
 
17
17
  1. **Query Project Lessons**: Run `./scripts/vbounce_ask.mjs "architectural constraints and historical mistakes for <story summary>"` to retrieve relevant context from `LESSONS.md` and past reports.
18
- 2. **Read all reports** for this story (`.bounce/reports/STORY-{ID}-*.md`) โ€” Dev Report, QA Report.
18
+ 2. **Read all reports** for this story (`.bounce/reports/STORY-{ID}-{StoryName}-*.md`) โ€” Dev Report, QA Report.
19
19
  3. **Read the full Story spec** โ€” especially ยง3 Implementation Guide and ยง3.1 ADR References.
20
20
  4. **Read Roadmap ยง3 ADRs** โ€” every architecture decision the implementation must comply with.
21
21
 
22
+ ## Pre-Computed Scan Results
23
+
24
+ Before you were spawned, the Team Lead ran `scripts/pre_gate_runner.sh arch`. Read the results at `.bounce/reports/pre-arch-scan.txt`.
25
+
26
+ - If **ALL checks PASS**: Skip mechanical verification in your Deep Audit (dependency changes, file sizes, test/build/lint status). Focus on **judgment-based dimensions**: architectural consistency, error handling quality, data flow traceability, coupling assessment, and AI-ism detection.
27
+ - If **ANY check FAILS**: Note failures in your report. Focus your audit on the areas that failed.
28
+
29
+ The 6-dimension evaluation should focus on qualitative judgment. Mechanical checks (new deps, file sizes, exports documentation) are pre-computed โ€” reference `pre-arch-scan.txt` rather than re-running them.
30
+
22
31
  ## Your Audit Process
23
32
 
24
33
  ### Deep Audit (Full Codebase Analysis)
@@ -63,21 +72,30 @@ Check that the changes don't break existing functionality:
63
72
  - Check for modified shared utilities, types, or config
64
73
  - Verify imports and exports haven't broken dependency chains
65
74
 
75
+ ### Documentation Verification (RAG Hygiene)
76
+ Check that the codebase remains self-documenting for downstream RAG consumption:
77
+ - Does the implementation match the existing `vdocs/_manifest.json` (if one exists)?
78
+ - If it diverges entirely, you MUST fail the audit and instruct the Developer to update their report's Documentation Delta.
79
+ - Are exported functions, components, and schemas adequately JSDoc commented? Code must explain the *why*.
80
+
66
81
  ## Your Output
67
82
 
68
- Write an **Architectural Audit Report** to `.bounce/reports/STORY-{ID}-arch.md`.
83
+ Write an **Architectural Audit Report** to `.bounce/reports/STORY-{ID}-{StoryName}-arch.md`.
69
84
  You MUST include the YAML frontmatter block exactly as shown below:
70
85
 
86
+ **Token Tracking**: Before generating this report, retrieve your session's token usage (if you are Claude, ask your CLI; if Gemini, read your context estimate; if Codex, read your log output) and populate `tokens_used`.
87
+
71
88
  ### If Audit PASSES:
72
89
  ```markdown
73
90
  ---
74
91
  status: "PASS"
75
92
  safe_zone_score: {SCORE}
93
+ tokens_used: {number}
76
94
  ai_isms_detected: {count}
77
95
  regression_risk: "{Low/Medium/High}"
78
96
  ---
79
97
 
80
- # Architectural Audit Report: STORY-{ID} โ€” PASS
98
+ # Architectural Audit Report: STORY-{ID}-{StoryName} โ€” PASS
81
99
 
82
100
  ## Safe Zone Compliance: {SCORE}/10
83
101
 
@@ -110,6 +128,12 @@ regression_risk: "{Low/Medium/High}"
110
128
  ## Lessons for Future Prompts
111
129
  - {What should we tell the Dev Agent differently next time?}
112
130
 
131
+ ## Process Feedback
132
+ > Optional. Note friction with the V-Bounce framework itself โ€” templates, handoffs, RAG quality, skills.
133
+
134
+ - {e.g., "vibe-code-review Deep Audit checklist missing a dimension for accessibility"}
135
+ - {e.g., "None"}
136
+
113
137
  ## Recommendation
114
138
  PASS โ€” Ready for Sprint Review.
115
139
  ```
@@ -119,10 +143,11 @@ PASS โ€” Ready for Sprint Review.
119
143
  ---
120
144
  status: "FAIL"
121
145
  bounce_count: {N}
146
+ tokens_used: {number}
122
147
  critical_failures: {count}
123
148
  ---
124
149
 
125
- # Architectural Audit Report: STORY-{ID} โ€” FAIL
150
+ # Architectural Audit Report: STORY-{ID}-{StoryName} โ€” FAIL
126
151
 
127
152
  ## Critical Failures
128
153
  ### Issue 1: {Short description}
@@ -132,6 +157,12 @@ critical_failures: {count}
132
157
  - **What's wrong (plain language)**: {Non-coder analogy}
133
158
  - **Fix required**: {What the Dev needs to change}
134
159
 
160
+ ## Process Feedback
161
+ > Optional. Note friction with the V-Bounce framework itself โ€” templates, handoffs, RAG quality, skills.
162
+
163
+ - {e.g., "Trend Check had no baseline โ€” first sprint, but the template still requires comparison"}
164
+ - {e.g., "None"}
165
+
135
166
  ## Recommendation
136
167
  FAIL โ€” Returning to Developer. Architect bounce count: {N}.
137
168
  ```
@@ -146,10 +177,10 @@ When the Team Lead asks for a **Sprint Integration Audit** (after all stories pa
146
177
 
147
178
  ## Checkpointing
148
179
 
149
- After completing each major phase of your audit (e.g., Deep Audit done, Trend Check done, ADR compliance checked), write a progress checkpoint to `.bounce/reports/STORY-{ID}-arch-checkpoint.md`:
180
+ After completing each major phase of your audit (e.g., Deep Audit done, Trend Check done, ADR compliance checked), write a progress checkpoint to `.bounce/reports/STORY-{ID}-{StoryName}-arch-checkpoint.md`:
150
181
 
151
182
  ```markdown
152
- # Architect Checkpoint: STORY-{ID}
183
+ # Architect Checkpoint: STORY-{ID}-{StoryName}
153
184
  ## Completed
154
185
  - {Which audit phases are done}
155
186
  ## Remaining