viepilot 2.4.0 → 2.12.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/CHANGELOG.md CHANGED
@@ -7,6 +7,133 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.12.0] - 2026-04-13
11
+
12
+ ### Added (FEAT-018 — Phase 75)
13
+ - **`vp-crystallize --brownfield`**: Brownfield Mode — bootstrap `.viepilot/` project context from an existing codebase without a brainstorm session
14
+ - 12-category codebase scanner: build manifests (11 platforms), framework detection (40+ dep patterns), architecture layer inference (18 directory patterns), database schema signals, API contract detection, infrastructure config, environment config shape, test coverage, code quality tools, documentation files, git history, file extension survey
15
+ - Structured Scan Report (YAML) with DETECTED / ASSUMED / MISSING gap classification
16
+ - MUST-DETECT gap tier: blocks artifact generation until user fills interactively
17
+ - Synthetic brainstorm stub (`docs/brainstorm/session-brownfield-import.md`) for `vp-audit` compatibility
18
+ - Safety rules: never reads `.env`; skips `node_modules/`, `.git/`, `target/`, `build/`, `dist/`, `__pycache__/`, `.venv/`, `vendor/`
19
+ - `vp-audit` updated to accept brownfield stub as valid brainstorm source (no false-positive errors)
20
+ - `TRACKER.md` annotated with `## Brownfield Import` block on first-time bootstrap
21
+
22
+ ## [2.11.0] - 2026-04-13
23
+
24
+ ### Added (ENH-045 — Phase 74)
25
+ - **`lib/proposal-generator.cjs`**: `getDesignConfig(projectContext)` helper + `DESIGN_CONFIGS` map (3 styles: modern-tech, enterprise, creative) — auto-selects palette from sector/audience/tone context
26
+ - **`scripts/gen-proposal-pptx.cjs`**: `PALETTES` map with 3 colour schemes + 3 rich slide layouts (timeline-gantt, team-card, investment-visual) + generates `project-proposal-{modern-tech,enterprise,creative}.pptx` variants
27
+ - **`workflows/proposal.md`**: dynamic slide count (no hard cap) + `designConfig` field in manifest + content-aware split rules (technicalNarrative > 4 → 2 slides; team > 4 → 2 slides; phases > 4 → 2 timeline slides) + DESIGN SELECTION AI prompt block
28
+ - 31 contract tests in `vp-enh045-dynamic-slides.test.js`
29
+
30
+ ## [2.10.1] - 2026-04-11
31
+
32
+ ### Changed (ENH-044 — Phase 73)
33
+ - **`lib/screenshot-artifact.cjs`**: `warnMissingTool(tool, installCmd)` — standardized stderr `⚠` warning when visual tool absent but artifacts exist; exports alongside existing helpers
34
+ - **`workflows/proposal.md` Step 4c**: mandatory enforcement — `visualSlides[]` MUST be non-empty when artifacts exist; puppeteer absent → `warnMissingTool('puppeteer', ...)` + `addPlaceholderVisual()` (no more silent skip)
35
+ - **`workflows/proposal.md` Step 7**: mandatory enforcement — Mermaid + ui/arch sections MUST be added when diagrams/artifacts exist; mmdc absent → text fallback + `warnMissingTool('mmdc', ...)`; puppeteer absent → placeholder paragraph + `warnMissingTool('puppeteer', ...)`
36
+ - `warnMissingTool()` called once per missing tool per generation run (not per-diagram)
37
+ - 16 tests in `vp-enh044-visual-enforce.test.js`
38
+
39
+ ## [2.10.0] - 2026-04-11
40
+
41
+ ### Added (ENH-043 — Phase 72)
42
+ - **`lib/screenshot-artifact.cjs`**: `isMmdcAvailable()` — boolean guard for `mmdc` CLI on PATH; `renderMermaidToPng(source, outPath)` — renders Mermaid source string → PNG via `mmdc` CLI; returns null when mmdc absent (no crash)
43
+ - **`scripts/gen-proposal-docx.cjs`**: `imageRunFromPng(pngPath, widthEmu, heightEmu)` → `ImageRun` (docx package) for embedding PNG as inline image; requires `screenshot-artifact.cjs` + `proposal-generator.cjs`; runtime visual embedding comment block documenting three injection points: Mermaid diagrams (renderMermaidToPng → ImageRun), UI prototype screenshot (before Executive Summary), architecture screenshot (after Technical Approach)
44
+ - **`workflows/proposal.md` Step 7**: Diagram Reference updated to render `mermaidSource` → PNG via `renderMermaidToPng()`; documents `screenshotArtifact` for ui-direction + architect injection; all paths use `cleanupScreenshot()`; graceful fallback when mmdc/puppeteer absent
45
+ - 19 tests in `vp-enh043-docx-visuals.test.js`; contracts +2 (769/769 total)
46
+
47
+ ## [2.9.0] - 2026-04-11
48
+
49
+ ### Added (ENH-042 — Phase 71)
50
+ - **`lib/proposal-generator.cjs`**: `detectVisualArtifacts(sessionDir)` — auto-scans `.viepilot/ui-direction/{latest-session}/` for ui-direction pages (`index.html`, `pages/*.html`) and 10 architect workspace page types (`architecture.html`, `erd.html`, `sequence-diagram.html`, etc.)
51
+ - **`lib/screenshot-artifact.cjs`** (new): `screenshotArtifact(htmlPath)` via optional puppeteer (headless Chrome) — returns `null` gracefully when puppeteer not installed; `isPuppeteerAvailable()` boolean guard; `cleanupScreenshot()` temp-file cleanup
52
+ - **`workflows/proposal.md` Step 4c `detect_visual_artifacts`**: AI maps slide topics to HTML artifact files, produces `visualSlides[]` array with `slideIndex`, `artifactType`, `htmlPath`, `label` fields
53
+ - **`scripts/gen-proposal-pptx.cjs`**: `addPlaceholderVisual(slide, label)` — styled navy+accent placeholder shape for when screenshots are unavailable; runtime integration comment block documenting the `screenshotArtifact` → `addImage` → `cleanupScreenshot` pattern
54
+ - Zero breaking change: all proposal generation works without puppeteer; visuals are additive
55
+
56
+ ## [2.8.0] - 2026-04-11
57
+
58
+ ### Added (ENH-041 — Phase 70)
59
+ - **`workflows/proposal.md` Step 4b `generate_docx_content`**: dedicated AI pass for deep `.docx` content, independent of the slide manifest — richer prose, risk analysis, diagrams
60
+ - **`docxContent` JSON schema**: `executiveSummary[]`, `problemStatement[]`, `solutionNarrative[]`, `technicalNarrative[]`, `riskRegister[]`, `glossary[]`, `diagrams[]` (with `mermaidSource`)
61
+ - **Step 7 updated**: `.docx` generator consumes `docxContent` for narrative paragraphs; new Risk Register and Glossary sections fed from `docxContent`
62
+ - **Step 8 updated**: `.md` companion embeds Mermaid fenced code blocks (` ```flowchart `, ` ```sequenceDiagram `, etc.) for each diagram in `docxContent.diagrams[]`
63
+ - **`getDiagramTypes(typeId)` helper** in `lib/proposal-generator.cjs`: maps proposal type to diagram array (`project-proposal` → `[flowchart, gantt]`, `tech-architecture` → `[flowchart, sequenceDiagram, classDiagram]`, etc.)
64
+ - **`.docx` Risk Register table**: Risk | Probability | Impact | Mitigation (5 placeholder rows)
65
+ - **`.docx` Glossary table**: Term | Definition (4 placeholder rows)
66
+ - `project-detail.docx` regenerated — 12 sections (added §8 Risk Register, §11 Glossary; previous §8–10 renumbered §9–12)
67
+ - 17 new tests in `tests/unit/vp-enh041-proposal-docx-ai.test.js`; `vp-proposal-contracts.test.js` updated (+5 ENH-041 assertions)
68
+
69
+ ## [2.7.0] - 2026-04-10
70
+
71
+ ### Added (ENH-040 — Phase 69)
72
+ - **`workflows/proposal.md` Step 2C Quality Brief**: 4 focused questions before AI generation — CTA, budget range, timeline constraint, decision-maker — stored in manifest `meta` field
73
+ - **Manifest `meta` schema**: `cta`, `budget`, `timeline`, `decisionMaker` fields drive tone and content specificity
74
+ - **AI Prompt Contract** in manifest_generation step: 8–15 word outcome-oriented bullets, 3–5 sentence speaker notes, concrete CTA on closing slide, avoids filler phrases
75
+ - **`.pptx` templates: 5 distinct layouts** (ENH-040 Layer 1):
76
+ - `cover` — split panel (left charcoal + ViePilot mark, right title/subtitle/meta)
77
+ - `section` — left accent sidebar + heading bar + bullets
78
+ - `two-column` — heading + dual column content (comparisons, scope, competitive)
79
+ - `data` — heading + up to 3 metric callout boxes (large value + label + note)
80
+ - `closing` — full charcoal, prominent CTA text, accent bars top/bottom
81
+ - **`.docx` template: structured tables + narrative** (ENH-040 Layer 3):
82
+ - **Timeline table**: Phase | Milestone/Deliverable | Duration | Dependencies (6 rows)
83
+ - **Budget/Investment table**: Line Item | Estimate | Notes (with TOTAL row)
84
+ - **Team table**: Role | Name/Background | Responsibility
85
+ - Narrative paragraphs for Executive Summary, Problem & Opportunity, Why Choose Us
86
+ - 10 sections + explicit `{{placeholder}}` instructions for AI to fill
87
+ - All 4 `.pptx` stock templates regenerated (137–151 KB; prev 97–126 KB)
88
+ - `project-detail.docx` regenerated (12 KB; prev 10 KB)
89
+
90
+ ### Tests
91
+ - Added `tests/unit/vp-enh040-proposal-quality.test.js` (27 tests — workflow contracts, pptx layout coverage, docx structure)
92
+ - Updated `tests/unit/vp-proposal-contracts.test.js` (+2 tests — quality brief + outcome-oriented rules)
93
+ - Total: **660 → 689 tests**
94
+
95
+ ## [2.6.0] - 2026-04-10
96
+
97
+ ### Added (ENH-039 — Phase 68)
98
+ - **`/vp-proposal --lang <code>`**: language selection for AI-generated content (ISO 639-1; e.g. `vi`, `en`, `ja`, `fr`, `zh`)
99
+ - If omitted: prompted with MRU suggestions from `~/.viepilot/config.json → proposal.recentLangs`
100
+ - Language is saved to MRU after each successful generation
101
+ - **`/vp-proposal --lang-content-only`**: translate bullets, notes, and paragraphs; keep structural labels / section names in English
102
+ - **MRU language history**: `~/.viepilot/config.json → proposal.recentLangs` (max 5, most recent first, deduped)
103
+ - **`lib/viepilot-config.cjs`**: `getProposalLang()` + `recordProposalLang()` helpers; `DEFAULTS` extended with `proposal.recentLangs` + `proposal.defaultLang`
104
+ - **`lib/proposal-generator.cjs`**: `buildLangInstruction(lang, contentOnly)` — builds AI prompt language instruction; no-op for English
105
+ - **`workflows/proposal.md`**: Step 3b Language Selection (MRU prompt); `langInstruction` injection in manifest generation; `recordProposalLang` after confirm output
106
+ - **`skills/vp-proposal/SKILL.md`**: `--lang` + `--lang-content-only` flags documented
107
+
108
+ ### Tests
109
+ - Added `tests/unit/vp-enh039-proposal-lang.test.js` (13 tests — config helpers, buildLangInstruction, SKILL.md/workflow contracts)
110
+ - Updated `tests/unit/vp-proposal-contracts.test.js` (+2 tests — --lang and --lang-content-only flag documentation)
111
+ - Total: **645 → 660 tests**
112
+
113
+ ## [2.5.0] - 2026-04-11
114
+
115
+ ### Added (FEAT-016 — Phases 63–67)
116
+ - **`/vp-proposal` skill**: convert brainstorm session (or direct brief) → professional proposal package
117
+ - `.pptx` presentation (ViePilot branded, dark navy/charcoal)
118
+ - `.docx` detailed document (10 sections: executive summary → appendix)
119
+ - `.md` Markdown source of truth
120
+ - Optional `.txt` Google Slides URL (`--slides` flag)
121
+ - **4 proposal types**: `project-proposal` (10 slides), `tech-architecture` (12), `product-pitch` (12), `general` (8)
122
+ - **`lib/proposal-generator.cjs`**: 2-tier template resolution (project `.viepilot/proposal-templates/` override → ViePilot stock fallback), context detection, type validation, output path builder
123
+ - **`lib/google-slides-exporter.cjs`**: service account auth; lazy-loads `@googleapis/slides`; graceful error when package or credentials absent
124
+ - **Stock templates**: `templates/proposal/pptx/` (4 files, dark navy `#1a1f36`/charcoal `#2d3142`, ViePilot branded) + `templates/proposal/docx/project-detail.docx`
125
+ - **`scripts/gen-proposal-pptx.cjs`** + **`scripts/gen-proposal-docx.cjs`**: template generation scripts
126
+ - **`skills/vp-proposal/SKILL.md`**: full skill definition; `--type`, `--from`, `--slides`, `--dry-run` flags
127
+ - **`workflows/proposal.md`**: 10-step workflow; slide manifest schema; 4 proposal type structures; error handling
128
+ - **`docs/user/features/proposal.md`**: full user guide with Google Slides 5-step setup guide
129
+ - **`@googleapis/slides`** added as `optionalDependencies` (install not required unless using `--slides`)
130
+ - **`pptxgenjs` + `docx`** added as runtime `dependencies`
131
+
132
+ ### Tests
133
+ - Added `tests/unit/vp-proposal-contracts.test.js` (25 tests — skill/workflow files, generator exports, stock templates, graceful degradation)
134
+ - Added `tests/unit/vp-proposal-core.test.js` (15 tests — resolveTemplate, validateType, detectBrainstormSession)
135
+ - Total: 607 → **647 tests**
136
+
10
137
  ## [2.4.0] - 2026-04-10
