the-product-playbook 2.5.2 → 2.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.
Files changed (58) hide show
  1. package/README.es.md +35 -2
  2. package/README.ja.md +35 -2
  3. package/README.ko.md +35 -2
  4. package/README.md +35 -2
  5. package/README.zh-CN.md +35 -2
  6. package/README.zh-TW.md +35 -2
  7. package/i18n/en/references/rules-build.md +19 -0
  8. package/i18n/en/references/rules-commands.md +2 -0
  9. package/i18n/en/references/rules-document-tools.md +126 -0
  10. package/i18n/en/references/rules-end-of-flow.md +17 -6
  11. package/i18n/en/references/rules-export-document.md +346 -0
  12. package/i18n/en/references/rules-file-integration.md +24 -2
  13. package/i18n/en/references/rules-import-document.md +261 -0
  14. package/i18n/es/references/rules-build.md +19 -0
  15. package/i18n/es/references/rules-commands.md +2 -0
  16. package/i18n/es/references/rules-document-tools.md +126 -0
  17. package/i18n/es/references/rules-end-of-flow.md +18 -7
  18. package/i18n/es/references/rules-export-document.md +346 -0
  19. package/i18n/es/references/rules-file-integration.md +24 -2
  20. package/i18n/es/references/rules-import-document.md +261 -0
  21. package/i18n/ja/references/rules-build.md +19 -0
  22. package/i18n/ja/references/rules-commands.md +2 -0
  23. package/i18n/ja/references/rules-document-tools.md +126 -0
  24. package/i18n/ja/references/rules-end-of-flow.md +18 -7
  25. package/i18n/ja/references/rules-export-document.md +346 -0
  26. package/i18n/ja/references/rules-file-integration.md +24 -2
  27. package/i18n/ja/references/rules-import-document.md +261 -0
  28. package/i18n/ko/references/rules-build.md +19 -0
  29. package/i18n/ko/references/rules-commands.md +2 -0
  30. package/i18n/ko/references/rules-document-tools.md +126 -0
  31. package/i18n/ko/references/rules-end-of-flow.md +17 -6
  32. package/i18n/ko/references/rules-export-document.md +346 -0
  33. package/i18n/ko/references/rules-file-integration.md +24 -2
  34. package/i18n/ko/references/rules-import-document.md +261 -0
  35. package/i18n/zh-CN/references/rules-build.md +19 -0
  36. package/i18n/zh-CN/references/rules-commands.md +3 -1
  37. package/i18n/zh-CN/references/rules-document-tools.md +126 -0
  38. package/i18n/zh-CN/references/rules-end-of-flow.md +18 -7
  39. package/i18n/zh-CN/references/rules-export-document.md +346 -0
  40. package/i18n/zh-CN/references/rules-file-integration.md +24 -2
  41. package/i18n/zh-CN/references/rules-import-document.md +261 -0
  42. package/i18n/zh-TW/references/rules-build.md +19 -0
  43. package/i18n/zh-TW/references/rules-commands.md +2 -0
  44. package/i18n/zh-TW/references/rules-document-tools.md +126 -0
  45. package/i18n/zh-TW/references/rules-end-of-flow.md +17 -6
  46. package/i18n/zh-TW/references/rules-export-document.md +346 -0
  47. package/i18n/zh-TW/references/rules-file-integration.md +24 -2
  48. package/i18n/zh-TW/references/rules-import-document.md +261 -0
  49. package/package.json +1 -1
  50. package/references/rules-build.md +19 -0
  51. package/references/rules-commands.md +85 -83
  52. package/references/rules-document-tools.md +126 -0
  53. package/references/rules-end-of-flow.md +71 -60
  54. package/references/rules-export-document.md +346 -0
  55. package/references/rules-file-integration.md +65 -43
  56. package/references/rules-import-document.md +261 -0
  57. package/references/templates/prd-style.css +464 -0
  58. package/references/templates/report-style.css +114 -0
package/README.es.md CHANGED
@@ -24,7 +24,8 @@ The Product Playbook es un **Skill de Claude AI** que te guía sistemáticamente
24
24
  - 🔄 **Motor de propagación de cambios** — modifica cualquier paso y todos los outputs downstream se actualizan automáticamente
25
25
  - 📎 **Integración inteligente de archivos** — sube datos, capturas de pantalla o documentos; la IA los integra automáticamente en el paso relevante
26
26
  - 🔗 **Handoff de desarrollo** — genera CLAUDE.md + TASKS.md + TICKETS.md para un handoff fluido al desarrollo en Claude Code
27
- - 📊 **Output multi-formato** — reportes HTML, PRDs, presentaciones PowerPoint, paquetes de handoff de desarrollo
27
+ - 📊 **Output multi-formato** — PDF (con marcadores), reportes HTML, documentos Word, presentaciones PowerPoint, paquetes de handoff de desarrollo
28
+ - 📄 **Importación inteligente de documentos** — análisis de PDF en tres capas (extracción de texto → Claude Vision → OCR como respaldo), soporte DOCX/PPTX
28
29
 
29
30
  **Activa todo el flujo con una sola oración:**
30
31
 
@@ -153,7 +154,13 @@ the-product-playbook/
153
154
  ├── 07-dev-handoff.md # Handoff de desarrollo: CLAUDE.md + TASKS.md + Arquitectura
154
155
  ├── 08-security-checklist.md # OWASP Top 10 + CORS + CSP + Arquitectura de seguridad
155
156
  ├── rules-context.md # Reglas de acumulación de contexto de producto cross-sesión
