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,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
+ ```
@@ -0,0 +1,150 @@
1
+ # 🏁 流程結束規則
2
+
3
+ > 所有步驟完成時載入。
4
+
5
+ ## ⛔ 結束條件檢查
6
+
7
+ 產出最終整合內容前,必須先執行:
8
+
9
+ 1. 確認進度指示器中所有步驟都已標記 ✅
10
+ 2. 若有步驟被跳過(使用者明確要求),在最終產出中標記「⚠️ 已跳過」
11
+ 3. 若有步驟標記為 ⬜(未執行),不得進入最終產出
12
+ 4. **安全性快速檢查**:若使用者將進入開發階段(產出開發交接包),在最終產出中附上安全性提醒,並在產出開發交接包時自動讀取 `references/08-security-checklist.md` 生成對應的安全架構段落
13
+
14
+ 違反此規則的行為:自行判斷「剩下的步驟不重要」而跳過、將未完成的步驟標記為已完成、合併多個步驟一次產出。
15
+
16
+ ## 🔍 決策一致性檢查
17
+
18
+ 在產出最終整合內容之前,掃描所有已完成的步驟,驗證跨步驟的一致性:
19
+
20
+ ### 依模式檢查項目
21
+
22
+ **🚀 快速模式**(3 步驟 — 檢查 2 項交叉引用):
23
+ 1. JTBD ↔ PR-FAQ:PR-FAQ 是否針對與 JTBD 陳述相同的問題?
24
+ 2. PR-FAQ ↔ North Star:北極星指標是否衡量了 PR-FAQ 承諾的成果?
25
+
26
+ **📦 完整模式**(20 步驟 — 檢查全部 7 項):
27
+ 1. 目標使用者 — 在 JTBD、定位、PR-FAQ 和 North Star 中是否引用相同的人物誌?
28
+ 2. 核心問題 / JTBD — PR-FAQ 針對相同問題?MVP 是否解決?
29
+ 3. 定位 — 是否反映在 PR-FAQ 標題和解法方向中?
30
+ 4. 解法方向 — 選出的解法是否與 MVP 範圍一致?
31
+ 5. MVP 範圍 — 是否與 PR-FAQ 承諾一致?「不做」的項目是否被遵守?
32
+ 6. North Star Metric — 是否衡量 JTBD 成果?在 MVP 範圍內是否可達成?
33
+ 7. Pre-mortem 風險 — 鑑於最終解法和 MVP,是否仍然相關?
34
+
35
+ **🔄 改版模式**(12 步驟 — 檢查 4 項):
36
+ 1. 既有 JTBD ↔ 痛點 ↔ 定位:重新評估後是否一致?
37
+ 2. PR-FAQ ↔ MVP 範圍:改版範圍是否與 PR-FAQ 描述一致?
38
+ 3. North Star ↔ 改版前後:指標比較是否合乎邏輯?
39
+ 4. Pre-mortem 風險:對改版後的產品是否仍然相關?
40
+
41
+ **⚡ 直接實作模式**(7 步驟 — 檢查 4 項):
42
+ 1. 問題陳述 ↔ PR-FAQ:是否針對相同問題?
43
+ 2. 解法方向 ↔ MVP 範圍:選定解法是否與 MVP 一致?
44
+ 3. North Star ↔ MVP:指標在 MVP 範圍內是否可達成?
45
+ 4. Pre-mortem 風險:對最終解法是否仍然相關?
46
+
47
+ **🔧 功能擴充模式**(4 步驟 — 檢查 3 項):
48
+ 1. 問題 ↔ 選定解法:解法是否直接解決所述問題?
49
+ 2. 解法 ↔ 執行範圍:範圍是否正確實作選定解法?
50
+ 3. 風險評估:已識別的風險對執行範圍是否仍然相關?
51
+
52
+ **✏️ 自訂模式** — 僅檢查使用者實際執行的步驟之間的交叉引用。跳過未納入自訂選擇的步驟檢查。
53
+
54
+ ### 執行方式
55
+ 1. 將每個核心決策列為一行摘要(例如:「目標使用者:早期新創公司創辦人」)
56
+ 2. 檢查步驟之間是否存在矛盾或過時的引用
57
+ 3. 若發現不一致:
58
+ - 顯示:「⚠️ 一致性檢查在最終產出前發現 [N] 個問題:」
59
+ - 列出每個問題及受影響的步驟
60
+ - 詢問使用者:「是否要在產出最終內容前修正這些問題,還是直接繼續?」
61
+ 4. 若全部一致:
62
+ - 顯示:「✅ 決策一致性檢查通過 — 所有步驟已對齊。」
63
+ - 繼續產出最終內容
64
+
65
+ ### 為什麼需要這個檢查
66
+ 在迭代規劃過程中,使用者可能修改上游決策(例如:更改 JTBD),而部分下游步驟仍保留過時的內容。此檢查能在最終文件產出前捕捉這些落差,避免產出不一致的交付物。
67
+
68
+ ## 📦 產品上下文自動萃取
69
+
70
+ 所有步驟完成後、產出最終整合內容的同時,讀取 `references/rules-context.md` Section 8 執行上下文萃取:
71
+
72
+ 1. **檢查 `.product-context.md` 是否存在**
73
+ - 不存在 → 建立新檔案
74
+ - 存在 → 依規則更新(Identity/Core Strategy 覆寫,Decision History 追加,Architecture 合併,Insights 合併去重)
75
+
76
+ 2. **萃取內容**(依流程類型對應 `rules-context.md` Section 8 表格)
77
+
78
+ 3. **告知使用者**:在最終產出後顯示:
79
+ 「✅ 產品上下文已更新至 `.product-context.md`,下次規劃時將自動載入。」
80
+
81
+ 4. **版控提醒**(僅首次建立時):
82
+ 「⚠️ 建議將 `.product-context.md` 加入 `.gitignore`,此檔案可能包含敏感的產品策略資訊。」
83
+
84
+ ## 最佳切入點分析(完整模式適用)
85
+
86
+ ```
87
+ [Persona 痛點] → [JTBD 陳述] → [OST 機會] → [HMW 問題]
88
+ → [定位(April Dunford)] → [PR-FAQ 驗證] → [解法選定]
89
+ → [Aha Moment] → [北極星指標] → [PMF 等級判定]
90
+ ```
91
+
92
+ 分析要點:最值得解決的問題 / 核心 JTBD / 產品定位 / PMF 等級與下一里程碑 / 第一步行動 / Pre-mortem 風險警示
93
+
94
+ ## 各模式最終產出
95
+
96
+ | 模式 | 最後自動整合產出 |
97
+ |------|----------------|
98
+ | 🔧 功能擴充模式 | 功能開發規格:問題 → 選定解法 → 影響範圍 → 執行範圍 → 風險 |
99
+ | 🚀 快速模式 | 一頁式方向摘要:問題 → 解法 → 成功定義 |
100
+ | 📦 完整模式 | 最佳切入點分析 + 產品規格摘要 |
101
+ | 🔄 改版模式 | 改版產品規格摘要:改版前後對照 + 改什麼/不改什麼 + 成功指標 |
102
+ | ✏️ 自訂模式 | 產品規格摘要(未執行欄位標記「未執行」) |
103
+ | ⚡ 直接實作模式 | 工程師導向的執行摘要 |
104
+
105
+ ### 產出語言覆寫
106
+
107
+ 使用者可以要求以不同於規劃會議的語言產出文件:
108
+ - 「用日文產出 PR-FAQ」
109
+ - 「用西班牙文輸出報告」
110
+ - 「用中文撰寫 PRD」
111
+
112
+ 當收到語言覆寫請求時:
113
+ 1. 以請求的語言生成產出內容
114
+ 2. 保持框架名稱為英文(JTBD、PR-FAQ、North Star 等)
115
+ 3. 產出完成後回到規劃會議的原始語言
116
+ 4. 注意:這僅影響產出文件的語言,不影響參考檔案或規劃流程
117
+
118
+ ## 延伸產出詢問
119
+
120
+ 完成最終整合產出後,主動詢問:
121
+
122
+ ```
123
+ 「企劃內容已整合完成!需要我幫你產出以下文件嗎?
124
+
125
+ □ 更新版 [文件類型](基於上傳的原始文件增量更新)← 僅在有上傳原始文件時顯示
126
+ □ PDF 文件(專業排版,含書籤導航,適合正式分享)
127
+ □ HTML 企劃報告(互動式,適合線上分享)
128
+ □ Word 文件(適合協作編輯)
129
+ □ PRD 工程師交付包(含流程圖、DB schema、UI wireframe)
130
+ □ 簡報 PPTX(適合會議報告,產出後建議用 Keynote / PowerPoint 美化)
131
+ □ 開發交接包(CLAUDE.md + TASKS.md + TICKETS.md + 技術架構,可直接在 Claude Code 中開始開發)
132
+ □ 以上都要
133
+
134
+ 也可以說「不用」直接結束,或指定特定文件。
135
+ 也可以隨時使用 /export [pdf|docx|pptx|html|md] 匯出。」
136
+ ```
137
+
138
+ **選項顯示規則**:
139
+ - 有上傳原始文件 → 「更新版 [文件類型]」列在最前,標註「(推薦)」
140
+ - 產出對象為工程師 → PRD 和開發交接包排前
141
+ - 產出對象為老闆/高層 → PDF 和簡報排前
142
+ - 產出對象為跨部門 → PDF、HTML 報告和簡報都列出
143
+ - 快速模式 → 只問是否需要 PDF 或簡報
144
+ - 產出對象為自己 → 開發交接包排第一位
145
+
146
+ **匯出觸發規則**:
147
+ - 使用者選擇 PDF / Word / 簡報 PPTX → 載入 `rules-export-document.md`
148
+ - 首次觸發文件匯出 → 先載入 `rules-document-tools.md` 檢查並安裝必要工具
149
+ - 使用者選擇 HTML 企劃報告 → 載入 `06-html-report.md`(現有規則)
150
+ - 使用者選擇「以上都要」→ 依序執行各格式匯出
@@ -0,0 +1,346 @@
1
+ # Multi-Format Document Export Rules
2
+
3
+ > Loaded when the user triggers `/export [format]` or selects an export format after the flow ends.
4
+ > On first use, load `rules-document-tools.md` first to confirm tools are installed.
5
+
6
+ ## Supported Export Formats
7
+
8
+ | Format | Command | Conversion Path | Tools |
9
+ |--------|---------|----------------|-------|
10
+ | PDF | `/export pdf` | HTML+CSS → Playwright → pikepdf bookmarks | Playwright MCP + pikepdf |
11
+ | DOCX | `/export docx` | MD → Pandoc | pandoc + reference.docx |
12
+ | PPTX | `/export pptx` | MD → Pandoc | pandoc |
13
+ | HTML | `/export html` | Existing `06-html-report.md` rules | Built-in |
14
+ | Markdown | `/export md` | Direct output | Built-in |
15
+
16
+ ---
17
+
18
+ ## PDF Export (Core Flow)
19
+
20
+ ### Path Selection
21
+
22
+ PDF export has two paths, automatically selected based on source content:
23
+
24
+ | Source | Path | Reason |
25
+ |--------|------|--------|
26
+ | Planning output direct export (PRD / incremental update / spec) | **Path A: setContent** | No external JS dependencies, all resources can be inlined |
27
+ | HTML planning report to PDF (with Mermaid diagrams / CDN fonts) | **Path B: HTTP Server** | Needs to load external JS (mermaid.js) and CDN fonts |
28
+
29
+ ### Path A: Standalone Document → PDF (setContent)
30
+
31
+ Applicable to: PRD, feature extension incremental updates, specs, any content without external JS.
32
+
33
+ **Step 1: Generate HTML Content**
34
+
35
+ Claude reads `references/templates/prd-style.css` and generates a complete HTML document:
36
+
37
+ ```html
38
+ <!DOCTYPE html>
39
+ <html lang="zh-TW">
40
+ <head>
41
+ <meta charset="UTF-8">
42
+ <style>
43
+ /* Read the full contents of prd-style.css and inline here */
44
+ </style>
45
+ </head>
46
+ <body>
47
+
48
+ <!-- Cover page -->
49
+ <div class="cover-page">
50
+ <h1>[Document Title]</h1>
51
+ <div class="subtitle">[Subtitle or one-line description]</div>
52
+ <div class="version-badge">[Version Number]</div>
53
+ <div class="meta-info">
54
+ <strong>PM</strong> [PM Name]<br>
55
+ <strong>Date</strong> [ISO Date]<br>
56
+ <strong>Status</strong> [Status]
57
+ </div>
58
+ </div>
59
+
60
+ <!-- Legend (only for incremental update documents) -->
61
+ <div class="diff-legend">
62
+ <div class="diff-legend-item"><div class="diff-legend-swatch swatch-new"></div> New in this version</div>
63
+ <div class="diff-legend-item"><div class="diff-legend-swatch swatch-upd"></div> Modified in this version</div>
64
+ <div class="diff-legend-item"><div class="diff-legend-swatch swatch-unchanged"></div> Unchanged</div>
65
+ </div>
66
+
67
+ <!-- Table of Contents page -->
68
+ <div class="toc-page">
69
+ <h2>Table of Contents</h2>
70
+ <ul class="toc">
71
+ <!-- Claude auto-generates TOC items based on h2 headings -->
72
+ <li>
73
+ <span class="toc-title">[Section Name]</span>
74
+ <span class="toc-dots"></span>
75
+ <span class="toc-page-num">[Page Number]</span>
76
+ </li>
77
+ </ul>
78
+ </div>
79
+
80
+ <!-- Body content -->
81
+ [Body HTML]
82
+
83
+ <!-- Footer -->
84
+ <div class="doc-footer">
85
+ [Document Code] [Version] | [Date] | Generated by Product Playbook
86
+ </div>
87
+
88
+ </body>
89
+ </html>
90
+ ```
91
+
92
+ **Important**:
93
+ - CSS must be fully inlined (no external links)
94
+ - Fonts use system fonts: `"PingFang TC", "Noto Sans TC", system-ui` (Playwright will automatically embed in PDF)
95
+ - No `<script>` tags or external resource references
96
+ - TOC page numbers are estimates (may need fine-tuning after PDF generation)
97
+
98
+ **Step 2: Playwright Renders PDF**
99
+
100
+ Save the HTML content to `/tmp/export-{timestamp}.html`, then call Playwright MCP:
101
+
102
+ ```javascript
103
+ // mcp__plugin_playwright_playwright__browser_run_code
104
+ async (page) => {
105
+ const fs = require('fs');
106
+ const html = fs.readFileSync('/tmp/export-{timestamp}.html', 'utf8');
107
+ await page.setContent(html, { waitUntil: 'networkidle' });
108
+ await page.pdf({
109
+ path: '{output_path}',
110
+ format: 'A4',
111
+ margin: { top: '1.8cm', bottom: '1.8cm', left: '2cm', right: '2cm' },
112
+ printBackground: true,
113
+ displayHeaderFooter: true,
114
+ headerTemplate: '<div></div>',
115
+ footerTemplate: '<div style="font-size:8pt;color:#999;text-align:center;width:100%;">p.<span class="pageNumber"></span> / <span class="totalPages"></span></div>'
116
+ });
117
+ return 'PDF generated';
118
+ }
119
+ ```
120
+
121
+ > Note: If the HTML content is too large (>500KB), setContent may time out. In that case, switch to Path B (HTTP Server).
122
+
123
+ **Step 3: pikepdf Bookmark Injection**
124
+
125
+ ```python
126
+ import pikepdf, re
127
+
128
+ pdf = pikepdf.open('{output_path}')
129
+
130
+ # Extract h2 headings from HTML as bookmarks
131
+ # Claude should record the estimated page number for each h2 when generating HTML
132
+ bookmarks = [
133
+ # (title, page index 0-based)
134
+ ("Revision History", 2),
135
+ ("User Story", 4),
136
+ ("Development Architecture", 6),
137
+ # ... generated based on actual content
138
+ ]
139
+
140
+ with pdf.open_outline() as outline:
141
+ for title, page_idx in bookmarks:
142
+ page_idx = min(page_idx, len(pdf.pages) - 1)
143
+ outline.root.append(
144
+ pikepdf.OutlineItem(title, page_idx)
145
+ )
146
+
147
+ # Set PDF metadata
148
+ with pdf.open_metadata() as meta:
149
+ meta['dc:title'] = '[Document Title]'
150
+ meta['dc:creator'] = ['[PM Name]']
151
+ meta['pdf:Producer'] = 'Product Playbook + Playwright'
152
+
153
+ pdf.save('{output_path}')
154
+ ```
155
+
156
+ **Step 4: Notify User**
157
+
158
+ ```
159
+ ✅ PDF exported to: {output_path}
160
+ 📄 {page_count} pages | {file_size}
161
+ 📑 Includes bookmark navigation ({bookmark_count} sections)
162
+ ```
163
+
164
+ ### Path B: HTML Report → PDF (HTTP Server)
165
+
166
+ Applicable to: HTML reports with Mermaid diagrams, CDN fonts, interactive elements.
167
+
168
+ **Step 1: HTML Report Already Generated**
169
+
170
+ The HTML report is generated by `06-html-report.md` rules and saved as `/tmp/report-{timestamp}.html`.
171
+
172
+ **Step 2: Start HTTP Server**
173
+
174
+ ```bash
175
+ cd /tmp && python3 -m http.server 18899 &
176
+ echo $! # Record PID
177
+ ```
178
+
179
+ **Step 3: Playwright Rendering**
180
+
181
+ ```javascript
182
+ // mcp__plugin_playwright_playwright__browser_run_code
183
+ async (page) => {
184
+ await page.goto('http://localhost:18899/report-{timestamp}.html', {
185
+ waitUntil: 'networkidle',
186
+ timeout: 30000
187
+ });
188
+ // Wait for Mermaid chart rendering to complete
189
+ await page.waitForTimeout(3000);
190
+ // Expand all accordion (<details>) elements
191
+ await page.evaluate(() => {
192
+ document.querySelectorAll('details').forEach(d => d.open = true);
193
+ });
194
+ await page.pdf({
195
+ path: '{output_path}',
196
+ format: 'A4',
197
+ margin: { top: '1.8cm', bottom: '1.8cm', left: '2cm', right: '2cm' },
198
+ printBackground: true,
199
+ displayHeaderFooter: true,
200
+ headerTemplate: '<div></div>',
201
+ footerTemplate: '<div style="font-size:8pt;color:#999;text-align:center;width:100%;">p.<span class="pageNumber"></span> / <span class="totalPages"></span></div>'
202
+ });
203
+ return 'PDF generated';
204
+ }
205
+ ```
206
+
207
+ **Step 4: Shut Down HTTP Server + pikepdf Bookmarks**
208
+
209
+ ```bash
210
+ kill {SERVER_PID}
211
+ ```
212
+
213
+ Then perform the same pikepdf bookmark injection step as Path A.
214
+
215
+ ### Playwright MCP Unavailable Fallback
216
+
217
+ If Playwright MCP is not connected, use Node.js directly:
218
+
219
+ ```bash
220
+ node -e "
221
+ const { chromium } = require('playwright');
222
+ const fs = require('fs');
223
+ (async () => {
224
+ const browser = await chromium.launch({ headless: true });
225
+ const page = await browser.newPage();
226
+ const html = fs.readFileSync('/tmp/export-{timestamp}.html', 'utf8');
227
+ await page.setContent(html, { waitUntil: 'networkidle' });
228
+ await page.pdf({
229
+ path: '${OUTPUT_PATH}',
230
+ format: 'A4',
231
+ printBackground: true,
232
+ margin: { top: '1.8cm', bottom: '1.8cm', left: '2cm', right: '2cm' }
233
+ });
234
+ await browser.close();
235
+ console.log('PDF generated');
236
+ })();
237
+ "
238
+ ```
239
+
240
+ ---
241
+
242
+ ## DOCX Export
243
+
244
+ ### Step 1: Generate Markdown
245
+
246
+ Claude organizes the planning output into clean Markdown format and saves it as `/tmp/export-{timestamp}.md`.
247
+
248
+ ### Step 2: Pandoc Conversion
249
+
250
+ ```bash
251
+ pandoc /tmp/export-{timestamp}.md \
252
+ -o "{output_path}" \
253
+ --from markdown \
254
+ --to docx \
255
+ --reference-doc="~/.claude/skills/product-playbook/references/templates/reference.docx" \
256
+ --toc \
257
+ --toc-depth=2
258
+ ```
259
+
260
+ If no reference.docx template is available, omit the `--reference-doc` parameter (uses Pandoc default styles).
261
+
262
+ ### Step 3: Notify User
263
+
264
+ ```
265
+ ✅ Word document exported to: {output_path}
266
+ 📄 Includes table of contents | {file_size}
267
+ ```
268
+
269
+ ---
270
+
271
+ ## PPTX Export
272
+
273
+ ```bash
274
+ pandoc /tmp/export-{timestamp}.md \
275
+ -o "{output_path}" \
276
+ --from markdown \
277
+ --to pptx \
278
+ --slide-level=2
279
+ ```
280
+
281
+ > Tip: Pandoc PPTX quality is limited. It's recommended to use the PPTX as an outline, then polish it with PowerPoint/Keynote.
282
+
283
+ ---
284
+
285
+ ## Special Handling for Incremental Update Documents
286
+
287
+ When exporting Feature Extension or Revision mode incremental update documents:
288
+
289
+ ### Diff Visual Marking Rules
290
+
291
+ 1. **Paragraphs marked `[NEW]`**:
292
+ - Use `<span class="new">NEW</span>` marker
293
+ - Table rows get `class="new-row"`
294
+ - Paragraphs get `class="diff-added"`
295
+
296
+ 2. **Paragraphs marked `[UPDATED]`**:
297
+ - Use `<span class="upd">UPDATED</span>` marker
298
+ - Table rows get `class="upd-row"`
299
+ - If original content exists, original content gets `class="diff-removed"`, new content gets `class="diff-added"`
300
+
301
+ 3. **Unchanged paragraphs**: Display normally, no special markers
302
+
303
+ 4. **Legend at document start**:
304
+ ```html
305
+ <div class="diff-legend">
306
+ <div class="diff-legend-item">
307
+ <div class="diff-legend-swatch swatch-new"></div> New in this version
308
+ </div>
309
+ <div class="diff-legend-item">
310
+ <div class="diff-legend-swatch swatch-upd"></div> Modified in this version
311
+ </div>
312
+ <div class="diff-legend-item">
313
+ <div class="diff-legend-swatch swatch-unchanged"></div> No marker = Unchanged
314
+ </div>
315
+ </div>
316
+ ```
317
+
318
+ ---
319
+
320
+ ## Output Path Rules
321
+
322
+ Default output to `~/Downloads/`, filename format:
323
+
324
+ ```
325
+ [Document Code] [Document Title] [Version].{ext}
326
+
327
+ Examples:
328
+ [D-221] Virtual Account v1.0.14 Full Merged Version.pdf
329
+ Product Planning Report - UPASS Virtual Account.docx
330
+ ```
331
+
332
+ If the user specifies a path, use the user-specified path.
333
+
334
+ ---
335
+
336
+ ## Quality Checklist
337
+
338
+ Before export, Claude self-checks:
339
+
340
+ - [ ] No residual Markdown syntax in HTML (`**`, `##`, `|---|`)
341
+ - [ ] All table row and column counts match the original content
342
+ - [ ] `[NEW]` / `[UPDATED]` markers correctly mapped to corresponding CSS classes
343
+ - [ ] Cover page information (title, version, PM, date) is correct
344
+ - [ ] TOC items match the body h2 headings
345
+ - [ ] CSS is fully inlined (Path A) or CDN is accessible (Path B)
346
+ - [ ] Bookmark count matches h2 heading count
@@ -0,0 +1,65 @@
1
+ # 📎 File Integration Guide
2
+
3
+ > Loaded when the user uploads supplementary materials.
4
+
5
+ ## Directly Supported File Types
6
+
7
+ | File Type | Common Scenarios | Integration Method |
8
+ |-----------|-----------------|-------------------|
9
+ | **Images** | Competitor screenshots, whiteboard photos, hand-drawn journey maps, app interface screenshots, data report screenshots | Recognize content and integrate into the corresponding step |
10
+ | **PDF** | Market reports, internal documents, user research reports, legacy PRDs | Load `rules-import-document.md` for three-layer parsing (pymupdf direct extraction → Claude Vision semantic parsing → Tesseract fallback). On first use, load `rules-document-tools.md` to check tools. |
11
+ | **CSV / Excel** | User behavior data, retention data, NPS survey results, sales data | Analyze data and use for quantitative assessment |
12
+ | **Text files** | Interview transcripts, existing requirements documents, meeting notes | Extract Persona clues, pain points, JTBD evidence |
13
+ | **DOCX** | Existing PRDs, product spec documents, user research reports | Load `rules-import-document.md`, use Pandoc to convert to Markdown then integrate. On first use, load `rules-document-tools.md` to check tools. |
14
+ | **PPTX** | Existing presentations, product intro slides | Load `rules-import-document.md`, use Pandoc to convert to Markdown then integrate. |
15
+
16
+ ## Not Directly Supported but Guidance Available
17
+
18
+ | File Type | Guidance |
19
+ |-----------|----------|
20
+ | **Video** | Ask the user to describe key scenes, or provide a transcript/subtitle file |
21
+ | **Figma / Sketch** | Ask the user to take screenshots and upload them |
22
+ | **Protobuf / Swagger** | Ask the user to export as JSON or text format |
23
+
24
+ ## File → Step Auto-Mapping Table
25
+
26
+ | Uploaded Content | Auto-Mapped Step | Integration Action |
27
+ |-----------------|-----------------|-------------------|
28
+ | Competitor app / website screenshots | Positioning | Identify as "competitive alternatives," analyze differentiation |
29
+ | Whiteboard hand-drawn flowchart | Journey Map / OST | Recognize the flow and convert into a structured table |
30
+ | User interview transcript | Persona + JTBD | Extract pain points, current workarounds, emotional reactions, Job statements |
31
+ | User behavior data (CSV) | Opportunity Assessment + North Star + PMF | Replace assumption-based scores with real data |
32
+ | NPS / satisfaction survey | PMF + Sean Ellis Score | Directly calculate the Score; determine PMF level |
33
+ | Existing PRD / requirements document | Revision Mode S1 + MVP | Extract existing feature list and decision history |
34
+ | Market report PDF | Opportunity Assessment + Strategy | Extract market size, trends, competitive landscape |
35
+ | Sales data | Business Model + GTM | Analyze revenue structure, customer distribution, channel effectiveness |
36
+ | App interface screenshots | Aha Moment + Journey | Analyze the current experience path |
37
+
38
+ ## Integration Rules
39
+
40
+ 1. **Proactive identification**: First explain "I see you uploaded [file type]. I will integrate the [key information] from it into [step name]."
41
+ 2. **Do not overwrite existing output**: Mark the uploaded content as "supplementary material," update the output, and trigger the change propagation rules
42
+ 3. **Mark the source**: Annotate in the output which content came from the uploaded file (e.g., "✦ From the uploaded user research report")
43
+ 4. **Data takes priority**: When real data conflicts with previous assumptions, defer to the real data
44
+ 5. **Cross-step impact**: A single file may affect multiple steps — list all affected steps at once
45
+
46
+ ## 📎 Source Document Identification & Incremental Update
47
+
48
+ When a user uploads a file during **Feature Extension** or **Revision Mode**, determine if it is a "source document" (a document that should be incrementally updated with the new planning output):
49
+
50
+ ### Identification Criteria
51
+ - File type: PRD, product spec, architecture doc, requirements doc, design doc
52
+ - User explicitly says: "this is our current PRD", "update this document", "build on this spec", etc.
53
+ - Uploaded during S1 (context collection) of Feature Extension or Revision Mode
54
+
55
+ ### When a Source Document Is Identified
56
+ 1. Mark it: "📎 Source document detected — final output will be an incremental update based on this file"
57
+ 2. Parse the document structure (section headings, formatting conventions, naming patterns)
58
+ 3. Record the document's format and style for consistent output
59
+ 4. During S1, use the document to pre-fill existing system context (tech stack, modules, features)
60
+
61
+ ### Incremental Output Rules (applied at Final Output stage)
62
+ - New content inserted into the appropriate sections, marked with `[NEW]`
63
+ - Modified content marked with `[UPDATED]`, original content preserved as comment
64
+ - Sections unrelated to the new feature remain untouched
65
+ - The output document maintains the original file's format, style, and naming conventions