sdtk-design-kit 0.2.1 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,160 +1,102 @@
1
- # SDTK-DESIGN Kit
1
+ # sdtk-design-kit
2
2
 
3
- `sdtk-design-kit` is the standalone SDTK-DESIGN Foundation Beta package.
3
+ `sdtk-design-kit` is the public CLI package for SDTK-DESIGN.
4
4
 
5
- SDTK-DESIGN is a local-first MVP design planner and reviewer for solo founders. It turns a rough MVP idea into reviewable design artifacts and a deterministic handoff for SDTK-CODE.
5
+ Package version in this source snapshot: `0.3.1`
6
+ CLI command: `sdtk-design`
6
7
 
7
- It is not a Figma clone, Lovable clone, v0 clone, full app builder, or production code generator.
8
+ SDTK-DESIGN is a local-first MVP design planner and reviewer. It turns either a rough MVP idea or explicit SDTK-SPEC design artifacts into reviewable design docs, a static prototype, visual review evidence, and an SDTK-CODE handoff.
8
9
 
9
- ## Beginner Flow
10
+ It is not a Figma clone, Lovable clone, v0 clone, full app builder, production code generator, or network service.
10
11
 
11
- Use this optimized flow for a clean project:
12
+ ## Install
12
13
 
13
- ```powershell
14
+ ```bash
15
+ npm install -g sdtk-design-kit
16
+ sdtk-design --version
17
+ sdtk-design --help
18
+ ```
19
+
20
+ ## Beginner Idea Flow
21
+
22
+ ```bash
14
23
  sdtk-design init
15
- sdtk-design start --idea "I want to build a lightweight CRM for solo consultants to track leads, follow-ups, notes, and simple revenue pipeline without using a complex enterprise CRM." --style premium-dashboard
24
+ sdtk-design start --idea "I want to build a lightweight CRM for solo consultants to track leads." --style premium-dashboard
16
25
  sdtk-design prototype
17
26
  sdtk-design review --artifact docs/design/prototype/index.html
18
27
  sdtk-design handoff
19
28
  sdtk-design status
20
29
  ```
21
30
 
22
- What each command does:
23
-
24
- - `init`: creates the local design workspace.
25
- - `start`: creates the design brief, screen map, required wireframes, and design system.
26
- - `prototype`: creates a static visual preview from the generated design artifacts.
27
- - `review`: reviews a local markdown or static HTML design artifact with visual polish checks.
28
- - `handoff`: converts the generated design package into SDTK-CODE handoff guidance.
29
- - `status`: reports complete artifacts, missing artifacts, and the next recommended command.
31
+ ## SPEC-Driven Multi-Screen Flow
30
32
 
31
- ## Available Commands
33
+ Use this when SDTK-SPEC or an agent has produced explicit screen/design artifacts.
32
34
 
33
- ```powershell
34
- sdtk-design --help
35
- sdtk-design --version
36
- sdtk-design init [--project-path <path>] [--force] [--no-state]
37
- sdtk-design start --idea "<idea>" [--style <preset>] [--project-path <path>] [--force]
38
- sdtk-design brief --idea "<idea>" [--project-path <path>] [--force]
39
- sdtk-design screens [--project-path <path>] [--force]
40
- sdtk-design wireframe --screen landing [--project-path <path>] [--force]
41
- sdtk-design wireframe --screen all [--project-path <path>] [--force]
42
- sdtk-design system [--style <preset>] [--project-path <path>] [--force]
43
- sdtk-design prototype [--style <preset>] [--project-path <path>] [--force]
44
- sdtk-design review --artifact docs/design/wireframes/LANDING.md [--project-path <path>] [--force]
45
- sdtk-design review --artifact docs/design/prototype/index.html [--project-path <path>] [--force]
46
- sdtk-design handoff [--project-path <path>] [--force]
47
- sdtk-design status [--project-path <path>]
35
+ ```bash
36
+ sdtk-design init
37
+ sdtk-design start --from-spec . --profile b2b-commerce
38
+ sdtk-design prototype --force
39
+ sdtk-design review --artifact docs/design/prototype/index.html
40
+ sdtk-design handoff
41
+ sdtk-design status
48
42
  ```
49
43
 
50
- ## Generated Artifacts
44
+ Optional read-only reference export mapping:
51
45
 
