@c0x12c/ai-toolkit 1.15.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 (255) hide show
  1. package/.claude-plugin/marketplace.json +16 -0
  2. package/.claude-plugin/plugin.json +12 -0
  3. package/README.md +439 -0
  4. package/VERSION +1 -0
  5. package/agents/design-critic.md +127 -0
  6. package/agents/idea-killer.md +72 -0
  7. package/agents/infrastructure-expert.md +49 -0
  8. package/agents/micronaut-backend-expert.md +45 -0
  9. package/agents/phase-reviewer.md +150 -0
  10. package/agents/research-planner.md +70 -0
  11. package/agents/solution-architect-cto.md +49 -0
  12. package/agents/sre-architect.md +49 -0
  13. package/agents/team-coordinator.md +111 -0
  14. package/bin/cli.js +780 -0
  15. package/claude-md/00-header.md +39 -0
  16. package/claude-md/01-core.md +105 -0
  17. package/claude-md/05-database.md +20 -0
  18. package/claude-md/11-backend-micronaut.md +19 -0
  19. package/claude-md/20-frontend-react.md +44 -0
  20. package/claude-md/25-ux-design.md +56 -0
  21. package/claude-md/30-infrastructure.md +24 -0
  22. package/claude-md/30-project-mgmt.md +119 -0
  23. package/claude-md/40-product.md +39 -0
  24. package/claude-md/50-ops.md +34 -0
  25. package/claude-md/60-research.md +27 -0
  26. package/claude-md/90-footer.md +21 -0
  27. package/commands/spartan/brainstorm.md +134 -0
  28. package/commands/spartan/brownfield.md +157 -0
  29. package/commands/spartan/build.md +435 -0
  30. package/commands/spartan/careful.md +94 -0
  31. package/commands/spartan/commit-message.md +112 -0
  32. package/commands/spartan/content.md +17 -0
  33. package/commands/spartan/context-save.md +161 -0
  34. package/commands/spartan/contribute.md +140 -0
  35. package/commands/spartan/daily.md +42 -0
  36. package/commands/spartan/debug.md +308 -0
  37. package/commands/spartan/deep-dive.md +55 -0
  38. package/commands/spartan/deploy.md +207 -0
  39. package/commands/spartan/e2e.md +264 -0
  40. package/commands/spartan/env-setup.md +166 -0
  41. package/commands/spartan/epic.md +199 -0
  42. package/commands/spartan/fe-review.md +181 -0
  43. package/commands/spartan/figma-to-code.md +260 -0
  44. package/commands/spartan/forensics.md +46 -0
  45. package/commands/spartan/freeze.md +84 -0
  46. package/commands/spartan/fundraise.md +53 -0
  47. package/commands/spartan/gate-review.md +229 -0
  48. package/commands/spartan/gsd-upgrade.md +376 -0
  49. package/commands/spartan/guard.md +42 -0
  50. package/commands/spartan/init-project.md +178 -0
  51. package/commands/spartan/init-rules.md +298 -0
  52. package/commands/spartan/interview.md +154 -0
  53. package/commands/spartan/kickoff.md +73 -0
  54. package/commands/spartan/kotlin-service.md +109 -0
  55. package/commands/spartan/lean-canvas.md +222 -0
  56. package/commands/spartan/lint-rules.md +122 -0
  57. package/commands/spartan/map-codebase.md +124 -0
  58. package/commands/spartan/migration.md +82 -0
  59. package/commands/spartan/next-app.md +317 -0
  60. package/commands/spartan/next-feature.md +212 -0
  61. package/commands/spartan/onboard.md +326 -0
  62. package/commands/spartan/outreach.md +16 -0
  63. package/commands/spartan/phase.md +142 -0
  64. package/commands/spartan/pitch.md +18 -0
  65. package/commands/spartan/plan.md +210 -0
  66. package/commands/spartan/pr-ready.md +202 -0
  67. package/commands/spartan/project.md +106 -0
  68. package/commands/spartan/qa.md +222 -0
  69. package/commands/spartan/research.md +254 -0
  70. package/commands/spartan/review.md +132 -0
  71. package/commands/spartan/scan-rules.md +173 -0
  72. package/commands/spartan/sessions.md +143 -0
  73. package/commands/spartan/spec.md +131 -0
  74. package/commands/spartan/startup.md +257 -0
  75. package/commands/spartan/team.md +570 -0
  76. package/commands/spartan/teardown.md +161 -0
  77. package/commands/spartan/testcontainer.md +97 -0
  78. package/commands/spartan/tf-cost.md +123 -0
  79. package/commands/spartan/tf-deploy.md +116 -0
  80. package/commands/spartan/tf-drift.md +100 -0
  81. package/commands/spartan/tf-import.md +107 -0
  82. package/commands/spartan/tf-module.md +121 -0
  83. package/commands/spartan/tf-plan.md +100 -0
  84. package/commands/spartan/tf-review.md +106 -0
  85. package/commands/spartan/tf-scaffold.md +109 -0
  86. package/commands/spartan/tf-security.md +147 -0
  87. package/commands/spartan/think.md +221 -0
  88. package/commands/spartan/unfreeze.md +13 -0
  89. package/commands/spartan/update.md +134 -0
  90. package/commands/spartan/ux.md +1233 -0
  91. package/commands/spartan/validate.md +193 -0
  92. package/commands/spartan/web-to-prd.md +706 -0
  93. package/commands/spartan/workstreams.md +109 -0
  94. package/commands/spartan/write.md +16 -0
  95. package/commands/spartan.md +386 -0
  96. package/frameworks/00-framework-comparison-guide.md +317 -0
  97. package/frameworks/01-lean-canvas.md +196 -0
  98. package/frameworks/02-design-sprint.md +304 -0
  99. package/frameworks/03-foundation-sprint.md +337 -0
  100. package/frameworks/04-business-model-canvas.md +391 -0
  101. package/frameworks/05-customer-development.md +426 -0
  102. package/frameworks/06-jobs-to-be-done.md +358 -0
  103. package/frameworks/07-mom-test.md +392 -0
  104. package/frameworks/08-value-proposition-canvas.md +488 -0
  105. package/frameworks/09-javelin-board.md +428 -0
  106. package/frameworks/10-build-measure-learn.md +467 -0
  107. package/frameworks/11-mvp-approaches.md +533 -0
  108. package/frameworks/think-before-build.md +593 -0
  109. package/lib/assembler.js +197 -0
  110. package/lib/assembler.test.js +159 -0
  111. package/lib/detector.js +166 -0
  112. package/lib/detector.test.js +221 -0
  113. package/lib/packs.js +16 -0
  114. package/lib/resolver.js +272 -0
  115. package/lib/resolver.test.js +298 -0
  116. package/lib/worktree.sh +104 -0
  117. package/package.json +50 -0
  118. package/packs/backend-micronaut.yaml +35 -0
  119. package/packs/backend-nodejs.yaml +15 -0
  120. package/packs/backend-python.yaml +15 -0
  121. package/packs/core.yaml +37 -0
  122. package/packs/database.yaml +21 -0
  123. package/packs/frontend-react.yaml +24 -0
  124. package/packs/infrastructure.yaml +40 -0
  125. package/packs/ops.yaml +16 -0
  126. package/packs/packs.compiled.json +371 -0
  127. package/packs/product.yaml +22 -0
  128. package/packs/project-mgmt.yaml +24 -0
  129. package/packs/research.yaml +39 -0
  130. package/packs/shared-backend.yaml +14 -0
  131. package/packs/ux-design.yaml +21 -0
  132. package/rules/backend-micronaut/API_DESIGN.md +313 -0
  133. package/rules/backend-micronaut/BATCH_PROCESSING.md +92 -0
  134. package/rules/backend-micronaut/CONTROLLERS.md +388 -0
  135. package/rules/backend-micronaut/KOTLIN.md +414 -0
  136. package/rules/backend-micronaut/RETROFIT_PLACEMENT.md +290 -0
  137. package/rules/backend-micronaut/SERVICES_AND_BEANS.md +325 -0
  138. package/rules/core/NAMING_CONVENTIONS.md +208 -0
  139. package/rules/core/SKILL_AUTHORING.md +174 -0
  140. package/rules/core/TIMEZONE.md +316 -0
  141. package/rules/database/ORM_AND_REPO.md +289 -0
  142. package/rules/database/SCHEMA.md +146 -0
  143. package/rules/database/TRANSACTIONS.md +311 -0
  144. package/rules/frontend-react/FRONTEND.md +344 -0
  145. package/rules/infrastructure/MODULES.md +260 -0
  146. package/rules/infrastructure/NAMING.md +196 -0
  147. package/rules/infrastructure/PROVIDERS.md +309 -0
  148. package/rules/infrastructure/SECURITY.md +310 -0
  149. package/rules/infrastructure/STATE_AND_BACKEND.md +237 -0
  150. package/rules/infrastructure/STRUCTURE.md +234 -0
  151. package/rules/infrastructure/VARIABLES.md +285 -0
  152. package/rules/shared-backend/ARCHITECTURE.md +46 -0
  153. package/rules/ux-design/DESIGN_PROCESS.md +176 -0
  154. package/skills/api-endpoint-creator/SKILL.md +455 -0
  155. package/skills/api-endpoint-creator/error-handling-guide.md +244 -0
  156. package/skills/api-endpoint-creator/examples.md +522 -0
  157. package/skills/api-endpoint-creator/testing-patterns.md +302 -0
  158. package/skills/article-writing/SKILL.md +109 -0
  159. package/skills/article-writing/examples.md +59 -0
  160. package/skills/backend-api-design/SKILL.md +84 -0
  161. package/skills/backend-api-design/code-patterns.md +138 -0
  162. package/skills/brainstorm/SKILL.md +95 -0
  163. package/skills/browser-qa/SKILL.md +87 -0
  164. package/skills/browser-qa/playwright-snippets.md +110 -0
  165. package/skills/ci-cd-patterns/SKILL.md +108 -0
  166. package/skills/ci-cd-patterns/workflows.md +149 -0
  167. package/skills/competitive-teardown/SKILL.md +93 -0
  168. package/skills/competitive-teardown/example-analysis.md +50 -0
  169. package/skills/content-engine/SKILL.md +131 -0
  170. package/skills/content-engine/examples.md +72 -0
  171. package/skills/database-patterns/SKILL.md +72 -0
  172. package/skills/database-patterns/code-templates.md +114 -0
  173. package/skills/database-table-creator/SKILL.md +141 -0
  174. package/skills/database-table-creator/examples.md +552 -0
  175. package/skills/database-table-creator/kotlin-templates.md +400 -0
  176. package/skills/database-table-creator/migration-template.sql +68 -0
  177. package/skills/database-table-creator/validation-checklist.md +337 -0
  178. package/skills/deep-research/SKILL.md +80 -0
  179. package/skills/design-intelligence/SKILL.md +268 -0
  180. package/skills/design-workflow/SKILL.md +127 -0
  181. package/skills/design-workflow/checklists.md +45 -0
  182. package/skills/idea-validation/SKILL.md +129 -0
  183. package/skills/idea-validation/example-report.md +50 -0
  184. package/skills/investor-materials/SKILL.md +122 -0
  185. package/skills/investor-materials/example-outline.md +70 -0
  186. package/skills/investor-outreach/SKILL.md +112 -0
  187. package/skills/investor-outreach/examples.md +76 -0
  188. package/skills/kotlin-best-practices/SKILL.md +58 -0
  189. package/skills/kotlin-best-practices/code-patterns.md +132 -0
  190. package/skills/market-research/SKILL.md +99 -0
  191. package/skills/security-checklist/SKILL.md +65 -0
  192. package/skills/security-checklist/audit-reference.md +95 -0
  193. package/skills/service-debugging/SKILL.md +116 -0
  194. package/skills/service-debugging/common-issues.md +65 -0
  195. package/skills/startup-pipeline/SKILL.md +152 -0
  196. package/skills/terraform-best-practices/SKILL.md +244 -0
  197. package/skills/terraform-module-creator/SKILL.md +284 -0
  198. package/skills/terraform-review/SKILL.md +222 -0
  199. package/skills/terraform-security-audit/SKILL.md +280 -0
  200. package/skills/terraform-service-scaffold/SKILL.md +574 -0
  201. package/skills/testing-strategies/SKILL.md +116 -0
  202. package/skills/testing-strategies/examples.md +103 -0
  203. package/skills/testing-strategies/integration-test-setup.md +71 -0
  204. package/skills/ui-ux-pro-max/SKILL.md +238 -0
  205. package/skills/ui-ux-pro-max/data/charts.csv +26 -0
  206. package/skills/ui-ux-pro-max/data/colors.csv +97 -0
  207. package/skills/ui-ux-pro-max/data/icons.csv +101 -0
  208. package/skills/ui-ux-pro-max/data/landing.csv +31 -0
  209. package/skills/ui-ux-pro-max/data/products.csv +97 -0
  210. package/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  211. package/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  212. package/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  213. package/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  214. package/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  215. package/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  216. package/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  217. package/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  218. package/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  219. package/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  220. package/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  221. package/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  222. package/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  223. package/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  224. package/skills/ui-ux-pro-max/data/styles.csv +68 -0
  225. package/skills/ui-ux-pro-max/data/typography.csv +58 -0
  226. package/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  227. package/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  228. package/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  229. package/skills/ui-ux-pro-max/python-setup.md +146 -0
  230. package/skills/ui-ux-pro-max/scripts/core.py +253 -0
  231. package/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
  232. package/skills/ui-ux-pro-max/scripts/search.py +114 -0
  233. package/skills/web-to-prd/SKILL.md +478 -0
  234. package/templates/build-config.yaml +44 -0
  235. package/templates/commands-config.yaml +55 -0
  236. package/templates/competitor-analysis.md +60 -0
  237. package/templates/content/AGENT_TEMPLATE.md +47 -0
  238. package/templates/content/COMMAND_TEMPLATE.md +27 -0
  239. package/templates/content/RULE_TEMPLATE.md +40 -0
  240. package/templates/content/SKILL_TEMPLATE.md +41 -0
  241. package/templates/design-config.md +105 -0
  242. package/templates/design-doc.md +207 -0
  243. package/templates/epic.md +100 -0
  244. package/templates/feature-spec.md +181 -0
  245. package/templates/idea-canvas.md +47 -0
  246. package/templates/implementation-plan.md +159 -0
  247. package/templates/prd-template.md +86 -0
  248. package/templates/preamble.md +89 -0
  249. package/templates/project-readme.md +35 -0
  250. package/templates/quality-gates.md +230 -0
  251. package/templates/spartan-config.yaml +164 -0
  252. package/templates/user-interview.md +69 -0
  253. package/templates/validation-checklist.md +108 -0
  254. package/templates/workflow-backend-micronaut.md +409 -0
  255. package/templates/workflow-frontend-react.md +233 -0
