ai-spector 0.4.0 → 0.4.2

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 (111) hide show
  1. package/README.md +10 -2
  2. package/assets/themes/airbnb/preview.html +281 -0
  3. package/assets/themes/airtable/preview.html +209 -0
  4. package/assets/themes/apple/preview.html +461 -0
  5. package/assets/themes/binance/preview.html +1013 -0
  6. package/assets/themes/bmw/preview.html +255 -0
  7. package/assets/themes/bugatti/preview.html +879 -0
  8. package/assets/themes/cal/preview.html +620 -0
  9. package/assets/themes/claude/preview.html +873 -0
  10. package/assets/themes/clay/preview.html +360 -0
  11. package/assets/themes/clickhouse/preview.html +833 -0
  12. package/assets/themes/cohere/preview.html +854 -0
  13. package/assets/themes/coinbase/preview.html +208 -0
  14. package/assets/themes/composio/preview.html +980 -0
  15. package/assets/themes/cursor/preview.html +428 -0
  16. package/assets/themes/elevenlabs/preview.html +296 -0
  17. package/assets/themes/expo/preview.html +580 -0
  18. package/assets/themes/ferrari/preview.html +1168 -0
  19. package/assets/themes/framer/preview.html +930 -0
  20. package/assets/themes/hashicorp/preview.html +1238 -0
  21. package/assets/themes/ibm/preview.html +473 -0
  22. package/assets/themes/intercom/preview.html +229 -0
  23. package/assets/themes/kraken/preview.html +213 -0
  24. package/assets/themes/lamborghini/preview.html +428 -0
  25. package/assets/themes/linear.app/preview.html +418 -0
  26. package/assets/themes/lovable/preview.html +393 -0
  27. package/assets/themes/meta/preview.html +656 -0
  28. package/assets/themes/minimax/preview.html +1293 -0
  29. package/assets/themes/mintlify/preview.html +443 -0
  30. package/assets/themes/miro/preview.html +218 -0
  31. package/assets/themes/mistral.ai/preview.html +850 -0
  32. package/assets/themes/mongodb/preview.html +304 -0
  33. package/assets/themes/nike/preview.html +1182 -0
  34. package/assets/themes/notion/preview.html +409 -0
  35. package/assets/themes/nvidia/preview.html +411 -0
  36. package/assets/themes/ollama/preview.html +725 -0
  37. package/assets/themes/opencode.ai/preview.html +402 -0
  38. package/assets/themes/pinterest/preview.html +277 -0
  39. package/assets/themes/playstation/preview.html +1125 -0
  40. package/assets/themes/posthog/preview.html +794 -0
  41. package/assets/themes/raycast/preview.html +735 -0
  42. package/assets/themes/renault/preview.html +652 -0
  43. package/assets/themes/replicate/preview.html +878 -0
  44. package/assets/themes/resend/preview.html +399 -0
  45. package/assets/themes/revolut/preview.html +278 -0
  46. package/assets/themes/runwayml/preview.html +712 -0
  47. package/assets/themes/sanity/preview.html +1180 -0
  48. package/assets/themes/sentry/preview.html +996 -0
  49. package/assets/themes/shopify/preview.html +611 -0
  50. package/assets/themes/spacex/preview.html +265 -0
  51. package/assets/themes/spotify/preview.html +275 -0
  52. package/assets/themes/stripe/preview.html +464 -0
  53. package/assets/themes/supabase/preview.html +1002 -0
  54. package/assets/themes/superhuman/preview.html +996 -0
  55. package/assets/themes/tesla/preview.html +971 -0
  56. package/assets/themes/theverge/preview.html +1143 -0
  57. package/assets/themes/together.ai/preview.html +944 -0
  58. package/assets/themes/uber/preview.html +1164 -0
  59. package/assets/themes/vercel/preview.html +412 -0
  60. package/assets/themes/voltagent/preview.html +813 -0
  61. package/assets/themes/warp/preview.html +580 -0
  62. package/assets/themes/webflow/preview.html +191 -0
  63. package/assets/themes/wired/preview.html +1049 -0
  64. package/assets/themes/wise/preview.html +274 -0
  65. package/assets/themes/x.ai/preview.html +452 -0
  66. package/assets/themes/zapier/preview.html +417 -0
  67. package/dist/cli.js +37 -1
  68. package/dist/cli.js.map +1 -1
  69. package/dist/commands/graph-visualize.d.ts.map +1 -1
  70. package/dist/commands/graph-visualize.js +1 -22
  71. package/dist/commands/graph-visualize.js.map +1 -1
  72. package/dist/commands/prototype.d.ts +19 -0
  73. package/dist/commands/prototype.d.ts.map +1 -1
  74. package/dist/commands/prototype.js +78 -3
  75. package/dist/commands/prototype.js.map +1 -1
  76. package/dist/prototype/config.d.ts +9 -1
  77. package/dist/prototype/config.d.ts.map +1 -1
  78. package/dist/prototype/config.js +29 -0
  79. package/dist/prototype/config.js.map +1 -1
  80. package/dist/prototype/htpasswd.d.ts +5 -0
  81. package/dist/prototype/htpasswd.d.ts.map +1 -0
  82. package/dist/prototype/htpasswd.js +33 -0
  83. package/dist/prototype/htpasswd.js.map +1 -0
  84. package/dist/prototype/theme-preview.d.ts +17 -0
  85. package/dist/prototype/theme-preview.d.ts.map +1 -0
  86. package/dist/prototype/theme-preview.js +73 -0
  87. package/dist/prototype/theme-preview.js.map +1 -0
  88. package/dist/prototype/types.d.ts +8 -0
  89. package/dist/prototype/types.d.ts.map +1 -1
  90. package/dist/prototype/validate.d.ts.map +1 -1
  91. package/dist/prototype/validate.js +19 -0
  92. package/dist/prototype/validate.js.map +1 -1
  93. package/dist/util/open-browser.d.ts +3 -0
  94. package/dist/util/open-browser.d.ts.map +1 -0
  95. package/dist/util/open-browser.js +24 -0
  96. package/dist/util/open-browser.js.map +1 -0
  97. package/package.json +4 -2
  98. package/scaffold/.ai-spector/.docflow/config/language.json +4 -0
  99. package/scaffold/cursor/WORKFLOW.md +2 -1
  100. package/scaffold/cursor/skills/_skill-router.md +1 -1
  101. package/scaffold/cursor/skills/ai-spector/references/generate-workflow.md +8 -0
  102. package/scaffold/cursor/skills/ai-spector/references/language-picker.md +70 -0
  103. package/scaffold/cursor/skills/ai-spector/references/project-conventions.md +13 -4
  104. package/scaffold/cursor/skills/ai-spector-generate-basic-design/SKILL.md +1 -0
  105. package/scaffold/cursor/skills/ai-spector-generate-detail-design/SKILL.md +1 -0
  106. package/scaffold/cursor/skills/ai-spector-generate-prototype/SKILL.md +13 -5
  107. package/scaffold/cursor/skills/ai-spector-generate-prototype/references/auth-picker.md +61 -0
  108. package/scaffold/cursor/skills/ai-spector-generate-prototype/references/runbook.md +32 -10
  109. package/scaffold/cursor/skills/ai-spector-generate-prototype/references/theme-picker.md +118 -0
  110. package/scaffold/cursor/skills/ai-spector-generate-srs/SKILL.md +1 -0
  111. package/scaffold/prototype/README.md +24 -3
