@hegemonart/get-design-done 1.0.7

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 (144) hide show
  1. package/.claude-plugin/marketplace.json +63 -0
  2. package/.claude-plugin/plugin.json +54 -0
  3. package/CHANGELOG.md +221 -0
  4. package/LICENSE +21 -0
  5. package/README.md +724 -0
  6. package/SKILL.md +232 -0
  7. package/agents/README.md +226 -0
  8. package/agents/a11y-mapper.md +118 -0
  9. package/agents/component-taxonomy-mapper.md +88 -0
  10. package/agents/design-advisor.md +139 -0
  11. package/agents/design-assumptions-analyzer.md +171 -0
  12. package/agents/design-auditor.md +383 -0
  13. package/agents/design-context-builder.md +544 -0
  14. package/agents/design-context-checker-gate.md +90 -0
  15. package/agents/design-context-checker.md +260 -0
  16. package/agents/design-discussant.md +98 -0
  17. package/agents/design-doc-writer.md +229 -0
  18. package/agents/design-executor.md +452 -0
  19. package/agents/design-figma-writer.md +302 -0
  20. package/agents/design-fixer.md +180 -0
  21. package/agents/design-integration-checker-gate.md +93 -0
  22. package/agents/design-integration-checker.md +326 -0
  23. package/agents/design-pattern-mapper.md +206 -0
  24. package/agents/design-phase-researcher.md +229 -0
  25. package/agents/design-plan-checker.md +164 -0
  26. package/agents/design-planner.md +352 -0
  27. package/agents/design-reflector.md +175 -0
  28. package/agents/design-research-synthesizer.md +127 -0
  29. package/agents/design-verifier-gate.md +97 -0
  30. package/agents/design-verifier.md +605 -0
  31. package/agents/gdd-graphify-sync.md +100 -0
  32. package/agents/gdd-intel-updater.md +88 -0
  33. package/agents/gdd-learnings-extractor.md +85 -0
  34. package/agents/motion-mapper.md +103 -0
  35. package/agents/token-mapper.md +103 -0
  36. package/agents/visual-hierarchy-mapper.md +95 -0
  37. package/connections/chromatic.md +247 -0
  38. package/connections/claude-design.md +190 -0
  39. package/connections/connections.md +218 -0
  40. package/connections/figma-writer.md +139 -0
  41. package/connections/figma.md +146 -0
  42. package/connections/graphify.md +197 -0
  43. package/connections/pinterest.md +153 -0
  44. package/connections/preview.md +173 -0
  45. package/connections/refero.md +189 -0
  46. package/connections/storybook.md +280 -0
  47. package/hooks/budget-enforcer.js +318 -0
  48. package/hooks/context-exhaustion.js +127 -0
  49. package/hooks/gdd-read-injection-scanner.js +44 -0
  50. package/hooks/hooks.json +44 -0
  51. package/package.json +60 -0
  52. package/reference/BRANCH-PROTECTION.md +65 -0
  53. package/reference/DEPRECATIONS.md +41 -0
  54. package/reference/STATE-TEMPLATE.md +200 -0
  55. package/reference/accessibility.md +190 -0
  56. package/reference/anti-patterns.md +336 -0
  57. package/reference/audit-scoring.md +205 -0
  58. package/reference/checklists.md +137 -0
  59. package/reference/config-schema.md +319 -0
  60. package/reference/debugger-philosophy.md +32 -0
  61. package/reference/heuristics.md +201 -0
  62. package/reference/intel-schema.md +266 -0
  63. package/reference/model-prices.md +37 -0
  64. package/reference/model-tiers.md +118 -0
  65. package/reference/motion.md +285 -0
  66. package/reference/parallelism-rules.md +108 -0
  67. package/reference/priority-matrix.md +31 -0
  68. package/reference/project-skills-guide.md +42 -0
  69. package/reference/review-format.md +107 -0
  70. package/reference/schemas/config.schema.json +41 -0
  71. package/reference/schemas/hooks.schema.json +55 -0
  72. package/reference/schemas/intel.schema.json +191 -0
  73. package/reference/schemas/marketplace.schema.json +72 -0
  74. package/reference/schemas/plugin.schema.json +59 -0
  75. package/reference/shared-preamble.md +82 -0
  76. package/reference/typography.md +229 -0
  77. package/scripts/aggregate-agent-metrics.js +144 -0
  78. package/scripts/apply-branch-protection.sh +75 -0
  79. package/scripts/bootstrap-manifest.txt +3 -0
  80. package/scripts/bootstrap.sh +80 -0
  81. package/scripts/build-intel.cjs +458 -0
  82. package/scripts/detect-stale-refs.cjs +101 -0
  83. package/scripts/extract-changelog-section.cjs +57 -0
  84. package/scripts/release-smoke-test.cjs +169 -0
  85. package/scripts/rollback-release.sh +42 -0
  86. package/scripts/run-injection-scanner-ci.cjs +92 -0
  87. package/scripts/validate-frontmatter.cjs +68 -0
  88. package/scripts/validate-schemas.cjs +225 -0
  89. package/scripts/verify-version-sync.cjs +30 -0
  90. package/skills/add-backlog/SKILL.md +47 -0
  91. package/skills/analyze-dependencies/SKILL.md +184 -0
  92. package/skills/apply-reflections/SKILL.md +112 -0
  93. package/skills/audit/SKILL.md +54 -0
  94. package/skills/brief/SKILL.md +75 -0
  95. package/skills/cache-manager/SKILL.md +120 -0
  96. package/skills/compare/SKILL.md +322 -0
  97. package/skills/complete-cycle/SKILL.md +33 -0
  98. package/skills/darkmode/SKILL.md +331 -0
  99. package/skills/debug/SKILL.md +38 -0
  100. package/skills/design/SKILL.md +281 -0
  101. package/skills/discover/SKILL.md +172 -0
  102. package/skills/discuss/SKILL.md +67 -0
  103. package/skills/do/SKILL.md +45 -0
  104. package/skills/explore/SKILL.md +109 -0
  105. package/skills/extract-learnings/SKILL.md +98 -0
  106. package/skills/fast/SKILL.md +44 -0
  107. package/skills/figma-write/SKILL.md +40 -0
  108. package/skills/graphify/SKILL.md +48 -0
  109. package/skills/health/SKILL.md +48 -0
  110. package/skills/help/SKILL.md +76 -0
  111. package/skills/list-assumptions/SKILL.md +60 -0
  112. package/skills/map/SKILL.md +112 -0
  113. package/skills/new-cycle/SKILL.md +35 -0
  114. package/skills/new-project/SKILL.md +53 -0
  115. package/skills/next/SKILL.md +42 -0
  116. package/skills/note/SKILL.md +47 -0
  117. package/skills/optimize/SKILL.md +120 -0
  118. package/skills/pause/SKILL.md +41 -0
  119. package/skills/plan/SKILL.md +251 -0
  120. package/skills/plant-seed/SKILL.md +47 -0
  121. package/skills/pr-branch/SKILL.md +31 -0
  122. package/skills/progress/SKILL.md +60 -0
  123. package/skills/quick/SKILL.md +43 -0
  124. package/skills/reapply-patches/SKILL.md +31 -0
  125. package/skills/reflect/SKILL.md +73 -0
  126. package/skills/resume/SKILL.md +37 -0
  127. package/skills/review-backlog/SKILL.md +45 -0
  128. package/skills/router/SKILL.md +67 -0
  129. package/skills/scan/SKILL.md +721 -0
  130. package/skills/settings/SKILL.md +78 -0
  131. package/skills/ship/SKILL.md +31 -0
  132. package/skills/sketch/SKILL.md +78 -0
  133. package/skills/sketch-wrap-up/SKILL.md +88 -0
  134. package/skills/skill-manifest/SKILL.md +79 -0
  135. package/skills/spike/SKILL.md +67 -0
  136. package/skills/spike-wrap-up/SKILL.md +81 -0
  137. package/skills/stats/SKILL.md +50 -0
  138. package/skills/style/SKILL.md +193 -0
  139. package/skills/synthesize/SKILL.md +93 -0
  140. package/skills/todo/SKILL.md +54 -0
  141. package/skills/undo/SKILL.md +30 -0
  142. package/skills/update/SKILL.md +36 -0
  143. package/skills/verify/SKILL.md +452 -0
  144. package/skills/warm-cache/SKILL.md +113 -0