@@ -0,0 +1,706 @@
1
+ ---
2
+ name: spartan:web-to-prd
3
+ description: Scan a live web app, extract all features, generate PRD with epics/stories/tasks, export to Notion
4
+ argument-hint: "[URL of the web app to scan]"
5
+ preamble-tier: 3
6
+ ---
7
+
8
+ # Web-to-PRD: {{ args[0] | default: "https://example.com" }}
9
+
10
+ You are the **Web-to-PRD pipeline** — scan a live web app, extract every feature, create PM artifacts, and push to Notion.
11
+
12
+ **Target URL:** {{ args[0] | default: "https://example.com" }}
13
+
14
+ ---
15
+
16
+ ## Step 0: Prerequisite Check
17
+
18
+ **This step is mandatory. Do NOT skip it.**
19
+
20
+ **IMPORTANT: `claude mcp add/remove` does NOT make tools available mid-session.** MCP tools only load when Claude Code starts. NEVER try to install or reconfigure MCP servers during a running session — it changes the config but won't load the tools. This causes the session to get stuck in a loop.
21
+
22
+ ### Check 1: Playwright MCP (REQUIRED)
23
+
24
+ Try to call any Playwright MCP tool (like `browser_snapshot` or `browser_navigate`).
25
+
26
+ **If the tool works** → check config is good:
27
+
28
+ ```bash
29
+ cat ~/.claude.json 2>/dev/null | grep -A5 playwright || \
30
+ cat .claude.json 2>/dev/null | grep -A5 playwright || \
31
+ echo "NO_CONFIG_FOUND"
32
+ ```
33
+
34
+ | Config | Status | Action |
35
+ |--------|--------|--------|
36
+ | `--user-data-dir` with `.playwright-profile` | Good | Proceed |
37
+ | `--user-data-dir` pointing to real Chrome profile | Risky | Warn: extensions cause timeouts |
38
+ | No `--user-data-dir` (clean mode) | OK for public sites | Proceed |
39
+ | `--cdp-endpoint` | Advanced mode | Proceed |
40
+
41
+ **If the tool is NOT found** → Playwright MCP is not loaded. Show this and STOP:
42
+
43
+ ```
44
+ Playwright MCP is not available. I need it to control a browser.
45
+
46
+ Run this in your terminal (outside Claude Code):
47
+
48
+ claude mcp add playwright -- npx @playwright/mcp@latest --user-data-dir=$HOME/.playwright-profile --browser=chrome
49
+
50
+ Then restart Claude Code and run:
51
+
52
+ /spartan:web-to-prd {{ args[0] | default: "URL" }}
53
+ ```
54
+
55
+ **Do NOT try to run `claude mcp add` yourself.** It won't load the tools in this session.
56
+
57
+ ### Check 2: Notion MCP (OPTIONAL)
58
+
59
+ Try to call `notion-search` with query "test".
60
+
61
+ - **If found** → will export to Notion at the end.
62
+ - **If not found** → note it, PRD will be saved locally. This is fine — continue the crawl.
63
+
64
+ Notion is a nice-to-have. The PRD always saves locally regardless.
65
+
66
+ ### Show status and proceed
67
+
68
+ ```
69
+ Prerequisite Check:
70
+ Playwright MCP: [connected / not found]
71
+ Notion MCP: [connected / not found] (optional)
72
+
73
+ [If Playwright connected]: Ready to scan. Proceeding...
74
+ [If Playwright missing]: Install instructions above. STOP.
75
+ ```
76
+
77
+ **Only Playwright is required. Notion is optional.**
78
+
79
+ ---
80
+
81
+ ## Step 1: Navigate and Handle Login
82
+
83
+ **This step ensures we're fully logged in before exploring anything.**
84
+
85
+ ### 1-pre. Clean up stale browser processes (MANDATORY before first navigate)
86
+
87
+ Playwright MCP leaves orphan Chrome processes from previous runs. These cause "Opening in existing browser session" errors. **Always run this before the first `browser_navigate` call:**
88
+
89
+ ```bash
90
+ # Remove stale lock files (safe — doesn't kill any processes)
91
+ rm -f "$HOME/.playwright-profile/SingletonLock" \
92
+ "$HOME/.playwright-profile/SingletonCookie" \
93
+ "$HOME/.playwright-profile/SingletonSocket" 2>/dev/null
94
+
95
+ echo "Browser cleanup done"
96
+ ```
97
+
98
+ **WARNING:** Do NOT run `pkill -f "playwright-profile"` — it kills the Playwright MCP server process too, disconnecting the tools mid-session. Only remove lock files.
99
+
100
+ **If `browser_navigate` still fails with "Opening in existing browser session":**
101
+ 1. Run the cleanup again
102
+ 2. Wait 2 seconds
103
+ 3. Retry once
104
+ 4. If still fails → tell user to restart Claude Code (MCP server needs fresh start)
105
+
106
+ Now navigate to the target URL using Playwright. Take a snapshot.
107
+
108
+ ### 1a. Check if login is needed
109
+
110
+ Look at the snapshot for login signals:
111
+ - Login/Sign-in form fields (email, password)
112
+ - "Sign in", "Log in", "Create account" text
113
+ - OAuth buttons (Google, GitHub, SSO)
114
+ - URL contains `/login`, `/signin`, `/auth`
115
+ - Redirect to a different domain (auth provider)
116
+
117
+ ### 1b. If login page detected — STOP and handle login
118
+
119
+ Playwright opens a **visible browser window** (headed mode). The user can see and interact with it.
120
+
121
+ Tell the user:
122
+
123
+ > "This app needs login before I can see all the features.
124
+ > A Chrome window should be open on your screen.
125
+ >
126
+ > Please log in directly in that browser window.
127
+ > I won't see or store your credentials.
128
+ >
129
+ > Tell me when you're logged in."
130
+
131
+ **Wait for user confirmation.** Do NOT proceed until they say "done", "logged in", or similar.
132
+
133
+ After user confirms:
134
+ 1. Take a snapshot of the current page
135
+ 2. Check if still on login page → "Still seeing the login page. Try again?"
136
+ 3. Check if on dashboard/home/main content → "Logged in. Proceeding."
137
+ 4. If unclear → ask user: "I see [page title]. Is this the main page after login?"
138
+
139
+ **Repeat until login is confirmed.** Do NOT start crawling while on a login page.
140
+
141
+ **Login security rules:**
142
+ - Never use `browser_type` to enter passwords — user types directly in browser
143
+ - Never ask for credentials in chat
144
+ - Never screenshot login pages (could capture pre-filled credentials)
145
+ - SSO/OAuth popups work normally — wait for user to complete
146
+
147
+ ### 1c. If NOT a login page — proceed directly
148
+
149
+ The site is public or already logged in (cookies from previous session).
150
+
151
+ ### 1d. Verify access level
152
+
153
+ After login (or on public site), check what's visible:
154
+
155
+ > "I can see [dashboard/home page]. I see these navigation sections:
156
+ > 1. [Section name]
157
+ > 2. [Section name]
158
+ > ...
159
+ >
160
+ > Does this look like full access? Or are there sections I'm missing?
161
+ > (Some apps hide admin/settings pages behind roles)"
162
+
163
+ **Wait for user to confirm** before starting the full crawl. This prevents generating a PRD from a limited view.
164
+
165
+ ### 1e. Show crawl plan
166
+
167
+ ```
168
+ Crawl Plan: [App Name]
169
+ URL: [target URL]
170
+ Type: [SPA / Multi-page / Hybrid]
171
+ Auth: [Logged in / Public]
172
+ Estimated pages: ~[N]
173
+ Estimated time: [N] minutes
174
+
175
+ Sections to explore:
176
+ 1. [Section name] — [N sub-items]
177
+ 2. [Section name] — [N sub-items]
178
+ ...
179
+
180
+ Proceed? [Y/n]
181
+ ```
182
+
183
+ ---
184
+
185
+ ## Step 2: Crawl and Extract
186
+
187
+ **Only start this step after login is confirmed and crawl plan is approved.**
188
+
189
+ **Goal: Try EVERY feature you can find.** Missing features = incomplete PRD = useless output.
190
+
191
+ ### Two-pass crawl strategy
192
+
193
+ **Pass 1: Map all pages (breadth-first)**
194
+
195
+ Go through every navigation link and build a complete sitemap FIRST. Don't explore features deeply yet.
196
+
197
+ 1. Start at homepage/dashboard
198
+ 2. Read the full navigation (sidebar, top nav, footer)
199
+ 3. Visit each nav item → take screenshot → note the page title and type → go back
200
+ 4. For each page, check for sub-navigation (tabs, nested menus) → note them
201
+ 5. Build a sitemap of ALL discoverable pages
202
+ 6. **Go back to home between sections** — don't get lost in deep pages
203
+
204
+ After Pass 1, show the user the sitemap:
205
+ > "I found [N] pages across [N] sections:
206
+ > 1. Dashboard — 1 page
207
+ > 2. Projects — 3 pages (list, detail, settings)
208
+ > 3. Users — 2 pages (list, profile)
209
+ > ...
210
+ > Anything I'm missing? Any hidden sections?"
211
+
212
+ **Pass 2: Deep exploration (exhaust every feature, go as deep as possible)**
213
+
214
+ Now go through each page from the sitemap. **On each page, follow every interaction path until you hit a dead end.**
215
+
216
+ 1. **Navigate to the page** — take a full screenshot
217
+ 2. **Read the entire page** — snapshot the accessibility tree
218
+ 3. **Try every interactive element on this page — follow the chain:**
219
+ - Click a button → what opens? A modal? A new page? A dropdown?
220
+ - If modal → what's inside? A form? Screenshot it. What fields? What happens on submit?
221
+ - If new page → is this a sub-page? Add to sitemap. Explore it fully before coming back.
222
+ - If dropdown → what options? Click each option. What changes?
223
+ - Click every tab → screenshot each tab. What content is different? Any sub-features inside each tab?
224
+ - Expand every accordion → what's inside? More buttons? More links? Follow them.
225
+ - Check every form → note ALL fields, types, placeholder text, validation rules.
226
+ - Are there conditional fields? (selecting option A shows different fields than option B)
227
+ - Test filters/search → type something → screenshot results → clear → try different filter combos
228
+ - Check hover states → tooltips? Action menus?
229
+ - Look for pagination → how many pages? What controls?
230
+ - Check empty states → what shows when a list has no items?
231
+ 4. **The rule: follow every path until there's nothing left to click.**
232
+ - Button → Modal → Form → Submit → Result → Back
233
+ - Tab → Content → Sub-tab → Detail → Back
234
+ - List → Click item → Detail page → Actions → Back to list
235
+ 5. **Take screenshots of each state** — modal open, filter applied, tab selected, form filled, etc.
236
+ 6. **Go back to the page's starting state** after exploring each branch
237
+ 7. **Move to next page only when you've exhausted every interaction on this page**
238
+
239
+ **Rules for both passes:**
240
+ - **Don't click destructive actions** — skip Delete, Remove, Reset, etc.
241
+ - **Add 1-2 second delay** between navigations
242
+ - **If session expires** (redirected to login) → STOP, tell user to re-login, wait, then continue
243
+ - **Check hidden navigation** — hamburger menus, footer links, user avatar dropdowns, help/docs sections
244
+ - **Go back to home/nav between sections** — don't lose your place
245
+
246
+ ### Progress updates
247
+
248
+ After every 10 pages or every major section:
249
+
250
+ > "Progress: Scanned [N] pages. Found [N] feature areas so far.
251
+ > Latest section: [section name]
252
+ > Continue? [Y/n]"
253
+
254
+ ### Screenshots (MANDATORY)
255
+
256
+ **Take a screenshot of EVERY page and important UI state.** Screenshots make the PRD 10x easier to understand.
257
+
258
+ ```bash
259
+ # Create screenshots directory
260
+ mkdir -p .planning/web-to-prd/screenshots
261
+ ```
262
+
263
+ **When to screenshot:**
264
+ - Every main page (after it fully loads)
265
+ - Modals/dialogs when opened
266
+ - Dropdowns/menus when expanded
267
+ - Different tab states
268
+ - Filter results (before and after filtering)
269
+ - Forms (showing fields and layout)
270
+ - Empty states
271
+ - Error states (if visible)
272
+
273
+ **How to take screenshots:** Use Playwright MCP's `browser_screenshot` tool. Save each screenshot with a clear name:
274
+
275
+ ```
276
+ .planning/web-to-prd/screenshots/
277
+ 01-homepage.png
278
+ 02-dashboard.png
279
+ 03-settings-general.png
280
+ 04-settings-billing.png
281
+ 05-user-list.png
282
+ 06-user-detail.png
283
+ 07-create-modal.png
284
+ 08-filter-expanded.png
285
+ ...
286
+ ```
287
+
288
+ **Naming:** `{NN}-{page-or-feature-name}.png` — numbered in crawl order for easy reference.
289
+
290
+ **Never screenshot login pages** — could capture pre-filled credentials.
291
+
292
+ ### What to capture per page
293
+
294
+ For each page, record:
295
+ - **Screenshot** (saved to `.planning/web-to-prd/screenshots/`)
296
+ - URL and page title
297
+ - Page type (dashboard, list, detail, form, settings, etc.)
298
+ - Features visible on the page
299
+ - Form fields and their types
300
+ - Action buttons and what they do
301
+ - Data displayed (tables, charts, cards)
302
+ - Navigation elements (tabs, breadcrumbs, sidebar items)
303
+
304
+ ### Build the feature map
305
+
306
+ As you crawl, build a structured feature map:
307
+
308
+ ```yaml
309
+ app:
310
+ name: "[detected app name]"
311
+ url: "[target URL]"
312
+ sections:
313
+ - name: "[Section from nav]"
314
+ pages:
315
+ - url: "/path"
316
+ title: "Page Title"
317
+ type: "list"
318
+ features:
319
+ - name: "Feature name"
320
+ type: "data-display | form | action | filter | notification"
321
+ description: "What it does"
322
+ ui_elements: ["table", "search bar", "export button"]
323
+ ```
324
+
325
+ ---
326
+
327
+ ## Step 2.5: Coverage Check (MANDATORY before generating PRD)
328
+
329
+ **You CANNOT proceed to Step 3 until this checklist passes. This prevents shallow PRDs.**
330
+
331
+ Before generating anything, count what you found and show the user:
332
+
333
+ ```
334
+ Coverage Report:
335
+ Pages visited: [N] (must be > number of nav items)
336
+ Screenshots taken: [N] (must be >= pages visited)
337
+ Buttons clicked: [N]
338
+ Modals/dialogs found: [N]
339
+ Forms found: [N] (with field counts)
340
+ Tabs explored: [N]
341
+ Filters tested: [N]
342
+ Dropdowns opened: [N]
343
+ Sub-pages discovered: [N] (pages found by clicking, not from nav)
344
+
345
+ Sections from nav: [list all nav items]
346
+ Sections explored: [list which ones you actually visited]
347
+ Sections NOT explored: [list any you skipped — explain why]
348
+ ```
349
+
350
+ **Fail conditions (must fix before proceeding):**
351
+ - [ ] Any nav section not explored → go back and explore it
352
+ - [ ] Fewer screenshots than pages → go back and screenshot missing pages
353
+ - [ ] Zero modals found on a page with action buttons → you didn't click the buttons, go back
354
+ - [ ] Zero forms found on an app with user input → you missed them, go back
355
+ - [ ] Any section explored with only 1 interaction → you only looked, didn't try features
356
+
357
+ **Ask the user:**
358
+ > "Here's my coverage report. I visited [N] pages, took [N] screenshots, tried [N] interactions.
359
+ > Missing anything? Any sections I should go back to?"
360
+
361
+ **Only proceed to Step 3 after user confirms coverage is enough.**
362
+
363
+ ---
364
+
365
+ ## Step 3: Organize and Prioritize
366
+
367
+ After crawling is done AND coverage check passes, organize the raw features:
368
+
369
+ ### 3a. Group into Epics
370
+
371
+ Group features by:
372
+ 1. Navigation sections (natural grouping)
373
+ 2. User goals (what the user is trying to do)
374
+ 3. Data domain (features that touch the same data)
375
+
376
+ ### 3b. Write User Stories
377
+
378
+ For each feature, write a story:
379
+ > As a [user type], I can [action] so that [benefit]
380
+
381
+ Add acceptance criteria (2-4 per story).
382
+
383
+ ### 3c. Assign Priorities
384
+
385
+ | Priority | Rule |
386
+ |----------|------|
387
+ | P0 | Core flow — app is broken without it |
388
+ | P1 | Important — app is usable but limited without it |
389
+ | P2 | Nice to have — enhancement, polish |
390
+ | P3 | Future — advanced, not needed now |
391
+
392
+ ### 3d. Map Dependencies
393
+
394
+ Figure out build order:
395
+ - Auth always comes first
396
+ - CRUD: Create → Read/List → Update → Delete
397
+ - Data display depends on data input
398
+ - Settings depend on the feature they configure
399
+
400
+ ### 3e. Show summary and confirm
401
+
402
+ > "Here's what I found:
403
+ >
404
+ > **App:** [name]
405
+ > **Pages scanned:** [N]
406
+ > **Epics:** [N]
407
+ > **Stories:** [N]
408
+ > **Tasks:** [N]
409
+ >
410
+ > **Build order:**
411
+ > Phase 1: [Epic A, Epic B] — no dependencies
412
+ > Phase 2: [Epic C] — depends on Phase 1
413
+ > Phase 3: [Epic D, Epic E] — depends on Phase 2
414
+ >
415
+ > Anything look wrong or missing before I generate the PRD?"
416
+
417
+ ---
418
+
419
+ ## Step 4: Generate PRD
420
+
421
+ Generate a full PRD document with this structure:
422
+
423
+ ```markdown
424
+ # PRD: [App Name]
425
+
426
+ ## 1. TL;DR
427
+
428
+ [1-2 sentences: what this app does, who it's for, what problem it solves, what makes it different.]
429
+
430
+ ## 2. Goals
431
+
432
+ ### Business Goals
433
+ - [What this app is trying to achieve as a business]
434
+ - [Revenue model, growth metrics observed]
435
+
436
+ ### User Goals
437
+ - [What users can do with this app]
438
+ - [What pain it solves]
439
+
440
+ ### Non-Goals
441
+ - [Things this app intentionally doesn't do]
442
+ - [Adjacent features it could have but chose not to]
443
+
444
+ ## 3. User Stories
445
+
446
+ [Grouped by persona/role detected in the app:]
447
+
448
+ - As a [user type], I want to [action], so that [benefit]
449
+ - As a [admin/manager], I want to [action], so that [benefit]
450
+
451
+ ## 4. Epics (ordered by implementation priority)
452
+
453
+ **Epics are ordered 1, 2, 3... by build order. Epic 1 = build first. Each Epic is a mini-PRD — a developer reads it and knows exactly what to build.**
454
+
455
+ **IMPORTANT: Try every feature you can find.** Click every menu item, tab, button (except destructive ones). Open modals, expand accordions, test filters, check settings. Features you don't try = features missing from the PRD.
456
+
457
+ ---
458
+
459
+ ### Epic 1: [Name] — Build First
460
+
461
+ **Phase:** 1 | **Dependencies:** none | **Complexity:** Simple/Medium/Complex
462
+
463
+ **Each Epic follows the FULL PRD format below. No shortcuts.**
464
+
465
+ #### 1. TL;DR
466
+ [1-2 sentences: what problem this epic solves, who it's for, what we're building, and why it matters.]
467
+
468
+ #### 2. Goals
469
+
470
+ **Business Goals**
471
+ - [What this epic achieves for the business — metrics, conversion, retention]
472
+
473
+ **User Goals**
474
+ - [What pain this solves for the user — specific, measurable]
475
+
476
+ **Non-Goals**
477
+ - [What's NOT in this epic — keeps scope clear]
478
+
479
+ #### 3. User Stories
480
+ - As a [user type], I want to [action], so that [benefit]
481
+ - As a [other user type], I want to [action], so that [benefit]
482
+
483
+ #### 4. Functional Requirements
484
+
485
+ **Screenshots:** (MUST be embedded inline — show what each feature looks like)
486
+
487
+ **4.1 [Feature name]** (Priority: High)
488
+ - [What it does — specific, not vague]
489
+ - [UI elements: buttons, forms, tables, cards, layout]
490
+ - [Data displayed: what columns, what values, what format]
491
+
492
+ ![Feature name](screenshots/NN-detail.png)
493
+
494
+ **4.2 [Feature name]** (Priority: High)
495
+ - [What it does]
496
+ - [UI details]
497
+
498
+ ![Feature name](screenshots/NN-detail.png)
499
+
500
+ **4.3 [Feature name]** (Priority: Medium)
501
+ - [What it does]
502
+
503
+ [Continue for ALL features in this epic. EVERY feature that has a screenshot MUST embed it with `![name](path)` syntax.]
504
+
505
+ #### 5. User Experience
506
+
507
+ **Entry Point**
508
+ - [How the user gets to this feature — which page, which button]
509
+
510
+ **Flow**
511
+ 1. User [does X] → sees [Y]
512
+ 2. User [clicks Z] → system [shows W]
513
+ 3. User [completes action] → [result]
514
+
515
+ **Edge Cases**
516
+ - Empty state: [what shows when no data]
517
+ - Error state: [what shows when something fails]
518
+ - Loading state: [what shows while loading]
519
+ - First-time user: [any onboarding or tooltip]
520
+
521
+ **Design Notes**
522
+ - [Layout patterns: cards, tables, sidebar, tabs]
523
+ - [Visual details: colors, icons, spacing]
524
+ - [Responsive behavior if observed]
525
+
526
+ #### 6. Narrative
527
+ [100 words: a short story from the user's perspective using THIS epic's features. Name the user, describe context, show the value.]
528
+
529
+ ---
530
+
531
+ ### Epic 2: [Name] — Build After Epic 1
532
+
533
+ **Phase:** 1 | **Dependencies:** Epic 1 | **Complexity:** Medium
534
+
535
+ [SAME full PRD format — sections 1-6. Every epic gets ALL 6 sections.]
536
+
537
+ ---
538
+
539
+ [Continue for ALL epics, ordered by build priority. NO epic can skip any section.]
540
+
541
+ ---
542
+
543
+ ## 5. User Flows (end-to-end)
544
+
545
+ [These connect stories across epics. Show the full user journey.]
546
+
547
+ ### Flow 1: [Name — e.g., "New user signs up and creates first project"]
548
+ 1. User lands on [page] → sees [what]
549
+ 2. Clicks [button] → goes to [page]
550
+ 3. Fills in [form fields] → submits
551
+ 4. System [creates/processes] → shows [result]
552
+ 5. User can now [next action]
553
+
554
+ ### Flow 2: [Name]
555
+ 1. ...
556
+
557
+ ### Edge Cases (cross-epic)
558
+ - [What happens when X fails mid-flow]
559
+ - [Empty states across flows]
560
+
561
+ ### Design Patterns Observed
562
+ - [Navigation pattern: sidebar/tabs/breadcrumbs]
563
+ - [Form patterns: inline edit/modal/full page]
564
+ - [Data display: cards/tables/lists]
565
+ - [Responsive behavior]
566
+
567
+ ## 6. Narrative
568
+
569
+ [200 words: walk through a typical user session from their point of view.
570
+ Makes the PRD feel real. Name the user, describe their context, show the friction points.]
571
+
572
+ ## 7. Build Roadmap
573
+
574
+ [Shows the order to build. Each phase lists epics that can be built in parallel.]
575
+
576
+ ### Phase 1: Foundation (no dependencies)
577
+ | Epic | Priority | Stories | Complexity | Why first |
578
+ |------|----------|---------|------------|-----------|
579
+ | [Epic A] | P0 | [N] | [Simple/Medium/Complex] | [Reason] |
580
+ | [Epic B] | P0 | [N] | [Simple/Medium/Complex] | [Reason] |
581
+
582
+ ### Phase 2: Core (depends on Phase 1)
583
+ | Epic | Priority | Stories | Complexity | Why this phase |
584
+ |------|----------|---------|------------|----------------|
585
+ | [Epic C] | P0 | [N] | [Medium/Complex] | [Reason — what from Phase 1 it needs] |
586
+
587
+ ### Phase 3: Enhancement (depends on Phase 2)
588
+ ...
589
+
590
+ ### Dependency Graph
591
+ ```
592
+ [Text diagram showing which epics depend on which]
593
+
594
+ Epic A (Phase 1) ──→ Epic C (Phase 2) ──→ Epic F (Phase 3)
595
+ Epic B (Phase 1) ──→ Epic D (Phase 2)
596
+ Epic E (Phase 2) ──→ Epic G (Phase 3)
597
+ ```
598
+
599
+ ## 8. Open Questions
600
+ - [Things that couldn't be determined from the UI]
601
+ - [Decisions that need product input]
602
+ - [Areas where the app behavior was unclear]
603
+ - [Features that might be behind a paywall or role — couldn't access]
604
+ ```
605
+
606
+ **Screenshots in the markdown PRD are MANDATORY.** Every feature that has a screenshot must embed it inline using `![Feature name](screenshots/NN-name.png)`. The path should be relative to the PRD file location. This makes the PRD self-contained — anyone opening the markdown sees the screenshots right next to the features they describe.
607
+
608
+ **Save locally first:**
609
+ ```
610
+ .planning/web-to-prd/
611
+ prd-[app-name].md ← screenshots embedded as ![name](screenshots/NN.png)
612
+ screenshots/ ← actual screenshot files
613
+ ```
614
+
615
+ ---
616
+
617
+ ## Step 5: Export to Notion
618
+
619
+ Ask the user:
620
+
621
+ > "Where should I create the backlog in Notion?
622
+ >
623
+ > A) New page in workspace root
624
+ > B) Under an existing page (I'll search for it)
625
+ > C) Skip Notion — just keep the local PRD file"
626
+
627
+ ### If A or B: Create Notion structure
628
+
629
+ **Structure: Parent page + one sub-page per Epic (each Epic is a full page, not a database row)**
630
+
631
+ 1. **Create parent page** — "[App Name] — PRD"
632
+ - Sections 1-3 (TL;DR, Goals, User Stories) as page content
633
+ - Sections 5-8 (User Flows, Narrative, Build Roadmap, Open Questions) as page content
634
+ - Table of contents linking to each Epic sub-page
635
+
636
+ 2. **Create one Notion page PER Epic** — as children of the parent page
637
+ Each Epic page MUST contain:
638
+ - **Title:** "Epic [N]: [Name] — P[priority] — Phase [N]"
639
+ - **Properties at top:** Priority, Phase, Complexity, Dependencies
640
+ - **Full content from Section 4** — the entire mini-PRD for this Epic:
641
+ - What this does (2-3 sentences)
642
+ - Pages/Screens involved
643
+ - **Screenshots embedded directly in the page** (not just local file references)
644
+ - Every feature with: user story, UI description, step-by-step flow, acceptance criteria, edge cases
645
+ - This is a FULL page, not a one-line database entry
646
+
647
+ 3. **Upload screenshots to each Epic page**
648
+ - For each screenshot referenced in the Epic, embed it in the Notion page
649
+ - Place screenshots next to the feature they document
650
+ - Use Notion's image embedding — the screenshot should be VISIBLE in the page, not a link to a local file
651
+ - If Notion MCP doesn't support image upload → add the screenshot file path and tell user to upload manually
652
+
653
+ 4. **Optionally create an Epics overview database** (for filtering/sorting):
654
+ - Name, Priority, Status, Phase, Complexity, Dependencies columns
655
+ - Each row links to its full Epic page
656
+ - Views: Table by Phase, Kanban by Status
657
+
658
+ **IMPORTANT: Each Epic in Notion must be as detailed as in the local PRD file. Don't summarize. Copy the full content.**
659
+
660
+ ### If C: Local only
661
+
662
+ Save to `.planning/web-to-prd/` with screenshots in `screenshots/` subdirectory.
663
+
664
+ ---
665
+
666
+ ## Step 6: Done
667
+
668
+ Show final summary:
669
+
670
+ ```
671
+ Web-to-PRD Complete
672
+
673
+ App: [name]
674
+ URL: [url]
675
+ Scanned: [N] pages
676
+
677
+ Generated:
678
+ - [N] Epics
679
+ - [N] Stories
680
+ - [N] Tasks
681
+ - [N] Phases (build order)
682
+
683
+ Saved to:
684
+ - Local: .planning/web-to-prd/prd-[app-name].md
685
+ - Notion: [page URL if exported]
686
+
687
+ Next steps:
688
+ - Review the PRD and adjust priorities
689
+ - Use /spartan:spec to detail individual features
690
+ - Use /spartan:plan to plan implementation for each epic
691
+ ```
692
+
693
+ ---
694
+
695
+ ## Rules
696
+
697
+ 1. **Prerequisites are non-negotiable.** Always check Playwright and Notion MCP first. Don't try to work around missing tools.
698
+ 2. **Don't guess features you can't see.** Only document what's visible in the UI.
699
+ 3. **Don't click destructive buttons.** No Delete, Remove, Reset, or similar actions during crawl.
700
+ 4. **Show progress.** Update the user every 10 pages or every section.
701
+ 5. **Local save always happens.** Even if Notion export works, save the PRD locally too.
702
+ 6. **Ask before login.** Never assume credentials. Let the user handle auth manually.
703
+ 7. **One app per run.** Don't follow links to external domains.
704
+ 8. **Delay between pages.** 1-2 seconds between navigations. Don't hammer the server.
705
+ 9. **Mark assumptions.** If you're guessing what a feature does, say so.
706
+ 10. **The PRD is a starting point.** Tell the user to review and adjust — it's not final.