get-shit-pretty 0.8.3 → 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.
Files changed (39) hide show
  1. package/gsp/skills/gsp-accessibility/SKILL.md +50 -0
  2. package/gsp/skills/gsp-accessibility/motion-effects.md +43 -0
  3. package/gsp/skills/gsp-brand-apply/SKILL.md +213 -0
  4. package/gsp/skills/gsp-brand-apply/bin/serve-preset.js +71 -0
  5. package/gsp/skills/gsp-brand-guidelines/SKILL.md +64 -4
  6. package/{bin → gsp/skills/gsp-brand-guidelines/bin}/theme-css.js +124 -10
  7. package/gsp/skills/gsp-brand-guidelines/methodology/gsp-brand-engineer.md +1 -1
  8. package/gsp/skills/gsp-brand-guidelines/token-mapping.md +2 -2
  9. package/gsp/skills/gsp-brand-identity/SKILL.md +5 -4
  10. package/gsp/skills/gsp-brand-refine/SKILL.md +33 -3
  11. package/gsp/skills/gsp-brand-research/SKILL.md +1 -1
  12. package/gsp/skills/gsp-brand-research/methodology/gsp-brand-researcher.md +9 -0
  13. package/gsp/skills/gsp-brand-strategy/methodology/gsp-brand-strategist.md +3 -3
  14. package/gsp/skills/gsp-brand-sync/SKILL.md +0 -1
  15. package/gsp/skills/gsp-project-brief/SKILL.md +6 -1
  16. package/gsp/skills/gsp-project-build/SKILL.md +44 -108
  17. package/gsp/skills/gsp-project-build/agent-rules.md +36 -0
  18. package/gsp/skills/gsp-project-build/brand-feedback.md +12 -0
  19. package/gsp/skills/gsp-project-build/component-classification.md +36 -0
  20. package/gsp/skills/gsp-project-build/extraction-review.md +31 -0
  21. package/gsp/skills/gsp-project-build/methodology/gsp-project-builder.md +17 -10
  22. package/gsp/skills/gsp-project-build/visual-effects.md +1 -16
  23. package/gsp/skills/gsp-project-critique/SKILL.md +5 -1
  24. package/gsp/skills/gsp-project-critique/methodology/gsp-project-critic.md +46 -89
  25. package/gsp/skills/gsp-project-design/SKILL.md +1 -1
  26. package/gsp/skills/gsp-project-design/methodology/gsp-project-designer.md +56 -118
  27. package/gsp/skills/gsp-project-research/SKILL.md +13 -0
  28. package/gsp/skills/gsp-project-review/SKILL.md +1 -1
  29. package/gsp/skills/gsp-project-review/methodology/gsp-project-reviewer.md +5 -4
  30. package/gsp/skills/gsp-scaffold/SKILL.md +13 -0
  31. package/gsp/skills/gsp-scaffold/shadcn-rules.md +7 -11
  32. package/gsp/skills/gsp-style/SKILL.md +3 -3
  33. package/gsp/skills/gsp-style/style-preset-schema.md +1 -1
  34. package/gsp/skills/gsp-visuals/domains/imagery.md +10 -16
  35. package/gsp/templates/branding/config.json +2 -2
  36. package/gsp/templates/phases/patterns.md +2 -2
  37. package/gsp/templates/projects/config.json +4 -3
  38. package/package.json +1 -1
  39. package/gsp/skills/gsp-brand-guidelines/design-tokens.md +0 -184
@@ -74,7 +74,7 @@ Read `system_strategy` from brand config:
74
74
 
75
75
  Leverage existing UI libraries — don't rewrite from scratch.
76
76
 
77
- **Tier 1: Token mapping** (always) — `components/token-mapping.md`. Maps brand tokens to library's theming API. Copy-paste-ready. Generate the CSS variables block by running `node bin/theme-css.js {brand-name}.yml` — it outputs a ready-to-paste `:root`/`.dark` block with OKLCH values. Token names in `.yml` are 1:1 with shadcn/ui CSS var names — no translation needed.
77
+ **Tier 1: Token mapping** (always) — `components/token-mapping.md`. Maps brand tokens to library's theming API. Documents the OKLCH values generated by `theme-css.js` — these are installed into `globals.css` via `/gsp-brand-apply` (not manually pasted). Token names in `.yml` are 1:1 with shadcn/ui CSS var names — no translation needed.
78
78
 
79
79
  **Tier 2: Override specs** (selective) — one file per component needing treatment beyond tokens. Why it's overridden, code hints.
80
80
 
@@ -1,4 +1,4 @@
1
- # Token Mapping → bin/theme-css.js
1
+ # Token Mapping → theme-css.js
2
2
 
3
3
  > **Superseded in v0.8.0.** The static mapping table has been replaced by a deterministic script.
4
4
 
@@ -7,7 +7,7 @@ GSP presets use shadcn/ui-native token names directly. The `.yml` token keys mat
7
7
  ## Generating CSS from a preset
8
8
 
9
9
  ```bash
10
- node bin/theme-css.js gsp/skills/gsp-style/styles/professional.yml --stdout
10
+ node gsp/skills/gsp-brand-guidelines/bin/theme-css.js gsp/skills/gsp-style/styles/professional.yml --stdout
11
11
  ```
12
12
 
13
13
  Output is `:root { }` + `.dark { }` blocks ready to paste into `globals.css`.
@@ -89,7 +89,7 @@ Spawn the `gsp-brand-creative-director` agent. **Inline all content** — the ag
89
89
 
90
90
  Pass in the agent prompt:
91
91
  - **Content of** BRIEF.md (loaded in Step 1)