@@ -0,0 +1,721 @@
1
+ ---
2
+ name: scan
3
+ description: "Design scanner for new or uninitialized repos. Automatically maps the existing design system (colors, typography, spacing, components, tokens), runs a full anti-pattern audit, scores all 7 categories, and produces two artifacts: DESIGN.md (living design system snapshot) and .design/DESIGN-DEBT.md (prioritized debt roadmap with effort estimates). Run this once before starting discovery in any new codebase."
4
+ argument-hint: "[--quick] [--full]"
5
+ user-invocable: true
6
+ ---
7
+
8
+ # Get Design Done — Scan
9
+
10
+ **Pre-pipeline initializer.** Run once in any new or existing repo before starting the Discover → Plan → Design → Verify pipeline.
11
+
12
+ Produces:
13
+ - `DESIGN.md` — snapshot of the existing design system as it actually is
14
+ - `.design/DESIGN-DEBT.md` — prioritized debt roadmap
15
+
16
+ `--quick`: Skip component inventory, focus on tokens + anti-patterns only (~2 min)
17
+ `--full`: Include component-by-component analysis (slower, more thorough)
18
+
19
+ Default: full scan of tokens, patterns, and anti-patterns. Component inventory is a summary count, not per-file.
20
+
21
+ ---
22
+
23
+ ## State Integration
24
+
25
+ ### Read or create STATE.md
26
+
27
+ At scan entry, before running any step:
28
+
29
+ 1. Check for `.design/STATE.md`.
30
+ - **If missing:** create it from `reference/STATE-TEMPLATE.md`. Set the following fields:
31
+ - `started_at` = now (ISO 8601) — **set once; never overwrite on subsequent runs**
32
+ - `last_checkpoint` = now
33
+ - frontmatter `stage` = `scan`
34
+ - `<position>` `stage` = `scan`, `status` = `in_progress`, `task_progress` = `0/8`
35
+ - **If present and `stage == scan` and `status == in_progress`:** RESUME — skip already-complete steps using `task_progress` as offset. Do not reset `started_at`.
36
+ - **Otherwise (normal transition):** set frontmatter `stage = scan`, `<position>` `stage = scan`, `status = in_progress`, `task_progress = 0/8`. Do not overwrite `started_at`.
37
+
38
+ ### Probe connection availability
39
+
40
+ Run both probes below. MCP tools may be in the deferred tool set — **always call ToolSearch first**; without it, a deferred tool invocation fails silently.
41
+
42
+ **Figma probe:**
43
+
44
+ ```
45
+ Step A1 — ToolSearch check:
46
+ ToolSearch({ query: "select:mcp__figma-desktop__get_metadata", max_results: 1 })
47
+ → Empty result → figma: not_configured (skip all Figma steps)
48
+ → Non-empty result → proceed to Step A2
49
+
50
+ Step A2 — Live tool call:
51
+ call mcp__figma-desktop__get_metadata
52
+ → Success → figma: available
53
+ → Error → figma: unavailable (skip all Figma steps)
54
+ ```
55
+
56
+ **Refero probe:**
57
+
58
+ ```
59
+ Step B1 — ToolSearch check:
60
+ ToolSearch({ query: "refero", max_results: 5 })
61
+ → Empty result → refero: not_configured (use fallback chain)
62
+ → Non-empty result → refero: available
63
+ ```
64
+
65
+ Note: scan probes **both** connections because the State Integration block is the authoritative connection-detection point for the entire pipeline. Scan itself does not use Refero, but it writes the Refero status so downstream stages (discover) do not need to re-probe from scratch.
66
+
67
+ ### Phase 8 Connection Probes
68
+
69
+ Run all 5 Phase 8 probes at scan entry. Results are written to STATE.md `<connections>` so downstream stages (verify, compare, darkmode, plan, design) do not re-probe unless needed.
70
+
71
+ **preview:**
72
+
73
+ ```
74
+ Step P1 — ToolSearch check:
75
+ ToolSearch({ query: "Claude_Preview", max_results: 5 })
76
+ → Empty result → preview: not_configured
77
+ → Non-empty result → proceed to Step P2
78
+
79
+ Step P2 — Live tool call:
80
+ call mcp__Claude_Preview__preview_list
81
+ → Success → preview: available
82
+ → Error → preview: unavailable
83
+
84
+ Write: preview: <status> to STATE.md <connections>
85
+ ```
86
+
87
+ **storybook:**
88
+
89
+ ```
90
+ Step B1 — Project detection:
91
+ Bash: ls .storybook/ 2>/dev/null || grep '"storybook"' package.json 2>/dev/null
92
+ → Found → storybook_project: true → proceed to Step B2
93
+ → Not found → storybook: not_configured
94
+
95
+ Step B2 — Dev server detection:
96
+ Bash: curl -sf http://localhost:6006/index.json 2>/dev/null | head -1
97
+ → Returns JSON → storybook: available
98
+ → Fails → Bash: curl -sf http://localhost:6006/stories.json 2>/dev/null | head -1
99
+ → Returns JSON → storybook: available (compat endpoint)
100
+ → Fails → storybook: unavailable
101
+
102
+ Write: storybook: <status> to STATE.md <connections>
103
+ ```
104
+
105
+ **chromatic:**
106
+
107
+ ```
108
+ Step C1 — CLI presence:
109
+ Bash: command -v chromatic 2>/dev/null || npx chromatic --version 2>/dev/null
110
+ → found → proceed to Step C2
111
+ → not found → chromatic: not_configured
112
+
113
+ Step C2 — Token check:
114
+ Bash: test -n "${CHROMATIC_PROJECT_TOKEN}"
115
+ → true → chromatic: available
116
+ → false → chromatic: unavailable
117
+
118
+ Write: chromatic: <status> to STATE.md <connections>
119
+ ```
120
+
121
+ **figma_writer:**
122
+
123
+ ```
124
+ ToolSearch({ query: "select:mcp__figma__use_figma", max_results: 1 })
125
+ → Empty result → figma_writer: not_configured
126
+ → Non-empty result → figma_writer: available
127
+
128
+ Write: figma_writer: <status> to STATE.md <connections>
129
+ Note: ToolSearch-only probe (same pattern as Refero). No live call at scan time.
130
+ ```
131
+
132
+ **graphify:**
133
+
134
+ ```
135
+ Step G1 — Config check:
136
+ Bash: node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" graphify status
137
+ → Error or { enabled: false } → graphify: not_configured
138
+ → { enabled: true } → proceed to Step G2
139
+
140
+ Step G2 — Graph file check:
141
+ Bash: test -f graphify-out/graph.json
142
+ → Present → graphify: available
143
+ → Absent → graphify: unavailable
144
+
145
+ Write: graphify: <status> to STATE.md <connections>
146
+ ```
147
+
148
+ After all 5 probes, STATE.md `<connections>` contains all 5 status entries. Downstream plans (08-02 through 08-05) read these values without re-probing.
149
+
150
+ ### Write STATE.md
151
+
152
+ Update `.design/STATE.md` with probe results:
153
+
154
+ ```xml
155
+ <connections>
156
+ figma: <available | unavailable | not_configured>
157
+ refero: <available | not_configured>
158
+ preview: <available | unavailable | not_configured>
159
+ storybook: <available | unavailable | not_configured>
160
+ chromatic: <available | unavailable | not_configured>
161
+ figma_writer: <available | not_configured>
162
+ graphify: <available | unavailable | not_configured>
163
+ </connections>
164
+ ```
165
+
166
+ Update `last_checkpoint` to now. Write `.design/STATE.md` to disk before proceeding to Step 1.
167
+
168
+ ---
169
+
170
+ ## Step 1 — Orient
171
+
172
+ Identify the project structure before scanning:
173
+
174
+ ```bash
175
+ # Framework detection
176
+ cat package.json 2>/dev/null | grep -E '"(next|nuxt|vite|react|vue|svelte|remix|astro|tailwind)"' | head -20
177
+
178
+ # CSS approach
179
+ ls src/styles/ styles/ app/styles/ 2>/dev/null
180
+ find . -name "tailwind.config.*" -not -path "*/node_modules/*" 2>/dev/null | head -3
181
+ find . -name "*.tokens.json" -o -name "design-tokens.*" -o -name "tokens.css" 2>/dev/null | grep -v node_modules | head -5
182
+
183
+ # Component count
184
+ find . -name "*.tsx" -o -name "*.jsx" -o -name "*.vue" -o -name "*.svelte" 2>/dev/null | grep -v node_modules | wc -l
185
+
186
+ # Style file count
187
+ find . -name "*.css" -o -name "*.scss" -o -name "*.less" 2>/dev/null | grep -v node_modules | wc -l
188
+ ```
189
+
190
+ Record: framework, CSS approach, component count, style file count, token system (yes/no).
191
+
192
+ **Detect source root.** Check these directories in order and use the first one that exists:
193
+ `src/` → `app/` → `pages/` → `lib/`. Substitute the detected source root (the matched
194
+ directory name) into every subsequent grep command in this SKILL.md that currently references
195
+ `src/` as the primary component root. If none of these directories exist, log
196
+ "No standard source directory found — manual audit required" and proceed with the unchanged
197
+ command (the `2>/dev/null` guards will suppress the no-match output).
198
+
199
+ Log the detected source root in DESIGN.md frontmatter as:
200
+ source_roots: [<detected_dir>]
201
+
202
+ ---
203
+
204
+ ## Step 2 — Extract Color System
205
+
206
+ ```bash
207
+ # All hex colors used
208
+ grep -roh "#[0-9a-fA-F]\{3,8\}" src/ styles/ app/ --include="*.css" --include="*.scss" --include="*.tsx" --include="*.jsx" --include="*.ts" --include="*.vue" 2>/dev/null | sort | uniq -c | sort -rn | head -40
209
+
210
+ # oklch / hsl / rgb colors
211
+ grep -rEoh "oklch\([^)]*\)|hsl\([^)]*\)|rgb\([^)]*\)" src/ styles/ --include="*.css" --include="*.scss" 2>/dev/null | sort | uniq -c | sort -rn | head -20
212
+
213
+ # CSS custom properties (color tokens)
214
+ grep -rEoh "\-\-[a-z][a-z0-9\-]*color[a-z0-9\-]*:\s*[^;]*|\-\-color[a-z0-9\-]*:\s*[^;]*" src/ styles/ --include="*.css" --include="*.scss" 2>/dev/null | sort | uniq | head -30
215
+
216
+ # Tailwind color config
217
+ grep -A 100 '"colors"' tailwind.config.* 2>/dev/null | head -50
218
+ ```
219
+
220
+ **Analyze the color data:**
221
+
222
+ 1. How many unique colors? (< 10 = disciplined, 10–25 = moderate, > 25 = ad-hoc)
223
+ 2. Is there a token layer (CSS custom properties)? Or raw hex in components?
224
+ 3. Does the palette contain AI-slop colors? (#6366f1, #8b5cf6, #06b6d4)
225
+ 4. Are there semantic roles evident from naming? (`--color-primary`, `--color-danger`)
226
+ 5. Is pure black (#000000) used in dark mode?
227
+
228
+ Produce a color inventory table:
229
+ ```
230
+ | Color | Occurrences | Role (inferred) | Issues |
231
+ ```
232
+
233
+ ---
234
+
235
+ ## Step 2A — Figma Token Augmentation
236
+
237
+ **Skip this step if `figma` is `not_configured` or `unavailable` in `.design/STATE.md` `<connections>`.** Fall back to the grep-based token extraction from Step 2 alone — no error, no warning. Scan continues normally.
238
+
239
+ ### If `figma: available`
240
+
241
+ Call `mcp__figma-desktop__get_variable_defs` (no arguments — returns all variables in the active Figma file).
242
+
243
+ > If no Figma file is open, the call errors. Treat any error as a graceful skip: update STATE.md `<connections>` to `figma: unavailable` and continue with Step 2 results only.
244
+
245
+ **For each variable returned, apply the following translation:**
246
+
247
+ | Variable type | Name pattern | Output |
248
+ |---------------|--------------|--------|
249
+ | `COLOR` | any | Add row to color inventory table |
250
+ | `FLOAT` | `spacing/*` | Add row to spacing system |
251
+ | `FLOAT` | `font-size/*` or `typography/*` | Add row to typography system |
252
+
253
+ Record both the variable **NAME** and resolved value — not just the value. `get_variable_defs` returns resolved values only (no alias chains); the name often carries semantic meaning the value cannot.
254
+
255
+ **Multi-mode (Light/Dark):** when `valuesByMode` has multiple entries, extract all values and note dark-mode existence in the DESIGN.md color section.
256
+
257
+ ### Merge, don't replace
258
+
259
+ Keep grep-derived tokens from Step 2 AND Figma tokens. Both sets appear in DESIGN.md:
260
+
261
+ - **Figma-only tokens** (in Figma, not in CSS): annotate as "design intention not yet implemented"
262
+ - **Code-only tokens** (in CSS, not in Figma): annotate as "implementation drift or local override"
263
+ - **Matching tokens**: show Figma value alongside CSS value; flag any discrepancy
264
+
265
+ ### DESIGN.md annotations required
266
+
267
+ When this step runs successfully:
268
+
269
+ 1. Change the token layer section header from "CSS custom properties" to "CSS custom properties + Figma variables"
270
+ 2. Add to DESIGN.md frontmatter:
271
+ - `figma_variables_used: true`
272
+ - `figma_source: [list of collection names returned by get_variable_defs]`
273
+
274
+ ### Caveats
275
+
276
+ - `get_variable_defs` returns **resolved values only** — no alias chains. Always record the variable NAME alongside the value; the name carries semantic meaning not present in the hex/float alone.
277
+ - **Multi-mode:** when Light and Dark mode values differ, record both. Note dark-mode variable presence in the DESIGN.md color section.
278
+ - **No file open:** if `get_variable_defs` errors (most commonly because no Figma file is open), skip this step entirely and update STATE.md `<connections>` to `figma: unavailable`. Do not error the scan stage.
279
+
280
+ ---
281
+
282
+ ## Step 3 — Extract Typography System
283
+
284
+ ```bash
285
+ # Font families
286
+ grep -rEoh "font-family:\s*[^;]*|fontFamily:\s*[^,}]*" src/ styles/ --include="*.css" --include="*.scss" --include="*.ts" --include="*.tsx" 2>/dev/null | sort | uniq -c | sort -rn | head -20
287
+
288
+ # Font sizes
289
+ grep -rEoh "font-size:\s*[0-9.]*\(rem|px|em\)|text-(xs|sm|base|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl)" src/ styles/ --include="*.css" --include="*.scss" --include="*.tsx" --include="*.jsx" 2>/dev/null | sort | uniq -c | sort -rn | head -30
290
+
291
+ # Font weights
292
+ grep -rEoh "font-weight:\s*[0-9]*|fw-[0-9]*|font-(thin|light|normal|medium|semibold|bold|extrabold|black)" src/ styles/ --include="*.css" --include="*.scss" --include="*.tsx" 2>/dev/null | sort | uniq -c | sort -rn | head -20
293
+
294
+ # Line heights
295
+ grep -rEoh "line-height:\s*[0-9.]*|leading-[a-z0-9]*" src/ styles/ --include="*.css" --include="*.scss" --include="*.tsx" 2>/dev/null | sort | uniq -c | sort -rn | head -15
296
+ ```
297
+
298
+ **Analyze:**
299
+
300
+ 1. How many font families? (> 2 = violation unless one is monospace)
301
+ 2. Are font sizes from a defined scale or arbitrary px?
302
+ 3. Map found sizes to nearest modular scale — identify outliers
303
+ 4. Are weights following hierarchy? (body 400, headings 600-700, never 300 on small text)
304
+ 5. Line-height on body text — is it 1.5–1.75?
305
+ 6. Any of the reflex fonts without apparent brand reason? (Inter, DM Sans, Space Grotesk, Plus Jakarta Sans)
306
+
307
+ Read `${CLAUDE_PLUGIN_ROOT}/reference/typography.md` for comparison criteria.
308
+
309
+ Produce a typography inventory table.
310
+
311
+ ---
312
+
313
+ ## Step 4 — Extract Spacing System
314
+
315
+ ```bash
316
+ # All CSS spacing values
317
+ grep -rEoh "padding:\s*[0-9]*px|margin:\s*[0-9]*px|gap:\s*[0-9]*px" src/ styles/ --include="*.css" --include="*.scss" 2>/dev/null | grep -oh "[0-9]*px" | sort -n | uniq -c | sort -rn | head -20
318
+
319
+ # Tailwind spacing overrides
320
+ grep -A 30 '"spacing"' tailwind.config.* 2>/dev/null | head -35
321
+
322
+ # Space tokens
323
+ grep -rEoh "\-\-space[a-z0-9\-]*:\s*[^;]*|\-\-spacing[a-z0-9\-]*:\s*[^;]*" src/ styles/ --include="*.css" 2>/dev/null | head -20
324
+ ```
325
+
326
+ **Analyze:**
327
+
328
+ Grid compliance: are spacing values in the 4/8/12/16/24/32/48/64 series? Flag any values not in this set (e.g., 13px, 22px, 37px are off-grid).
329
+
330
+ ---
331
+
332
+ ## Step 5 — Anti-Pattern Audit
333
+
334
+ Read `${CLAUDE_PLUGIN_ROOT}/reference/anti-patterns.md`. Run all grep commands.
335
+
336
+ ```bash
337
+ # BAN violations (−3 each from Anti-Pattern score)
338
+ echo "=== BAN-01: Side-stripe borders ===" && grep -rEn "border-left:\s*[2-9][0-9]*px|border-right:\s*[2-9][0-9]*px" src/ --include="*.css" --include="*.scss" --include="*.tsx" 2>/dev/null
339
+ echo "=== BAN-02: Gradient text ===" && grep -rEn "background-clip:\s*text|text-fill-color:\s*transparent" src/ 2>/dev/null
340
+ echo "=== BAN-03: Bounce easing ===" && grep -rEn "cubic-bezier\(.*-[0-9]|bounce|elastic" src/ --include="*.css" --include="*.scss" 2>/dev/null
341
+ echo "=== BAN-08: transition: all ===" && grep -rnE "transition:[[:space:]]*all([^a-zA-Z]|$)" src/ --include="*.css" --include="*.scss" --include="*.tsx" 2>/dev/null | head -10
342
+ echo "=== BAN-05: Pure black dark mode ===" && grep -rEn "#000000\b|rgb\(0,\s*0,\s*0\)" src/ --include="*.css" --include="*.scss" 2>/dev/null | head -5
343
+ echo "=== BAN-06: Disable zoom ===" && grep -rEn "user-scalable=no|maximum-scale=1" public/ src/ 2>/dev/null
344
+ echo "=== BAN-07: outline:none without replacement ===" && grep -rnE ":focus[[:space:]]*\{" src/ --include="*.css" --include="*.scss" 2>/dev/null | head -5
345
+
346
+ # SLOP signals (−1 each)
347
+ echo "=== SLOP-01: AI palette ===" && grep -rEn "#6366f1|#8b5cf6|#06b6d4" src/ 2>/dev/null | head -5
348
+ echo "=== SLOP-04: backdrop-filter ===" && grep -rnE "backdrop-filter:[[:space:]]*blur" src/ --include="*.css" --include="*.scss" 2>/dev/null | head -5
349
+
350
+ # Accessibility
351
+ echo "=== A11Y: focus rings ===" && grep -rEn "outline:\s*none|outline:\s*0" src/ --include="*.css" --include="*.scss" 2>/dev/null | head -5
352
+ echo "=== A11Y: reduced motion ===" && grep -rn "prefers-reduced-motion" src/ --include="*.css" --include="*.scss" 2>/dev/null | head -3
353
+ echo "=== A11Y: div onClick ===" && grep -rEn "onClick.*div|<div.*onClick" src/ --include="*.tsx" --include="*.jsx" 2>/dev/null | head -5
354
+ echo "=== A11Y: small font ===" && grep -rEn "font-size:\s*1[0-5]px|font-size:\s*[0-9]px" src/ --include="*.css" --include="*.scss" 2>/dev/null | head -5
355
+ ```
356
+
357
+ For each finding: record the count, a sample file:line, and severity (BAN = P0, SLOP = P1, A11Y = P0–P1 depending on type).
358
+
359
+ ---
360
+
361
+ ## Step 6 — Component Inventory
362
+
363
+ If `--quick`, skip this step.
364
+
365
+ ### Component pattern indicators
366
+
367
+ A bare `grep -rln "className" src/` produces false positives on type-only files, test files, utility helpers, and server-only modules — none of which are components. Instead, use a three-pass multi-signal filter. A file qualifies as a component only when **all three indicators** match:
368
+
369
+ 1. Has a JSX-like return: `grep -lE "return\s*\(" <file>`
370
+ 2. Has className or class attribute usage: `grep -lE "className=|class=" <file>`
371
+ 3. Has a component framework import: `grep -lE "from ['\"](react|preact|vue)" <file>`
372
+
373
+ ```bash
374
+ # Component inventory — three-pass filter (requires all three signals)
375
+
376
+ # Pass 1: files with JSX-like return statements
377
+ grep -rlE "return\s*\(" src/ --include="*.tsx" --include="*.jsx" 2>/dev/null \
378
+ | grep -vE "\.test\.|\.spec\.|\.stories\." > /tmp/scan-pass1.txt
379
+
380
+ # Pass 2: intersect with className/class presence
381
+ grep -lE "className=|class=" $(cat /tmp/scan-pass1.txt) 2>/dev/null > /tmp/scan-pass2.txt
382
+
383
+ # Pass 3: intersect with framework import (react, preact, or vue)
384
+ grep -lE "from ['\"](react|preact|vue)" $(cat /tmp/scan-pass2.txt) 2>/dev/null > /tmp/components.txt
385
+
386
+ # Count and list
387
+ wc -l < /tmp/components.txt
388
+ cat /tmp/components.txt
389
+ ```
390
+
391
+ This produces a component inventory that excludes false positives. The resulting file list is the authoritative component set for the rest of this step.
392
+
393
+ ```bash
394
+ # Count components by directory (from the filtered list)
395
+ xargs dirname < /tmp/components.txt | sort | uniq -c | sort -rn | head -20
396
+
397
+ # Look for design system component patterns
398
+ grep -rEln "Button|Modal|Dialog|Toast|Tooltip|Badge|Card|Input|Select|Dropdown|Table|Tab|Accordion" \
399
+ $(cat /tmp/components.txt) 2>/dev/null | grep -v node_modules | head -20
400
+ ```
401
+
402
+ Identify:
403
+ - Core UI primitives that exist (Button, Input, Modal, etc.)
404
+ - Which have design system-level implementation vs. one-off styles
405
+ - Which are candidates for design system extraction
406
+
407
+ ### --full mode per-file output
408
+
409
+ If `--full` flag is set, emit one row per file in the component inventory:
410
+
411
+ | File | Component Count | Styling Approach | Token Usage | Issues |
412
+ |------|-----------------|------------------|-------------|--------|
413
+ | src/components/Button.tsx | 1 | Tailwind | var(--primary), p-4, gap-2 | heading weight dup |
414
+ | src/components/Card.tsx | 1 | CSS Module | styles.card, rgb(...) | hardcoded color |
415
+
416
+ Columns:
417
+ - **File**: relative path from repo root
418
+ - **Component Count**: number of exported components in file (grep `export.*function\|export.*const.*=.*\(.*=>`)
419
+ - **Styling Approach**: `Tailwind` | `CSS Module` | `styled-components` | `inline` | `mixed`
420
+ - **Token Usage**: comma-separated tokens/values found (max 5, "+N more" if there are more)
421
+ - **Issues**: short flags for known problems (e.g., `hardcoded color`, `off-grid spacing`, `heading weight dup`)
422
+
423
+ Without `--full`, the component inventory is a summary count only (not per-file).
424
+
425
+ ---
426
+
427
+ ## Step 7 — Score All 7 Categories
428
+
429
+ Read `${CLAUDE_PLUGIN_ROOT}/reference/audit-scoring.md`. Score each category 0–10 based on what you found in Steps 1–6.
430
+
431
+ Apply the weighted formula:
432
+ ```
433
+ Score = (Accessibility × 0.25) + (Visual Hierarchy × 0.20) + (Typography × 0.15)
434
+ + (Color × 0.15) + (Layout × 0.10) + (Anti-Patterns × 0.10) + (Motion × 0.05)
435
+ ```
436
+
437
+ Calculate grade (A=90–100, B=75–89, C=60–74, D=45–59, F=0–44).
438
+
439
+ ---
440
+
441
+ ## Step 8 — Generate Design Debt Roadmap
442
+
443
+ Collect all findings from Steps 1–6. Classify each:
444
+
445
+ | Severity | Code | Rule |
446
+ |---|---|---|
447
+ | Blocker | P0 | BAN violations, contrast failures, keyboard nav broken |
448
+ | Major | P1 | SLOP signals, no token layer, off-grid spacing, no scale system |
449
+ | Minor | P2 | Reflex font without reason, inconsistent weights, redundant colors |
450
+ | Cosmetic | P3 | Polish items, minor naming inconsistencies |
451
+
452
+ Group into **debt themes**:
453
+
454
+ 1. **Foundation** — token layer, design system architecture
455
+ 2. **Typography** — scale, hierarchy, families
456
+ 3. **Color** — palette, semantics, dark mode
457
+ 4. **Accessibility** — contrast, focus, semantics, motion
458
+ 5. **Anti-Patterns** — BAN + SLOP removals
459
+ 6. **Components** — inconsistency, missing primitives
460
+ 7. **Motion** — easing, duration, reduced-motion
461
+
462
+ For each debt item, estimate effort:
463
+ - `XS` — single-line grep-and-replace (< 30 min)
464
+ - `S` — localized fix in 1–3 files (< 2h)
465
+ - `M` — affects 5–15 files, requires testing (2–8h)
466
+ - `L` — architectural change, touches 15+ files (1–3 days)
467
+ - `XL` — design system rebuild (3+ days)
468
+
469
+ ### Priority score for ordering DESIGN-DEBT.md entries
470
+
471
+ Each debt item gets three scores:
472
+
473
+ - **severity_weight**: `{ P0: 4, P1: 3, P2: 2, P3: 1 }`
474
+ - **effort_weight**: `{ XS: 5, S: 4, M: 3, L: 2, XL: 1 }` — high effort = lower priority
475
+ - **dependency_depth**: count of other debt items this fix unblocks
476
+
477
+ Formula:
478
+
479
+ ```
480
+ priority_score = (severity_weight × effort_weight) + (dependency_depth × 2)
481
+ ```
482
+
483
+ Ordering rules:
484
+ 1. Sort entries by `priority_score` descending (highest first)
485
+ 2. Tiebreak: file count descending (more files affected = more impact)
486
+ 3. Second tiebreak: alphabetical by item ID (D-001 before D-002)
487
+
488
+ Example: A P1 issue (`severity_weight = 3`) with S effort (`effort_weight = 4`) that unblocks 2 other items (`dependency_depth = 2`) scores: `(3 × 4) + (2 × 2) = 16`. A P0 issue (`4`) with XL effort (`1`) with no dependencies scores: `(4 × 1) + 0 = 4`. The P1 ranks above the P0 despite lower severity because its XL effort makes the P0 low ROI.
489
+
490
+ Identify **quick wins**: P1 issues with XS/S effort — these have the best ROI.
491
+ Identify **blocking dependencies**: fixes that must happen before others (e.g., token layer before dark mode).
492
+
493
+ ---
494
+
495
+ ## Output 1: DESIGN.md
496
+
497
+ Write `DESIGN.md` at the project root:
498
+
499
+ ```markdown
500
+ ---
501
+ generated: [ISO 8601]
502
+ tool: get-design-done scan
503
+ score: [N]/100 ([grade])
504
+ framework: [name]
505
+ css_approach: [tailwind | css-modules | styled-components | plain-css | mixed]
506
+ token_layer: true | false
507
+ ---
508
+
509
+ # Design System Snapshot — [Project Name]
510
+
511
+ > Auto-generated by get-design-done scan. Update manually when the system evolves.
512
+
513
+ ## Current Score
514
+
515
+ | Category | Score | Grade |
516
+ |---|---|---|
517
+ | Accessibility | [N]/10 | |
518
+ | Visual Hierarchy | [N]/10 | |
519
+ | Typography | [N]/10 | |
520
+ | Color | [N]/10 | |
521
+ | Layout & Spacing | [N]/10 | |
522
+ | Anti-Patterns | [N]/10 | |
523
+ | Motion | [N]/10 | |
524
+ | **Weighted Total** | **[N]/100** | **[grade]** |
525
+
526
+ ## Color System
527
+
528
+ **Token layer:** [Yes — CSS custom properties / No — raw values in components]
529
+
530
+ **Palette inventory:**
531
+ | Color | Hex | Role | Occurrences | Issues |
532
+ |---|---|---|---|---|
533
+ | Primary | #[hex] | [inferred role] | [N] | [any issues] |
534
+
535
+ **Semantic consistency:** [Pass / Fail — describe]
536
+ **Dark mode:** [Yes / No / Partial] — [pure black: yes/no]
537
+ **AI-slop palette present:** [Yes (#6366f1 etc.) / No]
538
+
539
+ ## Typography System
540
+
541
+ **Families used:** [family 1], [family 2]
542
+ **Scale:** [defined modular scale / ad-hoc px values / Tailwind defaults]
543
+
544
+ | Token | Size | Found occurrences | Scale-compliant |
545
+ |---|---|---|---|
546
+ | body | [Npx] | [N] | [✓/✗] |
547
+ | sm | [Npx] | [N] | [✓/✗] |
548
+
549
+ **Line-height body:** [value] ([pass ≥1.5 / fail])
550
+ **Weight hierarchy:** [described]
551
+ **Off-scale values found:** [list any non-standard sizes]
552
+
553
+ ## Spacing System
554
+
555
+ **Grid:** [8pt / 4pt / ad-hoc / Tailwind defaults]
556
+ **Non-grid values found:** [list off-grid values with occurrence count]
557
+
558
+ ## Component Inventory
559
+
560
+ **Total components:** [N]
561
+ **With consistent styling:** [N] (~[N]%)
562
+ **Core primitives present:** [Button ✓, Input ✓, Modal ✗, Toast ✗, ...]
563
+
564
+ ## Anti-Pattern Status
565
+
566
+ | Pattern | Status | Occurrences | Locations |
567
+ |---|---|---|---|
568
+ | BAN-01: Side-stripe border | [✓ Clear / ✗ Found] | [N] | [file:line] |
569
+ | BAN-02: Gradient text | [✓ Clear / ✗ Found] | [N] | |
570
+ | BAN-03: Bounce easing | [✓ Clear / ✗ Found] | [N] | |
571
+ | BAN-07: outline:none | [✓ Clear / ✗ Found] | [N] | |
572
+ | BAN-08: transition:all | [✓ Clear / ✗ Found] | [N] | |
573
+ | SLOP-01: AI palette | [✓ Clear / ✗ Found] | [N] | |
574
+ | SLOP-04: backdrop-filter | [✓ Clear / ✗ Found] | [N] | |
575
+
576
+ ## Motion / Animation
577
+
578
+ **prefers-reduced-motion:** [Implemented / Missing]
579
+ **Easing used:** [list found easing values]
580
+ **Bounce/elastic:** [Found / None]
581
+ ```
582
+
583
+ ---
584
+
585
+ ## Output 2: .design/DESIGN-DEBT.md
586
+
587
+ Create `.design/` if needed. Write `.design/DESIGN-DEBT.md`:
588
+
589
+ ```markdown
590
+ ---
591
+ generated: [ISO 8601]
592
+ score: [N]/100 ([grade])
593
+ p0_count: [N]
594
+ p1_count: [N]
595
+ p2_count: [N]
596
+ p3_count: [N]
597
+ ---
598
+
599
+ # Design Debt — [Project Name]
600
+
601
+ > Prioritized roadmap of design issues found by get-design-done scan.
602
+ > Fix P0s before shipping. Work through P1s in priority order.
603
+ > Quick wins (P1 + XS/S effort) are marked ⚡.
604
+
605
+ ## Summary
606
+
607
+ | Severity | Count | Est. Total Effort |
608
+ |---|---|---|
609
+ | P0 Blocker | [N] | [sum of estimates] |
610
+ | P1 Major | [N] | [sum] |
611
+ | P2 Minor | [N] | [sum] |
612
+ | P3 Cosmetic | [N] | [sum] |
613
+
614
+ **Category score to improve first:** [lowest-scoring category] ([N]/10) — highest impact on overall score.
615
+
616
+ ---
617
+
618
+ ## P0 — Blockers (fix before shipping)
619
+
620
+ ### D-001 — [Issue title]
621
+ Category: [scoring category]
622
+ Theme: [foundation | typography | color | accessibility | anti-patterns | components | motion]
623
+ Severity: [P0/P1/P2/P3]
624
+ Effort: [XS/S/M/L/XL]
625
+ priority_score: [computed: (severity_weight × effort_weight) + (dependency_depth × 2)]
626
+ Description: [What the issue is and where it was found]
627
+ Evidence: [file:line or grep pattern that found it]
628
+ Fix: [Concrete steps to fix — specific enough to execute without extra research]
629
+ Acceptance: [What pass looks like — verifiable]
630
+ Depends on: [D-XXX if this fix requires another fix first, else "none"]
631
+ Dependency depth: [N — count of items this fix unblocks]
632
+
633
+ ---
634
+
635
+ ## P1 — Major (fix in current design pass)
636
+
637
+ ### D-010 — [Issue title] ⚡
638
+ Category: [category]
639
+ Theme: [theme]
640
+ Severity: P1
641
+ Effort: XS
642
+ priority_score: [computed: (3 × 5) + (dependency_depth × 2) = 15+]
643
+ Description: [...]
644
+ Evidence: [...]
645
+ Fix: [...]
646
+ Acceptance: [...]
647
+ Dependency depth: [N]
648
+
649
+ ---
650
+
651
+ ## P2 — Minor (fix if time allows)
652
+
653
+ [same structure]
654
+
655
+ ---
656
+
657
+ ## P3 — Cosmetic (deferred to polish pass)
658
+
659
+ [same structure]
660
+
661
+ ---
662
+
663
+ ## Recommended Fix Order
664
+
665
+ Based on dependencies and ROI:
666
+
667
+ 1. **[D-XXX]** — [title] (unblocks [D-XXX, D-XXX])
668
+ 2. **[D-XXX]** — ⚡ quick win
669
+ 3. **[D-XXX]** — [title]
670
+ ...
671
+
672
+ ## Pipeline Recommendation
673
+
674
+ Given the scan results:
675
+
676
+ ```
677
+ Suggested first pipeline run:
678
+ /get-design-done:discover --auto
679
+ → Will use DESIGN.md as baseline context
680
+ /get-design-done:plan
681
+ → Scope: address all P0s + top 5 P1s
682
+ /get-design-done:design
683
+ /get-design-done:verify
684
+ → Target score: [current + 15 points minimum]
685
+ ```
686
+
687
+ Focus areas for first design pass:
688
+ 1. [highest-impact category]: [specific what to fix]
689
+ 2. [second-highest-impact]: [specific what to fix]
690
+ 3. Quick wins: [D-XXX], [D-XXX], [D-XXX] (all XS effort, instant score gain)
691
+ ```
692
+
693
+ ---
694
+
695
+ ## After Writing
696
+
697
+ ```
698
+ ━━━ Scan complete ━━━
699
+ Project: [name]
700
+ Score: [N]/100 ([grade])
701
+ P0 blockers: [N]
702
+ P1 major: [N]
703
+ Quick wins: [N] (P1 + XS/S effort)
704
+
705
+ Artifacts written:
706
+ DESIGN.md — design system snapshot
707
+ .design/DESIGN-DEBT.md — prioritized debt roadmap
708
+
709
+ Next steps:
710
+ Option A — Start the pipeline:
711
+ /get-design-done:discover
712
+ (DESIGN.md will be used as baseline context)
713
+
714
+ Option B — Fix quick wins first, then start:
715
+ [list top 3 quick win fixes inline]
716
+ Then: /get-design-done:discover
717
+
718
+ Option C — Just reference the debt:
719
+ DESIGN-DEBT.md is your backlog. Filter by theme or severity.
720
+ ━━━━━━━━━━━━━━━━━━━━━
721
+ ```