52
- Human-facing output is written under `docs/design/`:
53
-
54
- ```text
55
- docs/design/
56
- README.md
57
- DESIGN_BRIEF.md
58
- SCREEN_MAP.md
59
- DESIGN_SYSTEM.md
60
- DESIGN_HANDOFF.md
61
- prototype/
62
- index.html
63
- wireframes/
64
- LANDING.md
65
- ONBOARDING.md
66
- DASHBOARD.md
67
- reviews/
68
- DESIGN_REVIEW_YYYYMMDD.md
46
+ ```bash
47
+ sdtk-design start --from-spec . --reference-dir ./docs/design/reference-export --profile b2b-commerce
69
48
  ```
70
49
 
71
- Internal state may live under `.sdtk/design/`. SDTK-DESIGN must not create or mutate `.sdtk/atlas`.
72
-
73
- ## Visual Style Presets
74
-
75
- `start` and `system` accept `--style <preset>`. If omitted, SDTK-DESIGN uses `minimal-saas`.
76
-
77
- Available presets:
78
-
79
- - `minimal-saas`: clean solo-founder SaaS default.
80
- - `premium-dashboard`: dashboard-first MVP with stronger metrics, cards, and status surfaces.
81
- - `bold-founder`: high-contrast launch style for marketing-heavy MVPs.
82
- - `warm-editorial`: softer consultant/service-product style.
50
+ `start --from-spec` consumes explicit design artifacts. It does not parse raw requirement prose or invent missing screens.
83
51
 
84
- ## Command Details
85
-
86
- ### `init`
87
-
88
- Creates `docs/design/`, `docs/design/wireframes/`, `docs/design/reviews/`, `docs/design/README.md`, and `.sdtk/design/manifest.json`.
89
-
90
- Existing managed init files are skipped by default. Use `--force` only when you explicitly want to refresh managed init files. Use `--no-state` to skip `.sdtk/design`.
91
-
92
- ### `start`
93
-
94
- Runs:
52
+ ## Commands
95
53
 
96
54
  ```text
97
- brief -> screens -> wireframe --screen all -> system
98
- ```
99
-
100
- This is the beginner facade for the core design package. It does not run review or handoff. Existing managed core outputs are not overwritten unless `--force` is explicit.
101
-
102
- Use `--style premium-dashboard` for dashboard-led MVPs such as ClientPulse.
103
-
104
- ### `prototype`
105
-
106
- Creates a static visual preview at `docs/design/prototype/index.html`.
107
-
108
- ```powershell
109
- sdtk-design prototype --style premium-dashboard
110
- ```
111
-
112
- The prototype includes landing, onboarding, and dashboard sections with responsive CSS, selected visual preset tokens, and domain copy derived from the generated design artifacts. It is not production app code and does not create files outside `docs/design/prototype`.
113
-
114
- ### `review`
115
-
116
- Reviews a local markdown or static HTML artifact. For the optimized workflow, review the generated prototype:
117
-
118
- ```powershell
55
+ sdtk-design init
56
+ sdtk-design start --idea "<idea>" --style premium-dashboard
57
+ sdtk-design start --from-spec . --reference-dir ./docs/design/reference-export --profile b2b-commerce
58
+ sdtk-design brief --idea "<idea>"
59
+ sdtk-design screens
60
+ sdtk-design wireframe --screen landing
61
+ sdtk-design system --style minimal-saas
62
+ sdtk-design prototype
119
63
  sdtk-design review --artifact docs/design/prototype/index.html
64
+ sdtk-design handoff
65
+ sdtk-design status
120
66
  ```
121
67
 
122
- Markdown artifact review remains supported:
68
+ Visual style presets:
123
69
 
124
- ```powershell
125
- sdtk-design review --artifact docs/design/wireframes/LANDING.md
70
+ ```text
71
+ minimal-saas
72
+ premium-dashboard
73
+ bold-founder
74
+ warm-editorial
126
75
  ```
127
76
 
128
- The review report is written to `docs/design/reviews/DESIGN_REVIEW_YYYYMMDD.md`.
129
-
130
- Current review support is local artifact review only. The report includes visual polish checks for hierarchy, spacing/density, CTA clarity, dashboard information density, responsive/mobile risk, accessibility baseline, and anti-wireframe/mockup risk. No URL, browser, screenshot, vision, or DOM review is implemented in Foundation Beta.
131
-
132
- ### `handoff`
133
-
134
- Reads the generated brief, screen map, required wireframes, and design system, then writes `docs/design/DESIGN_HANDOFF.md`.
77
+ ## Outputs
135
78
 
136
- The handoff is planning input for SDTK-CODE. It includes screen-to-component mapping, screen-to-user-story mapping, design decisions, implementation notes, suggested data model, domain/status taxonomy, interaction flow, persistence guidance, visual implementation contract, prototype reference, SDTK-CODE build notes, acceptance criteria, and a readiness verdict. Domain-specific examples are derived from the generated artifacts rather than fixed to one demo product. It does not generate production app code.
79
+ Human-facing artifacts are written under `docs/design/`, including:
137
80
 
