product-playbook 1.0.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/LICENSE +21 -0
- package/README.es.md +518 -0
- package/README.ja.md +519 -0
- package/README.ko.md +518 -0
- package/README.md +520 -0
- package/README.zh-CN.md +518 -0
- package/README.zh-TW.md +518 -0
- package/SKILL.md +244 -0
- package/commands/product-build.md +13 -0
- package/commands/product-dev.md +21 -0
- package/commands/product-full.md +13 -0
- package/commands/product-prd.md +14 -0
- package/commands/product-quick.md +13 -0
- package/commands/product-report.md +12 -0
- package/commands/product-revision.md +13 -0
- package/i18n/en/SKILL.md +245 -0
- package/i18n/en/commands/product-build.md +13 -0
- package/i18n/en/commands/product-dev.md +21 -0
- package/i18n/en/commands/product-full.md +13 -0
- package/i18n/en/commands/product-prd.md +14 -0
- package/i18n/en/commands/product-quick.md +13 -0
- package/i18n/en/commands/product-report.md +12 -0
- package/i18n/en/commands/product-revision.md +13 -0
- package/i18n/en/references/00-opportunity-check.md +44 -0
- package/i18n/en/references/01-strategy.md +90 -0
- package/i18n/en/references/02a-persona.md +57 -0
- package/i18n/en/references/02b-jtbd.md +125 -0
- package/i18n/en/references/02c-ost-journey.md +65 -0
- package/i18n/en/references/03-define.md +118 -0
- package/i18n/en/references/04a-prfaq.md +112 -0
- package/i18n/en/references/04b-solutions.md +269 -0
- package/i18n/en/references/04c-mvp.md +21 -0
- package/i18n/en/references/05a-northstar-aha.md +93 -0
- package/i18n/en/references/05b-pmf-gtm.md +102 -0
- package/i18n/en/references/05c-validation-spec.md +117 -0
- package/i18n/en/references/06-html-report.md +128 -0
- package/i18n/en/references/07a-handoff-core.md +152 -0
- package/i18n/en/references/07b-tasks-tickets.md +215 -0
- package/i18n/en/references/07c-architecture-setup.md +197 -0
- package/i18n/en/references/08-security-checklist.md +221 -0
- package/i18n/en/references/rules-build.md +152 -0
- package/i18n/en/references/rules-change-propagation.md +74 -0
- package/i18n/en/references/rules-commands.md +98 -0
- package/i18n/en/references/rules-context.md +291 -0
- package/i18n/en/references/rules-custom.md +63 -0
- package/i18n/en/references/rules-document-tools.md +126 -0
- package/i18n/en/references/rules-end-of-flow.md +150 -0
- package/i18n/en/references/rules-export-document.md +346 -0
- package/i18n/en/references/rules-file-integration.md +65 -0
- package/i18n/en/references/rules-full.md +66 -0
- package/i18n/en/references/rules-import-document.md +261 -0
- package/i18n/en/references/rules-product-type.md +14 -0
- package/i18n/en/references/rules-progress.md +60 -0
- package/i18n/en/references/rules-quick.md +29 -0
- package/i18n/en/references/rules-revision.md +64 -0
- package/i18n/es/SKILL.md +245 -0
- package/i18n/es/commands/product-build.md +13 -0
- package/i18n/es/commands/product-dev.md +21 -0
- package/i18n/es/commands/product-full.md +13 -0
- package/i18n/es/commands/product-prd.md +14 -0
- package/i18n/es/commands/product-quick.md +13 -0
- package/i18n/es/commands/product-report.md +12 -0
- package/i18n/es/commands/product-revision.md +13 -0
- package/i18n/es/references/00-opportunity-check.md +44 -0
- package/i18n/es/references/01-strategy.md +90 -0
- package/i18n/es/references/02a-persona.md +57 -0
- package/i18n/es/references/02b-jtbd.md +125 -0
- package/i18n/es/references/02c-ost-journey.md +65 -0
- package/i18n/es/references/03-define.md +118 -0
- package/i18n/es/references/04a-prfaq.md +114 -0
- package/i18n/es/references/04b-solutions.md +269 -0
- package/i18n/es/references/04c-mvp.md +21 -0
- package/i18n/es/references/05a-northstar-aha.md +93 -0
- package/i18n/es/references/05b-pmf-gtm.md +102 -0
- package/i18n/es/references/05c-validation-spec.md +117 -0
- package/i18n/es/references/06-html-report.md +138 -0
- package/i18n/es/references/07a-handoff-core.md +152 -0
- package/i18n/es/references/07b-tasks-tickets.md +215 -0
- package/i18n/es/references/07c-architecture-setup.md +197 -0
- package/i18n/es/references/08-security-checklist.md +221 -0
- package/i18n/es/references/rules-build.md +152 -0
- package/i18n/es/references/rules-change-propagation.md +74 -0
- package/i18n/es/references/rules-commands.md +98 -0
- package/i18n/es/references/rules-context.md +291 -0
- package/i18n/es/references/rules-custom.md +63 -0
- package/i18n/es/references/rules-document-tools.md +126 -0
- package/i18n/es/references/rules-end-of-flow.md +150 -0
- package/i18n/es/references/rules-export-document.md +346 -0
- package/i18n/es/references/rules-file-integration.md +65 -0
- package/i18n/es/references/rules-full.md +66 -0
- package/i18n/es/references/rules-import-document.md +261 -0
- package/i18n/es/references/rules-product-type.md +14 -0
- package/i18n/es/references/rules-progress.md +60 -0
- package/i18n/es/references/rules-quick.md +29 -0
- package/i18n/es/references/rules-revision.md +64 -0
- package/i18n/ja/SKILL.md +245 -0
- package/i18n/ja/commands/product-build.md +13 -0
- package/i18n/ja/commands/product-dev.md +21 -0
- package/i18n/ja/commands/product-full.md +13 -0
- package/i18n/ja/commands/product-prd.md +14 -0
- package/i18n/ja/commands/product-quick.md +13 -0
- package/i18n/ja/commands/product-report.md +12 -0
- package/i18n/ja/commands/product-revision.md +13 -0
- package/i18n/ja/references/00-opportunity-check.md +44 -0
- package/i18n/ja/references/01-strategy.md +90 -0
- package/i18n/ja/references/02a-persona.md +57 -0
- package/i18n/ja/references/02b-jtbd.md +125 -0
- package/i18n/ja/references/02c-ost-journey.md +65 -0
- package/i18n/ja/references/03-define.md +118 -0
- package/i18n/ja/references/04a-prfaq.md +111 -0
- package/i18n/ja/references/04b-solutions.md +269 -0
- package/i18n/ja/references/04c-mvp.md +21 -0
- package/i18n/ja/references/05a-northstar-aha.md +93 -0
- package/i18n/ja/references/05b-pmf-gtm.md +102 -0
- package/i18n/ja/references/05c-validation-spec.md +117 -0
- package/i18n/ja/references/06-html-report.md +126 -0
- package/i18n/ja/references/07a-handoff-core.md +152 -0
- package/i18n/ja/references/07b-tasks-tickets.md +215 -0
- package/i18n/ja/references/07c-architecture-setup.md +197 -0
- package/i18n/ja/references/08-security-checklist.md +221 -0
- package/i18n/ja/references/rules-build.md +152 -0
- package/i18n/ja/references/rules-change-propagation.md +74 -0
- package/i18n/ja/references/rules-commands.md +98 -0
- package/i18n/ja/references/rules-context.md +291 -0
- package/i18n/ja/references/rules-custom.md +63 -0
- package/i18n/ja/references/rules-document-tools.md +126 -0
- package/i18n/ja/references/rules-end-of-flow.md +150 -0
- package/i18n/ja/references/rules-export-document.md +346 -0
- package/i18n/ja/references/rules-file-integration.md +65 -0
- package/i18n/ja/references/rules-full.md +66 -0
- package/i18n/ja/references/rules-import-document.md +261 -0
- package/i18n/ja/references/rules-product-type.md +14 -0
- package/i18n/ja/references/rules-progress.md +60 -0
- package/i18n/ja/references/rules-quick.md +29 -0
- package/i18n/ja/references/rules-revision.md +64 -0
- package/i18n/ko/SKILL.md +245 -0
- package/i18n/ko/commands/product-build.md +13 -0
- package/i18n/ko/commands/product-dev.md +21 -0
- package/i18n/ko/commands/product-full.md +13 -0
- package/i18n/ko/commands/product-prd.md +14 -0
- package/i18n/ko/commands/product-quick.md +13 -0
- package/i18n/ko/commands/product-report.md +12 -0
- package/i18n/ko/commands/product-revision.md +13 -0
- package/i18n/ko/references/00-opportunity-check.md +44 -0
- package/i18n/ko/references/01-strategy.md +90 -0
- package/i18n/ko/references/02a-persona.md +57 -0
- package/i18n/ko/references/02b-jtbd.md +125 -0
- package/i18n/ko/references/02c-ost-journey.md +65 -0
- package/i18n/ko/references/03-define.md +118 -0
- package/i18n/ko/references/04a-prfaq.md +112 -0
- package/i18n/ko/references/04b-solutions.md +269 -0
- package/i18n/ko/references/04c-mvp.md +21 -0
- package/i18n/ko/references/05a-northstar-aha.md +93 -0
- package/i18n/ko/references/05b-pmf-gtm.md +102 -0
- package/i18n/ko/references/05c-validation-spec.md +117 -0
- package/i18n/ko/references/06-html-report.md +126 -0
- package/i18n/ko/references/07a-handoff-core.md +152 -0
- package/i18n/ko/references/07b-tasks-tickets.md +215 -0
- package/i18n/ko/references/07c-architecture-setup.md +197 -0
- package/i18n/ko/references/08-security-checklist.md +221 -0
- package/i18n/ko/references/rules-build.md +152 -0
- package/i18n/ko/references/rules-change-propagation.md +74 -0
- package/i18n/ko/references/rules-commands.md +98 -0
- package/i18n/ko/references/rules-context.md +291 -0
- package/i18n/ko/references/rules-custom.md +63 -0
- package/i18n/ko/references/rules-document-tools.md +126 -0
- package/i18n/ko/references/rules-end-of-flow.md +150 -0
- package/i18n/ko/references/rules-export-document.md +346 -0
- package/i18n/ko/references/rules-file-integration.md +65 -0
- package/i18n/ko/references/rules-full.md +66 -0
- package/i18n/ko/references/rules-import-document.md +261 -0
- package/i18n/ko/references/rules-product-type.md +14 -0
- package/i18n/ko/references/rules-progress.md +60 -0
- package/i18n/ko/references/rules-quick.md +29 -0
- package/i18n/ko/references/rules-revision.md +64 -0
- package/i18n/zh-CN/SKILL.md +245 -0
- package/i18n/zh-CN/commands/product-build.md +13 -0
- package/i18n/zh-CN/commands/product-dev.md +21 -0
- package/i18n/zh-CN/commands/product-full.md +13 -0
- package/i18n/zh-CN/commands/product-prd.md +14 -0
- package/i18n/zh-CN/commands/product-quick.md +13 -0
- package/i18n/zh-CN/commands/product-report.md +12 -0
- package/i18n/zh-CN/commands/product-revision.md +13 -0
- package/i18n/zh-CN/references/00-opportunity-check.md +44 -0
- package/i18n/zh-CN/references/01-strategy.md +90 -0
- package/i18n/zh-CN/references/02a-persona.md +57 -0
- package/i18n/zh-CN/references/02b-jtbd.md +125 -0
- package/i18n/zh-CN/references/02c-ost-journey.md +65 -0
- package/i18n/zh-CN/references/03-define.md +118 -0
- package/i18n/zh-CN/references/04a-prfaq.md +106 -0
- package/i18n/zh-CN/references/04b-solutions.md +269 -0
- package/i18n/zh-CN/references/04c-mvp.md +21 -0
- package/i18n/zh-CN/references/05a-northstar-aha.md +93 -0
- package/i18n/zh-CN/references/05b-pmf-gtm.md +102 -0
- package/i18n/zh-CN/references/05c-validation-spec.md +117 -0
- package/i18n/zh-CN/references/06-html-report.md +123 -0
- package/i18n/zh-CN/references/07a-handoff-core.md +152 -0
- package/i18n/zh-CN/references/07b-tasks-tickets.md +215 -0
- package/i18n/zh-CN/references/07c-architecture-setup.md +197 -0
- package/i18n/zh-CN/references/08-security-checklist.md +221 -0
- package/i18n/zh-CN/references/rules-build.md +152 -0
- package/i18n/zh-CN/references/rules-change-propagation.md +74 -0
- package/i18n/zh-CN/references/rules-commands.md +98 -0
- package/i18n/zh-CN/references/rules-context.md +291 -0
- package/i18n/zh-CN/references/rules-custom.md +63 -0
- package/i18n/zh-CN/references/rules-document-tools.md +126 -0
- package/i18n/zh-CN/references/rules-end-of-flow.md +150 -0
- package/i18n/zh-CN/references/rules-export-document.md +346 -0
- package/i18n/zh-CN/references/rules-file-integration.md +65 -0
- package/i18n/zh-CN/references/rules-full.md +66 -0
- package/i18n/zh-CN/references/rules-import-document.md +261 -0
- package/i18n/zh-CN/references/rules-product-type.md +14 -0
- package/i18n/zh-CN/references/rules-progress.md +60 -0
- package/i18n/zh-CN/references/rules-quick.md +29 -0
- package/i18n/zh-CN/references/rules-revision.md +64 -0
- package/i18n/zh-TW/SKILL.md +244 -0
- package/i18n/zh-TW/commands/product-build.md +13 -0
- package/i18n/zh-TW/commands/product-dev.md +21 -0
- package/i18n/zh-TW/commands/product-full.md +13 -0
- package/i18n/zh-TW/commands/product-prd.md +14 -0
- package/i18n/zh-TW/commands/product-quick.md +13 -0
- package/i18n/zh-TW/commands/product-report.md +12 -0
- package/i18n/zh-TW/commands/product-revision.md +13 -0
- package/i18n/zh-TW/references/00-opportunity-check.md +44 -0
- package/i18n/zh-TW/references/01-strategy.md +90 -0
- package/i18n/zh-TW/references/02a-persona.md +57 -0
- package/i18n/zh-TW/references/02b-jtbd.md +125 -0
- package/i18n/zh-TW/references/02c-ost-journey.md +65 -0
- package/i18n/zh-TW/references/03-define.md +118 -0
- package/i18n/zh-TW/references/04a-prfaq.md +106 -0
- package/i18n/zh-TW/references/04b-solutions.md +269 -0
- package/i18n/zh-TW/references/04c-mvp.md +21 -0
- package/i18n/zh-TW/references/05a-northstar-aha.md +93 -0
- package/i18n/zh-TW/references/05b-pmf-gtm.md +102 -0
- package/i18n/zh-TW/references/05c-validation-spec.md +117 -0
- package/i18n/zh-TW/references/06-html-report.md +123 -0
- package/i18n/zh-TW/references/07a-handoff-core.md +152 -0
- package/i18n/zh-TW/references/07b-tasks-tickets.md +215 -0
- package/i18n/zh-TW/references/07c-architecture-setup.md +197 -0
- package/i18n/zh-TW/references/08-security-checklist.md +221 -0
- package/i18n/zh-TW/references/rules-build.md +152 -0
- package/i18n/zh-TW/references/rules-change-propagation.md +74 -0
- package/i18n/zh-TW/references/rules-commands.md +98 -0
- package/i18n/zh-TW/references/rules-context.md +291 -0
- package/i18n/zh-TW/references/rules-custom.md +63 -0
- package/i18n/zh-TW/references/rules-document-tools.md +126 -0
- package/i18n/zh-TW/references/rules-end-of-flow.md +150 -0
- package/i18n/zh-TW/references/rules-export-document.md +346 -0
- package/i18n/zh-TW/references/rules-file-integration.md +65 -0
- package/i18n/zh-TW/references/rules-full.md +66 -0
- package/i18n/zh-TW/references/rules-import-document.md +261 -0
- package/i18n/zh-TW/references/rules-product-type.md +14 -0
- package/i18n/zh-TW/references/rules-progress.md +60 -0
- package/i18n/zh-TW/references/rules-quick.md +29 -0
- package/i18n/zh-TW/references/rules-revision.md +64 -0
- package/install.sh +418 -0
- package/package.json +41 -0
- package/references/00-opportunity-check.md +44 -0
- package/references/01-strategy.md +90 -0
- package/references/02a-persona.md +57 -0
- package/references/02b-jtbd.md +125 -0
- package/references/02c-ost-journey.md +65 -0
- package/references/03-define.md +118 -0
- package/references/04a-prfaq.md +106 -0
- package/references/04b-solutions.md +269 -0
- package/references/04c-mvp.md +21 -0
- package/references/05a-northstar-aha.md +93 -0
- package/references/05b-pmf-gtm.md +102 -0
- package/references/05c-validation-spec.md +117 -0
- package/references/06-html-report.md +123 -0
- package/references/07a-handoff-core.md +152 -0
- package/references/07b-tasks-tickets.md +215 -0
- package/references/07c-architecture-setup.md +197 -0
- package/references/08-security-checklist.md +221 -0
- package/references/rules-build.md +152 -0
- package/references/rules-change-propagation.md +74 -0
- package/references/rules-commands.md +98 -0
- package/references/rules-context.md +291 -0
- package/references/rules-custom.md +63 -0
- package/references/rules-document-tools.md +126 -0
- package/references/rules-end-of-flow.md +150 -0
- package/references/rules-export-document.md +346 -0
- package/references/rules-file-integration.md +65 -0
- package/references/rules-full.md +66 -0
- package/references/rules-import-document.md +261 -0
- package/references/rules-product-type.md +14 -0
- package/references/rules-progress.md +60 -0
- package/references/rules-quick.md +29 -0
- package/references/rules-revision.md +64 -0
- package/references/templates/prd-style.css +464 -0
- package/references/templates/report-style.css +114 -0
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
# Document Import & Parsing Rules
|
|
2
|
+
|
|
3
|
+
> Loaded when the user uploads a PDF / DOCX / PPTX file, or triggers `/parse [file]`.
|
|
4
|
+
> On first use, load `rules-document-tools.md` first to confirm tools are installed.
|
|
5
|
+
> This rule works in conjunction with `rules-file-integration.md` — that file defines "when to trigger," this file defines "how to parse."
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Parsing Goal
|
|
10
|
+
|
|
11
|
+
Convert any format of input document into **structured Markdown** for use in subsequent flows:
|
|
12
|
+
- Feature Extension / Revision mode S1 context collection
|
|
13
|
+
- Incremental update source document baseline
|
|
14
|
+
- General document content extraction
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## PDF Parsing: Three-Layer Strategy + Per-Page Detection
|
|
19
|
+
|
|
20
|
+
### Overview
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
Input PDF
|
|
24
|
+
│
|
|
25
|
+
▼
|
|
26
|
+
pymupdf per-page text extraction (zero cost)
|
|
27
|
+
│
|
|
28
|
+
├── Page text > 30 characters → ✅ Convert directly to Markdown (Layer 1)
|
|
29
|
+
│
|
|
30
|
+
└── Page text ≤ 30 characters (blank / vector paths / scanned)
|
|
31
|
+
│
|
|
32
|
+
├── Default → Claude Vision semantic parsing (Layer 2)
|
|
33
|
+
│
|
|
34
|
+
└── Vision unavailable / Token budget insufficient → Tesseract OCR (Layer 3)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Step 1: Per-Page Type Detection
|
|
38
|
+
|
|
39
|
+
**Key principle**: Detect at the "page" level, not the entire document. A single PDF may mix digital text pages and scanned image pages.
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
import fitz # pymupdf
|
|
43
|
+
|
|
44
|
+
doc = fitz.open(pdf_path)
|
|
45
|
+
total_pages = len(doc)
|
|
46
|
+
page_results = {}
|
|
47
|
+
|
|
48
|
+
for i in range(total_pages):
|
|
49
|
+
page = doc[i]
|
|
50
|
+
text = page.get_text("text").strip()
|
|
51
|
+
|
|
52
|
+
if len(text) > 30:
|
|
53
|
+
# Layer 1: Digital text, extract directly
|
|
54
|
+
page_results[i] = {"type": "digital", "text": text}
|
|
55
|
+
else:
|
|
56
|
+
# Needs Vision or OCR
|
|
57
|
+
page_results[i] = {"type": "needs_vision", "text": None}
|
|
58
|
+
|
|
59
|
+
digital_count = sum(1 for p in page_results.values() if p["type"] == "digital")
|
|
60
|
+
vision_count = total_pages - digital_count
|
|
61
|
+
|
|
62
|
+
print(f"PDF analysis: {total_pages} pages, {digital_count} directly extractable, {vision_count} require visual parsing")
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Step 2: Large File Handling Strategy
|
|
66
|
+
|
|
67
|
+
| Condition | Strategy |
|
|
68
|
+
|-----------|----------|
|
|
69
|
+
| All pages are digital (vision_count = 0) | Extract all pages directly, zero cost |
|
|
70
|
+
| vision_count ≤ 20 | Read all pages needing visual parsing at once with Claude Vision |
|
|
71
|
+
| vision_count > 20 | Process in batches (≤ 20 pages each), merge results |
|
|
72
|
+
| Total pages > 50 and vision_count > 20 | Ask the user whether to parse the full document or specify a page range |
|
|
73
|
+
|
|
74
|
+
**Large file (>50 pages) user confirmation prompt**:
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
📄 This PDF has {total_pages} pages:
|
|
78
|
+
• {digital_count} pages can be directly extracted (free)
|
|
79
|
+
• {vision_count} pages require visual parsing (consumes Vision tokens)
|
|
80
|
+
|
|
81
|
+
Please choose:
|
|
82
|
+
1️⃣ Full document parsing (complete but consumes more tokens)
|
|
83
|
+
2️⃣ Parse specific pages only (enter page ranges, e.g. 1-10,15,20-25)
|
|
84
|
+
3️⃣ Extract only directly extractable pages (skip scanned/vector pages)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Step 3: Layer 1 — pymupdf Direct Extraction
|
|
88
|
+
|
|
89
|
+
```python
|
|
90
|
+
def extract_digital_pages(doc, page_results):
|
|
91
|
+
"""Extract all digital text pages"""
|
|
92
|
+
markdown_parts = []
|
|
93
|
+
for i, result in sorted(page_results.items()):
|
|
94
|
+
if result["type"] == "digital":
|
|
95
|
+
markdown_parts.append(f"<!-- Page {i+1} -->\n{result['text']}")
|
|
96
|
+
return "\n\n".join(markdown_parts)
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Step 4: Layer 2 — Claude Vision Semantic Parsing
|
|
100
|
+
|
|
101
|
+
For `needs_vision` type pages, first render to PNG with pymupdf, then read with Claude's Read tool.
|
|
102
|
+
|
|
103
|
+
**Render to image**:
|
|
104
|
+
```python
|
|
105
|
+
def render_pages_to_png(doc, page_indices, dpi=300):
|
|
106
|
+
"""Render specified pages to PNG"""
|
|
107
|
+
output_files = []
|
|
108
|
+
for i in page_indices:
|
|
109
|
+
page = doc[i]
|
|
110
|
+
pix = page.get_pixmap(dpi=dpi)
|
|
111
|
+
output_path = f"/tmp/pdf-page-{i+1:04d}.png"
|
|
112
|
+
pix.save(output_path)
|
|
113
|
+
output_files.append((i, output_path))
|
|
114
|
+
return output_files
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**Claude Vision parsing prompt**:
|
|
118
|
+
|
|
119
|
+
For each page requiring visual parsing (or batch), after reading the PNG with the Read tool, convert using the following prompt:
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
You are reading page {page_num}/{total_pages} of a PDF document.
|
|
123
|
+
Please convert the content of this page precisely into Markdown format.
|
|
124
|
+
|
|
125
|
+
Strict rules:
|
|
126
|
+
1. Tables → Markdown table (preserve all columns, rows, and alignment)
|
|
127
|
+
2. Headings → # / ## / ### corresponding to original level
|
|
128
|
+
3. Numbered lists → 1. 2. 3. (preserve original numbering)
|
|
129
|
+
4. Bullet points → - or •
|
|
130
|
+
5. Bold/Italic → **bold** / *italic*
|
|
131
|
+
6. Charts/Images → > [Chart: brief description]
|
|
132
|
+
7. Headers, footers, page numbers → Ignore
|
|
133
|
+
8. Numbers, dates, names, account numbers → Must be 100% accurate, do not guess
|
|
134
|
+
9. Do not add content not present in the original
|
|
135
|
+
10. Do not translate — preserve the original language
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
> **Why this is better than OCR**: Claude understands the "semantic structure" of tables (which row is the header, which columns are aligned), whereas Tesseract can only recognize characters one by one and then attempt to reconstruct tables with rules, which often fails.
|
|
139
|
+
|
|
140
|
+
### Step 5: Layer 3 — Tesseract OCR Fallback
|
|
141
|
+
|
|
142
|
+
Use only in the following situations:
|
|
143
|
+
- User explicitly requests token conservation
|
|
144
|
+
- Claude Vision is unavailable (API limitations, etc.)
|
|
145
|
+
- Offline environment
|
|
146
|
+
|
|
147
|
+
```python
|
|
148
|
+
import subprocess
|
|
149
|
+
from PIL import Image
|
|
150
|
+
|
|
151
|
+
def ocr_page(png_path, lang="chi_tra+eng"):
|
|
152
|
+
"""Tesseract OCR single page"""
|
|
153
|
+
# macOS tesseract may not read PNG directly, convert to TIFF or use stdin
|
|
154
|
+
tiff_path = png_path.replace('.png', '.tiff')
|
|
155
|
+
Image.open(png_path).save(tiff_path)
|
|
156
|
+
|
|
157
|
+
result = subprocess.run(
|
|
158
|
+
['tesseract', 'stdin', 'stdout', '-l', lang],
|
|
159
|
+
stdin=open(tiff_path, 'rb'),
|
|
160
|
+
capture_output=True, text=True, timeout=120
|
|
161
|
+
)
|
|
162
|
+
return result.stdout
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
**Tesseract notes (from practical experience)**:
|
|
166
|
+
- On macOS, tesseract may not read PNG files directly — use `stdin` pipe or convert to TIFF first
|
|
167
|
+
- Recommended resolution: 300dpi
|
|
168
|
+
- `chi_tra+eng` language pack recognizes both Traditional Chinese and English simultaneously
|
|
169
|
+
- OCR results need post-processing: merge broken lines, repair table structure
|
|
170
|
+
|
|
171
|
+
### Step 6: Merge All Pages
|
|
172
|
+
|
|
173
|
+
```python
|
|
174
|
+
def merge_all_pages(digital_md, vision_md_list):
|
|
175
|
+
"""Merge all pages' Markdown in page order"""
|
|
176
|
+
all_pages = {}
|
|
177
|
+
# digital pages
|
|
178
|
+
for page_num, md in digital_md.items():
|
|
179
|
+
all_pages[page_num] = md
|
|
180
|
+
# vision/ocr pages
|
|
181
|
+
for page_num, md in vision_md_list.items():
|
|
182
|
+
all_pages[page_num] = md
|
|
183
|
+
|
|
184
|
+
# Sort by page number and merge
|
|
185
|
+
final_md = []
|
|
186
|
+
for i in sorted(all_pages.keys()):
|
|
187
|
+
final_md.append(all_pages[i])
|
|
188
|
+
|
|
189
|
+
return "\n\n---\n\n".join(final_md)
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Step 7: Output and Notify User
|
|
193
|
+
|
|
194
|
+
```
|
|
195
|
+
📄 PDF parsing complete:
|
|
196
|
+
• Total pages: {total_pages}
|
|
197
|
+
• Direct extraction: {digital_count} pages (pymupdf)
|
|
198
|
+
• Visual parsing: {vision_count} pages (Claude Vision)
|
|
199
|
+
• Output: {output_path} (Markdown, {word_count} words)
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## DOCX Parsing
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
pandoc "{input_path}" -t markdown -o "/tmp/parsed-{timestamp}.md" --wrap=none
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
**Post-processing**:
|
|
211
|
+
- Remove excess blank lines generated by Pandoc
|
|
212
|
+
- Verify table formatting is correct
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## PPTX Parsing
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
pandoc "{input_path}" -t markdown -o "/tmp/parsed-{timestamp}.md" --wrap=none
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
> Pandoc converts each slide into a `##` heading section.
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## HTML Parsing
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
pandoc "{input_path}" -f html -t markdown -o "/tmp/parsed-{timestamp}.md" --wrap=none
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## Image Parsing
|
|
235
|
+
|
|
236
|
+
Use the Claude Read tool directly to read the image, then convert to Markdown using the Vision parsing prompt.
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## Coordination with rules-file-integration.md
|
|
241
|
+
|
|
242
|
+
When `rules-file-integration.md` detects the following scenarios, this rule is loaded:
|
|
243
|
+
|
|
244
|
+
| Scenario | Action |
|
|
245
|
+
|----------|--------|
|
|
246
|
+
| User uploads PDF during Feature Extension S1 | Load this rule → Parse PDF → Extract existing system context |
|
|
247
|
+
| User uploads old PRD during Revision S1 | Load this rule → Parse PDF → Use as revision baseline |
|
|
248
|
+
| User uses `/parse` command | Load this rule → Parse specified file → Output Markdown |
|
|
249
|
+
| User uploads market report PDF | Load this rule → Extract key information → Integrate into corresponding step |
|
|
250
|
+
|
|
251
|
+
### Source Document Identification
|
|
252
|
+
|
|
253
|
+
After parsing is complete, if the file is identified as a "source document" (PRD, spec, etc.), automatically mark it:
|
|
254
|
+
|
|
255
|
+
```
|
|
256
|
+
📎 Source document detected — final output will be an incremental update based on this file.
|
|
257
|
+
Document structure: {section_count} sections, {table_count} tables
|
|
258
|
+
Format conventions: [identified formatting characteristics]
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
The document structure is recorded for use by `rules-export-document.md` during final output.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# 🏢 B2B / B2C Differentiation Adjustments
|
|
2
|
+
|
|
3
|
+
> Loaded after the product type is confirmed. Claude automatically applies the following adjustments within each framework.
|
|
4
|
+
|
|
5
|
+
| Framework | B2C Adjustments | B2B Adjustments |
|
|
6
|
+
|-----------|----------------|----------------|
|
|
7
|
+
| **Persona** | Segment by personal motivations/habits | Distinguish between "buying decision maker" and "actual end user" as two Persona types; add "organization size" and "procurement process" fields |
|
|
8
|
+
| **JTBD** | Focus on personal emotional and social jobs | Add "organizational-level jobs": What goal does this help the company achieve? What job does the individual accomplish within the organization? |
|
|
9
|
+
| **PMF Assessment** | Primarily based on DAU/MAU, retention rate, Sean Ellis Score | Primarily based on "paying customers + expansion rate + NPS"; Level 1 = 3-5 paying customers |
|
|
10
|
+
| **Aha Moment** | Core value experienced during first use | May not emerge until onboarding/trial period; design a "Time-to-Value" metric |
|
|
11
|
+
| **MVP** | Can be a complete lightweight product | May need to be a Pilot (a customized deployment for a specific customer) |
|
|
12
|
+
| **GTM** | Primarily product-led growth (PLG) or community-driven | Primarily sales-driven or partner channel-driven |
|
|
13
|
+
| **Pricing** | Freemium / Subscription / Usage-based | Annual contract / Per-seat / Usage-based / Custom quote |
|
|
14
|
+
| **North Star** | User activity or core action completion count | ARR, Net Revenue Retention, Active Accounts |
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# 🔁 Progress Persistence & Interruption Recovery
|
|
2
|
+
|
|
3
|
+
> Loaded when the user says "pause," "save," or when the skill checks for progress at startup.
|
|
4
|
+
|
|
5
|
+
## Progress File Format
|
|
6
|
+
|
|
7
|
+
After each step is completed, create or update `.product-playbook-progress.md` in the project directory:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
# Product Playbook Progress Save
|
|
11
|
+
|
|
12
|
+
- Mode: [Quick Mode / Full Mode / ...]
|
|
13
|
+
- Product type: [B2C / B2B / ...]
|
|
14
|
+
- Product description: [User's product description]
|
|
15
|
+
- Current progress: S[X] / S[Y]
|
|
16
|
+
- Last updated: [timestamp]
|
|
17
|
+
|
|
18
|
+
## Completed Steps
|
|
19
|
+
|
|
20
|
+
### S1: [Step name] ✅
|
|
21
|
+
[Core output of this step — retain enough detail so it does not need to be redone upon recovery]
|
|
22
|
+
|
|
23
|
+
### S2: [Step name] ✅
|
|
24
|
+
[Same as above]
|
|
25
|
+
|
|
26
|
+
## Pending Steps
|
|
27
|
+
- S3: [Step name]
|
|
28
|
+
- S4: [Step name]
|
|
29
|
+
- ...
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Feature Extension Mode Example
|
|
33
|
+
```markdown
|
|
34
|
+
Mode: Feature Extension
|
|
35
|
+
Step: S2/S4
|
|
36
|
+
S1: Problem + existing system context ✅
|
|
37
|
+
S2: Three parallel solutions + AI recommendation ▶️
|
|
38
|
+
S3: Risk assessment ⬜
|
|
39
|
+
S4: Execution scope ⬜
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Trigger Rules
|
|
43
|
+
|
|
44
|
+
1. **Auto-save**: After each step is completed and confirmed by the user, immediately update the progress file
|
|
45
|
+
2. **Check on startup**: When the skill is triggered, first check whether `.product-playbook-progress.md` exists. If it does, display:
|
|
46
|
+
```
|
|
47
|
+
Detected unfinished product planning progress ([mode name], S[X]/S[Y]):
|
|
48
|
+
1️⃣ Continue — Resume from S[X]
|
|
49
|
+
2️⃣ Start over — Clear old progress and begin from scratch
|
|
50
|
+
(Enter 1 or 2)
|
|
51
|
+
```
|
|
52
|
+
3. **Pause command**: When the user says "pause," "do something else first," or "save," confirm the progress file has been updated and reply: "Progress saved to .product-playbook-progress.md (S[X]/S[Y]). It will be automatically detected next time you start the skill in this project."
|
|
53
|
+
4. **Cleanup on completion**: After the entire flow is completed and final documents are produced, ask the user whether to delete the progress file
|
|
54
|
+
6. **Version control reminder**: When `.product-playbook-progress.md` is created for the first time, remind the user: "⚠️ We recommend adding `.product-playbook-progress.md` to `.gitignore` — this file may contain sensitive product strategy information."
|
|
55
|
+
5. **Interruption save**: When an unrelated prompt is detected during the flow (see SKILL.md flow interruption handling rules), save progress even if the current step is not yet complete. Use 🔶 (in progress) instead of ✅ for the current step in the save format, and preserve the partially produced content:
|
|
56
|
+
```
|
|
57
|
+
### S[X]: [Step name] 🔶 (in progress, partially completed)
|
|
58
|
+
[Partially produced content]
|
|
59
|
+
⚠️ This step is not yet complete — resume from here upon recovery
|
|
60
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# 🚀 Quick Mode Step Sequence (3 Steps + Final Output)
|
|
2
|
+
|
|
3
|
+
> This file is the authoritative step definition for Quick Mode. Loaded by the SKILL.md core dispatcher.
|
|
4
|
+
|
|
5
|
+
## Step Sequence
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
S1. JTBD Statement → Read references/02b-jtbd.md
|
|
9
|
+
S2. PR-FAQ → Read references/04a-prfaq.md
|
|
10
|
+
S3. North Star Metric + Aha Moment → Read references/05a-northstar-aha.md
|
|
11
|
+
────
|
|
12
|
+
Final Output → One-page direction summary
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Reference Loading Instructions
|
|
16
|
+
|
|
17
|
+
When entering each step, read the corresponding reference file:
|
|
18
|
+
|
|
19
|
+
| Step | Reference File |
|
|
20
|
+
|------|---------------|
|
|
21
|
+
| S1 | `references/02b-jtbd.md` |
|
|
22
|
+
| S2 | `references/04a-prfaq.md` |
|
|
23
|
+
| S3 | `references/05a-northstar-aha.md` |
|
|
24
|
+
|
|
25
|
+
## Final Output Format
|
|
26
|
+
|
|
27
|
+
**One-page direction summary**: Problem → Solution → Success Definition, a three-part structure suitable for quick briefings or team syncs.
|
|
28
|
+
|
|
29
|
+
After completion, follow `references/rules-end-of-flow.md` to execute the end-of-flow rules. Quick Mode only asks whether a presentation is needed — it does not offer PRD or dev handoff packages (the content is not comprehensive enough).
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# 🔄 Revision Mode Step Sequence (12 Steps + Final Output)
|
|
2
|
+
|
|
3
|
+
> This file is the authoritative step definition for Revision Mode. Loaded by the SKILL.md core dispatcher.
|
|
4
|
+
|
|
5
|
+
## Step Sequence
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Phase 0: Current State Analysis
|
|
9
|
+
S1. Existing product review (user data overview + core metrics + known issues + security status)
|
|
10
|
+
S2. Re-examine existing user JTBD (which jobs are being done well? which aren't?)
|
|
11
|
+
|
|
12
|
+
Phase 1: Problem Convergence
|
|
13
|
+
S3. User pain point collection (retention/churn analysis + user feedback synthesis + behavioral data)
|
|
14
|
+
S4. Pain point summary table → load references/03-define.md → 2.1
|
|
15
|
+
S5. Positioning re-evaluation → load references/03-define.md → 2.2 (focus: does positioning need adjustment?)
|
|
16
|
+
S6. HMW question reframing → load references/03-define.md → 2.3
|
|
17
|
+
S7. Opportunity assessment table → load references/03-define.md → 2.4
|
|
18
|
+
|
|
19
|
+
Phase 2: Solution Design
|
|
20
|
+
S8. PR-FAQ → load references/04a-prfaq.md (describe the post-revision experience)
|
|
21
|
+
S9. Pre-mortem → load references/04b-solutions.md → 3.3
|
|
22
|
+
S10. MVP scope + Not Doing List → load references/04c-mvp.md (focus: what to change / what not to change)
|
|
23
|
+
|
|
24
|
+
Phase 3: Validation
|
|
25
|
+
S11. North Star + Aha Moment → load references/05a-northstar-aha.md (compare pre- vs. post-revision metrics)
|
|
26
|
+
S12. Hypothesis validation plan → load references/05c-validation-spec.md
|
|
27
|
+
────
|
|
28
|
+
Final Output → Product spec summary (revision edition)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### S1 Pre-step: Product Context Loading
|
|
32
|
+
|
|
33
|
+
Before entering S1, load `references/rules-context.md` and check `.product-context.md`:
|
|
34
|
+
|
|
35
|
+
- **Full context available (Scenario 1)**: Auto-populate PMF level, North Star, known pain points, security status, and the 3 most recent Decision History entries. S1 guidance switches to **delta mode**: "Last time we assessed, your PMF level was [X] and your North Star metric was [Y]. Has anything changed? What are the latest DAU/MAU and retention numbers?" — Previously collected decision history and known pain points do not need to be re-gathered.
|
|
36
|
+
- **No context available (Scenario 2)**: Trigger Context Bootstrap (`rules-context.md` Section 4, Round 1 + 3), then proceed to standard S1 data collection below.
|
|
37
|
+
- **Partial context (Scenario 3)**: Pull in feature change history from Decision History (know which modules were changed and what risks were identified), but ask about overall product strategy and metrics (previous work only covered feature expansion and lacks a holistic view).
|
|
38
|
+
|
|
39
|
+
### S1 Standard Guidance
|
|
40
|
+
|
|
41
|
+
> Revision Mode's S1 proactively asks the user to provide existing product data: DAU/MAU, retention rates, key user feedback, past version decisions, etc. If context already pre-fills some answers, confirm rather than re-collect.
|
|
42
|
+
> S1 also collects current security status: existing auth/authorization mechanisms, known security vulnerabilities or tech debt, recent security incidents. This information affects the revision's risk assessment and Pre-mortem.
|
|
43
|
+
|
|
44
|
+
### Fast Path
|
|
45
|
+
|
|
46
|
+
When the user provides sufficient data at S1 (including user feedback, metrics, and pain points), S4–S7 (pain points → positioning → HMW → opportunity assessment) can be produced in a single conversation turn, requiring only one confirmation instead of four. Trigger condition: the pain point list gathered in S3 already has clear prioritization and data support. Hard Gate rules remain unchanged — each step's output must still be fully presented; only the confirmation cadence is accelerated.
|
|
47
|
+
|
|
48
|
+
## Reference Loading Instructions
|
|
49
|
+
|
|
50
|
+
| Step | Reference File |
|
|
51
|
+
|------|---------------|
|
|
52
|
+
| S1–S3 | No external reference needed (guide the user to provide data directly) |
|
|
53
|
+
| S4–S7 | `references/03-define.md` |
|
|
54
|
+
| S8 | `references/04a-prfaq.md` |
|
|
55
|
+
| S9 | `references/04b-solutions.md` |
|
|
56
|
+
| S10 | `references/04c-mvp.md` |
|
|
57
|
+
| S11 | `references/05a-northstar-aha.md` |
|
|
58
|
+
| S12 + Final Output | `references/05c-validation-spec.md` |
|
|
59
|
+
|
|
60
|
+
## Final Output Format
|
|
61
|
+
|
|
62
|
+
**Revision Product Spec Summary**: Before/after comparison + what to change / what not to change + success metrics
|
|
63
|
+
|
|
64
|
+
Upon completion, execute end-of-flow rules per `references/rules-end-of-flow.md`.
|