get-shit-pretty 0.7.3 → 0.8.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 (78) hide show
  1. package/bin/theme-css.js +331 -0
  2. package/gsp/agents/gsp-brand-coherence.md +7 -0
  3. package/gsp/hooks/hooks.json +1 -1
  4. package/gsp/skills/gsp-brand-brief/SKILL.md +50 -5
  5. package/gsp/skills/gsp-brand-guidelines/SKILL.md +51 -31
  6. package/gsp/skills/gsp-brand-guidelines/design-tokens.md +2 -0
  7. package/gsp/skills/gsp-brand-guidelines/guidelines-structure.md +167 -0
  8. package/gsp/skills/gsp-brand-guidelines/methodology/gsp-brand-coherence.md +86 -0
  9. package/gsp/skills/gsp-brand-guidelines/methodology/gsp-brand-engineer.md +13 -5
  10. package/gsp/skills/gsp-brand-guidelines/token-mapping.md +16 -319
  11. package/gsp/skills/gsp-brand-identity/SKILL.md +1 -1
  12. package/gsp/skills/gsp-brand-refine/SKILL.md +5 -6
  13. package/gsp/skills/gsp-brand-research/SKILL.md +1 -1
  14. package/gsp/skills/gsp-brand-strategy/SKILL.md +1 -1
  15. package/gsp/skills/gsp-design-system/SKILL.md +1 -1
  16. package/gsp/skills/gsp-doctor/SKILL.md +51 -3
  17. package/gsp/skills/gsp-progress/SKILL.md +1 -1
  18. package/gsp/skills/gsp-project-brief/SKILL.md +40 -6
  19. package/gsp/skills/gsp-project-build/SKILL.md +27 -31
  20. package/gsp/skills/gsp-project-build/flows/figma.md +50 -0
  21. package/gsp/skills/gsp-project-build/flows/revision.md +64 -0
  22. package/gsp/skills/gsp-project-build/methodology/gsp-project-builder.md +84 -1
  23. package/gsp/skills/gsp-project-build/shadcn-composition.md +217 -0
  24. package/gsp/skills/gsp-project-critique/SKILL.md +3 -1
  25. package/gsp/skills/gsp-project-design/SKILL.md +3 -2
  26. package/gsp/skills/gsp-project-design/methodology/gsp-project-designer.md +28 -21
  27. package/gsp/skills/gsp-project-research/SKILL.md +3 -1
  28. package/gsp/skills/gsp-project-review/SKILL.md +10 -1
  29. package/gsp/skills/gsp-scaffold/SKILL.md +67 -11
  30. package/gsp/skills/gsp-scaffold/shadcn-rules.md +433 -0
  31. package/gsp/skills/gsp-scaffold/shadcn-theming.md +310 -0
  32. package/gsp/skills/gsp-start/SKILL.md +18 -2
  33. package/gsp/skills/gsp-style/SKILL.md +1 -1
  34. package/gsp/skills/gsp-style/style-preset-schema.md +59 -14
  35. package/gsp/skills/gsp-style/styles/academia.yml +58 -8
  36. package/gsp/skills/gsp-style/styles/art-deco.yml +39 -7
  37. package/gsp/skills/gsp-style/styles/bauhaus.yml +39 -8
  38. package/gsp/skills/gsp-style/styles/bold-typography.yml +39 -8
  39. package/gsp/skills/gsp-style/styles/botanical.yml +39 -9
  40. package/gsp/skills/gsp-style/styles/claymorphism.yml +39 -9
  41. package/gsp/skills/gsp-style/styles/cyberpunk.yml +39 -7
  42. package/gsp/skills/gsp-style/styles/enterprise.yml +39 -10
  43. package/gsp/skills/gsp-style/styles/flat-design.yml +39 -9
  44. package/gsp/skills/gsp-style/styles/fluent.yml +39 -10
  45. package/gsp/skills/gsp-style/styles/glassmorphism.yml +39 -8
  46. package/gsp/skills/gsp-style/styles/humanist-literary.yml +39 -9
  47. package/gsp/skills/gsp-style/styles/industrial.yml +59 -9
  48. package/gsp/skills/gsp-style/styles/kinetic.yml +32 -7
  49. package/gsp/skills/gsp-style/styles/liquid-glass.yml +59 -9
  50. package/gsp/skills/gsp-style/styles/luxury.yml +59 -9
  51. package/gsp/skills/gsp-style/styles/material.yml +59 -9
  52. package/gsp/skills/gsp-style/styles/maximalism.yml +32 -6
  53. package/gsp/skills/gsp-style/styles/minimal-dark.yml +32 -7
  54. package/gsp/skills/gsp-style/styles/modern-dark.yml +32 -7
  55. package/gsp/skills/gsp-style/styles/monochrome.yml +59 -10
  56. package/gsp/skills/gsp-style/styles/neubrutalism.yml +59 -9
  57. package/gsp/skills/gsp-style/styles/neumorphism.yml +32 -7
  58. package/gsp/skills/gsp-style/styles/newsprint.yml +32 -7
  59. package/gsp/skills/gsp-style/styles/nothing.yml +44 -13
  60. package/gsp/skills/gsp-style/styles/organic.yml +42 -9
  61. package/gsp/skills/gsp-style/styles/playful-geometric.yml +43 -9
  62. package/gsp/skills/gsp-style/styles/professional.yml +41 -10
  63. package/gsp/skills/gsp-style/styles/retro.yml +42 -8
  64. package/gsp/skills/gsp-style/styles/saas.yml +42 -9
  65. package/gsp/skills/gsp-style/styles/sketch.yml +42 -9
  66. package/gsp/skills/gsp-style/styles/swiss-minimalist.yml +41 -10
  67. package/gsp/skills/gsp-style/styles/terminal.yml +42 -8
  68. package/gsp/skills/gsp-style/styles/vaporwave.yml +42 -7
  69. package/gsp/skills/gsp-style/styles/web3.yml +42 -9
  70. package/gsp/templates/branding/brief.md +9 -0
  71. package/gsp/templates/branding/config.json +1 -1
  72. package/gsp/templates/design-claude.md +6 -0
  73. package/gsp/templates/phases/design.md +0 -8
  74. package/gsp/templates/phases/patterns.md +2 -2
  75. package/gsp/templates/projects/config.json +6 -3
  76. package/gsp/templates/projects/state.md +1 -1
  77. package/gsp/templates/system/STACK.md +1 -0
  78. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: gsp-brand-refine