138
- ### `status`
139
-
140
- Read-only command. It reports complete artifacts, missing artifacts, and the next recommended command.
141
-
142
- The optimized readiness path expects `docs/design/prototype/index.html` before prototype review and handoff.
143
-
144
- ## Non-Goals And Deferred Features
81
+ ```text
82
+ DESIGN_BRIEF.md
83
+ SCREEN_MAP.md
84
+ DESIGN_SYSTEM.md
85
+ DESIGN_HANDOFF.md
86
+ prototype/index.html
87
+ reviews/DESIGN_REVIEW_YYYYMMDD.md
88
+ wireframes/
89
+ ```
145
90
 
146
- Foundation Beta does not provide:
91
+ SPEC-driven/high-fidelity flows may also create per-screen briefs, component contracts, visual token contracts, reference maps, fidelity reviews, and internal state under `.sdtk/design/`.
147
92
 
148
- - Figma, Lovable, v0, or full app-builder replacement behavior.
149
- - Production app code generation.
150
- - URL, browser, screenshot, vision, or DOM review.
151
- - Network calls by default.
152
- - Pro entitlement gates.
153
- - `.sdtk/atlas` creation or mutation.
154
- - SDTK-WIKI output mutation.
155
- - Landing-site updates.
156
- - npm publish or maintainer packaging checks without separate maintainer approval.
93
+ ## Boundaries
157
94
 
158
- ## SDTK-CODE Handoff
95
+ - no production app code generation
96
+ - no URL/browser/screenshot/vision review in the CLI
97
+ - no network calls by default
98
+ - no `.sdtk/atlas` creation or mutation
99
+ - no SDTK-WIKI output mutation
100
+ - no overwrite unless a command explicitly supports `--force`
159
101
 
160
- After `sdtk-design handoff`, pass `docs/design/DESIGN_HANDOFF.md` to SDTK-CODE as implementation planning input. SDTK-CODE should still plan, implement, and verify code changes separately.
102
+ See `products/sdtk-design/governance/SDTK_DESIGN_USAGE_GUIDE.md` for the full usage guide.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sdtk-design-kit",
3
- "version": "0.2.1",
3
+ "version": "0.3.1",
4
4
  "description": "Local-first MVP design planner and reviewer for SDTK workspaces.",