@@ -0,0 +1,70 @@
1
+ # Language picker — ask, store, enforce
2
+
3
+ When **no document language is stored** and the user did not name one in this request, run this flow **before any document write**. Do not generate document content until the user confirms a language.
4
+
5
+ Skip this flow when:
6
+
7
+ - User named a language in this request ("write in Japanese", "use Vietnamese")
8
+ - `.ai-spector/.docflow/config/language.json` already exists and has `documentLanguage` set (use it — do not re-ask)
9
+
10
+ ## Step 1 — Check for stored preference
11
+
12
+ Read `.ai-spector/.docflow/config/language.json`. If the file exists and `documentLanguage` is a non-empty string, use that language for all document content. Skip the rest of this document.
13
+
14
+ ## Step 2 — Ask the user
15
+
16
+ Post exactly this message and **stop**. Do not write any document content until the user replies.
17
+
18
+ ```
19
+ What language should I use for all generated documents?
20
+
21
+ 1. English
22
+ 2. Japanese
23
+ 3. Vietnamese
24
+
25
+ Reply with **1**, **2**, or **3** — or type the language name directly.
26
+ Once saved, all document content — headings, body, tables, labels — will be written in that language consistently.
27
+ ```
28
+
29
+ Accept: `1` / `2` / `3`, or the language name typed directly (case-insensitive). Map to the canonical value:
30
+
31
+ | Input | Stored as |
32
+ |-------|-----------|
33
+ | `1`, `english` | `English` |
34
+ | `2`, `japanese` | `Japanese` |
35
+ | `3`, `vietnamese` | `Vietnamese` |
36
+
37
+ Any other input: reply "Please choose 1 (English), 2 (Japanese), or 3 (Vietnamese)." and wait again.
38
+
39
+ ## Step 3 — Persist the choice
40
+
41
+ When the user replies, create or overwrite `.ai-spector/.docflow/config/language.json`:
42
+
43
+ ```json
44
+ {
45
+ "version": 1,
46
+ "documentLanguage": "<user's answer>",
47
+ "setAt": "<ISO timestamp>"
48
+ }
49
+ ```
50
+
51
+ Then continue with document generation.
52
+
53
+ ## Changing the language later
54
+
55
+ If the user says "change language to X" or "switch to X" at any time:
56
+ - Accept only English, Japanese, or Vietnamese. For any other language, reply "Only English, Japanese, and Vietnamese are supported."
57
+ - Update `language.json` with the new value.
58
+ - Remind them that already-generated files keep their old language until regenerated.
59
+
60
+ ---
61
+
62
+ ## Enforcement rules (apply to every document write)
63
+
64
+ After the language is known, apply these rules for **every file written**:
65
+
66
+ 1. **All content in the target language** — headings, body paragraphs, table cell values, labels, bullet text, notes, captions.
67
+ 2. **ID tokens are never translated** — UC-01, F-03, API slugs (`POST /checkout`), screen IDs (S-01), graph node IDs, file paths, CLI commands, code blocks. These stay in their original form.
68
+ 3. **Template structure labels are translated** — e.g. if the template says "## Overview", write the heading in the target language ("## 概要" for Japanese, "## Tổng quan" for Vietnamese, etc.).
69
+ 4. **Never mix languages** — do not write an English heading with a non-English body, or vice versa. If you catch a mixed-language draft, fix it before writing.
70
+ 5. **Quote source material faithfully, then translate inline** — if a `docs/data-source` file contains text in another language, you may reference its meaning in the target language rather than copying the foreign text into the output document.
@@ -19,9 +19,18 @@ Missing templates → `npx ai-spector init --force`.
19
19
  | Detail design | `docs/detail-design/` |