3
- description: Targeted brand adjustments mid-project — tweak colors, typography, or spacing without re-running the full branding diamond
3
+ description: Adjust brand mid-project — use when: tweak the colors, change the font, adjust spacing, the brand feels off, refine the brand
4
4
  user-invocable: true
5
5
  allowed-tools:
6
6
  - Read
@@ -82,14 +82,13 @@ Show a clear before/after for each affected token:
82
82
 
83
83
  ─── Proposed Changes ─────────────────
84
84
 
85
- color.brand.accent
85
+ color.accent
86
86
  before: #B8860B
87
87
  after: #E8A317
88
88
  change: increased chroma
89
89
 
90
90
  Cascade:
91
- color.semantic.link → #E8A317
92
- color.semantic.focus-ring → #E8A317
91
+ color.ring → #E8A317 (shares accent as focus ring)
93
92
 
94
93
  Contrast: accent on white 3.2:1 → 2.8:1 ⚠️ below AA
95
94
  accent on dark 8.4:1 → 9.2:1 ✓
@@ -133,8 +132,8 @@ Append to `{BRAND_PATH}/REFINE-LOG.md`:
133
132
 
134
133
  | Token | Before | After |
135
134
  |-------|--------|-------|
136
- | color.brand.accent | #B8860B | #E8A317 |
137
- | color.semantic.link | #B8860B | #E8A317 |
135
+ | color.accent | #B8860B | #E8A317 |
136
+ | color.ring | #B8860B | #E8A317 |
138
137
  ```
139
138
 
140
139
  Display summary:
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: gsp-brand-research
3
- description: Research your market and competitors
3
+ description: Research market and competitors — use when: research competitors, who else is doing this, market analysis, what do competitors look like
4
4
  user-invocable: true
5
5
  allowed-tools:
6
6
  - Read
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: gsp-brand-strategy
3
- description: Define positioning, voice, and messaging (creative phase — benefits from capable models)
3
+ description: Define positioning, voice, and messaging (creative phase — benefits from capable models) — use when: define our positioning, brand strategy, what's our voice, how do we talk to customers
4
4
  user-invocable: true
5
5
  allowed-tools:
6
6
  - Read
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: gsp-design-system
3
- description: Scan and document the existing design system state
3
+ description: Scan and document the existing design system — use when: scan the codebase, document what components exist, what's already built, inventory the design system
4
4
  user-invocable: true
5
5
  allowed-tools:
6
6
  - Read
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: gsp-doctor
3
- description: Check project health
3
+ description: Check project health — use when: something's broken, check the project, is everything set up right, health check, what's the status of my GSP setup
4
4
  user-invocable: true
5
5
  allowed-tools:
6
6
  - Read
@@ -87,6 +87,9 @@ Check each exists:
87
87
  - All present → PASS
88
88
  - Core files missing → FAIL: list which are missing, suggest `/gsp-start`
89
89
 
90
+ **Monorepo app_path check:**
91
+ - If `repo_type` is `monorepo` (in config.json) and `app_path` is empty → WARN: "Project has no `app_path` set. Run `/gsp-project-brief` to assign a target app."
92
+
90
93
  **Design system check:**
91
94
  - If `.design/system/` directory exists, verify at least `STACK.md` is present → PASS
92
95
  - If `.design/system/` is missing and codebase is not greenfield → WARN: "Design system scan missing. Run `/gsp-design-system` to scan."
@@ -261,7 +264,45 @@ Check if `~/.claude/skills/` contains `gsp-*` directories when running from a lo
261
264
  - No matches → PASS
262
265
  - Matches found → FAIL: "Found {N} stale GSP skills in ~/.claude/skills/. Fix: run `npx get-shit-pretty --claude --local` to reinstall (the installer cleans stale globals automatically), or manually remove: `rm -rf ~/.claude/skills/gsp-*`"
263
266
 
264
- ### Cross-Instance Checks
267
+ ### Stack Compliance Checks (shadcn targets)
268
+
269
+ Only run these checks when `.design/system/STACK.md` exists and at least one project has `implementation_target: shadcn`.
270
+
271
+ > **Monorepo note:** For monorepos, each project's S-checks run in its declared `app_path`. Read `config.json` → `preferences.app_path` before running commands. If `app_path` is empty, run in repo root.
272
+
273
+ **Check S1: Alias drift**
274
+
275
+ Read `config.json` → `preferences.app_path`. Set `APP_PATH` (default `.` if empty).
276
+
277
+ Run `cd {APP_PATH} && npx shadcn@latest info --json` and extract `aliases.components`. Compare to `## Key Paths → Components` in STACK.md.
278
+
279
+ If mismatch → FAIL: "shadcn alias drift — STACK.md declares `{declared}` but live config has `{live}`. Imports will break. Fix by updating `components.json` or `STACK.md`."
280
+
281
+ **Check S2: Tailwind version drift**
282
+
283
+ Run `cd {APP_PATH} && node -e "console.log(require('tailwindcss/package.json').version)"`. Compare major version to `## Tech Stack → Styling` in STACK.md.
284
+
285
+ If major version differs → FAIL: "Tailwind version drift — STACK.md declares `{declared}` but `{live}` is installed. Run `/gsp-scaffold` to realign or update STACK.md."
286
+
287
+ **Check S3: Icon library drift**
288
+
289
+ Read `components.json` → `iconLibrary`. Compare to icon library recorded in STACK.md (if present).
290
+
291
+ If mismatch → WARN: "Icon library drift — STACK.md declares `{declared}` but `components.json` says `{live}`. Agents may import from the wrong package."
292
+
293
+ **Check S4: Token presence in globals.css**
294
+
295
+ Find the global CSS file (from `cd {APP_PATH} && npx shadcn@latest info --json` → `tailwindCssFile`, or glob for `globals.css` inside `APP_PATH`). Check it contains `--background`, `--foreground`, `--primary` CSS custom properties.
296
+
297
+ If missing → WARN: "CSS custom properties not found in `{file}`. Token integration may be incomplete. Run `/gsp-project-build` foundations phase to regenerate."
298
+
299
+ **Check S5: Tailwind v4 source scoping (if Tailwind v4)**
300
+
301
+ If Tailwind v4 detected, check `globals.css` for `@import "tailwindcss"`. If present without `source(...)` modifier, and the repo contains non-source directories with Tailwind class names (like `.design/`) → WARN: "Tailwind v4 source not scoped. Add `source(\"../\")` to avoid scanning `.design/` spec files."
302
+
303
+ All S checks pass → single PASS line: "S1-S5. Stack compliance .......... PASS"
304
+
305
+
265
306
 