5
5
  "bin": {
6
6
  "sdtk-design": "bin/sdtk-design.js"
@@ -9,6 +9,7 @@
9
9
  "type": "commonjs",
10
10
  "files": [
11
11
  "bin/",
12
+ "skills/",
12
13
  "src/",
13
14
  "README.md"
14
15
  ],
@@ -0,0 +1,276 @@
1
+ ---
2
+ name: design-prototype
3
+ description: Generate high-fidelity standalone HTML prototypes from an SDTK-DESIGN generation manifest, design system, design tokens, and per-screen briefs.
4
+ ---
5
+
6
+ # Design Prototype
7
+
8
+ Use this skill when the user asks you to generate, regenerate, or polish SDTK-DESIGN prototype screen HTML from `docs/design/prototype/.manifest.json`.
9
+
10
+ ## Inputs
11
+
12
+ Read these files before writing any screen HTML:
13
+
14
+ 1. `docs/design/prototype/.manifest.json`
15
+ 2. This skill's `references/designer-charter.md`
16
+ 3. This skill's `references/craft.md`
17
+ 4. `docs/design/DESIGN_SYSTEM.md`
18
+ 5. `docs/design/DESIGN_TOKENS.json`
19
+ 6. Each screen brief named by the manifest entry's `briefPath`
20
+
21
+ The manifest contract is:
22
+
23
+ ```json
24
+ {
25
+ "screens": [
26
+ {
27
+ "screenId": "home",
28
+ "title": "Home",
29
+ "role": "home",
30
+ "briefPath": "docs/design/screens/home_DESIGN_BRIEF.md",
31
+ "outPath": "docs/design/prototype/screens/home.html"
32
+ }
33
+ ]
34
+ }
35
+ ```
36
+
37
+ ## Workflow
38
+
39
+ 1. Validate that the manifest exists and that every screen entry has `screenId`, `title`, `role`, `briefPath`, and `outPath`.
40
+ 2. Read the charter and craft references once for the whole run.
41
+ 3. Read `DESIGN_SYSTEM.md` and `DESIGN_TOKENS.json` as the only brand and visual-direction authority.
42
+ 4. For each screen, read its `briefPath`, plan the page structure, then write exactly one complete standalone `<!doctype html>` document to its `outPath`.
43
+ 5. Keep CSS inline in the file. Do not create external CSS, JavaScript, image, or font files.
44
+ 6. Keep each generated HTML file under roughly 1000 lines.
45
+ 7. Use real brief-sourced content, data slots, states, actions, and screen purpose. Do not add filler sections to make the page feel dense.
46
+ 8. Verify each file after writing: complete doctype, `<html>`, `<head>`, `<body>`, non-empty `<title>`, one `<h1>`, visible state coverage, token usage, no raw debug JSON, no placeholder/filler copy.
47
+
48
+ ## NEEDS_* slot rendering convention (BK-227)
49
+
50
+ When emitting NEEDS_* placeholders in screen HTML, distinguish two slot classes by checking the brief's per-section `interactive_data_slots` array (sidecar JSON) or the `interactive=` detail in the brief markdown:
51
+
52
+ **Interactive slots** — markers listed in `interactive_data_slots`. These sit inside repeated card / row / list structures (product cards, order rows, search results, category cards, nav items). Emit each as:
53
+
54
+ <a href="#" data-needs="NEEDS_PRODUCT_NAME">NEEDS_PRODUCT_NAME</a>
55
+
56
+ **Static slots** — every other NEEDS_* marker (brand name in header, footer URLs, hero imagery, single-occurrence content). Emit as:
57
+
58
+ <span data-needs="NEEDS_BRAND_NAME">NEEDS_BRAND_NAME</span>
59
+
60
+ Rules:
61
+ - `href="#"` is the ONLY permitted destination for skeleton anchors. Never invent URLs.
62
+ - The visible marker text and the `data-needs` attribute value are identical across both classes — only the wrapper element changes.
63
+ - If a section mixes interactive and static slots, look up class per marker via set membership on `interactive_data_slots`.
64
+ - Skeleton anchors preserve BK-225 honesty (the `data-needs` attribute marks the gap) and BK-217 no-invented-content (`#` is not a real destination).
65
+
66
+ ### Density rule for repeated structures (BK-231)
67
+
68
+ When a section's `interactive_data_slots` is non-empty (BK-227 interactive) OR the section's `components` include a card / row / list-item / nav-item pattern, render **3–4 sample instances** rather than 1. Each instance reuses the same skeleton anchor + marker set from BK-227.
69
+
70
+ Cap at 4 instances per section to keep file size bounded (per-screen HTML must stay under ~1000 lines). Single-occurrence interactive slots (e.g. one cart-summary panel, one add-to-cart button on PDP) are unaffected — apply density only to repeated structures.
71
+
72
+ Composition with BK-229 facts:
73
+ - If `tokens.brand.categories[]` has N entries → render N category instances (use supplied labels per BK-229).
74
+ - For repeated structures NOT bound to factual data (product cards, order rows, search results, generic list items) → render exactly 4 instances, all carrying the same `NEEDS_*` marker set.
75
+
76
+ #### Examples
77
+
78
+ Product cards in a category screen — render 4 instances per BK-231 density rule (section.interactive_data_slots contains NEEDS_PRODUCT_NAME, NEEDS_PRODUCT_IMAGE, NEEDS_SKU, NEEDS_PRICE):
79
+ ```
80
+ <div class="product-grid">
81
+ <a href="#" data-needs="NEEDS_PRODUCT_NAME" class="product-card">
82
+ <span data-needs="NEEDS_PRODUCT_IMAGE" class="product-thumb">NEEDS_PRODUCT_IMAGE</span>
83
+ <span class="product-name">NEEDS_PRODUCT_NAME</span>
84
+ <span class="product-sku" data-needs="NEEDS_SKU">NEEDS_SKU</span>
85
+ <span class="product-price" data-needs="NEEDS_PRICE">NEEDS_PRICE</span>
86
+ </a>
87
+ <a href="#" data-needs="NEEDS_PRODUCT_NAME" class="product-card">
88
+ <span data-needs="NEEDS_PRODUCT_IMAGE" class="product-thumb">NEEDS_PRODUCT_IMAGE</span>
89
+ <span class="product-name">NEEDS_PRODUCT_NAME</span>
90
+ <span class="product-sku" data-needs="NEEDS_SKU">NEEDS_SKU</span>
91
+ <span class="product-price" data-needs="NEEDS_PRICE">NEEDS_PRICE</span>
92
+ </a>
93
+ <a href="#" data-needs="NEEDS_PRODUCT_NAME" class="product-card">
94
+ <span data-needs="NEEDS_PRODUCT_IMAGE" class="product-thumb">NEEDS_PRODUCT_IMAGE</span>
95
+ <span class="product-name">NEEDS_PRODUCT_NAME</span>
96
+ <span class="product-sku" data-needs="NEEDS_SKU">NEEDS_SKU</span>
97
+ <span class="product-price" data-needs="NEEDS_PRICE">NEEDS_PRICE</span>
98
+ </a>
99
+ <a href="#" data-needs="NEEDS_PRODUCT_NAME" class="product-card">
100
+ <span data-needs="NEEDS_PRODUCT_IMAGE" class="product-thumb">NEEDS_PRODUCT_IMAGE</span>
101
+ <span class="product-name">NEEDS_PRODUCT_NAME</span>
102
+ <span class="product-sku" data-needs="NEEDS_SKU">NEEDS_SKU</span>
103
+ <span class="product-price" data-needs="NEEDS_PRICE">NEEDS_PRICE</span>
104
+ </a>
105
+ </div>
106
+ ```
107
+
108
+ Brand logo in a header — single occurrence, density rule does NOT apply (section.interactive_data_slots empty — static slot):
109
+ ```
110
+ <a href="/" class="logo">
111
+ <span data-needs="NEEDS_BRAND_NAME">NEEDS_BRAND_NAME</span>
112
+ </a>
113
+ ```
114
+
115
+ Order row in order-history — pattern shape shown once; renderer applies BK-231 density to emit 4 such rows (section.interactive_data_slots contains NEEDS_ORDER_ID, NEEDS_DATE, NEEDS_TOTAL):
116
+ ```
117
+ <a href="#" data-needs="NEEDS_ORDER_ID" class="order-row">
118
+ <span class="order-id">NEEDS_ORDER_ID</span>
119
+ <span class="order-date" data-needs="NEEDS_DATE">NEEDS_DATE</span>
120
+ <span class="order-total" data-needs="NEEDS_TOTAL">NEEDS_TOTAL</span>
121
+ </a>
122
+ ```
123
+
124
+ ## Factual content from project-facts (BK-229)
125
+
126
+ Before emitting any NEEDS_* marker, check `tokens.brand` in `DESIGN_TOKENS.json` for a matching factual value. If the field is non-null and non-empty, render the value as visible text and OMIT the `data-needs` attribute and `NEEDS_*` marker. If the field is null or empty, fall back to the BK-227 wrapper emit rule.
127
+
128
+ Marker → token field mapping:
129
+
130
+ | NEEDS_* marker | tokens.brand field |
131
+ |---|---|
132
+ | NEEDS_BRAND_NAME | brand.name |
133
+ | NEEDS_COMPANY_NAME | brand.company |
134
+ | NEEDS_CONTACT_URL | brand.contactUrl |
135
+ | NEEDS_PRIVACY_URL | brand.privacyUrl |
136
+ | NEEDS_TERMS_URL | brand.termsUrl |
137
+ | NEEDS_CATEGORY_LABEL | brand.categories[i].label (keyed by element's `data-key` attribute) |
138
+
139
+ For NEEDS_CATEGORY_LABEL specifically — when a slot is also classified interactive (BK-227), the result combines both rules:
140
+ - BK-227 wraps as `<a href="#" data-needs="NEEDS_CATEGORY_LABEL" data-key="cable">`
141
+ - BK-229 fills label from `brand.categories` if `{ key: "cable", label: "..." }` present
142
+ - Combined output: `<a href="#" data-key="cable">...label...</a>`
143
+
144
+ ### Examples (BK-229)
145
+
146
+ Header brand (BK-227 static + BK-229 fact):
147
+ - `tokens.brand.name = "Esteam"`: `<a href="/" class="logo">Esteam</a>`
148
+ - `tokens.brand.name = null`: `<a href="/" class="logo"><span data-needs="NEEDS_BRAND_NAME">NEEDS_BRAND_NAME</span></a>`
149
+
150
+ Footer contact URL (BK-227 static + BK-229 fact):
151
+ - `tokens.brand.contactUrl = "https://example.com/contact"`: `<a href="https://example.com/contact">Contact</a>`
152
+ - null: `<a href="#" data-needs="NEEDS_CONTACT_URL">Contact</a>`
153
+
154
+ Category nav (BK-227 interactive + BK-229 fact, keyed by `data-key`):
155
+ - `tokens.brand.categories[0] = { key: "cable", label: "Cable" }`: `<a href="#" data-key="cable">Cable</a>`
156
+ - absent: `<a href="#" data-needs="NEEDS_CATEGORY_LABEL" data-key="cable">NEEDS_CATEGORY_LABEL</a>`
157
+
158
+ Boundary: do NOT derive `name`, `company`, `*Url`, or `categories` from requirement text, screen names, or any other source. The only source of factual content is the `tokens.brand` block populated by `--project-facts`.
159
+
160
+ ## Inter-screen navigation (BK-232)
161
+
162
+ The MVP prototype is a click-through demo across 10 sibling HTML files in `docs/design/prototype/screens/`. When emitting `<a>` elements for top-nav, footer-nav, or sidebar-nav links, convert SPEC-declared route paths to file-relative paths so clicking in browser navigates to the correct sibling file.
163
+
164
+ ### Canonical route → file mapping
165
+
166
+ | Route prefix (from brief / SPEC) | Target `href` value |
167
+ |---|---|
168
+ | `/` | `home.html` |
169
+ | `/category` or `/category/*` | `category.html` |
170
+ | `/product` or `/product/*` | `product-detail.html` |
171
+ | `/search` | `search.html` |
172
+ | `/cart` | `cart.html` |
173
+ | `/checkout` or `/checkout/*` | `checkout.html` |
174
+ | `/account` or `/account/info` | `account-info.html` |
175
+ | `/account/orders` (exact) | `order-history.html` |
176
+ | `/account/orders/*` (any order id) | `order-detail.html` |
177
+ | `/configure` or `/configure/*` | `mode-b-configurator.html` |
178
+
179
+ ### Fallback rule
180
+
181
+ Routes NOT in the mapping (`/account/quotes`, `/account/addresses`, `/logout`, `/shipping`, `/faq`, `/about`, `/help`, `/admin`, `/api/*`, etc.) → emit `href="#"` (BK-227 skeleton anchor). The placeholder is honest: no rendered file exists for the route.
182
+
183
+ ### Factual URL priority (BK-229)
184
+
185
+ When `tokens.brand.contactUrl` / `privacyUrl` / `termsUrl` is non-null AND the link is a footer contact / privacy / terms link, use the supplied URL directly as `href` (overrides the mapping; BK-229 facts always take priority over routing).
186
+
187
+ ### Current-page marker
188
+
189
+ When the rendered file IS the current screen (e.g. `order-history.html` rendering the `/account/orders` route), mark the matching nav link with `aria-current="page"`. Keep the `href` value pointing to the same file (self-link is fine).
190
+
191
+ ### Example
192
+
193
+ In `home.html` top nav:
194
+ ```
195
+ <nav aria-label="Main navigation">
196
+ <a href="category.html">高圧ケーブル</a>
197
+ <a href="category.html">開閉器(PAS)</a>
198
+ <a href="category.html">金具・支持材</a>
199
+ <a href="category.html">碍子・絶縁材</a>
200
+ <a href="search.html">検索</a>
201
+ <a href="mode-b-configurator.html">Mode B</a>
202
+ <a href="account-info.html" class="btn btn-secondary">アカウント</a>
203
+ <a href="cart.html" class="btn btn-primary">カート</a>
204
+ </nav>
205
+ ```
206
+
207
+ In `order-history.html` sidebar (current page = order-history):
208
+ ```
209
+ <nav class="account-nav" aria-label="アカウントナビゲーション">
210
+ <h2>マイアカウント</h2>
211
+ <ul>
212
+ <li><a href="account-info.html">ダッシュボード</a></li>
213
+ <li><a href="order-history.html" aria-current="page">注文履歴</a></li>
214
+ <li><a href="#">見積一覧</a></li>
215
+ <li><a href="account-info.html">アカウント情報</a></li>
216
+ <li><a href="#">配送先一覧</a></li>
217
+ <li><a href="#">ログアウト</a></li>
218
+ </ul>
219
+ </nav>
220
+ ```
221
+
222
+ ## CSS scope checklist for nav elements (BK-233)
223
+
224
+ When a screen contains multiple `<nav>` elements (e.g. header nav + sidebar account nav + footer nav), generic `nav ul { ... }` rules cascade into ALL nav contexts and break nested layouts. The renderer MUST scope every nav-targeting CSS rule to its structural context.
225
+
226
+ ### Required scoping per nav context
227
+
228
+ 1. **Header nav** — use `header nav ul { display: flex; ... }` (NEVER bare `nav ul`).
229
+ 2. **Sidebar nav / account nav / side panel nav** — explicit `display: block` (or `flex-direction: column`) on the scoped class selector. Example: `.account-nav ul { display: block; }`.
230
+ 3. **Footer nav** — same discipline: `footer nav ul { display: flex; ... }` if horizontal, OR explicit `display: block` if vertical.
231
+
232
+ Rule: if a `<nav>` element appears in more than one structural context within the same screen, scope EVERY nav-targeting rule with a parent selector. Never rely on cascade defaults for nested nav.
233
+
234
+ ### Negative example (DON'T)
235
+
236
+ ```
237
+ /* Generic nav ul cascades into ALL nav children — breaks sidebar */
238
+ nav ul { list-style: none; display: flex; gap: 1.5rem; }
239
+ .account-nav ul { list-style: none; } /* missing display reset! cascade wins */
240
+ ```
241
+
242
+ Result: sidebar `<li>` items render in a horizontal row, each becoming a narrow column where Japanese/CJK characters wrap one-per-line.
243
+
244
+ ### Positive example (DO)
245
+
246
+ ```
247
+ /* Scope header explicitly */
248
+ header nav ul { list-style: none; display: flex; gap: 1.5rem; }
249
+ header nav li { margin: 0; }
250
+
251
+ /* Sidebar explicitly declares display: block */
252
+ .account-nav ul { list-style: none; display: block; margin: 0; padding: 0; }
253
+ .account-nav li { display: block; margin-bottom: 0.25rem; }
254
+ .account-nav a { display: block; padding: 0.5rem 0.75rem; }
255
+ ```
256
+
257
+ Result: header nav horizontal, sidebar nav proper vertical menu list.
258
+
259
+ ### Sanity check during rendering
260
+
261
+ For each screen with multiple `<nav>` elements, verify before output:
262
+ - Does every `nav`-targeting rule have a parent selector (`header nav`, `footer nav`) OR a class scope (`.account-nav`)?
263
+ - Do nested nav class rules explicitly set `display`?
264
+ - Are there any bare `nav ul` or `nav li` rules without a parent / class scope?
265
+
266
+ If any check fails, fix the CSS before emitting the HTML file.
267
+
268
+ ## Boundaries
269
+
270
+ - Brand, palette, typography, spacing, mood, and component direction come only from `docs/design/DESIGN_SYSTEM.md` and `docs/design/DESIGN_TOKENS.json`.
271
+ - Do not infer brand direction from requirements, source quotes, screen names, or sample file names.
272
+ - Do not read `docs/ui/**` before generation completes.
273
+ - Do not copy or hash-match sample HTML, PNG, or other reference files.
274
+ - Do not hardcode Esteam screen names, routes, palette, copy, or layouts.
275
+ - Do not call a network service, start a daemon, spawn a subprocess, or require an API key.
276
+ - Do not create `.sdtk/atlas`.
@@ -0,0 +1,75 @@
1
+ # Prototype Craft Rules
2
+
3
+ These rules sit on top of `docs/design/DESIGN_SYSTEM.md` and `docs/design/DESIGN_TOKENS.json`. If there is a conflict, project design tokens and the design system define the brand; these rules define execution quality.
4
+
5
+ ## Anti-Slop
6
+
7
+ Must-fix patterns:
8
+
9
+ - Default Tailwind indigo or purple hex values used directly.
10
+ - Two-stop trust gradients on hero sections.
11
+ - Emoji inside headings, buttons, feature icons, or primary navigation.
12
+ - Rounded cards with colored left-border accents.
13
+ - Invented metrics such as "10x faster" or "99.9% uptime".
14
+ - Filler copy such as lorem ipsum, sample content, placeholder text, or numbered product cards.
15
+ - Repeated article/card bodies that only change the heading.
16
+
17
+ Should-fix patterns:
18
+
19
+ - Generic hero, feature, pricing, FAQ, CTA sequence when the screen brief calls for an app surface.
20
+ - Placeholder image CDNs.
21
+ - More than 12 raw hex values outside `:root`.
22
+ - `var(--accent)` or `var(--primary)` used so often that everything competes for attention.
23
+ - Decorative blob or wave SVG backgrounds.
24
+
25
+ ## Color
26
+
27
+ - Plan four layers before writing CSS: neutrals, one accent, semantic colors, and rare effects.
28
+ - Use tokens or CSS custom properties. Avoid raw hex outside `:root`.
29
+ - Keep accent use scarce: usually one primary CTA and one secondary signal per screen.
30
+ - Do not introduce a second accent unless `DESIGN_TOKENS.json` declares it.
31
+ - Normal text must meet WCAG AA contrast: 4.5:1 for body, 3:1 for large text and UI components.
32
+ - Avoid pure black and pure white backgrounds; use tokenized near-black/near-white values when available.
33
+
34
+ ## Typography
35
+
36
+ - Use the font families and scale from the design system.
37
+ - Cap visible type levels to a small, intentional set.
38
+ - One element should be the dominant entry point in each visual region.
39
+ - Use at least two hierarchy vectors for the dominant element: scale, weight, spacing, tracking, or alignment.
40
+ - Body copy should stay readable, with a comfortable line length around 50-75 characters.
41
+ - Button and label text should be concrete and action-oriented.
42
+ - All-caps labels need positive tracking; display sizes need deliberate tighter tracking.
43
+
44
+ ## Layout And Composition
45
+
46
+ - Prefer product-specific structure over generic cards.
47
+ - Use CSS Grid for real layout relationships, not only equal card rows.
48
+ - Vary density by screen purpose: dashboards and tables may be tight; landing and decision areas need more air.
49
+ - Do not place cards inside larger decorative cards.
50
+ - Keep navigation and repeated controls stable across screens.
51
+ - Use one decisive flourish: a proportion, type treatment, state surface, or interaction detail that supports the brief.
52
+
53
+ ## State Coverage
54
+
55
+ Every interactive list, table, card, form, search, or workflow surface needs visible handling for:
56
+
57
+ - Loading
58
+ - Empty
59
+ - Error
60
+ - Populated
61
+ - Edge cases such as long text, missing optional fields, large result counts, or disabled actions
62
+
63
+ Empty states need a headline, plain explanation, and action. Error states need what happened, why if knowable, and what the user can do next.
64
+
65
+ ## Accessibility Baseline
66
+
67
+ - One `<h1>` per document.
68
+ - Use semantic landmarks: `<header>`, `<nav>`, `<main>`, `<section>`, `<aside>`, `<footer>`.
69
+ - Prefer native controls over ARIA recreations.
70
+ - Inputs have visible labels.
71
+ - Icon-only controls have accessible names.
72
+ - Keyboard focus is visible with `:focus-visible`.
73
+ - Interactive targets should be at least 44px when practical.
74
+ - Do not rely on color alone for status.
75
+ - Respect reduced-motion preferences for animation.
@@ -0,0 +1,56 @@
1
+ # Designer Charter
2
+
3
+ You are an expert designer working in HTML. Your job is to produce thoughtful, well-crafted, engineered prototype screens as standalone HTML documents.
4
+
5
+ ## Operating Model
6
+
7
+ Work inside the project filesystem. The manifest tells you which files to write. Write files directly to the manifest `outPath`; do not hand off HTML through chat-only wrappers.
8
+
9
+ ## Workflow
10
+
11
+ 1. Understand the requested output, fidelity, constraints, screen purpose, audience, and active design system.
12
+ 2. Explore provided resources before building. Read the manifest, design system, tokens, craft reference, and the current screen brief.
13
+ 3. Plan the visual system before writing: background, type scale, layout pattern, density, interaction states, and one decisive flourish.
14
+ 4. Build the HTML file. Show real structure early in the file: landmarks, clear heading, primary action, state surfaces, and content tied to the brief.
15
+ 5. Verify the completed file before moving to the next screen.
16
+
17
+ ## HTML Output Rules
18
+
19
+ - The HTML must be complete and standalone.
20
+ - Inline all CSS in the document.
21
+ - Use semantic landmarks and native controls first.
22
+ - Keep each file under roughly 1000 lines.
23
+ - Use modern CSS deliberately: Grid, container queries where useful, `color-mix()`, `text-wrap: pretty`, and custom properties.
24
+
25
+ ## Content Rules
26
+
27
+ - No filler copy, dummy sections, placeholder text, or invented metrics.
28
+ - Use real content from the screen brief: purpose, data slots, user intent, primary action, component expectations, states, and acceptance criteria.
29
+ - Ask for clarification only when a required product fact is impossible to infer from the manifest, design system, tokens, and brief.
30
+ - Use sentence-case headings by default.
31
+ - Mobile hit targets are at least 44px when practical.
32
+ - Do not surprise-add flows or sections outside the brief.
33
+
34
+ ## Anti-AI-Slop Rules
35
+
36
+ Avoid these patterns:
37
+
38
+ - Aggressive gradient backgrounds.
39
+ - Gratuitous emoji.
40
+ - Rounded boxes with a colored left-border accent.
41
+ - SVG-as-illustration when a neutral placeholder or real content block belongs there.
42
+ - Overused fonts used without justification.
43
+ - Generic warm beige, peach, pink, orange, or brown canvas treatments when not brand-led.
44
+ - Default indigo or purple accents unless the design tokens explicitly require them.
45
+ - Decorative blobs, bokeh, or wave backgrounds without a functional role.
46
+
47
+ ## Visual Craft
48
+
49
+ Use restraint plus one decisive flourish. The page should feel specific to the product through structure, copy, state design, and proportions, not through decoration.
50
+
51
+ ## What Not To Do
52
+
53
+ - Do not recreate copyrighted designs or another company's distinctive UI.
54
+ - Do not mention tool internals in the generated HTML.
55
+ - Do not include raw source JSON or debug panels.
56
+ - Do not use product-specific sample files as a generation source.