156
- └── rules-*.md # Reglas de pasos por modo + reglas de progreso/cambio/integración de archivos
157
+ ├── rules-document-tools.md # Gestión de dependencias de herramientas de conversión de documentos
158
+ ├── rules-import-document.md # Análisis de PDF en tres capas + importación DOCX/PPTX
159
+ ├── rules-export-document.md # Exportación multi-formato (PDF/DOCX/PPTX)
160
+ ├── rules-*.md # Reglas de pasos por modo + reglas de progreso/cambio/integración de archivos
161
+ └── templates/
162
+ ├── prd-style.css # CSS profesional de grado impresión para exportación PDF
163
+ └── report-style.css # CSS de optimización de impresión para reporte HTML → PDF
157
164
  ```
158
165
 
159
166
  ---
@@ -261,6 +268,28 @@ Genera un paquete completo de handoff de desarrollo e inicia desarrollo en Claud
261
268
  > Por favor lee CLAUDE.md y TASKS.md, comienza ejecutando la Fase 0
262
269
  ```
263
270
 
271
+ ### 📄 Importación y Exportación de Documentos
272
+
273
+ **Importa** cualquier documento existente al flujo de planificación — sin copiar y pegar manualmente:
274
+
275
+ ```
276
+ PDF (digital) → extracción de texto pymupdf (instantáneo, gratuito)
277
+ PDF (vectorial/escaneo) → análisis semántico Claude Vision (mejor calidad)
278
+ PDF (respaldo) → Tesseract OCR (funciona offline)
279
+ DOCX / PPTX → conversión Pandoc
280
+ ```
281
+
282
+ **Exporta** outputs de planificación a formatos profesionales:
283
+
284
+ ```
285
+ /export pdf → renderizado Playwright + marcadores pikepdf (CJK perfecto)
286
+ /export docx → Pandoc + plantilla de referencia
287
+ /export pptx → generación de diapositivas Pandoc
288
+ /export html → reporte HTML interactivo (existente)
289
+ ```
290
+
291
+ > **¿Por qué PDF via Playwright?** WeasyPrint produce texto CJK ilegible. Playwright (Chromium) renderiza perfectamente — verificado en producción con documentos en chino tradicional.
292
+
264
293
  ### 🔥 Planifica Directamente sobre Sistemas Existentes (Funcionalidad Estrella del Modo Build)
265
294
 
266
295
  Lanza el **Modo Build** dentro de un directorio de proyecto existente — Claude Code lee tu codebase mientras hace planificación de producto, fusionando efectivamente **planificación de producto** y **evaluación de factibilidad técnica** en un solo flujo:
@@ -407,6 +436,10 @@ cp -r the-product-playbook/commands/* ~/.claude/commands/
407
436
  - `Generar PRD` — entrega de ingeniería (incluye diagramas de flujo + DB Schema + wireframes)
408
437
  - `Generar presentación` — presentación PowerPoint
409
438
  - `Iniciar desarrollo` — paquete de handoff de desarrollo (CLAUDE.md + TASKS.md)
439
+ - `/export pdf` — exportar como PDF con tipografía profesional, portada, índice y marcadores
440
+ - `/export docx` — exportar como documento Word
441
+ - `/export pptx` — exportar como diapositivas PowerPoint
442
+ - `/parse [file]` — analizar un PDF/DOCX/PPTX en Markdown para uso en planificación
410
443
 
411
444
  #### Comandos de Análisis
412
445
  - `Ejecutar evaluación de completitud` — evaluar cobertura de planificación
package/README.ja.md CHANGED
@@ -24,7 +24,8 @@ The Product Playbookは、ゼロから一まで体系的にプロダクト企画
24
24
  - 🔄 **変更伝播エンジン** — 任意のステップを修正すると下流の全出力が自動更新
25
25
  - 📎 **スマートファイル統合** — データ、スクリーンショット、ドキュメントをアップロードするとAIが関連ステップに自動統合
26
26
  - 🔗 **開発ハンドオフ** — CLAUDE.md + TASKS.md + TICKETS.mdを生成してClaude Code開発にシームレスに接続
27
- - 📊 **マルチフォーマット出力** — HTMLレポート、PRD、PowerPointデッキ、開発ハンドオフパッケージ
27
+ - 📊 **マルチフォーマット出力** — PDF(ブックマーク付き)、HTMLレポート、Wordドキュメント、PowerPointデッキ、開発ハンドオフパッケージ
28
+ - 📄 **スマートドキュメントインポート** — 三層PDFパース(テキスト抽出 → Claude Vision → OCRフォールバック)、DOCX/PPTXサポート
28
29
 
29
30
  **一文でフロー全体をトリガー:**
30
31
 
@@ -154,7 +155,13 @@ the-product-playbook/
154
155
  ├── 07-dev-handoff.md # 開発ハンドオフ:CLAUDE.md + TASKS.md + アーキテクチャ
155
156
  ├── 08-security-checklist.md # OWASP Top 10 + CORS + CSP + セキュリティアーキテクチャ
156
157
  ├── rules-context.md # クロスセッションプロダクトコンテキスト蓄積ルール
157
- └── rules-*.md # モードステップルール + 進捗/変更/ファイル統合ルール
158
+ ├── rules-document-tools.md # ドキュメント変換ツール依存管理
159
+ ├── rules-import-document.md # 三層PDFパース + DOCX/PPTXインポート
160
+ ├── rules-export-document.md # マルチフォーマットエクスポート(PDF/DOCX/PPTX)
161
+ ├── rules-*.md # モードステップルール + 進捗/変更/ファイル統合ルール
162
+ └── templates/
163
+ ├── prd-style.css # プロフェッショナル印刷グレードCSS(PDFエクスポート用)
164
+ └── report-style.css # 印刷最適化CSS(HTMLレポート → PDF)
158
165
  ```
159
166
 
160
167
  ---
@@ -262,6 +269,28 @@ MVPを修正 → User Stories、DBスキーマ、プロダクトスペックサ
262
269
  > CLAUDE.mdとTASKS.mdを読んで、Phase 0の実行を開始してください
263
270
  ```
264
271
 
272
+ ### 📄 ドキュメントインポート&エクスポート
273
+
274
+ **インポート** — 既存のドキュメントを企画フローに直接取り込み、手動コピペ不要:
275
+
276
+ ```
277
+ PDF(デジタル) → pymupdfテキスト抽出(即座、無料)
278
+ PDF(ベクター/スキャン) → Claude Visionセマンティックパース(最高品質)
279
+ PDF(フォールバック) → Tesseract OCR(オフライン対応)
280
+ DOCX / PPTX → Pandoc変換
281
+ ```
282
+
283
+ **エクスポート** — 企画アウトプットをプロフェッショナルなフォーマットに:
284
+
285
+ ```
286
+ /export pdf → Playwrightレンダリング + pikepdfブックマーク(CJK完全対応)
287
+ /export docx → Pandoc + リファレンステンプレート
288
+ /export pptx → Pandocスライド生成
289
+ /export html → インタラクティブHTMLレポート(既存)
290
+ ```
291
+
292
+ > **なぜPlaywrightでPDF?** WeasyPrintはCJKテキストが文字化けします。Playwright(Chromium)は完璧にレンダリング — 繁體中文ドキュメントで本番環境検証済み。
293
+
265
294
  ### 🔥 既存システム上で直接企画(ビルドモードのキラー機能)
266
295
 
267
296
  既存プロジェクトディレクトリ内で**ビルドモード**を起動 — Claude Codeがコードベースを読みながらプロダクト企画を行い、**プロダクト企画**と**技術的実現可能性評価**を単一フローに統合:
@@ -408,6 +437,10 @@ cp -r the-product-playbook/commands/* ~/.claude/commands/
408
437
  - `PRDを生成` — エンジニアリングハンドオフ(フローチャート + DBスキーマ + ワイヤーフレーム付き)
409
438
  - `プレゼンを生成` — PowerPointプレゼンテーション
410
439
  - `開発を始めて` — 開発ハンドオフパッケージ(CLAUDE.md + TASKS.md)
440
+ - `/export pdf` — プロフェッショナルなタイポグラフィ、表紙、目次、ブックマーク付きPDFとしてエクスポート
441
+ - `/export docx` — Wordドキュメントとしてエクスポート
442
+ - `/export pptx` — PowerPointスライドとしてエクスポート
443
+ - `/parse [file]` — PDF/DOCX/PPTXをMarkdownにパースして企画に利用
411
444
 
412
445
  #### 分析コマンド
413
446
  - `完成度チェックを実行` — 企画カバレッジの評価
package/README.ko.md CHANGED
@@ -24,7 +24,8 @@ The Product Playbook은 제로부터 원까지 제품 기획 전 과정을 체
24
24
  - 🔄 **변경 전파 엔진** — 어떤 단계든 수정하면 모든 하위 산출물이 자동 업데이트
25
25
  - 📎 **스마트 파일 통합** — 데이터, 스크린샷, 문서를 업로드하면 AI가 해당 단계에 자동 통합
26
26
  - 🔗 **개발 핸드오프** — CLAUDE.md + TASKS.md + TICKETS.md를 생성하여 Claude Code 개발로 원활하게 연결
27
- - 📊 **다중 형식 출력** — HTML 보고서, PRD, PowerPoint 덱, 개발 핸드오프 패키지
27
+ - 📊 **다중 형식 출력** — PDF(북마크 포함), HTML 보고서, Word 문서, PowerPoint 덱, 개발 핸드오프 패키지
28
+ - 📄 **스마트 문서 가져오기** — 3단계 PDF 파싱(텍스트 추출 → Claude Vision → OCR 폴백), DOCX/PPTX 지원
28
29
 
29
30
  **한 문장으로 전체 플로우를 트리거하세요:**
30
31
 
@@ -153,7 +154,13 @@ the-product-playbook/
153
154
  ├── 07-dev-handoff.md # 개발 핸드오프: CLAUDE.md + TASKS.md + Architecture
154
155
  ├── 08-security-checklist.md # OWASP Top 10 + CORS + CSP + 보안 아키텍처
155
156
  ├── rules-context.md # 세션 간 제품 컨텍스트 축적 규칙
156
- └── rules-*.md # 모드 단계 규칙 + 진행/변경/파일 통합 규칙
157
+ ├── rules-document-tools.md # 문서 변환 도구 의존성 관리
158
+ ├── rules-import-document.md # 3단계 PDF 파싱 + DOCX/PPTX 가져오기
159
+ ├── rules-export-document.md # 다중 형식 내보내기(PDF/DOCX/PPTX)
160
+ ├── rules-*.md # 모드 단계 규칙 + 진행/변경/파일 통합 규칙
161
+ └── templates/
162
+ ├── prd-style.css # 전문 인쇄 등급 CSS(PDF 내보내기용)
163
+ └── report-style.css # 인쇄 최적화 CSS(HTML 보고서 → PDF)
157
164
  ```
158
165
 
159
166
  ---
@@ -261,6 +268,28 @@ MVP 수정 → User Stories, DB Schema, 제품 스펙 요약 자동 업데이
261
268
  > CLAUDE.md와 TASKS.md를 읽고, Phase 0 실행 시작
262
269
  ```
263
270
 
271
+ ### 📄 문서 가져오기 및 내보내기
272
+
273
+ **가져오기** — 기존 문서를 기획 플로우에 직접 투입, 수동 복사 붙여넣기 불필요:
274
+
275
+ ```
276
+ PDF (디지털) → pymupdf 텍스트 추출 (즉시, 무료)
277
+ PDF (벡터/스캔) → Claude Vision 시맨틱 파싱 (최고 품질)
278
+ PDF (폴백) → Tesseract OCR (오프라인 가능)
279
+ DOCX / PPTX → Pandoc 변환
280
+ ```
281
+
282
+ **내보내기** — 기획 산출물을 전문적 형식으로:
283
+
284
+ ```
285
+ /export pdf → Playwright 렌더링 + pikepdf 북마크 (CJK 완벽 지원)
286
+ /export docx → Pandoc + 참조 템플릿
287
+ /export pptx → Pandoc 슬라이드 생성
288
+ /export html → 인터랙티브 HTML 보고서 (기존)
289
+ ```
290
+
291
+ > **왜 Playwright로 PDF를?** WeasyPrint은 CJK 텍스트가 깨집니다. Playwright(Chromium)는 완벽하게 렌더링됩니다 — 번체 중국어 문서로 프로덕션 환경에서 검증 완료.
292
+
264
293
  ### 🔥 기존 시스템 위에서 바로 기획 (빌드 모드 킬러 피처)
265
294
 
266
295
  기존 프로젝트 디렉토리에서 **빌드 모드**를 실행하면 — Claude Code가 코드베이스를 읽으면서 제품 기획을 수행하여, **제품 기획**과 **기술 실현 가능성 평가**를 단일 플로우로 병합합니다:
@@ -407,6 +436,10 @@ cp -r the-product-playbook/commands/* ~/.claude/commands/
407
436
  - `PRD 생성` — 엔지니어링 핸드오프 (플로우차트 + DB Schema + 와이어프레임 포함)
408
437
  - `덱 생성` — PowerPoint 프레젠테이션
409
438
  - `개발 시작` — 개발 핸드오프 패키지 (CLAUDE.md + TASKS.md)
439
+ - `/export pdf` — 전문 타이포그래피, 표지, 목차 및 북마크가 포함된 PDF로 내보내기
440
+ - `/export docx` — Word 문서로 내보내기
441
+ - `/export pptx` — PowerPoint 슬라이드로 내보내기
442
+ - `/parse [file]` — PDF/DOCX/PPTX를 Markdown으로 파싱하여 기획에 활용
410
443
 
411
444
  #### 분석 명령
412
445
  - `완성도 점검 해 주세요` — 기획 커버리지 평가
package/README.md CHANGED
@@ -24,7 +24,8 @@ The Product Playbook is a **Claude AI Skill** that systematically guides you thr
24
24
  - 🔄 **Change propagation engine** — modify any step and all downstream outputs update automatically
25
25
  - 📎 **Smart file integration** — upload data, screenshots, or documents; the AI automatically integrates them into the relevant step
26
26
  - 🔗 **Dev handoff** — generates CLAUDE.md + TASKS.md + TICKETS.md for seamless handoff to Claude Code development
27
- - 📊 **Multi-format output** — HTML reports, PRDs, PowerPoint decks, dev handoff packages
27
+ - 📊 **Multi-format output** — PDF (with bookmarks), HTML reports, Word docs, PowerPoint decks, dev handoff packages
28
+ - 📄 **Smart document import** — three-layer PDF parsing (text extraction → Claude Vision → OCR fallback), DOCX/PPTX support
28
29
 
29
30
  **Trigger the entire flow with a single sentence:**
30
31
 
@@ -153,7 +154,13 @@ the-product-playbook/
153
154
  ├── 07-dev-handoff.md # Dev handoff: CLAUDE.md + TASKS.md + Architecture
154
155
  ├── 08-security-checklist.md # OWASP Top 10 + CORS + CSP + Security architecture
155
156
  ├── rules-context.md # Cross-session product context accumulation rules
156
- └── rules-*.md # Mode step rules + progress/change/file integration rules
157
+ ├── rules-document-tools.md # Document conversion tool dependency management
158
+ ├── rules-import-document.md # Three-layer PDF parsing + DOCX/PPTX import
159
+ ├── rules-export-document.md # Multi-format export (PDF/DOCX/PPTX)
160
+ ├── rules-*.md # Mode step rules + progress/change/file integration rules
161
+ └── templates/
162
+ ├── prd-style.css # Professional print-grade CSS for PDF export
163
+ └── report-style.css # Print optimization CSS for HTML report → PDF
157
164
  ```
158
165
 
159
166
  ---
@@ -261,6 +268,28 @@ Generate a complete dev handoff package and kick off Claude Code development wit
261
268
  > Please read CLAUDE.md and TASKS.md, start executing Phase 0
262
269
  ```
263
270
 
271
+ ### 📄 Document Import & Export
272
+
273
+ **Import** any existing document into the planning flow — no manual copy-paste:
274
+
275
+ ```
276
+ PDF (digital) → pymupdf text extraction (instant, free)
277
+ PDF (vector/scan) → Claude Vision semantic parsing (best quality)
278
+ PDF (fallback) → Tesseract OCR (offline capable)
279
+ DOCX / PPTX → Pandoc conversion
280
+ ```
281
+
282
+ **Export** planning outputs to professional formats:
283
+
284
+ ```
285
+ /export pdf → Playwright rendering + pikepdf bookmarks (CJK-perfect)
286
+ /export docx → Pandoc + reference template
287
+ /export pptx → Pandoc slide generation
288
+ /export html → Interactive HTML report (existing)
289
+ ```
290
+
291
+ > **Why PDF via Playwright?** WeasyPrint produces garbled CJK text. Playwright (Chromium) renders perfectly — verified in production with Traditional Chinese documents.
292
+
264
293
  ### 🔥 Plan Directly on Existing Systems (Build Mode Killer Feature)
265
294
 
266
295
  Launch **Build Mode** inside an existing project directory — Claude Code reads your codebase while doing product planning, effectively merging **product planning** and **technical feasibility assessment** into a single flow:
@@ -407,6 +436,10 @@ cp -r the-product-playbook/commands/* ~/.claude/commands/
407
436
  - `Generate PRD` — engineering handoff (includes flowcharts + DB Schema + wireframes)
408
437
  - `Generate deck` — PowerPoint presentation
409
438
  - `Start development` — dev handoff package (CLAUDE.md + TASKS.md)
439
+ - `/export pdf` — export as PDF with professional typography, cover page, TOC, and bookmarks
440
+ - `/export docx` — export as Word document
441
+ - `/export pptx` — export as PowerPoint slides
442
+ - `/parse [file]` — parse a PDF/DOCX/PPTX into Markdown for planning use
410
443
 
411
444
  #### Analysis Commands
412
445
  - `Run a completeness check` — assess planning coverage
package/README.zh-CN.md CHANGED
@@ -24,7 +24,8 @@ The Product Playbook 是一个 **Claude AI Skill**,能够系统性地引导你
24
24
  - 🔄 **变更传播引擎** — 修改任何步骤,自动更新所有下游产出
25
25
  - 📎 **文件智慧整合** — 上传数据、截图、文件,AI 自动整合到对应步骤
26
26
  - 🔗 **开发衔接** — 产出 CLAUDE.md + TASKS.md + TICKETS.md,无缝衔接 Claude Code 开发
27
- - 📊 **多格式产出** — HTML 报告、PRD、PowerPoint、开发交接包
27
+ - 📊 **多格式产出** — PDF(含书签)、HTML 报告、Word 文档、PowerPoint、开发交接包
28
+ - 📄 **智慧文档导入** — 三层 PDF 解析(文字提取 → Claude Vision → OCR 兜底)、DOCX/PPTX 支持
28
29
 
29
30
  **用一句话触发整个流程:**
30
31
 
@@ -153,7 +154,13 @@ the-product-playbook/
153
154
  ├── 07-dev-handoff.md # 开发衔接:CLAUDE.md + TASKS.md + 架构
154
155
  ├── 08-security-checklist.md # OWASP Top 10 + CORS + CSP + 安全架构
155
156
  ├── rules-context.md # 跨 Session 产品上下文累积规则
156
- └── rules-*.md # 各模式步骤规则 + 进度/变更/文件整合规则
157
+ ├── rules-document-tools.md # 文档转换工具依赖管理
158
+ ├── rules-import-document.md # 三层 PDF 解析 + DOCX/PPTX 导入
159
+ ├── rules-export-document.md # 多格式导出(PDF/DOCX/PPTX)
160
+ ├── rules-*.md # 各模式步骤规则 + 进度/变更/文件整合规则
161
+ └── templates/
162
+ ├── prd-style.css # 专业印刷级 CSS(PDF 导出用)
163
+ └── report-style.css # 打印优化 CSS(HTML 报告 → PDF)
157
164
  ```
158
165
 
159
166
  ---
@@ -261,6 +268,28 @@ the-product-playbook/
261
268
  > 请读取 CLAUDE.md 和 TASKS.md,开始执行 Phase 0
262
269
  ```
263
270
 
271
+ ### 📄 文档导入与导出
272
+
273
+ **导入**任何现有文档到规划流程中 — 无需手动复制粘贴:
274
+
275
+ ```
276
+ PDF(数字版) → pymupdf 文字提取(即时、免费)
277
+ PDF(矢量/扫描) → Claude Vision 语义解析(最佳品质)
278
+ PDF(兜底) → Tesseract OCR(可离线使用)
279
+ DOCX / PPTX → Pandoc 转换
280
+ ```
281
+
282
+ **导出**规划成果为专业格式:
283
+
284
+ ```
285
+ /export pdf → Playwright 渲染 + pikepdf 书签(CJK 完美支持)
286
+ /export docx → Pandoc + 参考模板
287
+ /export pptx → Pandoc 幻灯片生成
288
+ /export html → 交互式 HTML 报告(既有功能)
289
+ ```
290
+
291
+ > **为什么用 Playwright 输出 PDF?** WeasyPrint 会产生 CJK 乱码。Playwright(Chromium)渲染完美 — 已在生产环境以繁体中文文档验证。
292
+
264
293
  ### 🔥 既有系统直接规划(Build 模式杀手级用法)
265
294
 
266
295
  在既有专案目录中启动 **直接实作模式**,Claude Code 会一边读取你的 codebase 一边做产品规划 — 等于把**产品规划**和**技术可行性评估**合在同一个流程里完成:
@@ -407,6 +436,10 @@ cp -r the-product-playbook/commands/* ~/.claude/commands/
407
436
  - `产出 PRD` — 工程师交付包(含流程图 + DB Schema + Wireframe)
408
437
  - `产出简报` — PowerPoint 简报
409
438
  - `进入开发` — 开发交接包(CLAUDE.md + TASKS.md)
439
+ - `/export pdf` — 导出为 PDF,含专业排版、封面、目录及书签
440
+ - `/export docx` — 导出为 Word 文档
441
+ - `/export pptx` — 导出为 PowerPoint 演示文稿
442
+ - `/parse [file]` — 解析 PDF/DOCX/PPTX 为 Markdown 以供规划使用
410
443
 
411
444
  #### 分析指令
412
445
  - `帮我做完整性评估` — 评估规划完整度
package/README.zh-TW.md CHANGED
@@ -24,7 +24,8 @@ The Product Playbook 是一個 **Claude AI Skill**,能夠系統性地引導你
24
24
  - 🔄 **變更傳播引擎** — 修改任何步驟,自動更新所有下游產出
25
25
  - 📎 **檔案智慧整合** — 上傳數據、截圖、文件,AI 自動整合到對應步驟
26
26
  - 🔗 **開發銜接** — 產出 CLAUDE.md + TASKS.md + TICKETS.md,無縫銜接 Claude Code 開發
27
- - 📊 **多格式產出** — HTML 報告、PRD、PowerPoint、開發交接包
27
+ - 📊 **多格式產出** — PDF(含書籤)、HTML 報告、Word 文件、PowerPoint、開發交接包
28
+ - 📄 **智慧文件匯入** — 三層 PDF 解析(文字擷取 → Claude Vision → OCR 備援)、DOCX/PPTX 支援
28
29
 
29
30
  **用一句話觸發整個流程:**
30
31
 
@@ -153,7 +154,13 @@ the-product-playbook/
153
154
  ├── 07-dev-handoff.md # 開發銜接:CLAUDE.md + TASKS.md + 架構
154
155
  ├── 08-security-checklist.md # OWASP Top 10 + CORS + CSP + 安全架構
155
156
  ├── rules-context.md # 跨 Session 產品上下文累積規則
156
- └── rules-*.md # 各模式步驟規則 + 進度/變更/檔案整合規則
157
+ ├── rules-document-tools.md # 文件轉換工具依賴管理
158
+ ├── rules-import-document.md # 三層 PDF 解析 + DOCX/PPTX 匯入
159
+ ├── rules-export-document.md # 多格式匯出(PDF/DOCX/PPTX)
160
+ ├── rules-*.md # 各模式步驟規則 + 進度/變更/檔案整合規則
161
+ └── templates/
162
+ ├── prd-style.css # 專業印刷級 CSS(PDF 匯出用)
163
+ └── report-style.css # 列印最佳化 CSS(HTML 報告 → PDF)
157
164
  ```
158
165
 
159
166
  ---
@@ -261,6 +268,28 @@ the-product-playbook/
261
268
  > 請讀取 CLAUDE.md 和 TASKS.md,開始執行 Phase 0
262
269
  ```
263
270
 
271
+ ### 📄 文件匯入與匯出
272
+
273
+ **匯入**任何現有文件到規劃流程中 — 無需手動複製貼上:
274
+
275
+ ```
276
+ PDF(數位) → pymupdf 文字擷取(即時、免費)
277
+ PDF(向量/掃描) → Claude Vision 語意解析(最佳品質)
278
+ PDF(備援) → Tesseract OCR(可離線使用)
279
+ DOCX / PPTX → Pandoc 轉換
280
+ ```
281
+
282
+ **匯出**規劃成果為專業格式:
283
+
284
+ ```
285
+ /export pdf → Playwright 渲染 + pikepdf 書籤(CJK 完美支援)
286
+ /export docx → Pandoc + 參考模板
287
+ /export pptx → Pandoc 投影片生成
288
+ /export html → 互動式 HTML 報告(既有功能)
289
+ ```
290
+
291
+ > **為什麼用 Playwright 輸出 PDF?** WeasyPrint 會產生 CJK 亂碼。Playwright(Chromium)渲染完美 — 已在正式環境以繁體中文文件驗證。
292
+
264
293
  ### 🔥 既有系統直接規劃(Build 模式殺手級用法)
265
294
 
266
295
  在既有專案目錄中啟動 **直接實作模式**,Claude Code 會一邊讀取你的 codebase 一邊做產品規劃 — 等於把**產品規劃**和**技術可行性評估**合在同一個流程裡完成:
@@ -407,6 +436,10 @@ cp -r the-product-playbook/commands/* ~/.claude/commands/
407
436
  - `產出 PRD` — 工程師交付包(含流程圖 + DB Schema + Wireframe)
408
437
  - `產出簡報` — PowerPoint 簡報
409
438
  - `進入開發` — 開發交接包(CLAUDE.md + TASKS.md)
439
+ - `/export pdf` — 匯出為 PDF,含專業排版、封面、目錄及書籤
440
+ - `/export docx` — 匯出為 Word 文件
441
+ - `/export pptx` — 匯出為 PowerPoint 簡報
442
+ - `/parse [file]` — 解析 PDF/DOCX/PPTX 為 Markdown 以供規劃使用
410
443
 
411
444
  #### 分析指令
412
445
  - `幫我做完整性評估` — 評估規劃完整度
@@ -121,6 +121,25 @@ Rationale: [Comprehensive judgment based on impact scope, complexity, and risk]
121
121
 
122
122
  **Feature development spec**: Problem statement → Selected solution + rationale → Impact scope → Execution scope + acceptance criteria → Risk list
123
123
 
124
+ ### Incremental Document Output (when source document is available)
125
+
126
+ If the user uploaded a source document (PRD, spec, etc.) during the process:
127
+
128
+ 1. **Incremental version** (default when source document exists):
129
+ - Insert/modify sections in the original document structure
130
+ - Maintain the original file's format, style, and naming conventions
131
+ - New content marked with `[NEW]`
132
+ - Modified content marked with `[UPDATED]` with original preserved as reference
133
+ - Sections unrelated to the new feature remain completely untouched
134
+
135
+ 2. **Standalone version** (when no source document):
136
+ - Use the standard Feature development spec format (as defined above)
137
+
138
+ 3. **Ask the user before generating**:
139
+ "I detected that you uploaded a [document type]. How would you like the output?
140
+ A) Incremental update on the original document (recommended)
141
+ B) Standalone feature development spec"
142
+
124
143
  ### Reference Loading Instructions
125
144
 
126
145
  | Step | Reference File |
@@ -88,5 +88,7 @@ When the user says "skip user research," "problem is already known," "go straigh
88
88
  | `"Pause"` / `"Save"` / `"Do something else first"` | Save progress per `references/rules-progress.md` |
89
89
  | `"Continue"` / `"Back to planning"` | Resume per `references/rules-progress.md` |
90
90
  | `"Clear progress"` / `"Start over"` | Delete progress file and start from scratch |
91
+ | `/export [format]` | Export to specified format. format = `pdf` / `docx` / `pptx` / `html` / `md`. Read `references/rules-export-document.md`. On first use, load `references/rules-document-tools.md` first to check tools. |
92
+ | `/parse [file]` | Parse an uploaded document to Markdown. Supports PDF / DOCX / PPTX / images. Read `references/rules-import-document.md`. On first use, load `references/rules-document-tools.md` first to check tools. |
91
93
 
92
94
  **Context-aware command hints**: After each step is completed, proactively suggest 2-3 of the most relevant available commands based on the current progress.
@@ -0,0 +1,126 @@
1
+ # Document Conversion Tool Dependency Management
2
+
3
+ > Loaded on first trigger of `/export` or `/parse` command.
4
+
5
+ ## Dependency Tiers
6
+
7
+ | Tier | Tool | Purpose | Installation | Size |
8
+ |------|------|---------|-------------|------|
9
+ | **Core (Zero Install)** | Claude Read tool (Vision) | PDF semantic parsing | Built-in | 0 |
10
+ | **Core (Zero Install)** | Playwright MCP | PDF rendering | Built-in | 0 |
11
+ | **Basic** | pymupdf (fitz) | PDF text extraction + image rendering | `pip3 install --break-system-packages pymupdf` | ~23MB |
12
+ | **Basic** | pikepdf | PDF bookmark injection + metadata | `pip3 install --break-system-packages pikepdf` | ~5MB |
13
+ | **Extended** | pandoc | DOCX / PPTX conversion | `brew install pandoc` | ~50MB |
14
+ | **Fallback** | tesseract + chi_tra | Offline OCR (when Vision is unavailable) | `brew install tesseract tesseract-lang` | ~150MB |
15
+ | **Advanced** | python-docx | High-quality DOCX output | `pip3 install --break-system-packages python-docx` | ~5MB |
16
+
17
+ ## Startup Detection Flow
18
+
19
+ When the user first triggers a document conversion feature, detect and install as needed in the following order:
20
+
21
+ ### Step 1: Determine Which Tools Are Needed
22
+
23
+ | User Action | Required Tools |
24
+ |-------------|---------------|
25
+ | `/export pdf` | pymupdf + pikepdf + Playwright MCP |
26
+ | `/export docx` or `/export pptx` | pandoc |
27
+ | `/parse [PDF file]` | pymupdf (+ Claude Vision or tesseract) |
28
+ | `/parse [DOCX/PPTX file]` | pandoc |
29
+
30
+ ### Step 2: Detect Installed Tools
31
+
32
+ Run the following Bash commands (silent detection, no output displayed):
33
+
34
+ ```bash
35
+ # pymupdf
36
+ python3 -c "import fitz; print(fitz.version)" 2>/dev/null && echo "pymupdf: OK" || echo "pymupdf: MISSING"
37
+
38
+ # pikepdf
39
+ python3 -c "import pikepdf; print(pikepdf.__version__)" 2>/dev/null && echo "pikepdf: OK" || echo "pikepdf: MISSING"
40
+
41
+ # pandoc
42
+ which pandoc >/dev/null 2>&1 && echo "pandoc: OK" || echo "pandoc: MISSING"
43
+
44
+ # tesseract (only detect when explicitly needed)
45
+ which tesseract >/dev/null 2>&1 && tesseract --list-langs 2>&1 | grep -q chi_tra && echo "tesseract: OK" || echo "tesseract: MISSING"
46
+ ```
47
+
48
+ ### Step 3: Auto-Install Missing Tools
49
+
50
+ If missing tools are detected, display the following message and install automatically:
51
+
52
+ ```
53
+ 📦 Document conversion requires the following tools:
54
+ ☐ [Tool name] ([purpose], [size])
55
+ ...
56
+ Installing, please wait...
57
+ ```
58
+
59
+ Run installation commands in sequence:
60
+
61
+ ```bash
62
+ # pymupdf + pikepdf (install together)
63
+ pip3 install --break-system-packages pymupdf pikepdf
64
+
65
+ # pandoc
66
+ brew install pandoc
67
+
68
+ # tesseract (only when offline OCR is needed)
69
+ brew install tesseract tesseract-lang
70
+ ```
71
+
72
+ After installation completes, display:
73
+ ```
74
+ ✅ Tool installation complete, continuing...
75
+ ```
76
+
77
+ ### Step 4: Detect Playwright MCP
78
+
79
+ Playwright MCP is a core dependency for PDF rendering. Detection method:
80
+
81
+ 1. Attempt to call `mcp__plugin_playwright_playwright__browser_run_code`
82
+ 2. If MCP is available → use normally
83
+ 3. If MCP is unavailable (not connected) → display:
84
+
85
+ ```
86
+ ⚠️ Playwright MCP is not connected. PDF rendering requires the Playwright browser.
87
+ Please do one of the following:
88
+ 1. Start Playwright MCP (recommended)
89
+ 2. Or run ! npx playwright install chromium to install local Chromium
90
+ ```
91
+
92
+ **Playwright Fallback** (when MCP is unavailable):
93
+
94
+ If the user has installed local Chromium, use Bash to run a Node.js script for PDF rendering:
95
+ ```bash
96
+ node -e "
97
+ const { chromium } = require('playwright');
98
+ (async () => {
99
+ const browser = await chromium.launch();
100
+ const page = await browser.newPage();
101
+ await page.setContent(require('fs').readFileSync('/tmp/export.html', 'utf8'));
102
+ await page.pdf({ path: '${OUTPUT_PATH}', format: 'A4', printBackground: true,
103
+ margin: { top: '1.8cm', bottom: '1.8cm', left: '2cm', right: '2cm' } });
104
+ await browser.close();
105
+ })();
106
+ "
107
+ ```
108
+
109
+ ## Tool State Cache
110
+
111
+ First detection results are recorded in memory (to avoid repeated detection):
112
+ - Within the same conversation session, confirmed installed tools are not re-detected
113
+ - If installation fails, record the error message and retry on the next trigger
114
+
115
+ ## Platform Compatibility
116
+
117
+ | Platform | pymupdf | pikepdf | pandoc | tesseract | Playwright |
118
+ |----------|---------|---------|--------|-----------|------------|
119
+ | macOS (Homebrew) | ✅ pip3 | ✅ pip3 | ✅ brew | ✅ brew | ✅ MCP/npx |
120
+ | Linux (apt) | ✅ pip3 | ✅ pip3 | ✅ apt | ✅ apt | ✅ MCP/npx |
121
+ | Windows (WSL) | ✅ pip3 | ✅ pip3 | ✅ choco | ✅ choco | ✅ MCP/npx |
122
+
123
+ Automatically select the corresponding package manager based on the user's operating system. Detection method:
124
+ ```bash
125
+ [[ "$(uname)" == "Darwin" ]] && echo "macOS" || echo "Linux"
126
+ ```
@@ -70,18 +70,29 @@ After completing the final integrated output, proactively ask:
70
70
  ```
71
71
  "The planning content has been fully integrated! Would you like me to generate any of the following documents?
72
72
 
73
- HTML planning report (suitable for sharing with everyone)
73
+ Updated [document type] (incremental update based on your uploaded source document) ← only show this option when a source document was uploaded
74
+ □ PDF document (professional layout with bookmark navigation, suitable for formal sharing)
75
+ □ HTML planning report (interactive, suitable for online sharing)
76
+ □ Word document (suitable for collaborative editing)
74
77
  □ PRD engineer delivery package (includes flowchart, DB schema, UI wireframe)
75
- PowerPoint presentation (suitable for meeting presentations)
78
+ Presentation PPTX (suitable for meeting reports, recommend polishing with Keynote / PowerPoint after export)
76
79
  □ Dev handoff package (CLAUDE.md + TASKS.md + TICKETS.md + technical architecture — ready to start development in Claude Code)
77
80
  □ All of the above
78
81
 
79
- You can also say 'No thanks' to finish, or specify a particular document."
82
+ You can also say 'No thanks' to finish, or specify a particular document.
83
+ You can also use /export [pdf|docx|pptx|html|md] to export at any time."
80
84
  ```
81
85
 
82
86
  **Option display rules**:
87
+ - Source document uploaded → "Updated [document type]" listed first with "(recommended)" label
83
88
  - Target audience is engineers → PRD and dev handoff package listed first
84
- - Target audience is executives/leadership → Presentation listed first
85
- - Target audience is cross-functional → Both HTML report and presentation listed
86
- - Quick Mode → Only ask if a presentation is needed
89
+ - Target audience is executives/leadership → PDF and presentation listed first
90
+ - Target audience is cross-functional → PDF, HTML report, and presentation all listed
91
+ - Quick Mode → Only ask if PDF or presentation is needed
87
92
  - Target audience is yourself → Dev handoff package listed first
93
+
94
+ **Export trigger rules**:
95
+ - User selects PDF / Word / Presentation PPTX → Load `rules-export-document.md`
96
+ - First time triggering document export → Load `rules-document-tools.md` first to check and install necessary tools
97
+ - User selects HTML planning report → Load `06-html-report.md` (existing rules)
98
+ - User selects "All of the above" → Execute each format export in sequence