266
307
  **Check X1: Multiple projects, same brand**
267
308
  If multiple projects reference the same brand, and brand has changed since any project consumed it → WARN with list of affected projects.
@@ -314,7 +355,14 @@ Overall Health: {SCORE}/100 {emoji}
314
355
  ✅ I4. VERSION file ............ PASS
315
356
  ✅ I5. No duplicate skills ..... PASS
316
357
 
317
- ─── Cross-Instance ────────────────────
358
+ ─── Stack Compliance (shadcn) ────────
359
+ ✅ S1. Alias ....................... PASS
360
+ ✅ S2. Tailwind version ........... PASS
361
+ ✅ S3. Icon library ............... PASS
362
+ ✅ S4. CSS custom properties ....... PASS
363
+ ✅ S5. Source scoping .............. PASS
364
+
365
+ ─── Cross-Instance ────────────────────
318
366
  ✅ X1. Brand Consistency ...... PASS
319
367
 
320
368
  ─── Issues Found ──────────────────────
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: gsp-progress
3
- description: How pretty are we?
3
+ description: Show pipeline progress dashboard — use when: where are we, what's done, show progress, how far along, what phase are we on
4
4
  user-invocable: true
5
5
  allowed-tools:
6
6
  - Read
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: gsp-project-brief
3
- description: Scope what you're building
3
+ description: Scope a feature or flow — use when: scope this, define what we're building, plan the project, what should we build, write a brief
4
4
  user-invocable: true
5
5
  allowed-tools:
6
6
  - Read
@@ -31,6 +31,8 @@ Scope the project and plan adaptations from the brand system.
31
31
  <process>
32
32
  ## Step 0: Resolve project and brand
33
33
 
34
+ If `.design/projects/` does not exist: output "No GSP project found. Run `/gsp-start` to begin." and stop.
35
+
34
36
  Resolve project from `.design/projects/` (one → use it, multiple → ask). Set `PROJECT_PATH`.
35
37
 
36
38
  Read `{PROJECT_PATH}/brand.ref` → set `BRAND_PATH`. If brand.ref doesn't exist, tell the user to run `/gsp-start`.
@@ -49,16 +51,41 @@ Also read the brand `.yml` preset from `{BRAND_PATH}/patterns/`.
49
51
 
50
52
  Read:
51
53
  - `{PROJECT_PATH}/BRIEF.md` — what we're building, platforms, tech stack
52
- - `{PROJECT_PATH}/config.json` — get `implementation_target`, `design_scope`, `codebase_type`
54
+ - `{PROJECT_PATH}/config.json` — get `implementation_target`, `design_scope`, `codebase_type`, `app_path`, `repo_type`
55
+
56
+ After reading config, check if `app_path` is empty. If empty AND (`repo_type` is `monorepo` OR multiple `package.json` files are found at `apps/*/package.json` or `packages/*/package.json`), set flag `NEEDS_APP_SELECTION = true`.
53
57
 
54
58
  ### Codebase context
55
59
 
56
60
  Read `.design/system/STACK.md` and `.design/system/COMPONENTS.md` (if exist) — existing tech stack, components, architecture.
57
61
 