11
138
 
12
139
  ### Added (FEAT-015 — Phase 62)
package/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  **Autonomous Vibe Coding Framework / Bộ khung phát triển tự động có kiểm soát**
4
4
 
5
- [![Version](https://img.shields.io/badge/version-2.4.0-blue.svg)](CHANGELOG.md)
5
+ [![Version](https://img.shields.io/badge/version-2.5.0-blue.svg)](CHANGELOG.md)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
7
- [![Skills](https://img.shields.io/badge/skills-16-purple.svg)](#skills-reference)
7
+ [![Skills](https://img.shields.io/badge/skills-17-purple.svg)](#skills-reference)
8
8
  [![Workflows](https://img.shields.io/badge/workflows-12-orange.svg)](#workflows)
9
9
  [![Templates](https://img.shields.io/badge/templates-17-cyan.svg)](#templates)
10
10
  [![Tests](https://img.shields.io/badge/tests-607%20passing-brightgreen.svg)](tests/)
@@ -29,7 +29,7 @@ Nếu ViePilot giúp ích cho bạn, bạn có thể ủng hộ một ly cafe:
29
29
  | Chỉ số / Metric | Giá trị / Value |
30
30
  |-----------------|-----------------|
31
31
  | Total LOC | **~39,668+** (`.md`, `.js`, `.cjs`, `.yml`, `.json`, `.sh`; không gồm `node_modules`) |
32
- | Skills | **16** |
32
+ | Skills | **17** |
33
33
  | Workflows | **12** |
34
34
  | Templates | **17** (Project: 12, Phase: 5) |
35
35
  | CLI Commands | **18** (`vp-tools` 17 subcommands + `viepilot` installer) |
@@ -43,7 +43,7 @@ Nếu ViePilot giúp ích cho bạn, bạn có thể ủng hộ một ly cafe:
43
43
 
44
44
  | Thành phần / Component | Số lượng / Count | Mô tả / Description |
45
45
  |------------------------|------------------|---------------------|
46
- | Skill Definitions | **16** | SKILL.md files với trigger, process, success criteria |
46
+ | Skill Definitions | **17** | SKILL.md files với trigger, process, success criteria |
47
47
  | Workflow Files | **12** | Step-by-step execution guides |
48
48
  | Project Templates | 12 | AI-GUIDE, ARCHITECTURE, VIEPILOT-META, README, SYSTEM-RULES, etc. |
49
49
  | Phase Templates | 5 | SPEC, PHASE-STATE, TASK, VERIFICATION, SUMMARY |
@@ -60,7 +60,7 @@ Tổng thể / Overall: ██████████████████
60
60
 
61
61
  | Lĩnh vực / Area | Trạng thái | Chi tiết |
62
62
  |-----------------|------------|----------|
63
- | Core Skills (16) | ✅ Hoàn thiện | brainstorm, crystallize, auto, pause, resume, status, info, request, evolve, docs, update, task, debug, rollback, audit, ui-components |
63
+ | Core Skills (17) | ✅ Hoàn thiện | brainstorm, crystallize, auto, pause, resume, status, info, request, evolve, docs, update, task, debug, rollback, audit, ui-components, **proposal** |
64
64
  | Workflows (12) | ✅ Hoàn thiện | Full step-by-step guides với success criteria |
65
65
  | Project Templates (12) | ✅ Hoàn thiện | Placeholders cho customization (+ `VIEPILOT-META` FEAT-009) |
66
66
  | Phase Templates (5) | ✅ Hoàn thiện | Task tracking, verification, summary |
@@ -126,6 +126,7 @@ Tổng thể / Overall: ██████████████████
126
126
  | `/vp-debug` | Debug có hệ thống với state tracking / Systematic debugging | "debug", "gỡ lỗi" | Debug |
127
127
  | `/vp-rollback` | Khôi phục về checkpoint / Rollback to checkpoint | "rollback", "revert" | Recovery |
128
128
  | `/vp-audit` | Kiểm tra sync docs vs implementation | "audit", "kiểm tra" | Quality |
129
+ | `/vp-proposal` | Generate .pptx + .docx proposal package từ brainstorm | "proposal", "pitch", "presentation" | Deliver |
129
130
 
130
131
  ---
131
132
 
@@ -0,0 +1,194 @@
1
+ # Brainstorm Session — 2026-04-11
2
+
3
+ ## Topic
4
+ **vp-proposal** — Skill mới: Idea → Proposal Documents + Presentation files (.pptx, .docx)
5
+
6
+ ## Status
7
+ Completed — Ready for `/vp-crystallize` / `/vp-request` → `/vp-evolve` → `/vp-auto`
8
+
9
+ ---
10
+
11
+ ## Problem Statement
12
+ ViePilot hiện có thể đưa ý tưởng thành code nhưng chưa có cầu nối sang **tài liệu bán hàng / thuyết phục**. Developer cần trình bày dự án cho khách hàng, đối tác, nhà đầu tư — hiện phải tự làm thủ công PowerPoint/Word tốn nhiều thời gian.
13
+
14
+ ---
15
+
16
+ ## Solution: `/vp-proposal`
17
+
18
+ Skill chuyển đổi ideas/brainstorm session → professional proposal package:
19
+ - **Presentation** (`.pptx`) — thuyết trình trực tiếp
20
+ - **Detail document** (`.docx`) — tài liệu chi tiết kèm theo
21
+ - **Markdown summary** (`.md`) — source of truth, version-controlled
22
+ - **Google Slides link** (optional `--slides`) — cloud sharing
23
+
24
+ ---
25
+
26
+ ## Decisions
27
+
28
+ ### D1: AI content generation
29
+ Auto-generate từ brainstorm session notes (context-aware).
30
+ - Nếu có `docs/brainstorm/session-*.md` → load latest session tự động làm input
31
+ - Standalone mode: user cung cấp brief trực tiếp trong chat
32
+ - Không cần user điền outline thủ công — AI extract + structure
33
+
34
+ ### D2: Template system (2-tier resolution)
35
+ ```
36
+ Tier 1 (project override): .viepilot/proposal-templates/{type}.pptx|docx
37
+ Tier 2 (stock fallback): {viepilot-install}/templates/proposal/pptx/{type}.pptx
38
+ {viepilot-install}/templates/proposal/docx/{type}.docx
39
+ ```
40
+ - Override chỉ ảnh hưởng project hiện tại
41
+ - Stock templates ship theo npm package
42
+
43
+ ### D3: Proposal types (4 + 1 docx)
44
+ | Type ID | Tên | Use case |
45
+ |---------|-----|----------|
46
+ | `project-proposal` | Project Proposal | Scope, timeline, budget cho khách hàng |
47
+ | `tech-architecture` | Technical Architecture | Thiết kế hệ thống cho technical partner |
48
+ | `product-pitch` | Product Pitch Deck | Investor / partner pitch |
49
+ | `general` | General Proposal | Tổng quát, fallback |
50
+ | `project-detail` (docx) | Project Detail Doc | Tài liệu chi tiết bổ sung cho tất cả loại trên |
51
+
52
+ ### D4: Output location
53
+ ```
54
+ docs/proposals/
55
+ ├── {slug}-{date}.md # Markdown source
56
+ ├── {slug}-{date}.pptx # Presentation
57
+ ├── {slug}-{date}.docx # Detail document
58
+ └── {slug}-{date}-slides.txt # Google Slides URL (nếu --slides)
59
+ ```
60
+
61
+ ### D5: Tech stack
62
+ | Output | Package | Version | Downloads/wk |
63
+ |--------|---------|---------|-------------|
64
+ | `.pptx` | `pptxgenjs` | ^3.x | 1.8M |
65
+ | `.docx` | `docx` | ^9.x | 3.5M |
66
+ | Google Slides | `@googleapis/slides` | official | optional dep |
67
+
68
+ ### D6: Workflow integration
69
+ - `c` — Context-aware: detect brainstorm session tự động OR standalone brief
70
+ - Auto-detect: check `docs/brainstorm/session-*.md` → sort by date → load latest
71
+ - User có thể override: `/vp-proposal --from session-2026-04-11.md`
72
+
73
+ ---
74
+
75
+ ## Architecture
76
+
77
+ ### New files
78
+ ```
79
+ skills/vp-proposal/
80
+ └── SKILL.md # Skill definition
81
+
82
+ workflows/
83
+ └── proposal.md # Step-by-step workflow
84
+
85
+ lib/
86
+ └── proposal-generator.cjs # Core: template resolution + pptxgenjs + docx
87
+
88
+ templates/proposal/
89
+ ├── pptx/
90
+ │ ├── project-proposal.pptx # ViePilot stock template
91
+ │ ├── tech-architecture.pptx
92
+ │ ├── product-pitch.pptx
93
+ │ └── general.pptx
94
+ └── docx/
95
+ └── project-detail.docx # ViePilot stock .docx template
96
+ ```
97
+
98
+ ### Template resolution logic (lib/proposal-generator.cjs)
99
+ ```js
100
+ function resolveTemplate(type, ext, projectRoot) {
101
+ const projectOverride = path.join(projectRoot, '.viepilot/proposal-templates', `${type}.${ext}`);
102
+ if (fs.existsSync(projectOverride)) return projectOverride;
103
+ return path.join(__dirname, '../templates/proposal', ext, `${type}.${ext}`);
104
+ }
105
+ ```
106
+
107
+ ### Slide generation flow
108
+ ```
109
+ /vp-proposal [--type project-proposal] [--slides]
110
+
111
+ ├─ 1. Load context (brainstorm session or user brief)
112
+ ├─ 2. AI structures content → JSON slide manifest
113
+ ├─ 3. resolveTemplate() → pick .pptx/.docx template
114
+ ├─ 4. pptxgenjs → write .pptx
115
+ ├─ 5. docx → write .docx
116
+ ├─ 6. Write .md summary
117
+ └─ 7. (--slides) Google Slides API upload → write URL
118
+ ```
119
+
120
+ ---
121
+
122
+ ## Open Questions
123
+
124
+ - ~~OQ1~~: **Resolved** — Dark theme: navy/charcoal. Professional, tech feel.
125
+ - ~~OQ2~~: **Resolved** — Flexible per type: project-proposal 10, tech-architecture 12, product-pitch 12, general 8.
126
+ - ~~OQ3~~: **Resolved** — `optionalDependencies` — load on demand khi `--slides` flag, npm install không fail nếu thiếu.
127
+ - ~~OQ4~~: **Resolved** — Skill-only `/vp-proposal`, nhất quán với các skill khác.
128
+
129
+ ---
130
+
131
+ ## Phases
132
+
133
+ ### Phase 1 — Core infrastructure
134
+ - Add `pptxgenjs` + `docx` to `package.json` dependencies
135
+ - `lib/proposal-generator.cjs`: template resolution + base pptx/docx writer
136
+ - Unit tests: template resolution logic
137
+
138
+ ### Phase 2 — Skill + Workflow
139
+ - `skills/vp-proposal/SKILL.md`
140
+ - `workflows/proposal.md` — full step-by-step
141
+ - Context detection: brainstorm session auto-load
142
+ - 4 proposal types wired up
143
+
144
+ ### Phase 3 — Stock templates
145
+ - Design + generate 4 stock `.pptx` templates (ViePilot branded)
146
+ - 1 stock `.docx` template
147
+ - Store in `templates/proposal/`
148
+
149
+ ### Phase 4 — Google Slides export (optional)
150
+ - `--slides` flag
151
+ - `@googleapis/slides` optional dependency
152
+ - Service account auth guide in docs
153
+
154
+ ### Phase 5 — Tests + Docs
155
+ - Jest contracts for proposal-generator
156
+ - `docs/user/features/proposal.md`
157
+ - Update `docs/skills-reference.md` + `README.md`
158
+
159
+ ---
160
+
161
+ ## Research Notes
162
+
163
+ ### pptxgenjs
164
+ - MIT, zero runtime dependencies
165
+ - Supports Slide Masters for branded templates
166
+ - HTML-to-PPTX in 1 line
167
+ - Template injection: load existing .pptx → inject content
168
+
169
+ ### docx (by Dolan Miu)
170
+ - MIT, 3.5M downloads/week
171
+ - Declarative API: `new Document({ sections: [...] })`
172
+ - Supports tables, images, headings, lists
173
+ - Version 9.6.1, actively maintained
174
+
175
+ ### Google Slides API
176
+ - Official `@googleapis/slides` Node.js client
177
+ - Service account = no browser auth for CLI
178
+ - Template-based: create in Slides → replace placeholders via API
179
+ - Optional: only needed for `--slides` flag
180
+
181
+ ---
182
+
183
+ ## Project meta intake (FEAT-009)
184
+ Waiver — this is the ViePilot framework repo itself; profile binding already exists.
185
+
186
+ ---
187
+
188
+ ## Session Summary
189
+ - **Feasibility**: HIGH ✅
190
+ - **Dependencies**: 2 well-maintained npm packages (pptxgenjs + docx), both MIT
191
+ - **Complexity**: Medium — template system + AI content structuring + 2 file formats
192
+ - **Estimated phases**: 5
193
+ - **Suggested ID**: FEAT-016
194
+ - **Target version**: 2.5.0
@@ -467,3 +467,49 @@ CHANGELOG.md (updated)
467
467
  ### Lưu ý
468
468
  - Trong repo **application** có `node_modules/viepilot`, update mặc định có thể target **local** — dùng **`--global`** nếu chỉ muốn global.
469
469
  - Luồng an toàn: `vp-tools update --dry-run` → sau đó `vp-tools update --yes` (hoặc `--global --yes`).
470
+
471
+ ---
472
+
473
+ ## /vp-proposal
474
+
475
+ **Purpose**: Generate professional proposal packages (.pptx + .docx + .md) from brainstorm sessions or direct briefs.
476
+
477
+ **Triggers**: "proposal", "pitch deck", "presentation", "tài liệu đề xuất"
478
+
479
+ ### Proposal Types
480
+ | Type | Slides | Use case |
481
+ |------|--------|----------|
482
+ | `project-proposal` | 10 | Client delivery — scope, timeline, budget |
483
+ | `tech-architecture` | 12 | Technical partners — system design |
484
+ | `product-pitch` | 12 | Investors / partners — pitch |
485
+ | `general` | 8 | Any audience — flexible |
486
+
487
+ ### Flags
488
+ | Flag | Description |
489
+ |------|-------------|
490
+ | `--type <id>` | Proposal type ID. If omitted: guided menu. |
491
+ | `--from <file>` | Explicit brainstorm session file to use |
492
+ | `--slides` | Upload to Google Slides after generation (requires service account) |
493
+ | `--dry-run` | Print slide manifest; no files written |
494
+
495
+ ### Output
496
+ ```
497
+ docs/proposals/
498
+ ├── {slug}-{date}.md Markdown source
499
+ ├── {slug}-{date}.pptx Presentation
500
+ ├── {slug}-{date}.docx Detailed document
501
+ └── {slug}-{date}-slides.txt Google Slides URL (--slides only)
502
+ ```
503
+
504
+ ### Template Override
505
+ Place custom `.pptx`/`.docx` files in `.viepilot/proposal-templates/` to override stock ViePilot templates for a specific project.
506
+
507
+ ### Examples
508
+ ```
509
+ /vp-proposal Auto-detect session + guided type selection
510
+ /vp-proposal --type product-pitch 12-slide investor pitch
511
+ /vp-proposal --type project-proposal --slides + upload to Google Slides
512
+ /vp-proposal --dry-run Preview manifest only
513
+ ```
514
+
515
+ Full guide: `docs/user/features/proposal.md`
@@ -0,0 +1,196 @@
1
+ # vp-proposal — Proposal Package Generator
2
+
3
+ Generate professional proposal packages directly from your ViePilot brainstorm sessions.
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ `/vp-proposal` converts a brainstorm session (or a direct brief) into three synchronized files:
10
+
11
+ | File | Format | Purpose |
12
+ |------|--------|---------|
13
+ | `{slug}-{date}.md` | Markdown | Source of truth, version-controlled |
14
+ | `{slug}-{date}.pptx` | PowerPoint | Presentation (direct delivery) |
15
+ | `{slug}-{date}.docx` | Word | Detailed supporting document |
16
+ | `{slug}-{date}-slides.txt` | Text | Google Slides URL (with `--slides` flag) |
17
+
18
+ All files are written to `docs/proposals/` in your project.
19
+
20
+ ---
21
+
22
+ ## Quick Start
23
+
24
+ ```bash
25
+ # Auto-detects latest brainstorm session
26
+ /vp-proposal
27
+
28
+ # Specify type directly
29
+ /vp-proposal --type product-pitch
30
+
31
+ # With Google Slides upload
32
+ /vp-proposal --type project-proposal --slides
33
+
34
+ # Preview slide manifest without writing files
35
+ /vp-proposal --dry-run
36
+ ```
37
+
38
+ ---
39
+
40
+ ## Proposal Types
41
+
42
+ | Type ID | Name | Slides | Best for |
43
+ |---------|------|--------|----------|
44
+ | `project-proposal` | Project Proposal | 10 | Client delivery — scope, timeline, budget |
45
+ | `tech-architecture` | Technical Architecture | 12 | Technical partners — system design |
46
+ | `product-pitch` | Product Pitch Deck | 12 | Investors / partners — pitch |
47
+ | `general` | General Proposal | 8 | Any audience — flexible structure |
48
+
49
+ ---
50
+
51
+ ## Flags
52
+
53
+ | Flag | Description |
54
+ |------|-------------|
55
+ | `--type <id>` | Proposal type (see table above). If omitted: guided menu. |
56
+ | `--from <file>` | Explicit brainstorm session: `--from docs/brainstorm/session-2026-04-11.md` |
57
+ | `--slides` | Upload generated .pptx to Google Slides after generation |
58
+ | `--dry-run` | Show slide manifest (JSON) without writing any files |
59
+
60
+ ---
61
+
62
+ ## Context Detection
63
+
64
+ `/vp-proposal` automatically loads the most recent brainstorm session:
65
+
66
+ 1. Scans `docs/brainstorm/session-*.md`
67
+ 2. Sorts descending by filename (ISO date format)
68
+ 3. Loads the latest session as proposal content
69
+
70
+ **Override:** use `--from <session-file>` to specify a different session.
71
+
72
+ **Standalone mode:** if no session exists, you'll be prompted for a brief:
73
+ - Project name
74
+ - One-line description
75
+ - Target audience
76
+ - 3–5 key points
77
+
78
+ ---
79
+
80
+ ## Template Override
81
+
82
+ ViePilot ships stock templates (dark navy/charcoal, ViePilot branded).
83
+ To use your own branded templates for a specific project:
84
+
85
+ ```
86
+ your-project/
87
+ └── .viepilot/
88
+ └── proposal-templates/
89
+ ├── project-proposal.pptx ← overrides stock
90
+ ├── tech-architecture.pptx
91
+ ├── product-pitch.pptx
92
+ ├── general.pptx
93
+ └── project-detail.docx
94
+ ```
95
+
96
+ **Resolution order:**
97
+ 1. `.viepilot/proposal-templates/{type}.pptx` (project-level override)
98
+ 2. `{viepilot-install}/templates/proposal/pptx/{type}.pptx` (ViePilot stock)
99
+
100
+ The override only applies to the project where the file is placed.
101
+
102
+ ---
103
+
104
+ ## Output Structure
105
+
106
+ ```
107
+ docs/proposals/
108
+ ├── my-project-2026-04-11.md # Markdown source of truth
109
+ ├── my-project-2026-04-11.pptx # Presentation
110
+ ├── my-project-2026-04-11.docx # Detailed document
111
+ └── my-project-2026-04-11-slides.txt # Google Slides URL (if --slides)
112
+ ```
113
+
114
+ The `.md` file is the diff-friendly source. The `.pptx` and `.docx` are generated from it and can be regenerated at any time.
115
+
116
+ ---
117
+
118
+ ## Google Slides Export
119
+
120
+ Use the `--slides` flag to automatically upload the generated `.pptx` to Google Slides.
121
+
122
+ ### Setup (one-time)
123
+
124
+ **Step 1: Create a Google Cloud project**
125
+ 1. Go to [console.cloud.google.com](https://console.cloud.google.com)
126
+ 2. Create a new project (or select an existing one)
127
+
128
+ **Step 2: Enable APIs**
129
+ 1. Navigate to **APIs & Services → Library**
130
+ 2. Enable **Google Drive API**
131
+ 3. Enable **Google Slides API**
132
+
133
+ **Step 3: Create a Service Account**
134
+ 1. Go to **APIs & Services → Credentials**
135
+ 2. Click **Create Credentials → Service Account**
136
+ 3. Fill in name (e.g., `viepilot-proposal`)
137
+ 4. Click **Done**
138
+ 5. Click the new service account → **Keys** tab → **Add Key → Create new key (JSON)**
139
+ 6. Save the downloaded JSON file securely (e.g., `~/.config/viepilot-gcp-key.json`)
140
+
141
+ **Step 4: Set environment variable**
142
+ ```bash
143
+ export GOOGLE_APPLICATION_CREDENTIALS=/path/to/your-service-account-key.json
144
+
145
+ # Add to ~/.zshrc or ~/.bashrc to persist:
146
+ echo 'export GOOGLE_APPLICATION_CREDENTIALS=~/.config/viepilot-gcp-key.json' >> ~/.zshrc
147
+ ```
148
+
149
+ **Step 5: Install the optional dependency**
150
+ ```bash
151
+ npm install @googleapis/slides
152
+ ```
153
+
154
+ ### Usage
155
+ ```bash
156
+ /vp-proposal --type product-pitch --slides
157
+ # Output: docs/proposals/my-project-2026-04-11-slides.txt
158
+ # Content: https://docs.google.com/presentation/d/{id}/edit
159
+ ```
160
+
161
+ ### Notes
162
+ - The uploaded presentation retains the `.pptx` layout (converted by Google Drive)
163
+ - Upload failures are non-fatal — the `.pptx`, `.docx`, and `.md` files are always written first
164
+ - The service account needs no special permissions beyond the API scopes
165
+
166
+ ---
167
+
168
+ ## Examples
169
+
170
+ ### Client proposal from brainstorm session
171
+ ```
172
+ /vp-proposal --type project-proposal
173
+ → Auto-loads docs/brainstorm/session-2026-04-11.md
174
+ → Generates 10-slide project proposal
175
+ ```
176
+
177
+ ### Investor pitch standalone
178
+ ```
179
+ /vp-proposal --type product-pitch
180
+ → No session found — prompts for brief
181
+ → Generates 12-slide pitch deck
182
+ ```
183
+
184
+ ### Architecture review with Google Slides
185
+ ```
186
+ /vp-proposal --type tech-architecture --slides
187
+ → Generates 12-slide architecture proposal + uploads to Google Slides
188
+ → Writes URL to docs/proposals/*-slides.txt
189
+ ```
190
+
191
+ ### Preview without writing files
192
+ ```
193
+ /vp-proposal --dry-run
194
+ → Prints JSON slide manifest to console
195
+ → No files written
196
+ ```