20
20
  | HTML prototype | `prototype/src/` |
21
21
 
22
+ ## Document language
23
+
24
+ Stored in `.ai-spector/.docflow/config/language.json` (`documentLanguage` field).
25
+
26
+ - **Before the first write** in any session, check this file. If `documentLanguage` is `null` or missing, run the language-picker flow ([language-picker.md](./language-picker.md)) — ask the user, persist the answer, then continue.
27
+ - **All generated content** (headings, body, tables, labels) must be in `documentLanguage`. Identifiers (UC-01, F-02, API paths, code) are never translated.
28
+ - Change with: edit `language.json` directly; already-generated files are not auto-updated.
29
+
22
30
  ## Generation discipline (all layers)
23
31
 
24
- 1. Read template from `.ai-spector/templates/` never invent section structure.
25
- 2. Query graph before writing (`ai-spector graph query`).
26
- 3. Merge projection patches after each wave (`graph merge`).
27
- 4. Validate when the command doc requires it.
32
+ 1. **Check document language** ([language-picker.md](./language-picker.md)) before any write.
33
+ 2. Read template from `.ai-spector/templates/` never invent section structure.
34
+ 3. Query graph before writing (`ai-spector graph query`).
35
+ 4. Merge projection patches after each wave (`graph merge`).
36
+ 5. Validate when the command doc requires it.
@@ -23,6 +23,7 @@ paths:
23
23
  ## Checklist
24
24
 