62
+ **Stack inheritance (existing codebases):** If `STACK.md` exists and the project `config.json` has empty or generic values for `tech_stack`, `implementation_target`, or `codebase_type`, inherit them from `STACK.md` directly — do not ask the user questions the stack already answers. Update `config.json` with the inherited values before proceeding.
63
+
64
+ The global stack is the compliance baseline. Every project in this workspace must target it. If the user's brief describes a different stack than what `STACK.md` declares (e.g., "I want to use Radix directly" when `STACK.md` says `shadcn/ui`), surface the conflict: "⚠️ Your brief mentions {X}, but the workspace stack is {Y} per STACK.md. Proceed with the workspace stack, or update STACK.md first?"
65
+
58
66
  Read `.design/CHANGELOG.md` — quick history of what prior projects built.
59
67
  For projects with overlapping scope, read their `codebase/MANIFEST.md` for detail.
60
68
  Glob `.design/projects/*/STATE.md` — detect active sibling projects.
61
69
 
70
+ ## Step 1.3: App targeting
71
+
72
+ Run when `NEEDS_APP_SELECTION = true`.
73
+
74
+ 1. Glob for `apps/*/package.json` and `packages/*/package.json` to find all app packages.
75
+ 2. Read each package.json to extract `name` and the primary framework dependency (Next.js, Vite, React Native, etc.).
76
+ 3. Build an app list, e.g.:
77
+ ```
78
+ apps/web → my-app-web (Next.js)
79
+ apps/mobile → my-app-mobile (Expo / React Native)
80
+ packages/ui → my-app-ui (Vite)
81
+ ```
82
+ 4. Use `AskUserQuestion`: "Which app does this project target?" with one option per detected app (showing path + framework) plus **Whole repo (no specific app)**.
83
+ 5. Based on the user's choice:
84
+ - If an app was selected: set `app_path` to the chosen path (e.g. `apps/web`) and `repo_type` to `monorepo`
85
+ - If "Whole repo" was selected: set `app_path` to `""` and `repo_type` to `monorepo`
86
+ 6. Write the updated `app_path` and `repo_type` back to `{PROJECT_PATH}/config.json`.
87
+ 7. Derive `APP_NAME` = last segment of `app_path` (e.g. `apps/web` → `web`, empty → `root`). Note that the per-app stack file will live at `.design/system/stacks/{APP_NAME}.md`.
88
+
62
89
  ## Step 1.5: Scope check
63
90
 
64
91
  **If `design_scope` is `tokens`:**
@@ -69,10 +96,10 @@ Glob `.design/projects/*/STATE.md` — detect active sibling projects.
69
96
 
70
97
  ## Step 1.7: Issue framing
71
98
 
72
- Suggest to the user:
73
- "Consider framing this project as a bounded issue (or set of issues) and a PR. Smaller scope = higher quality. What's the tightest version of this that ships?"
74
-
75
- If the project scope feels large, suggest breaking it into multiple bounded issues — each one a focused deliverable that can be reviewed independently.
99
+ Ask the user (via `AskUserQuestion`): "Is this project linked to a GitHub issue?"
100
+ - **Yes paste the issue URL** → read the issue number from the URL, write `git.issue` to `{PROJECT_PATH}/config.json` and populate the `| Issue |` row in STATE.md. Also read the issue title/body via `gh issue view {number} --json title,body,labels` and use that content to pre-populate scope context (saves the user from re-describing what the issue already states).
101
+ - **No — describe it** → continue with manual brief as before
102
+ - **Skip** continue without issue link
76
103
 
77
104
  ## Step 2: Scope the project
78
105
 
@@ -157,6 +184,13 @@ Update `{PROJECT_PATH}/STATE.md`:
157
184
  - Set Phase 1 (Brief) status to `complete`
158
185
  - Record completion date
159
186
 
187
+ Write/update `.design/CLAUDE.md` — register the project as started. If the file doesn't exist, read the template from `${CLAUDE_SKILL_DIR}/../../templates/design-claude.md` first. Append under `## Projects`:
188
+
189
+ ```markdown
190
+ ### {project-name} · in progress · {DATE}
191
+ brand: {brand-name} · next: gsp-project-research · .design/projects/{project-name}/
192
+ ```
193
+
160
194
  ## Step 5: Phase transition output
161
195
 
162
196
  Invoke `/gsp-phase-transition` with phase `brief` and output directory `{PROJECT_PATH}/brief/`.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: gsp-project-build
3
- description: Translate designs to code (technical phase — benefits from capable models)
3
+ description: Translate designs to code (technical phase — benefits from capable models) — use when: build this, implement, code this up, build me a X, add a X to the app, make the X page
4
4
  user-invocable: true
5
5
  allowed-tools:
6
6
  - Read
@@ -70,6 +70,8 @@ Implement designs as production-ready code in the codebase via phased pipeline w
70
70
  <process>
71
71
  ## Step 0: Resolve project and brand
72
72
 
73
+ If `.design/projects/` does not exist: output "No GSP project found. Run `/gsp-start` to begin." and stop.
74
+
73
75
  Resolve project from `.design/projects/` (one → use it, multiple → ask). Set `PROJECT_PATH`.
74
76
 
75
77
  Read `{PROJECT_PATH}/brand.ref` → set `BRAND_PATH`.
