@llipe.com/dev-tasks 0.9.1 → 0.10.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.
- package/.claude/agents/ux-engineer.md +118 -114
- package/.claude/skills/activity-refine/SKILL.md +1 -0
- package/.claude/skills/ux-scaffold/SKILL.md +129 -0
- package/.claude/skills/ux-scaffold/scripts/scaffold-full.sh +183 -0
- package/.claude/skills/ux-scaffold/scripts/scaffold-lite.sh +235 -0
- package/.claude/skills/ux-theme-gen/SKILL.md +149 -0
- package/.github/agents/ux-engineer.agent.md +119 -114
- package/.github/skills/activity-refine/SKILL.md +6 -0
- package/.github/skills/ux-scaffold/SKILL.md +129 -0
- package/.github/skills/ux-scaffold/scripts/scaffold-full.sh +183 -0
- package/.github/skills/ux-scaffold/scripts/scaffold-lite.sh +235 -0
- package/.github/skills/ux-theme-gen/SKILL.md +149 -0
- package/.kiro/agents/ux-engineer.md +119 -132
- package/.kiro/skills/activity-refine/SKILL.md +1 -0
- package/.kiro/skills/ux-scaffold/SKILL.md +129 -0
- package/.kiro/skills/ux-scaffold/scripts/scaffold-full.sh +183 -0
- package/.kiro/skills/ux-scaffold/scripts/scaffold-lite.sh +235 -0
- package/.kiro/skills/ux-theme-gen/SKILL.md +149 -0
- package/AGENTS.md +8 -7
- package/CHANGELOG.md +42 -0
- package/DESIGN.md +233 -0
- package/README.md +30 -28
- package/bundle-manifest.json +1 -0
- package/dist/bin/dev-tasks.js +4 -0
- package/dist/bin/dev-tasks.js.map +1 -1
- package/dist/core/distribution/doctor.d.ts +2 -2
- package/dist/core/distribution/doctor.js +3 -3
- package/dist/core/distribution/migrate.d.ts +5 -3
- package/dist/core/distribution/migrate.d.ts.map +1 -1
- package/dist/core/distribution/migrate.js +27 -4
- package/dist/core/distribution/migrate.js.map +1 -1
- package/dist/core/distribution/profiles.d.ts.map +1 -1
- package/dist/core/distribution/profiles.js +1 -1
- package/dist/core/distribution/profiles.js.map +1 -1
- package/dist/core/distribution/update.d.ts +2 -0
- package/dist/core/distribution/update.d.ts.map +1 -1
- package/dist/core/distribution/update.js +14 -2
- package/dist/core/distribution/update.js.map +1 -1
- package/package.json +4 -3
- package/.claude/skills/webapp-mockup/SKILL.md +0 -76
- package/.claude/skills/webapp-mockup/scripts/scaffold-mockup.sh +0 -469
- package/.github/skills/webapp-mockup/SKILL.md +0 -71
- package/.github/skills/webapp-mockup/scripts/scaffold-mockup.sh +0 -469
- package/.kiro/skills/webapp-mockup/SKILL.md +0 -76
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# scaffold-lite.sh — Generate a navigable html-lite mockup scaffold.
|
|
5
|
+
# All screens are self-contained HTML files styled from DESIGN.md tokens.
|
|
6
|
+
#
|
|
7
|
+
# Usage:
|
|
8
|
+
# ./scripts/scaffold-lite.sh <feature> <variant-num> <theme-css-path> <output-dir>
|
|
9
|
+
#
|
|
10
|
+
# Example:
|
|
11
|
+
# ./scripts/scaffold-lite.sh onboarding 1 /mockups/.theme/theme.css docs/requirements/mockups/onboarding/
|
|
12
|
+
|
|
13
|
+
usage() {
|
|
14
|
+
echo "Usage: $0 <feature> <variant-num> <theme-css-path> <output-dir>"
|
|
15
|
+
echo ""
|
|
16
|
+
echo " feature Feature slug (lowercase, hyphenated)"
|
|
17
|
+
echo " variant-num Variant number (integer)"
|
|
18
|
+
echo " theme-css-path Path to the generated theme.css from ux-theme-gen"
|
|
19
|
+
echo " output-dir Directory to create the mockup in"
|
|
20
|
+
exit 1
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if [[ $# -ne 4 ]]; then
|
|
24
|
+
usage
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
FEATURE="$(echo "$1" | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | tr -cd 'a-z0-9-')"
|
|
28
|
+
VARIANT="$2"
|
|
29
|
+
THEME_CSS="$3"
|
|
30
|
+
OUTPUT_DIR="$4"
|
|
31
|
+
|
|
32
|
+
if [[ -z "$FEATURE" ]]; then
|
|
33
|
+
echo "Error: <feature> produced an empty slug."
|
|
34
|
+
exit 1
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
if ! [[ "$VARIANT" =~ ^[0-9]+$ ]]; then
|
|
38
|
+
echo "Error: <variant-num> must be an integer."
|
|
39
|
+
exit 1
|
|
40
|
+
fi
|
|
41
|
+
|
|
42
|
+
if [[ ! -f "$THEME_CSS" ]]; then
|
|
43
|
+
echo "Error: theme.css not found at: $THEME_CSS"
|
|
44
|
+
echo "Run ux-theme-gen first to generate theme artifacts from DESIGN.md."
|
|
45
|
+
exit 1
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
# Extract :root block from theme.css to inline in HTML files
|
|
49
|
+
ROOT_STYLES=$(sed -n '/:root/,/^}/p' "$THEME_CSS")
|
|
50
|
+
THEME_INLINE=$(sed -n '/@theme inline/,/^}/p' "$THEME_CSS")
|
|
51
|
+
|
|
52
|
+
mkdir -p "$OUTPUT_DIR"
|
|
53
|
+
|
|
54
|
+
# Screen types the agent will fill with content
|
|
55
|
+
SCREENS=(
|
|
56
|
+
"happy:Primary flow — success state"
|
|
57
|
+
"error-validation:Form validation failures"
|
|
58
|
+
"error-server:Server or network error state"
|
|
59
|
+
"error-permission:Permission denied or unauthorized"
|
|
60
|
+
"empty:No data or first-use experience"
|
|
61
|
+
"loading:Skeleton screens and spinners"
|
|
62
|
+
"edge-overflow:Long text, many items"
|
|
63
|
+
"edge-zero:Zero items, disabled states"
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
# Generate individual screen files
|
|
67
|
+
for entry in "${SCREENS[@]}"; do
|
|
68
|
+
name="${entry%%:*}"
|
|
69
|
+
desc="${entry#*:}"
|
|
70
|
+
filename="screen-${name}.html"
|
|
71
|
+
|
|
72
|
+
cat > "${OUTPUT_DIR}/${filename}" << SCREEN_EOF
|
|
73
|
+
<!DOCTYPE html>
|
|
74
|
+
<html lang="en">
|
|
75
|
+
<head>
|
|
76
|
+
<meta charset="UTF-8">
|
|
77
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
78
|
+
<title>${FEATURE} v${VARIANT} — ${name}</title>
|
|
79
|
+
<style>
|
|
80
|
+
${ROOT_STYLES}
|
|
81
|
+
|
|
82
|
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
83
|
+
body {
|
|
84
|
+
font-family: system-ui, -apple-system, sans-serif;
|
|
85
|
+
background: var(--background);
|
|
86
|
+
color: var(--foreground);
|
|
87
|
+
min-height: 100vh;
|
|
88
|
+
padding: 1rem;
|
|
89
|
+
}
|
|
90
|
+
.nav-strip {
|
|
91
|
+
display: flex; gap: 0.5rem; padding: 0.75rem 1rem;
|
|
92
|
+
background: var(--muted); border-radius: 0.5rem;
|
|
93
|
+
margin-bottom: 1.5rem; flex-wrap: wrap; font-size: 0.875rem;
|
|
94
|
+
}
|
|
95
|
+
.nav-strip a { color: var(--primary); text-decoration: none; }
|
|
96
|
+
.nav-strip a:hover { text-decoration: underline; }
|
|
97
|
+
.nav-strip .current { font-weight: 700; color: var(--foreground); }
|
|
98
|
+
.screen-content {
|
|
99
|
+
border: 1px solid var(--border); border-radius: 0.75rem;
|
|
100
|
+
padding: 2rem; min-height: 60vh;
|
|
101
|
+
}
|
|
102
|
+
.screen-content h1 { font-size: 1.5rem; margin-bottom: 1rem; }
|
|
103
|
+
.screen-content .description { color: var(--muted-foreground); margin-bottom: 2rem; }
|
|
104
|
+
.banner {
|
|
105
|
+
background: var(--accent); color: var(--accent-foreground);
|
|
106
|
+
padding: 0.75rem 1rem; border-radius: 0.5rem; margin-bottom: 1.5rem;
|
|
107
|
+
font-size: 0.875rem;
|
|
108
|
+
}
|
|
109
|
+
</style>
|
|
110
|
+
</head>
|
|
111
|
+
<body>
|
|
112
|
+
<nav class="nav-strip">
|
|
113
|
+
<a href="index.html">Index</a>
|
|
114
|
+
SCREEN_EOF
|
|
115
|
+
|
|
116
|
+
# Add prev/next/related links placeholder
|
|
117
|
+
cat >> "${OUTPUT_DIR}/${filename}" << 'NAV_EOF'
|
|
118
|
+
<!-- Agent: replace with actual prev/next links based on screen order -->
|
|
119
|
+
<span class="current">CURRENT_SCREEN</span>
|
|
120
|
+
</nav>
|
|
121
|
+
|
|
122
|
+
<div class="banner">
|
|
123
|
+
Partial mockup — variant VARIANT_NUM of feature FEATURE_NAME. Extend with actual UI content.
|
|
124
|
+
</div>
|
|
125
|
+
|
|
126
|
+
<main class="screen-content" data-ac="AC-TODO">
|
|
127
|
+
<h1>SCREEN_TITLE</h1>
|
|
128
|
+
<p class="description">SCREEN_DESC</p>
|
|
129
|
+
|
|
130
|
+
<!-- Agent: implement the screen content here -->
|
|
131
|
+
<p style="color: var(--muted-foreground); font-style: italic;">
|
|
132
|
+
Screen content to be implemented by ux-engineer.
|
|
133
|
+
</p>
|
|
134
|
+
</main>
|
|
135
|
+
</body>
|
|
136
|
+
</html>
|
|
137
|
+
NAV_EOF
|
|
138
|
+
|
|
139
|
+
# Replace placeholders
|
|
140
|
+
sed -i '' "s/CURRENT_SCREEN/${name}/g" "${OUTPUT_DIR}/${filename}"
|
|
141
|
+
sed -i '' "s/VARIANT_NUM/${VARIANT}/g" "${OUTPUT_DIR}/${filename}"
|
|
142
|
+
sed -i '' "s/FEATURE_NAME/${FEATURE}/g" "${OUTPUT_DIR}/${filename}"
|
|
143
|
+
sed -i '' "s/SCREEN_TITLE/${name}/g" "${OUTPUT_DIR}/${filename}"
|
|
144
|
+
sed -i '' "s/SCREEN_DESC/${desc}/g" "${OUTPUT_DIR}/${filename}"
|
|
145
|
+
done
|
|
146
|
+
|
|
147
|
+
# Generate index.html
|
|
148
|
+
cat > "${OUTPUT_DIR}/index.html" << INDEX_EOF
|
|
149
|
+
<!DOCTYPE html>
|
|
150
|
+
<html lang="en">
|
|
151
|
+
<head>
|
|
152
|
+
<meta charset="UTF-8">
|
|
153
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
154
|
+
<title>${FEATURE} v${VARIANT} — Screen Index</title>
|
|
155
|
+
<style>
|
|
156
|
+
${ROOT_STYLES}
|
|
157
|
+
|
|
158
|
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
159
|
+
body {
|
|
160
|
+
font-family: system-ui, -apple-system, sans-serif;
|
|
161
|
+
background: var(--background);
|
|
162
|
+
color: var(--foreground);
|
|
163
|
+
min-height: 100vh;
|
|
164
|
+
padding: 2rem;
|
|
165
|
+
max-width: 800px; margin: 0 auto;
|
|
166
|
+
}
|
|
167
|
+
h1 { font-size: 2rem; margin-bottom: 0.5rem; }
|
|
168
|
+
.subtitle { color: var(--muted-foreground); margin-bottom: 2rem; }
|
|
169
|
+
.screen-list { list-style: none; }
|
|
170
|
+
.screen-list li {
|
|
171
|
+
border: 1px solid var(--border); border-radius: 0.5rem;
|
|
172
|
+
padding: 1rem; margin-bottom: 0.75rem;
|
|
173
|
+
}
|
|
174
|
+
.screen-list a { color: var(--primary); text-decoration: none; font-weight: 600; }
|
|
175
|
+
.screen-list a:hover { text-decoration: underline; }
|
|
176
|
+
.screen-list .desc { color: var(--muted-foreground); font-size: 0.875rem; margin-top: 0.25rem; }
|
|
177
|
+
.screen-map { margin-top: 2rem; padding: 1.5rem; border: 1px solid var(--border); border-radius: 0.75rem; }
|
|
178
|
+
.screen-map h2 { margin-bottom: 1rem; }
|
|
179
|
+
pre { background: var(--muted); padding: 1rem; border-radius: 0.5rem; overflow-x: auto; font-size: 0.8rem; }
|
|
180
|
+
</style>
|
|
181
|
+
</head>
|
|
182
|
+
<body>
|
|
183
|
+
<h1>${FEATURE} — Variant ${VARIANT}</h1>
|
|
184
|
+
<p class="subtitle">Lite mockup — open any screen below. All links are relative and work from file://.</p>
|
|
185
|
+
|
|
186
|
+
<ul class="screen-list">
|
|
187
|
+
INDEX_EOF
|
|
188
|
+
|
|
189
|
+
for entry in "${SCREENS[@]}"; do
|
|
190
|
+
name="${entry%%:*}"
|
|
191
|
+
desc="${entry#*:}"
|
|
192
|
+
cat >> "${OUTPUT_DIR}/index.html" << ITEM_EOF
|
|
193
|
+
<li>
|
|
194
|
+
<a href="screen-${name}.html">${name}</a>
|
|
195
|
+
<div class="desc">${desc}</div>
|
|
196
|
+
</li>
|
|
197
|
+
ITEM_EOF
|
|
198
|
+
done
|
|
199
|
+
|
|
200
|
+
cat >> "${OUTPUT_DIR}/index.html" << FOOTER_EOF
|
|
201
|
+
</ul>
|
|
202
|
+
|
|
203
|
+
<div class="screen-map">
|
|
204
|
+
<h2>Screen Map</h2>
|
|
205
|
+
<pre><code>
|
|
206
|
+
See screen-map.md for the Mermaid source.
|
|
207
|
+
Agent: embed a rendered diagram here or link to screen-map.md.
|
|
208
|
+
</code></pre>
|
|
209
|
+
</div>
|
|
210
|
+
</body>
|
|
211
|
+
</html>
|
|
212
|
+
FOOTER_EOF
|
|
213
|
+
|
|
214
|
+
# Generate screen-map.md placeholder
|
|
215
|
+
cat > "${OUTPUT_DIR}/screen-map.md" << MAP_EOF
|
|
216
|
+
# Screen Map — ${FEATURE} v${VARIANT}
|
|
217
|
+
|
|
218
|
+
\`\`\`mermaid
|
|
219
|
+
flowchart LR
|
|
220
|
+
happy[Happy Path] --> error-validation[Validation Error]
|
|
221
|
+
happy --> empty[Empty State]
|
|
222
|
+
happy --> loading[Loading]
|
|
223
|
+
error-validation --> happy
|
|
224
|
+
error-server[Server Error] --> happy
|
|
225
|
+
error-permission[Permission Denied] --> happy
|
|
226
|
+
empty --> happy
|
|
227
|
+
edge-overflow[Overflow] --> happy
|
|
228
|
+
edge-zero[Zero Items] --> happy
|
|
229
|
+
\`\`\`
|
|
230
|
+
|
|
231
|
+
> Agent: update this diagram to reflect the actual navigation flow derived from the PRD/spec.
|
|
232
|
+
MAP_EOF
|
|
233
|
+
|
|
234
|
+
echo "Done. Lite scaffold created at: ${OUTPUT_DIR}"
|
|
235
|
+
echo " index.html + $(echo "${SCREENS[@]}" | wc -w | tr -d ' ') screen files + screen-map.md"
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ux-theme-gen
|
|
3
|
+
description: "Generate platform-specific theme artifacts from DESIGN.md. Use when mockups or production code need consumable tokens derived from the canonical design contract."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# UX Theme Generation
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Transform the YAML front matter in `/DESIGN.md` into consumable theme artifacts that mockups and production code import directly. This eliminates hand-copied colour values and keeps every surface aligned with the declared contract.
|
|
11
|
+
|
|
12
|
+
## When to Use
|
|
13
|
+
|
|
14
|
+
- Before generating any mockup (Phase 0 of `ux-engineer`).
|
|
15
|
+
- When `developer` needs production theme files aligned with DESIGN.md.
|
|
16
|
+
- After filling or updating DESIGN.md tokens.
|
|
17
|
+
- When a stale theme artifact is detected (its tokens don't match DESIGN.md).
|
|
18
|
+
|
|
19
|
+
## Inputs
|
|
20
|
+
|
|
21
|
+
| Input | Required | Default |
|
|
22
|
+
| --------------------------------------- | -------- | ------------------ |
|
|
23
|
+
| `/DESIGN.md` | yes | — |
|
|
24
|
+
| `theme_output` path (from front matter) | no | `/mockups/.theme/` |
|
|
25
|
+
|
|
26
|
+
## Contract Check (Must Run First)
|
|
27
|
+
|
|
28
|
+
Before generating any artifact:
|
|
29
|
+
|
|
30
|
+
1. Read `/DESIGN.md` front matter.
|
|
31
|
+
2. If `status: placeholder` → **refuse** with: "DESIGN.md is an unfilled placeholder. Run ux-engineer to fill it first."
|
|
32
|
+
3. If any `"<unfilled>"` sentinel remains in the token groups (`colors`, `typography`, `rounded`, `spacing`) → **refuse** and list the unfilled fields.
|
|
33
|
+
4. Resolve `{colors.x}` / `{typography.y}` style references. If a reference points to an unfilled or missing key → **refuse** and report the broken reference.
|
|
34
|
+
5. Only proceed to generation if all checks pass.
|
|
35
|
+
|
|
36
|
+
## Outputs
|
|
37
|
+
|
|
38
|
+
Generated into `{theme_output}` (default `/mockups/.theme/`):
|
|
39
|
+
|
|
40
|
+
| File | Content | When |
|
|
41
|
+
| ------------- | ------------------------------------------------------------------ | ------------------------------------------------ |
|
|
42
|
+
| `theme.css` | `:root` token declarations + `@theme inline` block for Tailwind v4 | always |
|
|
43
|
+
| `tokens.json` | Raw JSON: all token groups as a flat or nested object | always |
|
|
44
|
+
| `rn-theme.ts` | TypeScript theme object for React Native | only when `platform` includes `mobile` or `both` |
|
|
45
|
+
|
|
46
|
+
### `theme.css` structure
|
|
47
|
+
|
|
48
|
+
```css
|
|
49
|
+
/* DO NOT EDIT — generated from /DESIGN.md by ux-theme-gen */
|
|
50
|
+
|
|
51
|
+
@theme inline {
|
|
52
|
+
--font-sans: "<fontFamily from typography.body-md>";
|
|
53
|
+
--color-background: var(--background);
|
|
54
|
+
--color-foreground: var(--foreground);
|
|
55
|
+
--color-primary: var(--primary);
|
|
56
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
57
|
+
/* ... one --color-* per semantic slot ... */
|
|
58
|
+
--radius-sm: <rounded.sm>;
|
|
59
|
+
--radius-md: <rounded.md>;
|
|
60
|
+
--radius-lg: <rounded.lg>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:root {
|
|
64
|
+
--background: <colors.background>;
|
|
65
|
+
--foreground: <colors.foreground>;
|
|
66
|
+
--primary: <colors.primary>;
|
|
67
|
+
--primary-foreground: <colors.primary-foreground>;
|
|
68
|
+
/* ... all semantic slots ... */
|
|
69
|
+
--radius: <rounded.md>;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.dark {
|
|
73
|
+
/* dark-mode overrides if declared in DESIGN.md */
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Colour handling
|
|
78
|
+
|
|
79
|
+
- Emit colour values **exactly as declared** in DESIGN.md (hex, rgb, hsl, oklch — whatever the consumer wrote).
|
|
80
|
+
- Do **not** convert between colour spaces. `@theme` accepts any valid CSS colour.
|
|
81
|
+
- If DESIGN.md uses hex and the consumer later wants OKLCH, that is a DESIGN.md authoring decision, not a generator decision.
|
|
82
|
+
|
|
83
|
+
### Slot mapping
|
|
84
|
+
|
|
85
|
+
The semantic slots below are the ones Tailwind v4 + shadcn components consume via `@theme inline`. `ux-theme-gen` maps from DESIGN.md token names to these slots:
|
|
86
|
+
|
|
87
|
+
| DESIGN.md token | CSS variable | @theme inline mapping |
|
|
88
|
+
| ------------------------------- | -------------------------- | --------------------------------------------------------------- |
|
|
89
|
+
| `colors.background` | `--background` | `--color-background: var(--background)` |
|
|
90
|
+
| `colors.foreground` | `--foreground` | `--color-foreground: var(--foreground)` |
|
|
91
|
+
| `colors.primary` | `--primary` | `--color-primary: var(--primary)` |
|
|
92
|
+
| `colors.primary-foreground` | `--primary-foreground` | `--color-primary-foreground: var(--primary-foreground)` |
|
|
93
|
+
| `colors.secondary` | `--secondary` | `--color-secondary: var(--secondary)` |
|
|
94
|
+
| `colors.secondary-foreground` | `--secondary-foreground` | `--color-secondary-foreground: var(--secondary-foreground)` |
|
|
95
|
+
| `colors.muted` | `--muted` | `--color-muted: var(--muted)` |
|
|
96
|
+
| `colors.muted-foreground` | `--muted-foreground` | `--color-muted-foreground: var(--muted-foreground)` |
|
|
97
|
+
| `colors.accent` | `--accent` | `--color-accent: var(--accent)` |
|
|
98
|
+
| `colors.accent-foreground` | `--accent-foreground` | `--color-accent-foreground: var(--accent-foreground)` |
|
|
99
|
+
| `colors.destructive` | `--destructive` | `--color-destructive: var(--destructive)` |
|
|
100
|
+
| `colors.destructive-foreground` | `--destructive-foreground` | `--color-destructive-foreground: var(--destructive-foreground)` |
|
|
101
|
+
| `colors.border` | `--border` | `--color-border: var(--border)` |
|
|
102
|
+
| `colors.input` | `--input` | `--color-input: var(--input)` |
|
|
103
|
+
| `colors.ring` | `--ring` | `--color-ring: var(--ring)` |
|
|
104
|
+
| `colors.card` | `--card` | `--color-card: var(--card)` |
|
|
105
|
+
| `colors.card-foreground` | `--card-foreground` | `--color-card-foreground: var(--card-foreground)` |
|
|
106
|
+
|
|
107
|
+
Tokens in `colors-extended` get their own `--<name>` variable in `:root` and a `--color-<name>` in `@theme inline`.
|
|
108
|
+
|
|
109
|
+
### `tokens.json` structure
|
|
110
|
+
|
|
111
|
+
```json
|
|
112
|
+
{
|
|
113
|
+
"colors": { "background": "#...", "foreground": "#...", ... },
|
|
114
|
+
"colors-extended": { ... },
|
|
115
|
+
"typography": { ... },
|
|
116
|
+
"rounded": { "sm": "6px", "md": "8px", "lg": "12px" },
|
|
117
|
+
"spacing": { "xs": "4px", ... }
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Generated file header
|
|
122
|
+
|
|
123
|
+
Every generated file **MUST** start with:
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
/* DO NOT EDIT — generated from /DESIGN.md by ux-theme-gen */
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
(or the equivalent comment syntax for `.ts` / `.json`).
|
|
130
|
+
|
|
131
|
+
## Rules
|
|
132
|
+
|
|
133
|
+
1. **Read-only on DESIGN.md** — never modify the contract.
|
|
134
|
+
2. **Refuse on placeholder** — never generate from unfilled tokens.
|
|
135
|
+
3. **No colour-space conversion** — emit values as declared.
|
|
136
|
+
4. **Idempotent** — running twice with the same DESIGN.md produces byte-identical output.
|
|
137
|
+
5. **Regenerable** — hand-edits to generated files are findings; the correct fix is to update DESIGN.md and regenerate.
|
|
138
|
+
6. **Independent of mockup workflow** — `developer` can invoke this skill directly for production theming.
|
|
139
|
+
|
|
140
|
+
## Acceptance Checklist
|
|
141
|
+
|
|
142
|
+
- Contract check runs before any file is written
|
|
143
|
+
- Refuses against a placeholder or partially-unfilled DESIGN.md
|
|
144
|
+
- Generated `theme.css` uses `@theme inline` (Tailwind v4 pattern)
|
|
145
|
+
- Generated `tokens.json` is valid JSON with all token groups
|
|
146
|
+
- `rn-theme.ts` is only produced when `platform` includes `mobile` or `both`
|
|
147
|
+
- No hardcoded palette values exist in output (all derived from DESIGN.md)
|
|
148
|
+
- Every generated file carries the DO-NOT-EDIT header
|
|
149
|
+
- Output directory matches `theme_output` from front matter or defaults to `/mockups/.theme/`
|