92
- - **Content of** strategy chunks: archetype.md, positioning.md, brand-platform.md, voice-and-tone.md (loaded in Step 1)
92
+ - **Content of** strategy chunks: archetype.md, positioning.md, brand-platform.md, voice-and-tone.md, messaging.md (all 5 loaded in Step 1; older brands without messaging.md proceed without it). Tagline directions and core message in `messaging.md` materially shape logo concept rationale and typography voice — do not skip it.
93
93
  - **Content of** discover/mood-board-direction.md (loaded in Step 1)
94
94
  - **Content of** style base preset `.yml` + `.md` (when loaded in Step 1) — `.yml` as structural scaffold, `.md` as design philosophy and signature techniques
95
95
  - **Content of** audit/brand-inventory.md (when loaded in Step 2)
@@ -109,14 +109,15 @@ The agent writes 5 chunks + INDEX.md (creative decisions only — no technical e
109
109
 
110
110
  ## Step 3.5: Enrich with domain skills (parallel)
111
111
 
112
- After the creative-director finishes, invoke all 4 domain skills in parallel — they operate on separate chunks with zero dependencies:
112
+ After the creative-director finishes, invoke all 5 domain skills in parallel — they operate on separate chunks with zero dependencies:
113
113
 
114
114
  - **`/gsp-logo --enrich`** — reads `logo-directions.md`, enriches with construction geometry, variation specs, clear space rules, minimum size calculations.
115
115
  - **`/gsp-color --enrich`** — reads `color-system.md`, generates OKLCH palettes via tints.dev, calculates WCAG contrast, writes `palettes.json`, enriches with contrast ratios and semantic mapping.
116
116
  - **`/gsp-typography --enrich`** — reads `typography.md`, generates mathematical type scale, adds fluid type formulas, enriches with font loading instructions.
117
- - **`/gsp-visuals --imagery --enrich`** — reads `imagery-style.md`, adds icon library specifics, CSS texture/treatment recipes, enriches with technical implementation details.
117
+ - **`/gsp-visuals --imagery --enrich`** — reads `imagery-style.md`, enriches with photography/illustration direction, CSS texture/treatment recipes, image processing implementation. Icons are NOT covered here — `gsp-icons` owns them.
118
+ - **`/gsp-icons --enrich`** — defines the icon system: library selection, stroke standardization, size system, container treatments, custom SVG direction.
118
119
 
119
- Invoke all 4 using the Skill tool simultaneously. Each skill loads its own domain references on-demand — no upfront context cost.
120
+ Invoke all 5 using the Skill tool simultaneously. Each skill loads its own domain references on-demand — no upfront context cost.
120
121
 
121
122
  ## Step 4: Perspective check
122
123
 
@@ -21,12 +21,11 @@ This skill modifies **`{brand-name}.yml`** — the single source of truth for br
21
21
  Accept natural language feedback about brand visuals, identify which `.yml` values are affected, apply targeted changes, and regenerate `STYLE.md` if it exists.
22
22
 
23
23
  **Input:** Natural language feedback (e.g., "accent is too muted", "make buttons rounder", "more motion")
24
- **Output:** Updated `{brand-name}.yml` + regenerated `STYLE.md` (if exists) + `REFINE-LOG.md`
24
+ **Output:** Updated `{brand-name}.yml` + regenerated `STYLE.md` (if exists) + `{brand-name}.theme.json` (regenerated) + `REFINE-LOG.md`
25
25
  **Agent:** None — inline skill, surgical edits
26
26
  </objective>
27
27
 
28
28
  <execution_context>
29
- @${CLAUDE_SKILL_DIR}/../gsp-brand-guidelines/design-tokens.md
30
29
  </execution_context>
31
30
 
32
31
  <rules>
@@ -123,7 +122,38 @@ Apply confirmed changes:
123
122
  1. **`{brand-name}.yml`** — edit values in place with `Edit`. Preserve structure.
124
123
  2. **`STYLE.md`** — if it exists, regenerate the affected sections (Patterns tables, Constraints lists, Effects tables, or Intensity dials) to reflect the `.yml` changes. Read the template from `${CLAUDE_SKILL_DIR}/../../templates/phases/style.md` for format reference.
125
124
 
126
- ## Step 4: Log and finish
125
+ ## Step 4: Regenerate theme.json and offer to apply
126
+
127
+ After updating `{brand-name}.yml` and (if applicable) regenerating `STYLE.md`, regenerate the shadcn registry artifact:
128
+
129
+ ```bash
130
+ node ${CLAUDE_SKILL_DIR}/../gsp-brand-guidelines/bin/theme-css.js \
131
+ {BRAND_PATH}/patterns/{brand-name}.yml \
132
+ --registry \
133
+ --output {BRAND_PATH}/patterns/{brand-name}.theme.json
134
+ ```
135
+
136
+ Verify the file is valid JSON:
137
+
138
+ ```bash
139
+ node -e "JSON.parse(require('fs').readFileSync('{BRAND_PATH}/patterns/{brand-name}.theme.json', 'utf8'))" \
140
+ && echo "✓ theme.json refreshed"
141
+ ```
142
+
143
+ If a project config exists (`.design/projects/*/config.json` with a non-empty `app_path`) AND `{app_path}/components.json` exists (a shadcn target), use `AskUserQuestion`:
144
+
145
+ - Question: "Theme refreshed. Apply changes to `{app_path}` now?"
146
+ - Options:
147
+ - A: "Yes — apply now"
148
+ - B: "Skip — apply later"
149
+
150
+ On A: output `Run /gsp-brand-apply {brand-name}` as the next user step.
151
+
152
+ On B: output `Refreshed. Apply later with /gsp-brand-apply {brand-name}.`
153
+
154
+ If no shadcn target is detected, skip the prompt and output a passive note: `Theme refreshed. No shadcn target detected — apply later with /gsp-brand-apply {brand-name} once a shadcn project is set up.`
155
+
156
+ ## Step 5: Log and finish
127
157
 
128
158
  Append to `{BRAND_PATH}/REFINE-LOG.md`:
129
159
 
@@ -85,5 +85,5 @@ Update `{BRAND_PATH}/STATE.md`: set Phase 1 (Discover) to `complete`.
85
85
 
86
86
  ## Step 5: Phase transition
87
87
 
88
- Invoke `/gsp-phase-transition` with phase `discover` and output directory `{BRAND_PATH}/research/`.
88
+ Invoke `/gsp-phase-transition` with phase `discover` and output directory `{BRAND_PATH}/discover/`.
89
89
  </process>
@@ -31,6 +31,15 @@ Act as a senior design researcher. Analyze the market landscape and competitive
31
31
  - Competitor map must use real competitors from BRIEF.md
32
32
  - Mood board specs must be actionable (hex values, typeface names)
33
33
  - Recommendations must be specific to this brand's personas, not generic
34
+
35
+ ## Downstream expertise context (for mood-board direction)
36
+
37
+ Stay opinionated but don't over-commit on technical specifics — downstream phases will refine via expertise skills:
38
+ - Hex color picks → `gsp-color` will re-express as OKLCH and validate WCAG contrast in identity phase
39
+ - Typeface picks → `gsp-typography` will pair, scale, and verify rhythm
40
+ - Imagery style direction → `gsp-visuals/domains/imagery.md` owns the canonical imagery vocabulary; align mood-board language with it where possible
41
+
42
+ This is forward awareness only — research output stays in research's lane.
34
43
  </methodology>
35
44
 
36
45
  <output>
@@ -32,9 +32,9 @@ Act as Head of Strategy at a top branding agency. Define the strategic foundatio
32
32
  </methodology>
33
33
 
34
34
  <references>
35
- - `references/brand-archetypes.md` — 12 archetypes with traits, shadows, visual tendencies
36
- - `references/positioning-frameworks.md` — positioning maps, brand pyramid
37
- - `references/voice-tone.md` — voice attribute framework, tone spectrum, messaging matrix
35
+ - `${CLAUDE_SKILL_DIR}/brand-archetypes.md` — 12 archetypes with traits, shadows, visual tendencies
36
+ - `${CLAUDE_SKILL_DIR}/positioning-frameworks.md` — positioning maps, brand pyramid
37
+ - `${CLAUDE_SKILL_DIR}/voice-tone.md` — voice attribute framework, tone spectrum, messaging matrix
38
38
  </references>
39
39
 
40
40
  <output>
@@ -29,7 +29,6 @@ Compare a project's shipped state against its source brand across all dimensions
29
29
  </objective>
30
30
 
31
31
  <execution_context>
32
- @${CLAUDE_SKILL_DIR}/../gsp-brand-guidelines/design-tokens.md
33
32
  @${CLAUDE_SKILL_DIR}/chunk-format.md
34
33
  </execution_context>
35
34
 
@@ -51,10 +51,15 @@ Also read the brand `.yml` preset from `{BRAND_PATH}/patterns/`.
51
51
 
52
52
  Read:
53
53
  - `{PROJECT_PATH}/BRIEF.md` — what we're building, platforms, tech stack
54
- - `{PROJECT_PATH}/config.json` — get `implementation_target`, `design_scope`, `codebase_type`, `app_path`, `repo_type`
54
+ - `{PROJECT_PATH}/config.json` — get `implementation_target`, `design_scope`, `codebase_type`, `app_path`, `repo_type`, `accessibility_level`, `style_preset`
55
55
 
56
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`.
57
57
 
58
+ **Expertise pointers:**
59
+ - `accessibility_level` (AA vs AAA) carries scope implications for contrast-sensitive components — see `${CLAUDE_SKILL_DIR}/../gsp-accessibility/SKILL.md` for level interpretation when reasoning about adaptations
60
+ - `style_preset` (when set) drives style-preset-specific component conventions — see `${CLAUDE_SKILL_DIR}/../gsp-style/styles/{preset}.md` for the preset's patterns + constraints + effects vocabulary that adaptation reasoning should respect
61
+ - When writing token overrides in `target-adaptations.md`, consult `${CLAUDE_SKILL_DIR}/../gsp-color/domains/palette.md` for OKLCH/contrast considerations and `${CLAUDE_SKILL_DIR}/../gsp-typography/domains/scale.md` for type-scale ratios
62
+
58
63
  ### Codebase context
59
64
 
60
65
  Read `.design/system/STACK.md` and `.design/system/COMPONENTS.md` (if exist) — existing tech stack, components, architecture.
@@ -137,10 +137,33 @@ Read these reference files:
137
137
  - `${CLAUDE_SKILL_DIR}/visual-effects.md`
138
138
  - `${CLAUDE_SKILL_DIR}/../gsp-project-design/block-patterns.md`
139
139
  - `${CLAUDE_SKILL_DIR}/shadcn-composition.md`
140
+ - `${CLAUDE_SKILL_DIR}/agent-rules.md` — common spawn guardrails (universal + per-mode)
140
141
 
141
142
  Hold their content for inlining into agent prompts in Steps 3, 4.5, 5, 7, and 8.
142
143
 
143
- > **Note:** Anti-patterns are distilled into the `gsp-project-builder` agent prompt. Full ref remains on disk for edge-case agent lookup.
144
+ ## Step 2.7: Theme apply gate
145
+
146
+ Verify brand tokens are installed in the codebase before spawning foundations. Foundations no longer pastes tokens — `/gsp-brand-apply` is the install primitive.
147
+
148
+ 1. If `{APP_PATH}/components.json` does not exist, skip this gate silently — the target is non-shadcn (scaffold's failure gate at end of Step 2 already covers a broken shadcn scaffold).
149
+ 2. Resolve the CSS path: read `{APP_PATH}/components.json` and extract the value at `.tailwind.css` (a relative path from `APP_PATH`).
150
+ 3. Open `{APP_PATH}/{cssPath}`. Verify:
151
+ - Contains `oklch(`
152
+ - Has both `:root {` and `.dark {` blocks
153
+ - Declares `--background`, `--foreground`, `--primary`, `--radius`
154
+ - **If** `{BRAND_PATH}/patterns/{brand-name}.theme.json` exists: contains the brand's signature `cssVars.light.background` value from that file (this distinguishes the applied brand from shadcn's nova defaults). If `{brand-name}.theme.json` does NOT exist (older brand from before Task 4 landed), skip the brand-signature check and rely on the structural checks only — log `⚠ Brand theme.json not found — skipping brand-signature check.`
155
+
156
+ If any required check fails, brand tokens are not applied (or the wrong brand is applied). Use `AskUserQuestion`:
157
+ - Question: "Brand tokens for **{brand-name}** not detected in `{APP_PATH}/{cssPath}`. Run `/gsp-brand-apply {brand-name}` now?"
158
+ - Options:
159
+ - A: "Yes — I'll run /gsp-brand-apply {brand-name}, then re-run /gsp-project-build"
160
+ - B: "No, abort the build"
161
+
162
+ On A: output `Next: run /gsp-brand-apply {brand-name}, then re-invoke /gsp-project-build` and exit this skill. The build does not auto-continue — the apply runs out-of-band and you re-invoke when ready.
163
+
164
+ On B: stop the build phase. Output: `Build aborted — apply brand tokens with /gsp-brand-apply {brand-name} and re-run /gsp-project-build.`
165
+
166
+ If all checks pass, log `✓ Brand tokens verified` and continue to Step 3.
144
167
 
145
168
  ## Step 3: Phase 2 — FOUNDATIONS
146
169
 
@@ -166,20 +189,16 @@ Spawn `gsp-project-builder` agent with **execution_mode: foundations**.
166
189
  ### Agent instructions:
167
190
 
168
191
  > execution_mode: foundations
192
+ > Build token integration, global styles, layout primitives, theme provider/utilities ONLY.
169
193
  >
170
- > Build token integration, global styles, and layout primitives ONLY.
194
+ > Foundation-specific actions:
195
+ > 1. Add base styles + dark mode setup + font imports that `apply` did not handle (`cssVars.theme.font-sans` may set the CSS var without the `next/font/google` import — add it if missing)
196
+ > 2. Create root layout with nav + footer shells (structure only)
197
+ > 3. Create shared utilities (cn helper, theme provider)
198
+ > 4. Apply STYLE.md bold bets + effects as CSS utilities / Tailwind extensions; validate against never/always constraints
199
+ > 5. For shadcn targets: semantic tokens (`bg-primary`), never raw values (`bg-blue-500`); `gap-*` not `space-y-*`; `size-*` when w/h equal
171
200
  >
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.
173
- > 2. Create global CSS (resets, base styles, font imports, dark mode setup)
174
- > 3. Create root layout with nav shell and footer shell (structure only — no page content)
175
- > 4. Create shared utilities (cn helper, theme provider if needed)
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).
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
181
- >
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.
201
+ > See `agent-rules.md` (loaded in Step 2.6) for universal + per-mode guardrails (write to codebase, leave unstaged, log to `build/logs/foundations.md`, no BUILD-LOG.md direct write).
183
202
 
184
203
  ### Checkpoint: Compile check
185
204
 
@@ -234,54 +253,13 @@ Use `AskUserQuestion`: "Foundations look good? Continue building components, or
234
253
 
235
254
  ### Brand feedback loop
236
255
 
237
- If the user requests adjustments during foundation review:
238
-
239
- 1. Apply the changes to the project codebase first (directly or via a quick builder re-run)
240
- 2. Ask: "Should this change also update the brand system? (Other projects using this brand would inherit it)"
241
- 3. If yes, spawn a background `gsp-brand-engineer` agent to update brand patterns:
242
- - Pass: the specific changes made (what tokens/values changed, old → new)
243
- - Pass: `{BRAND_PATH}/patterns/{brand-name}.yml` and relevant identity chunks
244
- - Agent updates the `.yml` preset, foundation chunks, and STYLE.md if applicable
245
- - Agent writes to `{BRAND_PATH}/` — the brand source of truth
246
- - Run synchronously (do NOT use `run_in_background`) — Step 4.5 reads the brand `.yml` from disk, so the updated values must be committed before components begin
247
- 4. Wait for brand sync to complete, then continue to Step 4.5
256
+ Read `${CLAUDE_SKILL_DIR}/brand-feedback.md` for the full procedure. Key constraint: the `gsp-brand-engineer` re-sync runs synchronously before Step 4.5 begins.
248
257
 
249
258
  ## Step 4.5: Phase 4 — COMPONENTS
250
259
 
251
- ### Build component manifest
252
-
253
- Read ALL design chunks from `{PROJECT_PATH}/design/` — every `screen-{NN}-{name}.md`. Also read:
254
- - `{PROJECT_PATH}/brief/scope.md` (feature map)
255
- - `{PROJECT_PATH}/brief/target-adaptations.md` (component adaptations)
256
- - `{BRAND_PATH}/patterns/components/token-mapping.md` (if exists)
257
-
258
- Extract every component referenced across all screens. Deduplicate. Build a manifest:
259
-
260
- ```
261
- COMPONENT_MANIFEST = [
262
- { name: "Button", source: "shadcn", classification: "library-default", screens: [01, 03, 05] },
263
- { name: "Card", source: "shadcn", classification: "library-customize", screens: [01, 02, 04], overrides: "custom radius + shadow from STYLE.md" },
264
- { name: "PricingTier", source: "custom", classification: "custom", screens: [03] },
265
- ...
266
- ]
267
- ```
268
-
269
- ### Classify each component
270
-
271
- | Category | Criteria | Action |
272
- |----------|----------|--------|
273
- | `library-default` | Exists in target library, no brand overrides needed | Install as-is |
274
- | `library-customize` | Exists in target library, STYLE.md or token-mapping requires overrides | Install then customize |
275
- | `custom` | No library match, or design requires bespoke component | Build from scratch |
276
- | `existing` | Already in codebase (from scaffold or prior project) | Skip — already available |
260
+ ### Build component manifest + classify + partition
277
261
 
278
- ### Partition into agent groups
279
-
280
- Group components to minimize conflicts:
281
- 1. No two agents install the same library component
282
- 2. Group related variants together (Card + CardHeader + CardContent + CardFooter → same agent)
283
- 3. Balance work across agents (aim for 3-6 components per agent)
284
- 4. If total components ≤ 5, use a single agent (no need to parallelize)
262
+ Read `${CLAUDE_SKILL_DIR}/component-classification.md` for the manifest schema, classification table (`library-default` / `library-customize` / `custom` / `existing`), and partitioning rules (≤5 → single agent; group related variants; 3-6 components per agent).
285
263
 
286
264
  ### Resume check
287
265
 
@@ -324,18 +302,9 @@ Agent instructions template:
324
302
  > implementation_target: {target}
325
303
  > components: [{partition list with classifications}]
326
304
  >
327
- > Install, customize, or create the assigned components.
328
- > 1. For library-default: install via CLI, verify import works
329
- > 2. For library-customize: install via CLI, then apply brand overrides (STYLE.md constraints, token values)
330
- > 3. For custom: create from scratch following brand patterns and STYLE.md
331
- > 4. Read foundations from codebase (tokens, utilities already exist)
332
- > 5. Do NOT modify foundation files (global CSS, layout, tokens, theme provider)
333
- > 6. Do NOT build screens or page content
334
- > 7. Write code directly to the codebase
335
- > 8. Leave changes unstaged
305
+ > Install, customize, or create the assigned components per their classification (library-default → install as-is; library-customize → install + STYLE.md overrides; custom → create from scratch).
336
306
  >
337
- > After completing components, write `{PROJECT_PATH}/build/logs/component-{partition-name}.md` list components installed/customized/created, files written, and any issues. Do NOT write to BUILD-LOG.md directly.
338
- > Also write `{PROJECT_PATH}/build/status/component-{partition-name}.json` with `{"status": "complete", "components": [{list}], "timestamp": "{ISO}"}`.
307
+ > See `agent-rules.md` (loaded in Step 2.6) for guardrails (read foundations from codebase, do not modify foundation files, log to `build/logs/component-{partition-name}.md`, write `build/status/component-{partition-name}.json` for resume support).
339
308
 
340
309
  ### Checkpoint: Compile check
341
310
 
@@ -397,19 +366,14 @@ Agent instructions per screen:
397
366
  > execution_mode: screen
398
367
  > screen: {name} ({NN})
399
368
  >
400
- > Build the {name} screen. Foundations and components are already in the codebase.
369
+ > Build the {name} screen. Foundations + components are already in the codebase.
401
370
  >
402
- > 1. Read the existing layout, tokens, utilities, and components from the codebase
403
- > 2. Create the route page and screen-specific components
404
- > 3. Wire imports to existing foundation and component files
405
- > 4. Do NOT modify foundation files (global CSS, layout, tokens, theme provider)
406
- > 5. Do NOT modify shared component files (they were built in the components phase)
407
- > 6. Write code directly to the codebase, not to `.design/`
408
- > 7. Leave changes unstaged
409
- > 8. The brand's visual effects were implemented as utilities during foundations — use those utilities/classes
371
+ > 1. Read existing layout, tokens, utilities, components from the codebase
372
+ > 2. Create the route page + screen-specific components
373
+ > 3. Wire imports to existing foundation + component files
374
+ > 4. The brand's visual effects exist as utilities/classes from foundations — use them, don't redefine
410
375
  >
411
- > After completing this screen, write `{PROJECT_PATH}/build/logs/screen-{NN}-{name}.md` list files written, components used, and any issues. Do NOT write to BUILD-LOG.md directly.
412
- > Also write `{PROJECT_PATH}/build/status/screen-{NN}-{name}.json` with `{"status": "complete", "screen": "{name}", "files": [{list}], "timestamp": "{ISO}"}`.
376
+ > See `agent-rules.md` (loaded in Step 2.6) for guardrails (no modifying foundations or shared components, log to `build/logs/screen-{NN}-{name}.md`, write `build/status/screen-{NN}-{name}.json` for resume support).
413
377
 
414
378
  ### Checkpoint: Compile check
415
379
 
@@ -428,35 +392,7 @@ Update `{PROJECT_PATH}/STATE.md` `## Screen Build Status` table — set complete
428
392
 
429
393
  ## Step 5.5: Extraction review (lightweight)
430
394
 
431
- Components were built in Phase 4, so most reuse is already handled. This is a quick sanity check.
432
-
433
- ### Automated scan
434
-
435
- Run these checks on the built codebase:
436
-
437
- 1. **Hardcoded values** — Grep for hardcoded hex colors, rgb(), pixel values that should be tokens. Flag any that don't reference CSS variables or Tailwind tokens.
438
- 2. **Duplicated patterns** — Use Grep to find identical `className` strings (>3 classes) appearing in 2+ screen files. These are patterns the components phase missed.
439
-
440
- ### Surface findings
441
-
442
- If issues found, present to user:
443
-
444
- ```
445
- ◆ post-build scan
446
-
447
- Found {N} hardcoded values and {M} duplicated patterns.
448
- {list if any}
449
-
450
- ──────────────────────────────
451
- ```
452
-
453
- If no issues: "Post-build scan clean — no hardcoded values or duplicated patterns found."
454
-
455
- Use `AskUserQuestion` only if issues were found: "Fix these, or continue to finalize?"
456
- - **Fix** → apply changes inline (mechanical refactors, no agent needed)
457
- - **Continue** → proceed to Step 6
458
-
459
- If hardcoded values map to missing brand tokens, suggest: "These token gaps may also exist in the brand. Consider running `/gsp-brand-refine` after build completes."
395
+ Read `${CLAUDE_SKILL_DIR}/extraction-review.md` for the full procedure. Quick post-build sanity check: hardcoded values + duplicated patterns. If issues found, AskUserQuestion (Fix inline / Continue to Step 6).
460
396
 
461
397
  ## Step 6: Finalize
462
398
 
@@ -0,0 +1,36 @@
1
+ # Agent Rules (foundations + components + screens)
2
+
3
+ Common guardrails for `gsp-project-builder` agent spawns. Each spawn references this file once instead of repeating the rules inline. Mode-specific instructions are in the spawn block (foundations / component / screen).
4
+
5
+ ## Universal rules (all modes)
6
+
7
+ - **Write code directly to the codebase** — not to `.design/`
8
+ - **Leave changes unstaged** — orchestrator handles commits
9
+ - **Do NOT write to BUILD-LOG.md directly** — orchestrator merges per-agent logs after each phase. Each agent writes to `{PROJECT_PATH}/build/logs/{phase}-{name}.md`
10
+ - For component/screen modes, also write `{PROJECT_PATH}/build/status/{phase}-{name}.json` with `{"status": "complete", "timestamp": "{ISO}"}` for resume support
11
+
12
+ ## Mode-specific guardrails
13
+
14
+ ### foundations
15
+ - Verify brand tokens are already installed in `globals.css` (orchestrator gates this; tokens MUST be present before agent runs)
16
+ - If tokens missing, abort with error pointing at `/gsp-brand-apply {brand-name}`. Do NOT manually paste tokens
17
+ - Build root layout shells, shared utilities, theme providers ONLY
18
+ - Do NOT build individual screens or page content
19
+
20
+ ### component
21
+ - Read foundations from codebase (tokens, utilities already exist)
22
+ - Do NOT modify foundation files (global CSS, layout, tokens, theme provider)
23
+ - Do NOT build screens or page content
24
+ - Library-default → install via CLI as-is
25
+ - Library-customize → install + apply STYLE.md overrides (radius, shadow, color tokens)
26
+ - Custom → create from scratch following brand patterns
27
+
28
+ ### screen
29
+ - Read foundations + components from codebase
30
+ - Do NOT modify foundation files
31
+ - Do NOT modify shared component files (built in Phase 4)
32
+ - Build the screen's route page + screen-specific components only
33
+
34
+ ## When in doubt
35
+
36
+ STYLE.md takes precedence over all defaults. If the preset explicitly defines a technique, implement it. The methodology file (`methodology/gsp-project-builder.md`) has the full domain-rule pointers (color, typography, accessibility, imagery, anti-patterns).
@@ -0,0 +1,12 @@
1
+ # Brand Feedback Loop (Step 4)
2
+
3
+ If the user requests adjustments during foundation review:
4
+
5
+ 1. **Apply to project codebase first** — directly or via a quick builder re-run
6
+ 2. **Ask:** "Should this change also update the brand system? (Other projects using this brand would inherit it.)"
7
+ 3. **If yes**, spawn a `gsp-brand-engineer` agent **synchronously** (NOT `run_in_background` — Step 4.5 reads the brand `.yml` from disk; updated values must be committed before components begin):
8
+ - Pass: the specific changes made (what tokens/values changed, old → new)
9
+ - Pass: `{BRAND_PATH}/patterns/{brand-name}.yml` and relevant identity chunks
10
+ - Agent updates the `.yml` preset, foundation chunks, and STYLE.md if applicable
11
+ - Agent writes to `{BRAND_PATH}/` — the brand source of truth
12
+ 4. **Wait for brand sync to complete**, then continue to Step 4.5
@@ -0,0 +1,36 @@
1
+ # Component Classification (Step 4.5)
2
+
3
+ ## Build component manifest
4
+
5
+ Read ALL design chunks from `{PROJECT_PATH}/design/` — every `screen-{NN}-{name}.md`. Also read:
6
+ - `{PROJECT_PATH}/brief/scope.md` (feature map)
7
+ - `{PROJECT_PATH}/brief/target-adaptations.md` (component adaptations)
8
+ - `{BRAND_PATH}/patterns/components/token-mapping.md` (if exists)
9
+
10
+ Extract every component referenced across all screens. Deduplicate. Build a manifest:
11
+
12
+ ```
13
+ COMPONENT_MANIFEST = [
14
+ { name: "Button", source: "shadcn", classification: "library-default", screens: [01, 03, 05] },
15
+ { name: "Card", source: "shadcn", classification: "library-customize", screens: [01, 02, 04], overrides: "custom radius + shadow from STYLE.md" },
16
+ { name: "PricingTier", source: "custom", classification: "custom", screens: [03] },
17
+ ...
18
+ ]
19
+ ```
20
+
21
+ ## Classify each component
22
+
23
+ | Category | Criteria | Action |
24
+ |----------|----------|--------|
25
+ | `library-default` | Exists in target library, no brand overrides needed | Install as-is |
26
+ | `library-customize` | Exists in target library, STYLE.md or token-mapping requires overrides | Install then customize |
27
+ | `custom` | No library match, or design requires bespoke component | Build from scratch |
28
+ | `existing` | Already in codebase (from scaffold or prior project) | Skip — already available |
29
+
30
+ ## Partition into agent groups
31
+
32
+ Group components to minimize conflicts:
33
+ 1. No two agents install the same library component
34
+ 2. Group related variants together (Card + CardHeader + CardContent + CardFooter → same agent)
35
+ 3. Balance work across agents (aim for 3-6 components per agent)
36
+ 4. If total components ≤ 5, use a single agent (no need to parallelize)
@@ -0,0 +1,31 @@
1
+ # Extraction Review (Step 5.5)
2
+
3
+ Components were built in Phase 4, so most reuse is already handled. This is a quick sanity check.
4
+
5
+ ## Automated scan
6
+
7
+ Run these on the built codebase:
8
+
9
+ 1. **Hardcoded values** — Grep for hardcoded hex colors, `rgb()`, pixel values that should be tokens. Flag any that don't reference CSS variables or Tailwind tokens.
10
+ 2. **Duplicated patterns** — Grep for identical `className` strings (>3 classes) appearing in 2+ screen files. These are patterns the components phase missed.
11
+
12
+ ## Surface findings
13
+
14
+ If issues found:
15
+
16
+ ```
17
+ ◆ post-build scan
18
+
19
+ Found {N} hardcoded values and {M} duplicated patterns.
20
+ {list if any}
21
+
22
+ ──────────────────────────────
23
+ ```
24
+
25
+ If no issues: "Post-build scan clean — no hardcoded values or duplicated patterns found."
26
+
27
+ Use `AskUserQuestion` only if issues were found: "Fix these, or continue to finalize?"
28
+ - **Fix** → apply changes inline (mechanical refactors, no agent needed)
29
+ - **Continue** → proceed to Step 6
30
+
31
+ If hardcoded values map to missing brand tokens, suggest: "These token gaps may also exist in the brand. Consider running `/gsp-brand-refine` after build completes."
@@ -17,8 +17,8 @@ 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. 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
- - Global CSS (resets, base styles, dark mode)
20
+ - **Verify** brand tokens are already installed in the CSS file (path declared in `components.json` `.tailwind.css`). The orchestrator has already gated this by the time you run, tokens MUST be present (installed via `/gsp-brand-apply` either directly or through the brand-guidelines prompt). If you find tokens missing, abort with a clear error pointing at `/gsp-brand-apply {brand-name}`. **Do NOT manually paste tokens or run `theme-css.js`.**
21
+ - Base styles, dark mode setup, and any font imports that `apply` did not handle (`cssVars.theme.font-sans` may set the CSS variable but not generate the `next/font/google` import in `layout.tsx` — add it if missing, leave it alone if present)
22
22
  - Layout components (root layout, nav shell, footer shell)
23
23
  - Shared utilities (cn helper, theme provider)
24
24
  - **Do NOT build individual screens or page content**
@@ -93,16 +93,23 @@ When the user gives feedback during a build, classify it:
93
93
 
94
94
  Never silently apply style-level changes to code without surfacing the choice. A button radius change in one screen that doesn't flow back to the `.yml` creates drift — the next screen gets built with the old radius.
95
95
 
96
- ## Anti-Pattern Awareness (distilled)
96
+ ## Anti-Pattern Awareness (delegated to expertise)
97
97
 
98
- Check code against these before marking a screen complete — **but STYLE.md takes precedence**. If the preset explicitly defines a technique listed here, implement what the preset says. These are defaults for when the style is silent.
98
+ **STYLE.md takes precedence over all defaults.** When the preset is silent, defer to the canonical owners:
99
99
 
100
- - **Typography:** no Inter/Roboto defaults, `font-variant-numeric: tabular-nums` for data, `text-wrap: balance` for headings
101
- - **Color:** off-black not #000, tint shadows to background hue, single accent color, single light source
100
+ - **Color** `${CLAUDE_SKILL_DIR}/../gsp-color/domains/system.md` (off-black, accent count, shadow tinting, light source) + `${CLAUDE_SKILL_DIR}/../gsp-color/references/color-composition.md` (60-30-10 rule)
101
+ - **Typography** — `${CLAUDE_SKILL_DIR}/../gsp-typography/domains/system.md` + `pairing.md` (no Inter/Roboto defaults, `tabular-nums`, `text-wrap: balance`, scale ratios)
102
+ - **Motion + effects** — `${CLAUDE_SKILL_DIR}/../gsp-accessibility/motion-effects.md` (`prefers-reduced-motion`, contrast on effects, hover magnitudes, spring physics)
103
+ - **Imagery** — `${CLAUDE_SKILL_DIR}/../gsp-visuals/domains/imagery.md` (photography, illustration, treatments)
104
+ - **Full anti-pattern catalog** — `${CLAUDE_SKILL_DIR}/../gsp-project-critique/anti-patterns.md` (consolidated checklist; cite this for code-quality patterns beyond the domains above)
105
+ - **STYLE.md vocabulary** — `${CLAUDE_SKILL_DIR}/../gsp-style/style-preset-schema.md` (constraint/pattern/effects/bold-bet structure)
106
+
107
+ Do not re-derive these rules inline — read the canonical owner before applying.
108
+
109
+ **Builder-specific defaults** (not domain knowledge — keep here):
102
110
  - **Layout:** `min-h-[100dvh]` not `h-screen`, always max-width, CSS Grid over flexbox %, bottom-align CTAs in card groups
103
- - **Surfaces:** vary elevation treatments, z-layer system (flat/subtle/elevated/floating/overlay)
111
+ - **Surfaces:** z-layer system (flat/subtle/elevated/floating/overlay)
104
112
  - **Content:** real copy always, diverse names, organic numbers, sentence case, no AI clichés
105
- - **Motion:** spring physics (`cubic-bezier(0.16,1,0.3,1)`), `transform`+`opacity` only, 200-300ms minimum, `prefers-reduced-motion`, stagger entrances
106
113
  - **Components:** customize shadcn radii/colors/shadows, skeleton loaders not spinners, semantic HTML
107
114
  - **Code:** no inline styles mixed with utilities, relative units, clean z-index scale, alt text, verify imports exist
108
115
 
@@ -187,7 +194,7 @@ These rules are always enforced for shadcn targets. They reflect the official sh
187
194
  ```
188
195
  - Do not override `--sidebar-width` in `globals.css` — it belongs on the provider instance
189
196
 
190
- Full reference: `references/anti-patterns.md` (available via Read for the complete list with fixes).
197
+ Full reference: `${CLAUDE_SKILL_DIR}/../gsp-project-critique/anti-patterns.md` (available via Read for the complete list with fixes).
191
198
 
192
199
  **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
200
 
@@ -197,7 +204,7 @@ Every screen must pass these before marking complete. When `STYLE.md` is provide
197
204
 
198
205
  1. **Background treatment** — never plain white/dark. Subtle gradient, texture, or decorative element.
199
206
  2. **State polish** — hover/focus/active/pressed feel deliberate (shadow shifts, subtle scale, translateY) not just color swaps
200
- 3. **Icon consistency** — one icon family, one stroke weight throughout
207
+ 3. **Icon consistency** — import from `preferences.icon_library` only (project config — defaults to `lucide`); one icon family, one stroke weight throughout. No mixing libraries within a screen
201
208
  4. **Image direction** — imagery style (photo/illustration/CSS-only) matches brand character
202
209
  5. **Responsive craft** — mobile is a designed experience, not just "it fits"
203
210
 
@@ -457,19 +457,4 @@ Beyond basic glassmorphism — simulating realistic glass edge refraction and de
457
457
 
458
458
  ## Accessibility
459
459
 
460
- All visual effects must degrade gracefully:
461
-
462
- ```css
463
- @media (prefers-reduced-motion: reduce) {
464
- *, *::before, *::after {
465
- animation-duration: 0.01ms !important;
466
- animation-iteration-count: 1 !important;
467
- transition-duration: 0.01ms !important;
468
- }
469
- }
470
- ```
471
-
472
- - Glow/shadow: ensure text contrast meets WCAG AA without effects
473
- - Backdrop-blur: `@supports not (backdrop-filter: blur(1px))` solid bg fallback
474
- - Gradient text: test contrast ratio of gradient endpoints, not just midpoint
475
- - Hover transforms: keep magnitude small (2-4px translate, 1.02-1.05 scale) to avoid disorientation
460
+ Canonical motion + effects accessibility guidance lives in `${CLAUDE_SKILL_DIR}/../gsp-accessibility/motion-effects.md` — owned by `gsp-accessibility`. Builder must read it before applying any effect from this reference. Covers `prefers-reduced-motion`, contrast on glow/shadow/gradient text, backdrop-filter fallbacks, and hover-transform magnitudes.
@@ -69,10 +69,12 @@ Read `{PROJECT_PATH}/config.json` to get `implementation_target`, `design_scope`
69
69
  Read these reference files and hold their content for inlining into agent prompts in Step 2:
70
70
  - `${CLAUDE_SKILL_DIR}/../gsp-accessibility-audit/wcag-checklist.md`
71
71
  - `${CLAUDE_SKILL_DIR}/../gsp-color/references/color-composition.md`
72
+ - `${CLAUDE_SKILL_DIR}/../gsp-typography/domains/scale.md` — type-scale verification rules
73
+ - `${CLAUDE_SKILL_DIR}/../gsp-visuals/domains/imagery.md` — imagery vocabulary for critique
72
74
  - `${CLAUDE_SKILL_DIR}/../gsp-accessibility-audit/methodology/gsp-accessibility-auditor.md`
73
75
  - `${CLAUDE_SKILL_DIR}/../../templates/phases/critique.md` — critique output template
74
76
 
75
- > **Note:** Nielsen's heuristics, visual taste, and anti-patterns are distilled into the `gsp-project-critic` agent prompt. Full refs remain on disk for edge-case agent lookup.
77
+ > **Note:** Nielsen's heuristics, visual taste, and anti-patterns are distilled into the `gsp-project-critic` agent prompt. anti-patterns.md is a critic-owned consolidated checklist; canonical sources are gsp-typography, gsp-color, gsp-visuals — update those when fixing drift, not the consolidated checklist alone.
76
78
 
77
79
  ## Step 1.9: Load agent methodology
78
80
 
@@ -92,6 +94,8 @@ Read `${CLAUDE_SKILL_DIR}/methodology/gsp-project-critic.md`. Include the full c
92
94
  - **Content of** research recommendations.md (loaded in Step 1)
93
95
  - **Content of** BRIEF.md
94
96
  - **Content of** color composition reference (loaded in Step 1.8)
97
+ - **Content of** typography scale reference (loaded in Step 1.8)
98
+ - **Content of** imagery vocabulary reference (loaded in Step 1.8)
95
99
  - **Content of** critique output template (loaded in Step 1.8)
96
100
  - `references_path`: `${CLAUDE_SKILL_DIR}/` — for supplementary Read access to visual-taste.md, anti-patterns.md
97
101
  - Output path: `{PROJECT_PATH}/critique/`