@@ -83,7 +85,9 @@ Exception: if `design_scope` is `tokens` in config.json, skip this check (tokens
83
85
 
84
86
  ## Step 1: Load config and check state
85
87
 
86
- Read `{PROJECT_PATH}/config.json` to get `implementation_target`, `design_scope`, `codebase_type`.
88
+ Read `{PROJECT_PATH}/config.json` to get `implementation_target`, `design_scope`, `codebase_type`, `app_path`.
89
+
90
+ Set `APP_PATH` = value of `app_path`. If empty, default to `.` (repo root).
87
91
 
88
92
  ### Branch check
89
93
 
@@ -132,6 +136,7 @@ Read `${CLAUDE_SKILL_DIR}/methodology/gsp-project-builder.md`. Include the full
132
136
  Read these reference files:
133
137
  - `${CLAUDE_SKILL_DIR}/visual-effects.md`
134
138
  - `${CLAUDE_SKILL_DIR}/../gsp-project-design/block-patterns.md`
139
+ - `${CLAUDE_SKILL_DIR}/shadcn-composition.md`
135
140
 
136
141
  Hold their content for inlining into agent prompts in Steps 3, 4.5, 5, 7, and 8.
137
142
 
@@ -145,14 +150,16 @@ Spawn `gsp-project-builder` agent with **execution_mode: foundations**.
145
150
 
146
151
  | File | Purpose |
147
152
  |------|---------|
148
- | `{BRAND_PATH}/patterns/{brand-name}.yml` | Token values only — used with `gsp-brand-guidelines/token-mapping.md` to generate CSS variables. Do NOT re-read patterns/constraints/effects from here — those are in STYLE.md. |
153
+ | `{BRAND_PATH}/patterns/{brand-name}.yml` | Token values only — used with token-mapping.md to generate CSS variables. Do NOT re-read patterns/constraints/effects from here — those are in STYLE.md. |
149
154
  | `{BRAND_PATH}/patterns/STYLE.md` | Design law — philosophy, patterns, constraints, effects, bold bets, implementation hints (if exists; fall back to `{brand-name}.md`) |
150
155
  | `{PROJECT_PATH}/brief/target-adaptations.md` | Component adaptations for target |
151
- | `.design/system/STACK.md` | Stack state |
156
+ | `.design/system/STACK.md` | Stack state (or `.design/system/stacks/{APP_NAME}.md` for monorepos) |
152
157
  | `.design/system/CONVENTIONS.md` | Codebase conventions (if exists) |
153
158
  | `.design/system/COMPONENTS.md` | Existing components (if exists) |
154
- | `{PROJECT_PATH}/config.json` | Tech stack, target |
159
+ | `{PROJECT_PATH}/config.json` | Tech stack, target, `app_path` |
160
+ | `APP_PATH = {APP_PATH}` | Working directory — all file writes and build commands run here |
155
161
  | Build output template (from execution_context) | Build log structure |
162
+ | Token mapping ref (loaded in Step 2.6) | shadcn component composition rules, semantic token usage, `cn()`, `cva`, RSC patterns |
156
163
  | Visual effects, block patterns refs (loaded in Step 2.6) | Design patterns + CSS recipes |
157
164
  | Agent methodology (loaded in Step 2.5) | Builder role, process, quality standards |
158
165
 
@@ -162,27 +169,28 @@ Spawn `gsp-project-builder` agent with **execution_mode: foundations**.
162
169
  >
163
170
  > Build token integration, global styles, and layout primitives ONLY.
164
171
  >
165
- > 1. Integrate design tokens into the codebase (CSS variables, Tailwind config, or theme file)
172
+ > 1. Integrate design tokens into the codebase: run `node bin/theme-css.js {brand-name}.yml --stdout` and paste the OKLCH `:root`/`.dark` output into `globals.css`. For shadcn targets, follow the `@theme inline` pattern from `shadcn-rules.md`. Map ALL variables — background, foreground, card, popover, primary, secondary, muted, accent, destructive, border, input, ring, sidebar-*, chart-1 through chart-5, and --radius.
166
173
  > 2. Create global CSS (resets, base styles, font imports, dark mode setup)
167
174
  > 3. Create root layout with nav shell and footer shell (structure only — no page content)
168
175
  > 4. Create shared utilities (cn helper, theme provider if needed)
169
176
  > 5. Apply the STYLE.md bold bets and effects vocabulary — create CSS utilities or Tailwind extensions for the brand's signature effects. Validate against constraints (never/always rules are non-negotiable).
170
- > 6. Do NOT build individual screens or page content
171
- > 7. Write code directly to the codebase, not to `.design/`
172
- > 8. Leave changes unstaged
177
+ > 6. For shadcn targets: use semantic color tokens (`bg-primary`, `text-muted-foreground`) — never raw color values like `bg-blue-500`. Use `gap-*` not `space-y-*`. Use `size-*` when width and height are equal.
178
+ > 7. Do NOT build individual screens or page content
179
+ > 8. Write code directly to the codebase, not to `.design/`
180
+ > 9. Leave changes unstaged
173
181
  >
174
182
  > After completing foundations, write `{PROJECT_PATH}/build/logs/foundations.md` with what was done (foundations section). Do NOT write to BUILD-LOG.md directly — the orchestrator merges logs after each phase.
175
183
 
176
184
  ### Checkpoint: Compile check
177
185
 
178
- After the foundations agent completes, run the build command:
186
+ After the foundations agent completes, run the build command in `APP_PATH`:
179
187
 
180
188
  | Stack | Build command |
181
189
  |-------|--------------|
182
- | Next.js | `npx next build` |
183
- | Vite | `npx vite build` |
184
- | TypeScript only | `npx tsc --noEmit` |
185
- | Generic | `npm run build` |
190
+ | Next.js | `cd {APP_PATH} && npx next build` |
191
+ | Vite | `cd {APP_PATH} && npx vite build` |
192
+ | TypeScript only | `cd {APP_PATH} && npx tsc --noEmit` |
193
+ | Generic | `cd {APP_PATH} && npm run build` |
186
194
 
187
195
  **Pass:** Continue to preview verification, then Step 4.
188
196
  **Fail:** Log the error. Do NOT re-spawn the agent. Surface the error to the user and ask how to proceed.
@@ -494,25 +502,13 @@ Invoke `/gsp-phase-transition` with phase `build` and output directory `{PROJECT
494
502
 
495
503
  ## Step 7: Figma fallback
496
504
 
497
- For `implementation_target: figma`, skip the phased pipeline. Spawn a single `gsp-project-builder` agent with execution_mode: `full` and spec-only flag. Builder writes `build/CODE.md` + `build/components/` instead of editing codebase. Then continue from Step 6 (finalize).
505
+ Read `${CLAUDE_SKILL_DIR}/flows/figma.md` for full instructions.
498
506
 
499
- ## Step 8: Revision mode
500
-
501
- For `needs-revision` status, spawn a single `gsp-project-builder` agent with execution_mode: `full` and `review/issues.md` contents. The agent fixes QA issues in the codebase and appends revision sections to BUILD-LOG.md.
507
+ For `implementation_target: figma`, skip the phased pipeline. Produce Figma-ready implementation specs instead of editing the codebase. Then continue from Step 6 (finalize).
502
508
 
503
- ### Checkpoint: Compile check
504
-
505
- After the revision agent completes, run the build command (same stack table as Step 3 checkpoint).
506
-
507
- **Pass:** Continue to brand feedback check below.
508
- **Fail:** Log the error. Surface to user: "Revision introduced build errors: {error}. Fix before finalizing?"
509
-
510
- ### Brand feedback on revisions
511
-
512
- After the revision agent completes, check if any QA fixes changed token-level values (colors, typography, spacing, shadows). If so:
509
+ ## Step 8: Revision mode
513
510
 
514
- 1. Ask: "These revisions changed brand-level values. Update brand patterns so future projects inherit the fix?"
515
- 2. If yes, spawn a background `gsp-brand-engineer` agent with the changed values to update `{BRAND_PATH}/patterns/`.
511
+ Read `${CLAUDE_SKILL_DIR}/flows/revision.md` for full instructions.
516
512
 
517
- Then continue from Step 6 (finalize).
513
+ For `needs-revision` status, fix QA issues from `review/issues.md` via a single revision agent. Then continue from Step 6 (finalize).
518
514
  </process>
@@ -0,0 +1,50 @@
1
+ # Build Flow: Figma Fallback
2
+
3
+ Activated when `implementation_target` is `figma` in `config.json`.
4
+
5
+ ## When this runs
6
+
7
+ When the project's target is Figma (designer handoff), there is no codebase to edit. Instead, the builder produces structured implementation specs that a developer can use to implement in Figma or hand off to their dev team.
8
+
9
+ ## Steps
10
+
11
+ ### 1. Log intent
12
+
13
+ Log: "Figma target — producing implementation specs (no codebase to edit)"
14
+
15
+ ### 2. Spawn spec agent
16
+
17
+ Spawn a single `gsp-project-builder` agent with:
18
+ - `execution_mode: full`
19
+ - `spec_only: true`
20
+ - All design chunks from `{PROJECT_PATH}/design/` inlined
21
+ - Brand system: `{BRAND_PATH}/patterns/STYLE.md` and `{BRAND_PATH}/patterns/{brand-name}.yml`
22
+ - Brief: `{PROJECT_PATH}/brief/target-adaptations.md` and `{PROJECT_PATH}/brief/scope.md`
23
+ - Agent methodology (loaded in Step 2.5 of main flow)
24
+
25
+ Agent instructions:
26
+
27
+ > execution_mode: full
28
+ > spec_only: true
29
+ >
30
+ > Produce Figma-ready implementation specs — no codebase to edit.
31
+ >
32
+ > Output:
33
+ > 1. `{PROJECT_PATH}/build/CODE.md` — component-by-component implementation guide:
34
+ > - For each screen: component tree, token values, interaction states, responsive behavior
35
+ > - For each component: props, variants, accessibility requirements
36
+ > - Token table: all CSS variables with values from the brand `.yml`
37
+ >
38
+ > 2. `{PROJECT_PATH}/build/components/` — one `.md` file per significant custom component:
39
+ > - Structure (HTML/JSX pseudocode)
40
+ > - Variants and states
41
+ > - Token usage (which CSS variables drive which properties)
42
+ > - Accessibility notes (ARIA roles, keyboard, focus)
43
+ >
44
+ > Format specs for developer consumption — be precise about measurements, colors (include both OKLCH and hex), and interaction behavior.
45
+
46
+ ### 3. Finalize
47
+
48
+ After the spec agent completes, continue from Step 6 (Finalize) of the main build flow.
49
+
50
+ `BUILD-LOG.md` in this mode documents spec files produced rather than codebase changes.
@@ -0,0 +1,64 @@
1
+ # Build Flow: Revision Mode
2
+
3
+ Activated when `{PROJECT_PATH}/STATE.md` shows build status `needs-revision`.
4
+
5
+ ## When this runs
6
+
7
+ After `/gsp-project-review` completes and writes `{PROJECT_PATH}/review/issues.md` with QA issues, the next invocation of `/gsp-project-build` enters revision mode automatically.
8
+
9
+ ## Steps
10
+
11
+ ### 1. Read issues
12
+
13
+ Read `{PROJECT_PATH}/review/issues.md`. This file contains QA issues prioritized by severity.
14
+
15
+ Log: "Revision mode — addressing QA issues from review/issues.md"
16
+
17
+ ### 2. Spawn revision agent
18
+
19
+ Spawn a single `gsp-project-builder` agent with:
20
+ - `execution_mode: full`
21
+ - `revision: true`
22
+ - Full content of `review/issues.md` inlined
23
+ - Agent methodology (loaded in Step 2.5 of main flow)
24
+ - Visual effects and block patterns refs (loaded in Step 2.6 of main flow)
25
+
26
+ Agent instructions:
27
+
28
+ > execution_mode: full
29
+ > revision: true
30
+ >
31
+ > Fix the QA issues from review/issues.md in the codebase.
32
+ >
33
+ > 1. Work through issues in priority order (critical → high → medium → low)
34
+ > 2. Read the relevant codebase files before editing — don't guess at existing structure
35
+ > 3. Do NOT modify foundation files unless the QA issue explicitly requires it
36
+ > 4. Do NOT refactor or improve code outside the scope of the listed issues
37
+ > 5. Leave changes unstaged
38
+ >
39
+ > After completing revisions, append a `## Revision` section to `{PROJECT_PATH}/build/BUILD-LOG.md` listing each issue addressed (issue ID, file changed, what was fixed).
40
+
41
+ ### 3. Compile check
42
+
43
+ After the revision agent completes, run the build command:
44
+
45
+ | Stack | Build command |
46
+ |-------|--------------|
47
+ | Next.js | `npx next build` |
48
+ | Vite | `npx vite build` |
49
+ | TypeScript only | `npx tsc --noEmit` |
50
+ | Generic | `npm run build` |
51
+
52
+ **Pass:** Continue to brand feedback check.
53
+ **Fail:** Log the error. Surface to user: "Revision introduced build errors: {error}. Fix before finalizing?"
54
+
55
+ ### 4. Brand feedback on revisions
56
+
57
+ After the revision agent completes, check if any QA fixes changed token-level values (colors, typography, spacing, shadows). If so:
58
+
59
+ 1. Ask: "These revisions changed brand-level values. Update brand patterns so future projects inherit the fix?"
60
+ 2. If yes, spawn a background `gsp-brand-engineer` agent with the changed values to update `{BRAND_PATH}/patterns/`.
61
+
62
+ ### 5. Finalize
63
+
64
+ Continue from Step 6 (Finalize) of the main build flow.
@@ -17,7 +17,7 @@ You are spawned with an `execution_mode` parameter. Follow the mode strictly:
17
17
 
18
18
  ### `foundations`
19
19
  Build token integration, global styles, and layout primitives ONLY. Stop after foundations.
20
- - Design tokens → CSS variables / Tailwind config. Write only **global tokens**: brand colors, font families, spacing scale, base radius, base shadows. Do NOT write screen-specific tokens yet.
20
+ - Design tokens → CSS variables / Tailwind config. Run `node bin/theme-css.js <preset.yml> --stdout` to generate a ready-to-paste `:root` and `.dark` block in OKLCH format. If `bin/theme-css.js` is unavailable, convert hex to OKLCH manually. Write ALL variables in `:root` and `.dark` scopes (background, foreground, card, popover, primary, secondary, muted, accent, destructive, border, input, ring, sidebar-*, chart-1 through chart-5, --radius). Write only **global tokens**: brand colors, font families, spacing scale, base radius, base shadows. Do NOT write screen-specific tokens yet.
21
21
  - Global CSS (resets, base styles, dark mode)
22
22
  - Layout components (root layout, nav shell, footer shell)
23
23
  - Shared utilities (cn helper, theme provider)
@@ -106,8 +106,91 @@ Check code against these before marking a screen complete — **but STYLE.md tak
106
106
  - **Components:** customize shadcn radii/colors/shadows, skeleton loaders not spinners, semantic HTML
107
107
  - **Code:** no inline styles mixed with utilities, relative units, clean z-index scale, alt text, verify imports exist
108
108
 
109
+ ## shadcn/ui Rules (when target is shadcn)
110
+
111
+ These rules are always enforced for shadcn targets. They reflect the official shadcn/ui composition patterns:
112
+
113
+ **Styling:**
114
+ - Use semantic color tokens (`bg-primary`, `text-muted-foreground`) — never raw values like `bg-blue-500`
115
+ - No manual `dark:` color overrides — use semantic tokens that auto-adapt
116
+ - Use `gap-*` with flex/grid — never `space-x-*` or `space-y-*`
117
+ - Use `size-*` when width and height are equal — `size-10` not `w-10 h-10`
118
+ - Use `cn()` for conditional classes — never manual template literal ternaries
119
+ - No manual `z-index` on overlay components (Dialog, Sheet, Popover handle their own stacking)
120
+ - Use built-in variants before custom styles (`variant="outline"`, `size="sm"`)
121
+
122
+ **Composition:**
123
+ - Items always inside their Group (`SelectItem` → `SelectGroup`, `DropdownMenuItem` → `DropdownMenuGroup`)
124
+ - Dialog, Sheet, and Drawer always need a Title (use `className="sr-only"` if visually hidden)
125
+ - Use full Card composition (`CardHeader`/`CardTitle`/`CardDescription`/`CardContent`/`CardFooter`)
126
+ - `TabsTrigger` must be inside `TabsList`
127
+ - `Avatar` always needs `AvatarFallback`
128
+ - Use `Alert` for callouts, `Badge` for status, `Skeleton` for loading, `Separator` for dividers, `Empty` for empty states, `sonner` for toast
129
+ - `Button` has no `isPending`/`isLoading` prop — compose with `<Spinner data-icon="inline-start" />` + `disabled`
130
+
131
+ **Forms:**
132
+ - Use `FieldGroup` + `Field` for form layout — never raw `div` with `space-y-*` or `grid gap-*`
133
+ - Option sets (2–7 choices) use `ToggleGroup` + `ToggleGroupItem` — not a loop of `Button` with manual active state
134
+ - Buttons inside inputs use `InputGroup` + `InputGroupAddon` — not `relative` positioning with `absolute` button
135
+ - Use `InputGroupInput` / `InputGroupTextarea` inside `InputGroup` — not raw `Input`/`Textarea`
136
+ - Group related checkboxes/radios with `FieldSet` + `FieldLegend` — not `div` with a heading
137
+ - Field validation: `data-invalid` on `Field`, `aria-invalid` on the control; `data-disabled` on `Field`, `disabled` on the control
138
+
139
+ **base vs radix API (check `base` from `npx shadcn@latest info`):**
140
+ - Custom triggers: `asChild` (radix) vs `render` prop (base)
141
+ - Button as link: `<Button asChild><a>` (radix) vs `<Button render={<a />} nativeButton={false}>` (base)
142
+ - `ToggleGroup`: radix uses `type="single"/"multiple"` + string `defaultValue`; base uses no `type` + array `defaultValue`
143
+ - `Slider`: radix always uses array (`defaultValue={[50]}`); base uses plain number for single thumb
144
+ - `Select`: base requires `items` prop on root; radix uses inline JSX only
145
+
146
+ **Icons:**
147
+ - Icons in `Button` use `data-icon` attribute (`data-icon="inline-start"` or `data-icon="inline-end"`) — do NOT add `mr-2`/`ml-2` margin; the component handles spacing via CSS
148
+ - No sizing classes on icons inside components — components handle icon sizing via CSS
149
+
150
+ **CLI awareness:**
151
+ - Install components via `npx shadcn@latest add {name}` — never copy/paste from GitHub
152
+ - Use `npx shadcn@latest search {name}` to find components before building custom ones
153
+ - Use `npx shadcn@latest docs {name}` to get live docs and example URLs before implementing or debugging a component
154
+ - Use `npx shadcn@latest add {name} --dry-run` to preview all affected files before writing
155
+ - Use `npx shadcn@latest add {name} --diff {file}` to preview a specific file's changes before overwriting
156
+ - After installing components from registries, verify imports match the project's alias config
157
+ - After installing from community registries, check added non-UI files for hardcoded `@/components/ui/...` paths — rewrite to match the project's actual aliases
158
+
159
+ **Charts (Recharts v3):**
160
+ - Color references: `fill="var(--chart-1)"` or `fill="var(--color-chart-1)"` — **no `hsl()` wrapper** (tokens are OKLCH, not HSL channels)
161
+ - `<ChartContainer>` **requires** an explicit height — add `className="min-h-[200px]"` or `aspect-video`; no implicit height is set
162
+ - Add `accessibilityLayer` prop to chart root elements (`<BarChart accessibilityLayer>`)
163
+ - The `layout` prop belongs on the parent chart (`<BarChart layout="vertical">`), not on `<Bar>`
164
+
165
+ **Forms (React Hook Form + Field API):**
166
+ - New projects use the `<Field>/<Controller>` API — not `<FormField>/<FormItem>/<FormControl>/<FormMessage>`:
167
+ ```jsx
168
+ <Controller
169
+ name="email"
170
+ control={form.control}
171
+ render={({ field, fieldState }) => (
172
+ <Field data-invalid={fieldState.invalid}>
173
+ <FieldLabel htmlFor={field.name}>Email</FieldLabel>
174
+ <Input {...field} id={field.name} aria-invalid={fieldState.invalid} />
175
+ {fieldState.invalid && <FieldError errors={[fieldState.error]} />}
176
+ </Field>
177
+ )}
178
+ />
179
+ ```
180
+ - Components: `Field`, `FieldLabel`, `FieldDescription`, `FieldError`, `FieldGroup`, `FieldSet`, `FieldLegend`
181
+ - If the existing project has the old `form.tsx` (with `FormField`/`FormItem`), match its pattern — do not mix APIs
182
+
183
+ **Sidebar:**
184
+ - Set custom sidebar width via inline CSS prop on `<SidebarProvider>`:
185
+ ```jsx
186
+ <SidebarProvider style={{ "--sidebar-width": "20rem" } as React.CSSProperties}>
187
+ ```
188
+ - Do not override `--sidebar-width` in `globals.css` — it belongs on the provider instance
189
+
109
190
  Full reference: `references/anti-patterns.md` (available via Read for the complete list with fixes).
110
191
 
192
+ **Theming reference:** when building or fixing themes, read `${CLAUDE_SKILL_DIR}/../../gsp-scaffold/shadcn-theming.md` — full token table, dark mode setup, common theming bugs and fixes.
193
+
111
194
  ## Visual Quality Checklist
112
195
 
113
196
  Every screen must pass these before marking complete. When `STYLE.md` is provided, it overrides these defaults.