25
25
  ```
26
+ - [ ] language confirmed (language-picker.md — check before first write)
26
27
  - [ ] graph validate; SRS on disk
27
28
  - [ ] index after every wave (mandatory)
28
29
  - [ ] one file per endpoint row / Screen Index row — not per F-xx
@@ -23,6 +23,7 @@ paths:
23
23
  ## Checklist
24
24
 
25
25
  ```
26
+ - [ ] language confirmed (language-picker.md — check before first write)
26
27
  - [ ] graph validate; SRS + basic design present
27
28
  - [ ] generate-workflow waves + merge per target
28
29
  ```
@@ -2,9 +2,10 @@
2
2
  name: ai-spector-generate-prototype
3
3
  description: >-
4
4
  Generates static HTML/CSS/JS screen prototypes from basic-design screen specs and bundled UI themes.
5
- Use when the user asks for HTML prototype, screen mockups, or prototype/src files. Asks user to
6
- choose a theme if none is stored; uses stored preference on subsequent runs. Do not use for
7
- markdown SRS/basic/detail design only, or graph operations without HTML output.
5
+ Use when the user asks for HTML prototype, screen mockups, or prototype/src files. When no theme is
6
+ stored, recommends 3 best-fit themes from project context, opens preview samples in the browser,
7
+ and waits for the user to choose before setup. Uses stored preference on subsequent runs. Do not use
8
+ for markdown SRS/basic/detail design only, or graph operations without HTML output.
8
9
  paths:
9
10
  - "prototype/**"
10
11
  ---
@@ -15,13 +16,18 @@ paths:
15
16
 
16
17
  ## Required reading
17
18
 
18
- [references/runbook.md](references/runbook.md) — theme resolution (no upfront picker), manifest, HTML rules.
19
+ - [references/runbook.md](references/runbook.md) — manifest, HTML rules, theme resolution
20
+ - [references/auth-picker.md](references/auth-picker.md) — **when no basic auth stored**: ask username/password, create htpasswd
21
+ - [references/theme-picker.md](references/theme-picker.md) — **when no theme stored**: recommend 3, preview, confirm
19
22
 
20
23
  ## Checklist
21
24
 
22
25
  ```
26
+ - [ ] language confirmed (language-picker.md — check before writing any screen text content)
23
27
  - [ ] list-screens + screen detail docs exist
24
- - [ ] theme resolved (request theme.json → manifest → prototype.config.json → **ask user if none stored**)
28
+ - [ ] basic auth resolved (config basicAuth + prototype/htpasswd → **auth picker if none**)
29
+ - [ ] theme resolved (request → theme.json → manifest → config → **theme picker if none**)
30
+ - [ ] if picker: 3 recommendations + previews opened + user confirmed before setup
25
31
  - [ ] prototype setup (with --theme when needed; persists when user named a theme)
26
32
  - [ ] one .html per screen; prototypeStem from manifest
27
33
  - [ ] prototype manifest && prototype validate --strict
@@ -31,4 +37,6 @@ paths:
31
37
 
32
38
  “HTML prototype”, “mockup screens”, “prototype with stripe theme” → this skill.
33
39
 
40
+ “Help me pick a theme”, “what theme fits my app?”, “show me theme options” → [theme-picker.md](references/theme-picker.md) (even before generating).
41
+
34
42
  Constraints: `prototype/CLAUDE.md` in the project repo.
