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.
Files changed (291) hide show
  1. package/LICENSE +21 -0
  2. package/README.es.md +518 -0
  3. package/README.ja.md +519 -0
  4. package/README.ko.md +518 -0
  5. package/README.md +520 -0
  6. package/README.zh-CN.md +518 -0
  7. package/README.zh-TW.md +518 -0
  8. package/SKILL.md +244 -0
  9. package/commands/product-build.md +13 -0
  10. package/commands/product-dev.md +21 -0
  11. package/commands/product-full.md +13 -0
  12. package/commands/product-prd.md +14 -0
  13. package/commands/product-quick.md +13 -0
  14. package/commands/product-report.md +12 -0
  15. package/commands/product-revision.md +13 -0
  16. package/i18n/en/SKILL.md +245 -0
  17. package/i18n/en/commands/product-build.md +13 -0
  18. package/i18n/en/commands/product-dev.md +21 -0
  19. package/i18n/en/commands/product-full.md +13 -0
  20. package/i18n/en/commands/product-prd.md +14 -0
  21. package/i18n/en/commands/product-quick.md +13 -0
  22. package/i18n/en/commands/product-report.md +12 -0
  23. package/i18n/en/commands/product-revision.md +13 -0
  24. package/i18n/en/references/00-opportunity-check.md +44 -0
  25. package/i18n/en/references/01-strategy.md +90 -0
  26. package/i18n/en/references/02a-persona.md +57 -0
  27. package/i18n/en/references/02b-jtbd.md +125 -0
  28. package/i18n/en/references/02c-ost-journey.md +65 -0
  29. package/i18n/en/references/03-define.md +118 -0
  30. package/i18n/en/references/04a-prfaq.md +112 -0
  31. package/i18n/en/references/04b-solutions.md +269 -0
  32. package/i18n/en/references/04c-mvp.md +21 -0
  33. package/i18n/en/references/05a-northstar-aha.md +93 -0
  34. package/i18n/en/references/05b-pmf-gtm.md +102 -0
  35. package/i18n/en/references/05c-validation-spec.md +117 -0
  36. package/i18n/en/references/06-html-report.md +128 -0
  37. package/i18n/en/references/07a-handoff-core.md +152 -0
  38. package/i18n/en/references/07b-tasks-tickets.md +215 -0
  39. package/i18n/en/references/07c-architecture-setup.md +197 -0
  40. package/i18n/en/references/08-security-checklist.md +221 -0
  41. package/i18n/en/references/rules-build.md +152 -0
  42. package/i18n/en/references/rules-change-propagation.md +74 -0
  43. package/i18n/en/references/rules-commands.md +98 -0
  44. package/i18n/en/references/rules-context.md +291 -0
  45. package/i18n/en/references/rules-custom.md +63 -0
  46. package/i18n/en/references/rules-document-tools.md +126 -0
  47. package/i18n/en/references/rules-end-of-flow.md +150 -0
  48. package/i18n/en/references/rules-export-document.md +346 -0
  49. package/i18n/en/references/rules-file-integration.md +65 -0
  50. package/i18n/en/references/rules-full.md +66 -0
  51. package/i18n/en/references/rules-import-document.md +261 -0
  52. package/i18n/en/references/rules-product-type.md +14 -0
  53. package/i18n/en/references/rules-progress.md +60 -0
  54. package/i18n/en/references/rules-quick.md +29 -0
  55. package/i18n/en/references/rules-revision.md +64 -0
  56. package/i18n/es/SKILL.md +245 -0
  57. package/i18n/es/commands/product-build.md +13 -0
  58. package/i18n/es/commands/product-dev.md +21 -0
  59. package/i18n/es/commands/product-full.md +13 -0
  60. package/i18n/es/commands/product-prd.md +14 -0
  61. package/i18n/es/commands/product-quick.md +13 -0
  62. package/i18n/es/commands/product-report.md +12 -0
  63. package/i18n/es/commands/product-revision.md +13 -0
  64. package/i18n/es/references/00-opportunity-check.md +44 -0
  65. package/i18n/es/references/01-strategy.md +90 -0
  66. package/i18n/es/references/02a-persona.md +57 -0
  67. package/i18n/es/references/02b-jtbd.md +125 -0
  68. package/i18n/es/references/02c-ost-journey.md +65 -0
  69. package/i18n/es/references/03-define.md +118 -0
  70. package/i18n/es/references/04a-prfaq.md +114 -0
  71. package/i18n/es/references/04b-solutions.md +269 -0
  72. package/i18n/es/references/04c-mvp.md +21 -0
  73. package/i18n/es/references/05a-northstar-aha.md +93 -0
  74. package/i18n/es/references/05b-pmf-gtm.md +102 -0
  75. package/i18n/es/references/05c-validation-spec.md +117 -0
  76. package/i18n/es/references/06-html-report.md +138 -0
  77. package/i18n/es/references/07a-handoff-core.md +152 -0
  78. package/i18n/es/references/07b-tasks-tickets.md +215 -0
  79. package/i18n/es/references/07c-architecture-setup.md +197 -0
  80. package/i18n/es/references/08-security-checklist.md +221 -0
  81. package/i18n/es/references/rules-build.md +152 -0
  82. package/i18n/es/references/rules-change-propagation.md +74 -0
  83. package/i18n/es/references/rules-commands.md +98 -0
  84. package/i18n/es/references/rules-context.md +291 -0
  85. package/i18n/es/references/rules-custom.md +63 -0
  86. package/i18n/es/references/rules-document-tools.md +126 -0
  87. package/i18n/es/references/rules-end-of-flow.md +150 -0
  88. package/i18n/es/references/rules-export-document.md +346 -0
  89. package/i18n/es/references/rules-file-integration.md +65 -0
  90. package/i18n/es/references/rules-full.md +66 -0
  91. package/i18n/es/references/rules-import-document.md +261 -0
  92. package/i18n/es/references/rules-product-type.md +14 -0
  93. package/i18n/es/references/rules-progress.md +60 -0
  94. package/i18n/es/references/rules-quick.md +29 -0
  95. package/i18n/es/references/rules-revision.md +64 -0
  96. package/i18n/ja/SKILL.md +245 -0
  97. package/i18n/ja/commands/product-build.md +13 -0
  98. package/i18n/ja/commands/product-dev.md +21 -0
  99. package/i18n/ja/commands/product-full.md +13 -0
  100. package/i18n/ja/commands/product-prd.md +14 -0
  101. package/i18n/ja/commands/product-quick.md +13 -0
  102. package/i18n/ja/commands/product-report.md +12 -0
  103. package/i18n/ja/commands/product-revision.md +13 -0
  104. package/i18n/ja/references/00-opportunity-check.md +44 -0
  105. package/i18n/ja/references/01-strategy.md +90 -0
  106. package/i18n/ja/references/02a-persona.md +57 -0
  107. package/i18n/ja/references/02b-jtbd.md +125 -0
  108. package/i18n/ja/references/02c-ost-journey.md +65 -0
  109. package/i18n/ja/references/03-define.md +118 -0
  110. package/i18n/ja/references/04a-prfaq.md +111 -0
  111. package/i18n/ja/references/04b-solutions.md +269 -0
  112. package/i18n/ja/references/04c-mvp.md +21 -0
  113. package/i18n/ja/references/05a-northstar-aha.md +93 -0
  114. package/i18n/ja/references/05b-pmf-gtm.md +102 -0
  115. package/i18n/ja/references/05c-validation-spec.md +117 -0
  116. package/i18n/ja/references/06-html-report.md +126 -0
  117. package/i18n/ja/references/07a-handoff-core.md +152 -0
  118. package/i18n/ja/references/07b-tasks-tickets.md +215 -0
  119. package/i18n/ja/references/07c-architecture-setup.md +197 -0
  120. package/i18n/ja/references/08-security-checklist.md +221 -0
  121. package/i18n/ja/references/rules-build.md +152 -0
  122. package/i18n/ja/references/rules-change-propagation.md +74 -0
  123. package/i18n/ja/references/rules-commands.md +98 -0
  124. package/i18n/ja/references/rules-context.md +291 -0
  125. package/i18n/ja/references/rules-custom.md +63 -0
  126. package/i18n/ja/references/rules-document-tools.md +126 -0
  127. package/i18n/ja/references/rules-end-of-flow.md +150 -0
  128. package/i18n/ja/references/rules-export-document.md +346 -0
  129. package/i18n/ja/references/rules-file-integration.md +65 -0
  130. package/i18n/ja/references/rules-full.md +66 -0
  131. package/i18n/ja/references/rules-import-document.md +261 -0
  132. package/i18n/ja/references/rules-product-type.md +14 -0
  133. package/i18n/ja/references/rules-progress.md +60 -0
  134. package/i18n/ja/references/rules-quick.md +29 -0
  135. package/i18n/ja/references/rules-revision.md +64 -0
  136. package/i18n/ko/SKILL.md +245 -0
  137. package/i18n/ko/commands/product-build.md +13 -0
  138. package/i18n/ko/commands/product-dev.md +21 -0
  139. package/i18n/ko/commands/product-full.md +13 -0
  140. package/i18n/ko/commands/product-prd.md +14 -0
  141. package/i18n/ko/commands/product-quick.md +13 -0
  142. package/i18n/ko/commands/product-report.md +12 -0
  143. package/i18n/ko/commands/product-revision.md +13 -0
  144. package/i18n/ko/references/00-opportunity-check.md +44 -0
  145. package/i18n/ko/references/01-strategy.md +90 -0
  146. package/i18n/ko/references/02a-persona.md +57 -0
  147. package/i18n/ko/references/02b-jtbd.md +125 -0
  148. package/i18n/ko/references/02c-ost-journey.md +65 -0
  149. package/i18n/ko/references/03-define.md +118 -0
  150. package/i18n/ko/references/04a-prfaq.md +112 -0
  151. package/i18n/ko/references/04b-solutions.md +269 -0
  152. package/i18n/ko/references/04c-mvp.md +21 -0
  153. package/i18n/ko/references/05a-northstar-aha.md +93 -0
  154. package/i18n/ko/references/05b-pmf-gtm.md +102 -0
  155. package/i18n/ko/references/05c-validation-spec.md +117 -0
  156. package/i18n/ko/references/06-html-report.md +126 -0
  157. package/i18n/ko/references/07a-handoff-core.md +152 -0
  158. package/i18n/ko/references/07b-tasks-tickets.md +215 -0
  159. package/i18n/ko/references/07c-architecture-setup.md +197 -0
  160. package/i18n/ko/references/08-security-checklist.md +221 -0
  161. package/i18n/ko/references/rules-build.md +152 -0
  162. package/i18n/ko/references/rules-change-propagation.md +74 -0
  163. package/i18n/ko/references/rules-commands.md +98 -0
  164. package/i18n/ko/references/rules-context.md +291 -0
  165. package/i18n/ko/references/rules-custom.md +63 -0
  166. package/i18n/ko/references/rules-document-tools.md +126 -0
  167. package/i18n/ko/references/rules-end-of-flow.md +150 -0
  168. package/i18n/ko/references/rules-export-document.md +346 -0
  169. package/i18n/ko/references/rules-file-integration.md +65 -0
  170. package/i18n/ko/references/rules-full.md +66 -0
  171. package/i18n/ko/references/rules-import-document.md +261 -0
  172. package/i18n/ko/references/rules-product-type.md +14 -0
  173. package/i18n/ko/references/rules-progress.md +60 -0
  174. package/i18n/ko/references/rules-quick.md +29 -0
  175. package/i18n/ko/references/rules-revision.md +64 -0
  176. package/i18n/zh-CN/SKILL.md +245 -0
  177. package/i18n/zh-CN/commands/product-build.md +13 -0
  178. package/i18n/zh-CN/commands/product-dev.md +21 -0
  179. package/i18n/zh-CN/commands/product-full.md +13 -0
  180. package/i18n/zh-CN/commands/product-prd.md +14 -0
  181. package/i18n/zh-CN/commands/product-quick.md +13 -0
  182. package/i18n/zh-CN/commands/product-report.md +12 -0
  183. package/i18n/zh-CN/commands/product-revision.md +13 -0
  184. package/i18n/zh-CN/references/00-opportunity-check.md +44 -0
  185. package/i18n/zh-CN/references/01-strategy.md +90 -0
  186. package/i18n/zh-CN/references/02a-persona.md +57 -0
  187. package/i18n/zh-CN/references/02b-jtbd.md +125 -0
  188. package/i18n/zh-CN/references/02c-ost-journey.md +65 -0
  189. package/i18n/zh-CN/references/03-define.md +118 -0
  190. package/i18n/zh-CN/references/04a-prfaq.md +106 -0
  191. package/i18n/zh-CN/references/04b-solutions.md +269 -0
  192. package/i18n/zh-CN/references/04c-mvp.md +21 -0
  193. package/i18n/zh-CN/references/05a-northstar-aha.md +93 -0
  194. package/i18n/zh-CN/references/05b-pmf-gtm.md +102 -0
  195. package/i18n/zh-CN/references/05c-validation-spec.md +117 -0
  196. package/i18n/zh-CN/references/06-html-report.md +123 -0
  197. package/i18n/zh-CN/references/07a-handoff-core.md +152 -0
  198. package/i18n/zh-CN/references/07b-tasks-tickets.md +215 -0
  199. package/i18n/zh-CN/references/07c-architecture-setup.md +197 -0
  200. package/i18n/zh-CN/references/08-security-checklist.md +221 -0
  201. package/i18n/zh-CN/references/rules-build.md +152 -0
  202. package/i18n/zh-CN/references/rules-change-propagation.md +74 -0
  203. package/i18n/zh-CN/references/rules-commands.md +98 -0
  204. package/i18n/zh-CN/references/rules-context.md +291 -0
  205. package/i18n/zh-CN/references/rules-custom.md +63 -0
  206. package/i18n/zh-CN/references/rules-document-tools.md +126 -0
  207. package/i18n/zh-CN/references/rules-end-of-flow.md +150 -0
  208. package/i18n/zh-CN/references/rules-export-document.md +346 -0
  209. package/i18n/zh-CN/references/rules-file-integration.md +65 -0
  210. package/i18n/zh-CN/references/rules-full.md +66 -0
  211. package/i18n/zh-CN/references/rules-import-document.md +261 -0
  212. package/i18n/zh-CN/references/rules-product-type.md +14 -0
  213. package/i18n/zh-CN/references/rules-progress.md +60 -0
  214. package/i18n/zh-CN/references/rules-quick.md +29 -0
  215. package/i18n/zh-CN/references/rules-revision.md +64 -0
  216. package/i18n/zh-TW/SKILL.md +244 -0
  217. package/i18n/zh-TW/commands/product-build.md +13 -0
  218. package/i18n/zh-TW/commands/product-dev.md +21 -0
  219. package/i18n/zh-TW/commands/product-full.md +13 -0
  220. package/i18n/zh-TW/commands/product-prd.md +14 -0
  221. package/i18n/zh-TW/commands/product-quick.md +13 -0
  222. package/i18n/zh-TW/commands/product-report.md +12 -0
  223. package/i18n/zh-TW/commands/product-revision.md +13 -0
  224. package/i18n/zh-TW/references/00-opportunity-check.md +44 -0
  225. package/i18n/zh-TW/references/01-strategy.md +90 -0
  226. package/i18n/zh-TW/references/02a-persona.md +57 -0
  227. package/i18n/zh-TW/references/02b-jtbd.md +125 -0
  228. package/i18n/zh-TW/references/02c-ost-journey.md +65 -0
  229. package/i18n/zh-TW/references/03-define.md +118 -0
  230. package/i18n/zh-TW/references/04a-prfaq.md +106 -0
  231. package/i18n/zh-TW/references/04b-solutions.md +269 -0
  232. package/i18n/zh-TW/references/04c-mvp.md +21 -0
  233. package/i18n/zh-TW/references/05a-northstar-aha.md +93 -0
  234. package/i18n/zh-TW/references/05b-pmf-gtm.md +102 -0
  235. package/i18n/zh-TW/references/05c-validation-spec.md +117 -0
  236. package/i18n/zh-TW/references/06-html-report.md +123 -0
  237. package/i18n/zh-TW/references/07a-handoff-core.md +152 -0
  238. package/i18n/zh-TW/references/07b-tasks-tickets.md +215 -0
  239. package/i18n/zh-TW/references/07c-architecture-setup.md +197 -0
  240. package/i18n/zh-TW/references/08-security-checklist.md +221 -0
  241. package/i18n/zh-TW/references/rules-build.md +152 -0
  242. package/i18n/zh-TW/references/rules-change-propagation.md +74 -0
  243. package/i18n/zh-TW/references/rules-commands.md +98 -0
  244. package/i18n/zh-TW/references/rules-context.md +291 -0
  245. package/i18n/zh-TW/references/rules-custom.md +63 -0
  246. package/i18n/zh-TW/references/rules-document-tools.md +126 -0
  247. package/i18n/zh-TW/references/rules-end-of-flow.md +150 -0
  248. package/i18n/zh-TW/references/rules-export-document.md +346 -0
  249. package/i18n/zh-TW/references/rules-file-integration.md +65 -0
  250. package/i18n/zh-TW/references/rules-full.md +66 -0
  251. package/i18n/zh-TW/references/rules-import-document.md +261 -0
  252. package/i18n/zh-TW/references/rules-product-type.md +14 -0
  253. package/i18n/zh-TW/references/rules-progress.md +60 -0
  254. package/i18n/zh-TW/references/rules-quick.md +29 -0
  255. package/i18n/zh-TW/references/rules-revision.md +64 -0
  256. package/install.sh +418 -0
  257. package/package.json +41 -0
  258. package/references/00-opportunity-check.md +44 -0
  259. package/references/01-strategy.md +90 -0
  260. package/references/02a-persona.md +57 -0
  261. package/references/02b-jtbd.md +125 -0
  262. package/references/02c-ost-journey.md +65 -0
  263. package/references/03-define.md +118 -0
  264. package/references/04a-prfaq.md +106 -0
  265. package/references/04b-solutions.md +269 -0
  266. package/references/04c-mvp.md +21 -0
  267. package/references/05a-northstar-aha.md +93 -0
  268. package/references/05b-pmf-gtm.md +102 -0
  269. package/references/05c-validation-spec.md +117 -0
  270. package/references/06-html-report.md +123 -0
  271. package/references/07a-handoff-core.md +152 -0
  272. package/references/07b-tasks-tickets.md +215 -0
  273. package/references/07c-architecture-setup.md +197 -0
  274. package/references/08-security-checklist.md +221 -0
  275. package/references/rules-build.md +152 -0
  276. package/references/rules-change-propagation.md +74 -0
  277. package/references/rules-commands.md +98 -0
  278. package/references/rules-context.md +291 -0
  279. package/references/rules-custom.md +63 -0
  280. package/references/rules-document-tools.md +126 -0
  281. package/references/rules-end-of-flow.md +150 -0
  282. package/references/rules-export-document.md +346 -0
  283. package/references/rules-file-integration.md +65 -0
  284. package/references/rules-full.md +66 -0
  285. package/references/rules-import-document.md +261 -0
  286. package/references/rules-product-type.md +14 -0
  287. package/references/rules-progress.md +60 -0
  288. package/references/rules-quick.md +29 -0
  289. package/references/rules-revision.md +64 -0
  290. package/references/templates/prd-style.css +464 -0
  291. 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`.