@@ -0,0 +1,61 @@
1
+ # Basic auth picker — username, password, htpasswd
2
+
3
+ Before **any** prototype HTML is generated, the project must have HTTP basic auth configured. Run this flow when `prototype.config.json` has no `basicAuth` (or username/password is empty).
4
+
5
+ Skip when:
6
+
7
+ - `basicAuth.username` and `basicAuth.password` are already set in `.ai-spector/.docflow/config/prototype.config.json` — run `ai-spector prototype auth --from-config` only if `prototype/htpasswd` is missing
8
+ - User is only previewing themes (no generation)
9
+
10
+ ## Step 1 — Check stored credentials
11
+
12
+ Read `.ai-spector/.docflow/config/prototype.config.json`. If `basicAuth.username` and `basicAuth.password` are non-empty, skip asking. Ensure `prototype/htpasswd` exists; if not:
13
+
14
+ ```bash
15
+ ai-spector prototype auth --from-config
16
+ ```
17
+
18
+ ## Step 2 — Ask the user
19
+
20
+ Post exactly this message and **stop**. Do not run `prototype setup` or write HTML until the user replies.
21
+
22
+ ```
23
+ Prototype hosting uses HTTP basic auth. Choose credentials for reviewers:
24
+
25
+ • **Username** (e.g. reviewer, demo, staging)
26
+ • **Password** (share securely with your team)
27
+
28
+ Reply with both values (e.g. "username: demo / password: …").
29
+
30
+ Credentials are saved in `.ai-spector/.docflow/config/prototype.config.json` and hashed into `prototype/htpasswd` for nginx/Apache.
31
+ ```
32
+
33
+ If the user gives only one field, ask for the missing one and wait.
34
+
35
+ ## Step 3 — Persist and create htpasswd
36
+
37
+ When both values are known, run (replace placeholders; never log the password in chat after this step):
38
+
39
+ ```bash
40
+ ai-spector prototype auth --username <username> --password '<password>'
41
+ ```
42
+
43
+ This writes:
44
+
45
+ | Artifact | Purpose |
46
+ |----------|---------|
47
+ | `prototype.config.json` → `basicAuth` | Plain username/password for regeneration and team reference |
48
+ | `prototype/htpasswd` | Apache apr1 hash for web server `auth_basic` |
49
+
50
+ Then continue with theme resolution and [runbook.md](runbook.md) §1 (setup).
51
+
52
+ ## Changing credentials later
53
+
54
+ If the user asks to rotate credentials:
55
+
56
+ 1. Collect new username/password (or reuse username with new password).
57
+ 2. Run `ai-spector prototype auth --username … --password …` again (overwrites config and htpasswd).
58
+
59
+ ## Security note
60
+
61
+ `prototype.config.json` contains the password in plain text. Treat the file like a secret in production; restrict repo access or use environment-specific config outside git if needed.
@@ -7,7 +7,8 @@ Generate **static HTML** prototypes from basic-design screen specs. All setup an
7
7
  ## Philosophy
8
8
 
9
9
  - **Screen design is source of truth** — `docs/basic-design/list-screens.md` + `docs/basic-design/screens/<slug>.md`
10
- - **Theme must be confirmed before generating** — if no theme is stored, ask the user to choose one before running setup. Once the user has chosen (stored in `prototype/theme.json` or `prototype.config.json`), never ask again.
10
+ - **Basic auth must be configured before generating** — if `prototype.config.json` has no `basicAuth`, run the [auth picker](auth-picker.md): ask for username/password, then `ai-spector prototype auth`. Once saved, do not ask again unless the user wants to rotate credentials.
11
+ - **Theme must be confirmed before generating** — if no theme is stored, run the [theme picker](theme-picker.md): recommend 3 fits from project context, open previews, wait for user choice. Once chosen (stored in `prototype/theme.json` or config), never ask again.
11
12
  - **One HTML per screen** — `prototype/src/<prototypeStem>.html` must match `prototype/manifest.json`
12
13
  - **Static only** — HTML/CSS/JS under `prototype/`; no frameworks, no CDN unless the theme DESIGN allows it
13
14
 
@@ -26,6 +27,16 @@ Generate **static HTML** prototypes from basic-design screen specs. All setup an
26
27
 
27
28
  ## Required behavior (agent runs CLI)
28
29
 
30
+ ### 0. Resolve basic auth
31
+
32
+ **If `prototype.config.json` → `basicAuth` is missing** (no username/password), run the **[auth picker](auth-picker.md)** — do not generate HTML until credentials are saved and `prototype/htpasswd` exists.
33
+
34
+ If credentials exist but `prototype/htpasswd` is missing:
35
+
36
+ ```bash
37
+ ai-spector prototype auth --from-config
38
+ ```
39
+
29
40
  ### 1. Resolve theme and setup workspace
30
41
 
31
42
  **Resolution order** (first match wins):
@@ -35,14 +46,16 @@ Generate **static HTML** prototypes from basic-design screen specs. All setup an
35
46
  3. `prototype/manifest.json` → `themeName` (non-empty)
36
47
  4. `.ai-spector/.docflow/config/prototype.config.json` → `defaultTheme`
37
48
 
38
- **If no stored theme is found**, ask the user to choose before proceeding:
49
+ **If no stored theme is found** and the user did **not** name one in this request, run the **[theme picker](theme-picker.md)** — do **not** ask a bare “which theme?” without recommendations.
39
50
 
40
- ```
41
- No theme is saved yet. Which UI theme would you like for your prototype?
42
- Run `ai-spector prototype themes` to see all options, or name one (e.g. vercel, stripe, notion, linear.app).
43
- ```
51
+ Summary of the picker:
52
+
53
+ 1. Read project context (SRS, list-screens §1, knowledge, data-source).
54
+ 2. `ai-spector prototype themes --json` — pick **3 best-fit** themes with one-line rationale each.
55
+ 3. `ai-spector prototype preview <name> --open` for all 3 — user compares in the browser.
56
+ 4. Post a numbered table; **wait for user to choose** before setup.
44
57
 
45
- Wait for the user's answer do **not** silently default to `vercel`. Once the user names a theme, proceed with setup; the choice is persisted and will not be asked again.
58
+ Once the user confirms (or named a theme upfront), proceed with setup; the choice is persisted and will not be asked again.
46
59
 
47
60
  Setup (creates `prototype/`, copies `DESIGN.md`, seeds manifest when `list-screens.md` exists):
48
61
 
@@ -54,12 +67,18 @@ Omit `--theme` only when setup can infer the same name from stored files (the CL
54
67
 
55
68
  **Persist** when the user explicitly names a theme in this session: `prototype setup --theme <name>` updates `prototype/theme.json` and saves `defaultTheme` in `prototype.config.json` for later runs.
56
69
 
57
- List themes when the user asks (“what themes?”, “list prototype themes”):
70
+ List all themes:
58
71
 
59
72
  ```bash
60
73
  ai-spector prototype themes
61
74
  ```
62
75
 
76
+ Themes with a visual sample show `[preview]`. Open any theme sample:
77
+
78
+ ```bash
79
+ ai-spector prototype preview <name> --open
80
+ ```
81
+
63
82
  ### 2. Plan screens
64
83
 
65
84
  ```bash
@@ -96,12 +115,15 @@ git commit -m "chore(prototype): add HTML screens (<theme>)"
96
115
  |-----------|--------|
97
116
  | “use stripe theme”, `--theme stripe` | `prototype setup --theme stripe` (persists preference); add `--force-design` if switching theme mid-branch |
98
117
  | “what themes?” | `ai-spector prototype themes` |
99
- | no theme in message, no stored theme | **Ask the user** to name a theme before proceeding |
118
+ | “preview stripe theme”, “show me vercel theme | `ai-spector prototype preview <name> --open` |
119
+ | no theme in message, no stored theme | **[theme picker](theme-picker.md)**: recommend 3 → open previews → wait for choice |
100
120
  | no theme in message, stored theme found | Use stored theme — do not ask |
121
+ | “help me pick a theme”, “which theme fits?” | Full [theme picker](theme-picker.md) even if not generating yet |
101
122
 
102
123
  ## Accuracy checklist
103
124
 
104
- - [ ] Theme resolved without blocking theme picker (unless user asked to list themes)
125
+ - [ ] If no stored basic auth: [auth picker](auth-picker.md) run username/password collected, `prototype auth` executed, `prototype/htpasswd` present
126
+ - [ ] If no stored theme: [theme picker](theme-picker.md) run — 3 recommendations, previews opened, user confirmed
105
127
  - [ ] `prototype setup` run with resolved theme
106
128
  - [ ] Every generated file name matches `prototypeStem` in manifest
107
129
  - [ ] Wireframe/layout from screen detail doc reflected in HTML
@@ -0,0 +1,118 @@
1
+ # Theme picker — recommend, preview, confirm
2
+
3
+ When **no theme is stored** and the user did **not** name one in this request, run this flow **before** `prototype setup`. Do not generate HTML until the user confirms a theme.
4
+
5
+ Skip this flow when:
6
+
7
+ - User named a theme (`--theme stripe`, “use notion theme”)
8
+ - `prototype/theme.json`, manifest, or config already has a theme (use it — do not re-ask)
9
+ - User is only asking to preview or list themes (no generation yet)
10
+
11
+ ## Step 1 — Gather project context
12
+
13
+ Read enough to infer product type, audience, and visual tone. Prefer, in order:
14
+
15
+ | Source | What to extract |
16
+ |--------|-----------------|
17
+ | `docs/basic-design/list-screens.md` §1 Design System | Stated palette, typography, density, light/dark |
18
+ | `docs/srs/` (overview, use cases) | Domain (fintech, devtools, commerce, …), B2B vs consumer |
19
+ | `.ai-spector/.docflow/analysis/knowledge.json` | Product name, features, actors |
20
+ | `docs/data-source/` | Brand references, competitor mentions, industry |
21
+ | User message | Explicit vibe (“dark dashboard”, “like Stripe”, “travel app”) |
22
+
23
+ If context is thin, infer from screen names (e.g. checkout → commerce; admin dashboard → B2B SaaS).
24
+
25
+ ## Step 2 — Load theme catalog
26
+
27
+ ```bash
28
+ ai-spector prototype themes --json
29
+ ```
30
+
31
+ Each entry has `name`, `summary` (first line of SUMMARY.md), and `preview` (visual sample available).
32
+
33
+ Optionally read `assets/themes/<name>/SUMMARY.md` for top candidates only — do not read all 65.
34
+
35
+ ## Step 3 — Pick 3 best-fit themes
36
+
37
+ Choose **exactly 3** themes. Rank #1 = strongest match. Use signals below; tie-break with preview availability (`preview: true` preferred).
38
+
39
+ ### Domain → theme families
40
+
41
+ | Project signal | Prefer (examples) |
42
+ |----------------|-------------------|
43
+ | Payments, banking, fintech, wallet | `stripe`, `wise`, `revolut`, `coinbase`, `kraken` |
44
+ | Developer tools, infra, CI, APIs | `vercel`, `supabase`, `raycast`, `sentry`, `posthog`, `hashicorp` |
45
+ | Issue tracking, eng productivity, dark UI | `linear.app`, `cursor`, `warp` |
46
+ | Docs, wiki, workspace, notes | `notion`, `mintlify`, `miro` |
47
+ | Spreadsheets, ops, internal tools | `airtable`, `clickhouse` |
48
+ | E-commerce, merchant, checkout | `shopify`, `stripe` |
49
+ | Marketplace, travel, consumer listings | `airbnb`, `uber` |
50
+ | AI / ML product, chat, agents | `claude`, `mistral.ai`, `cohere`, `elevenlabs`, `x.ai`, `opencode.ai` |
51
+ | Marketing site, landing, portfolio | `framer`, `webflow`, `lovable`, `resend` |
52
+ | Scheduling, calendar | `cal` |
53
+ | Support, messaging, CRM | `intercom`, `superhuman` |
54
+ | Analytics, product data | `posthog`, `mixpanel-style` → `posthog`, `clickhouse` |
55
+ | Automotive / luxury brand | `bmw`, `tesla`, `porsche-style` → `ferrari`, `lamborghini`, `bugatti` |
56
+ | Media, social, content | `spotify`, `pinterest`, `wired`, `theverge` |
57
+ | Enterprise / big tech tone | `ibm`, `meta`, `nvidia` |
58
+ | Minimal / unknown | `vercel` (light dev), `notion` (friendly product), `linear.app` (dark pro) |
59
+
60
+ ### Tone modifiers
61
+
62
+ | User / doc says | Lean toward |
63
+ |-----------------|-------------|
64
+ | Dark mode, dense dashboard | `linear.app`, `cursor`, `raycast`, `binance` |
65
+ | Light, airy, friendly | `notion`, `airbnb`, `cal`, `lovable` |
66
+ | Premium, polished, fintech | `stripe`, `wise`, `revolut` |
67
+ | Playful, consumer | `spotify`, `airbnb`, `lovable` |
68
+ | “Like X” | That theme if bundled; else closest row above |
69
+
70
+ Write one sentence **why** for each of the 3 picks tied to **this project** (not generic theme marketing copy).
71
+
72
+ ## Step 4 — Show previews
73
+
74
+ Open all 3 recommended themes in the browser so the user can compare:
75
+
76
+ ```bash
77
+ ai-spector prototype preview <pick-1> --open
78
+ ai-spector prototype preview <pick-2> --open
79
+ ai-spector prototype preview <pick-3> --open
80
+ ```
81
+
82
+ If a pick has no preview (`preview: false`), say so and still include it if it is the best domain match.
83
+
84
+ ## Step 5 — Present choices and wait
85
+
86
+ Post a short message like this (adapt to project):
87
+
88
+ ```markdown
89
+ No prototype theme is saved yet. Based on **[project/domain]**, here are 3 fits:
90
+
91
+ | # | Theme | Why | Preview |
92
+ |---|-------|-----|---------|
93
+ | 1 | **stripe** | Fintech checkout + admin — matches your payment flows | opened in browser |
94
+ | 2 | **wise** | Cross-border money — similar trust/minimal fintech tone | opened in browser |
95
+ | 3 | **shopify** | Merchant commerce — if storefront is primary | opened in browser |
96
+
97
+ Three preview tabs should be open. Reply with **1**, **2**, **3**, or another theme name (`ai-spector prototype themes` lists all).
98
+
99
+ I will run setup after you choose.
100
+ ```
101
+
102
+ **Stop here.** Do not run `prototype setup` or generate HTML until the user replies.
103
+
104
+ ## Step 6 — Persist choice
105
+
106
+ When the user picks (number or name):
107
+
108
+ ```bash
109
+ ai-spector prototype setup --theme <chosen-name>
110
+ ```
111
+
112
+ Then continue the generate-prototype runbook (manifest → HTML → validate).
113
+
114
+ If the user asks to see more options, run `prototype themes` and offer to preview additional names they shortlist.
115
+
116
+ ## User already named a theme
117
+
118
+ If the user says “use stripe” or `--theme stripe`, skip the picker — run setup directly. Optionally offer a quick preview first only if they seem unsure (“want to preview before committing?”).
@@ -23,6 +23,7 @@ paths:
23
23
  ## Checklist
24
24
 
25
25
  ```
26
+ - [ ] language confirmed (language-picker.md — check before first write)
26
27
  - [ ] graph validate
27
28
  - [ ] runbook + generate-workflow followed
28
29
  - [ ] templates from .ai-spector/templates/srs/
@@ -2,13 +2,34 @@
2
2
 
3
3
  Static HTML prototypes for screens defined in basic design.
4
4
 
5
+ ## Basic auth (once per project)
6
+
7
+ Before generating HTML, configure HTTP basic auth (credentials in config, hash in htpasswd):
8
+
9
+ ```bash
10
+ ai-spector prototype auth --username <user> --password '<secret>'
11
+ ```
12
+
13
+ Stored in `.ai-spector/.docflow/config/prototype.config.json` (`basicAuth`) and `prototype/htpasswd`.
14
+
15
+ Regenerate htpasswd after cloning if the file is missing:
16
+
17
+ ```bash
18
+ ai-spector prototype auth --from-config
19
+ ```
20
+
5
21
  ## Setup (once per project or when changing theme)
6
22
 
7
- The agent resolves the theme automatically (`theme.json`, manifest, or `prototype.config.json` → `defaultTheme`). You only need to name a theme when you want to switch (e.g. “prototype with stripe theme”).
23
+ The agent resolves the theme automatically (`theme.json`, manifest, or `prototype.config.json` → `defaultTheme`).
24
+
25
+ **First time (no theme saved):** the agent reads your project docs, recommends **3 best-fit themes**, opens preview samples in your browser, and waits for you to pick before setup.
26
+
27
+ You can also name a theme directly (e.g. “prototype with stripe theme”) to skip recommendations.
8
28
 
9
29
  ```bash
10
- ai-spector prototype setup --theme vercel # persists defaultTheme when --theme is set
11
- ai-spector prototype themes # optional: list bundled themes
30
+ ai-spector prototype themes # full list ([preview] = visual sample)
31
+ ai-spector prototype preview stripe --open # open one theme sample
32
+ ai-spector prototype setup --theme vercel # after you choose — persists defaultTheme
12
33
  ```
13
34
 
14
35
  ## Generate screens