@hegemonart/get-design-done 1.28.0 → 1.28.6

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 (98) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +134 -0
  4. package/SKILL.md +1 -1
  5. package/hooks/gdd-decision-injector.js +149 -3
  6. package/package.json +1 -1
  7. package/reference/adr-format.md +96 -0
  8. package/reference/architecture-vocabulary.md +102 -0
  9. package/reference/context-md-format.md +106 -0
  10. package/reference/heuristics.md +84 -0
  11. package/reference/registry.json +29 -1
  12. package/reference/registry.schema.json +1 -1
  13. package/reference/shared-preamble.md +78 -6
  14. package/reference/skill-authoring-contract.md +159 -0
  15. package/scripts/validate-skill-length.cjs +283 -0
  16. package/skills/add-backlog/SKILL.md +1 -0
  17. package/skills/analyze-dependencies/SKILL.md +33 -122
  18. package/skills/apply-reflections/SKILL.md +1 -40
  19. package/skills/apply-reflections/apply-reflections-procedure.md +68 -0
  20. package/skills/audit/SKILL.md +3 -1
  21. package/skills/bandit-status/SKILL.md +31 -66
  22. package/skills/benchmark/SKILL.md +15 -55
  23. package/skills/brief/SKILL.md +12 -1
  24. package/skills/cache-manager/SKILL.md +3 -57
  25. package/skills/cache-manager/cache-policy.md +126 -0
  26. package/skills/check-update/SKILL.md +38 -75
  27. package/skills/compare/SKILL.md +29 -269
  28. package/skills/compare/compare-rubric.md +171 -0
  29. package/skills/complete-cycle/SKILL.md +1 -1
  30. package/skills/connections/SKILL.md +21 -427
  31. package/skills/connections/connections-onboarding.md +417 -0
  32. package/skills/continue/SKILL.md +1 -0
  33. package/skills/darkmode/SKILL.md +32 -287
  34. package/skills/darkmode/darkmode-audit-procedure.md +258 -0
  35. package/skills/debug/SKILL.md +11 -8
  36. package/skills/debug/debug-feedback-loops.md +119 -0
  37. package/skills/design/SKILL.md +27 -245
  38. package/skills/design/design-procedure.md +304 -0
  39. package/skills/discover/SKILL.md +26 -133
  40. package/skills/discover/discover-procedure.md +204 -0
  41. package/skills/discuss/SKILL.md +18 -2
  42. package/skills/explore/SKILL.md +40 -205
  43. package/skills/explore/explore-procedure.md +267 -0
  44. package/skills/fast/SKILL.md +1 -0
  45. package/skills/figma-write/SKILL.md +2 -2
  46. package/skills/health/SKILL.md +11 -33
  47. package/skills/health/health-mcp-detection.md +44 -0
  48. package/skills/health/health-skill-length-report.md +69 -0
  49. package/skills/help/SKILL.md +1 -0
  50. package/skills/list-assumptions/SKILL.md +1 -0
  51. package/skills/map/SKILL.md +8 -31
  52. package/skills/new-cycle/SKILL.md +3 -1
  53. package/skills/new-cycle/milestone-completeness-rubric.md +87 -0
  54. package/skills/next/SKILL.md +1 -0
  55. package/skills/note/SKILL.md +1 -0
  56. package/skills/optimize/SKILL.md +21 -44
  57. package/skills/pause/SKILL.md +1 -0
  58. package/skills/peer-cli-add/SKILL.md +26 -108
  59. package/skills/peer-cli-add/peer-cli-protocol.md +161 -0
  60. package/skills/peer-cli-customize/SKILL.md +22 -42
  61. package/skills/peers/SKILL.md +33 -57
  62. package/skills/plan/SKILL.md +33 -220
  63. package/skills/plan/plan-procedure.md +278 -0
  64. package/skills/plant-seed/SKILL.md +1 -0
  65. package/skills/pr-branch/SKILL.md +1 -0
  66. package/skills/progress/SKILL.md +1 -7
  67. package/skills/quality-gate/SKILL.md +34 -166
  68. package/skills/quality-gate/threat-modeling.md +101 -0
  69. package/skills/quick/SKILL.md +1 -0
  70. package/skills/reapply-patches/SKILL.md +1 -0
  71. package/skills/recall/SKILL.md +1 -0
  72. package/skills/resume/SKILL.md +1 -0
  73. package/skills/review-backlog/SKILL.md +1 -0
  74. package/skills/router/SKILL.md +3 -59
  75. package/skills/router/router-rules.md +84 -0
  76. package/skills/scan/SKILL.md +36 -675
  77. package/skills/scan/scan-procedure.md +731 -0
  78. package/skills/settings/SKILL.md +1 -0
  79. package/skills/ship/SKILL.md +1 -0
  80. package/skills/sketch/SKILL.md +1 -1
  81. package/skills/sketch-wrap-up/SKILL.md +13 -54
  82. package/skills/spike/SKILL.md +1 -1
  83. package/skills/spike-wrap-up/SKILL.md +12 -46
  84. package/skills/start/SKILL.md +13 -112
  85. package/skills/start/start-procedure.md +115 -0
  86. package/skills/stats/SKILL.md +1 -0
  87. package/skills/style/SKILL.md +18 -140
  88. package/skills/style/style-doc-procedure.md +150 -0
  89. package/skills/synthesize/SKILL.md +1 -0
  90. package/skills/timeline/SKILL.md +1 -0
  91. package/skills/todo/SKILL.md +1 -0
  92. package/skills/turn-closeout/SKILL.md +36 -56
  93. package/skills/undo/SKILL.md +1 -0
  94. package/skills/update/SKILL.md +1 -0
  95. package/skills/verify/SKILL.md +42 -457
  96. package/skills/verify/verify-procedure.md +512 -0
  97. package/skills/warm-cache/SKILL.md +3 -35
  98. package/skills/zoom-out/SKILL.md +26 -0
@@ -1,13 +1,15 @@
1
1
  ---
2
2
  name: get-design-done:darkmode
3
- description: "Audit dark mode implementation. Detects architecture (CSS custom props, Tailwind dark:, JS class toggle), checks contrast, semantic token overrides, dark-specific anti-patterns, and color-scheme meta property. Writes .design/DARKMODE-AUDIT.md (read-only — no score writeback to DESIGN.md)."
3
+ description: "Audit a project's dark mode implementation detects architecture (CSS custom props, Tailwind `dark:` prefix, or JS class toggle), runs architecture-specific contrast / token-override / anti-pattern / meta-property checks, and writes a prioritized fix list to `.design/DARKMODE-AUDIT.md`. Use when the user wants to verify dark mode quality without re-running the full design pipeline. Read-only — no score writeback to `DESIGN.md`."
4
4
  argument-hint: ""
5
5
  user-invocable: true
6
6
  ---
7
7
 
8
8
  # get-design-done:darkmode — Dark Mode Audit
9
9
 
10
- Standalone dark mode audit command. It detects the project's dark mode architecture, runs architecture-specific checks across contrast, token completeness, anti-patterns, and meta properties, then writes a prioritized fix list to `.design/DARKMODE-AUDIT.md`.
10
+ Standalone dark mode audit. Detects the project's dark mode architecture, runs architecture-specific checks across contrast, token completeness, anti-patterns, and meta properties, then writes a prioritized fix list to `.design/DARKMODE-AUDIT.md`.
11
+
12
+ For the full step-by-step methodology (architecture-detection greps, WCAG contrast formula, anti-pattern grep snippets, meta-property checks, screenshot capture, and `DARKMODE-AUDIT.md` template), see `./darkmode-audit-procedure.md`. For the perceptual-contrast layer (APCA / WCAG 3 draft) sitting on top of WCAG 2.1 ratios, see `../../reference/contrast-advanced.md`. For OKLCH-based dark token-pair generation, see `../../reference/color-theory.md` §OKLCH. For the cross-skill output discipline + connection-probe pattern, see `../../reference/shared-preamble.md#output-contract-reminders` and `../../reference/shared-preamble.md#connection-handshake-summary`.
11
13
 
12
14
  ---
13
15
 
@@ -15,317 +17,60 @@ Standalone dark mode audit command. It detects the project's dark mode architect
15
17
 
16
18
  This command is a **standalone audit** — not a pipeline stage:
17
19
 
18
- - It does NOT update DESIGN.md scores (V2-05 deferred — two-sources-of-truth risk).
19
- - It does NOT invoke design-auditor (Pitfall 4 — darkmode runs its own inline audit, separate from the DESIGN-AUDIT.md pipeline).
20
- - It does NOT write to `.design/STATE.md`, `DESIGN-CONTEXT.md`, `DESIGN-PLAN.md`, `DESIGN-SUMMARY.md`, or `DESIGN-VERIFICATION.md`.
21
- - It writes exactly ONE artifact: `.design/DARKMODE-AUDIT.md`.
22
- - It does NOT execute fixes — audit-only per V2-07 deferral (fixes belong in the design skill's color task).
20
+ - Does NOT update `DESIGN.md` scores (V2-05 deferred — two-sources-of-truth risk).
21
+ - Does NOT invoke `design-auditor` (Pitfall 4 — darkmode runs its own inline audit, separate from the `DESIGN-AUDIT.md` pipeline).
22
+ - Does NOT write to `.design/STATE.md`, `DESIGN-CONTEXT.md`, `DESIGN-PLAN.md`, `DESIGN-SUMMARY.md`, or `DESIGN-VERIFICATION.md`.
23
+ - Writes exactly ONE artifact: `.design/DARKMODE-AUDIT.md`.
24
+ - Does NOT execute fixes — audit-only per V2-07 deferral (fixes belong in the design pipeline's color task).
23
25
 
24
- Output artifact prefix is `DARKMODE-AUDIT` distinct from the pipeline namespace (`DESIGN-*.md`). No naming conflict.
26
+ Output artifact prefix `DARKMODE-AUDIT` is distinct from the pipeline namespace (`DESIGN-*.md`). No naming conflict.
25
27
 
26
28
  ---
27
29
 
28
30
  ## Pre-Flight
29
31
 
30
- Confirm source root exists before scanning. Try each candidate in order:
31
-
32
- 1. `src/` — preferred (most React/Vue/Svelte projects)
33
- 2. `app/` — Next.js App Router
34
- 3. `lib/` — library projects
35
- 4. `pages/` — Next.js Pages Router
36
-
37
- Set `SRC_ROOT` to the first directory that exists. If none exist, abort:
38
-
39
- > "No source directory detected. Run /get-design-done scan first."
40
-
41
- Confirm `.design/` exists (create it if absent — `mkdir -p .design/`).
42
-
43
- ### Probe Preview connection
44
-
45
- Run at stage entry, after pre-flight checks:
46
-
47
- ```
48
- Step P1 — ToolSearch check:
49
- ToolSearch({ query: "Claude_Preview", max_results: 5 })
50
- → Empty result → preview: not_configured (skip Dark Mode Rendering section)
51
- → Non-empty result → proceed to Step P2
52
-
53
- Step P2 — Live tool call:
54
- call mcp__Claude_Preview__preview_list
55
- → Success → preview: available
56
- → Error → preview: unavailable
57
-
58
- Write preview status to .design/STATE.md <connections>.
59
- ```
60
-
61
- ---
62
-
63
- ## Step 1: Architecture Detection (DARK-02)
64
-
65
- Run all three architecture greps against `$SRC_ROOT`. Use `2>/dev/null` on each to suppress missing-directory errors.
66
-
67
- ```bash
68
- # Architecture 1: CSS custom properties with dark media query
69
- arch1_count=$(grep -rEn "prefers-color-scheme.*dark|\.dark[[:space:]]*\{" "$SRC_ROOT" \
70
- --include="*.css" --include="*.scss" 2>/dev/null | wc -l)
71
-
72
- # Architecture 2: Tailwind dark: prefix
73
- arch2_count=$(grep -rEn "dark:[a-z]" "$SRC_ROOT" \
74
- --include="*.tsx" --include="*.jsx" --include="*.html" 2>/dev/null | wc -l)
75
-
76
- # Architecture 3: JS class toggle on <html> / <body>
77
- arch3_count=$(grep -rEn "classList.*dark|setAttribute.*dark|document\.documentElement" "$SRC_ROOT" \
78
- --include="*.ts" --include="*.tsx" --include="*.js" 2>/dev/null | wc -l)
79
- ```
80
-
81
- **Classification rules:**
82
-
83
- | Condition | Classification |
84
- |-----------|---------------|
85
- | All three counts < 3 | No dark mode — abort: "No dark mode implementation detected — nothing to audit." |
86
- | Exactly one count ≥ 3 | Primary architecture = that one |
87
- | Two or more counts ≥ 5 | Hybrid (list all detected architectures) |
88
- | One count ≥ 3, others < 5 | Primary = highest count |
89
-
90
- Record `ARCH_DETECTED` as one of: `Architecture 1 (CSS custom props)`, `Architecture 2 (Tailwind dark:)`, `Architecture 3 (JS class toggle)`, or `Hybrid`.
91
-
92
- ---
93
-
94
- ## Step 2: Contrast Audit (DARK-03)
95
-
96
- For the detected architecture, enumerate color token + background token pairs used in dark context, then compute WCAG contrast ratios.
97
-
98
- **Token extraction by architecture:**
99
-
100
- **Architecture 1 (CSS custom props):**
101
- ```bash
102
- # Extract dark-context token definitions from .dark { } blocks and @media (prefers-color-scheme: dark) blocks
103
- grep -rEn "\.dark[[:space:]]*\{|prefers-color-scheme.*dark" "$SRC_ROOT" \
104
- --include="*.css" --include="*.scss" -A 30 2>/dev/null \
105
- | grep -E "^\s*--[a-z].*:\s*#[0-9a-fA-F]{3,8}|^\s*--[a-z].*:\s*rgb"
106
- ```
107
-
108
- **Architecture 2 (Tailwind dark:):**
109
- ```bash
110
- # Extract dark:bg-* and dark:text-* class combinations
111
- grep -rEhon "dark:(bg|text)-[a-z0-9-]+" "$SRC_ROOT" \
112
- --include="*.tsx" --include="*.jsx" --include="*.html" 2>/dev/null | sort -u
113
- ```
114
-
115
- **Architecture 3 (JS class toggle):**
116
- ```bash
117
- # Read dark CSS rules (same as Architecture 1 — the JS toggle sets .dark on <html>)
118
- grep -rEn "\.dark[[:space:]]*\{" "$SRC_ROOT" \
119
- --include="*.css" --include="*.scss" -A 30 2>/dev/null \
120
- | grep -E "color|background"
121
- ```
122
-
123
- **WCAG contrast computation:**
124
-
125
- Use the linearized-sRGB formula from `agents/design-executor.md` Type: accessibility (pre-calibrated — do not re-derive). For each text/background pair:
126
-
127
- 1. Convert each hex channel to linear light: `c_lin = (c/255 ≤ 0.04045) ? c/255/12.92 : ((c/255 + 0.055)/1.055)^2.4`
128
- 2. Relative luminance: `L = 0.2126 * R_lin + 0.7152 * G_lin + 0.0722 * B_lin`
129
- 3. Contrast ratio: `(L_lighter + 0.05) / (L_darker + 0.05)`
130
-
131
- **Thresholds:**
32
+ Confirm source root exists. Try in order: `src/` (preferred), `app/` (Next.js App Router), `lib/` (libraries), `pages/` (Next.js Pages Router). Set `SRC_ROOT` to the first that exists. If none exist, abort: `"No source directory detected. Run /get-design-done scan first."`
132
33
 
133
- | Text type | Min ratio | Fail severity |
134
- |-----------|-----------|---------------|
135
- | Body text (< 18pt or < 14pt bold) | 4.5:1 | P0 (critical) |
136
- | Large text (≥ 18pt or ≥ 14pt bold) | 3:1 | P1 (major) |
137
- | UI component boundaries | 3:1 | P1 (major) |
34
+ Confirm `.design/` exists (create if absent: `mkdir -p .design/`).
138
35
 
139
- Flag every pair that fails its threshold. Include token names, hex values, computed ratio, and required ratio in the fix description.
36
+ Probe `preview` connection per `../../reference/shared-preamble.md#connection-handshake-summary` (ToolSearch `mcp__Claude_Preview__preview_list` STATE.md write). Result drives Step 5B (visual dark mode rendering).
140
37
 
141
38
  ---
142
39
 
143
- ## Step 3: Token Override Completeness (DARK-04)
40
+ ## Workflow
144
41
 
145
- Check that every light-mode color token has a corresponding dark-mode override.
146
-
147
- **Enumerate light-mode tokens:**
148
- ```bash
149
- # CSS custom props approach
150
- grep -rEhon "var\(--color-[a-z0-9-]+\)" "$SRC_ROOT" \
151
- --include="*.css" --include="*.scss" --include="*.tsx" --include="*.jsx" 2>/dev/null \
152
- | grep -oE "\-\-color-[a-z0-9-]+" | sort -u
153
-
154
- # Tailwind semantic classes (if Arch 2)
155
- grep -rEhon "(bg|text|border|ring)-[a-z]+-[0-9]+" "$SRC_ROOT" \
156
- --include="*.tsx" --include="*.jsx" 2>/dev/null | sort -u
157
- ```
158
-
159
- **Check dark overrides (architecture-specific):**
160
- - Arch 1: Token appears in `.dark { --color-* }` block or `@media (prefers-color-scheme: dark) { --color-* }`
161
- - Arch 2: A `dark:` prefixed variant of the Tailwind class exists in the same file or a shared layout
162
- - Arch 3: Token appears in the dark CSS block activated by JS class toggle
163
-
164
- **Flag:** Any light-mode color token with no dark override → P1 (major). Include token name and file location.
165
-
166
- ---
167
-
168
- ## Step 4: Dark-Specific Anti-Patterns (DARK-05)
169
-
170
- **Anti-pattern A: Images and SVGs without dark variant**
171
-
172
- ```bash
173
- # Find all <img> and <svg> references
174
- grep -rEn "<img[^>]+src=|<svg" "$SRC_ROOT" \
175
- --include="*.tsx" --include="*.jsx" --include="*.html" --include="*.vue" 2>/dev/null \
176
- | grep -v "dark\."
177
- ```
178
-
179
- For each image/SVG found, check whether any of the following exist:
180
- - A sibling file with pattern `[name]-dark.{png,svg,webp}`
181
- - A `dark:hidden` / `dark:block` swap class pairing in the same component
182
- - A `<picture>` element with a `prefers-color-scheme: dark` source
183
-
184
- Flag images/SVGs with none of the above → P2 (minor).
185
-
186
- **Anti-pattern B: Pure-black backgrounds (BAN-05)**
187
-
188
- ```bash
189
- # Grep for pure-black in dark-context CSS
190
- grep -rEn "#000000|#000\b|rgb\([[:space:]]*0[[:space:]]*,[[:space:]]*0[[:space:]]*,[[:space:]]*0[[:space:]]*\)|background[^:]*:[[:space:]]*black" \
191
- "$SRC_ROOT" --include="*.css" --include="*.scss" 2>/dev/null
192
- ```
193
-
194
- Any match within a `.dark {}` block or `@media (prefers-color-scheme: dark)` context → P1 (major). Pure black (`#000000`) in dark mode causes visual harshness and fails accessibility in high-contrast conditions. Use near-black (`#0a0a0a`–`#1a1a1a`) instead.
195
-
196
- **Anti-pattern C: Missing forced-colors media query**
197
-
198
- ```bash
199
- forced_count=$(grep -rEn "@media.*forced-colors" "$SRC_ROOT" \
200
- --include="*.css" --include="*.scss" 2>/dev/null | wc -l)
201
- ```
202
-
203
- If `forced_count` equals 0 → P2 (minor). The `forced-colors` media query ensures the design respects Windows High Contrast mode and similar OS accessibility overrides.
204
-
205
- ---
206
-
207
- ## Step 5: Meta Property Check (DARK-06)
208
-
209
- **color-scheme property:**
210
- ```bash
211
- cs_count=$(grep -rEn "color-scheme" "$SRC_ROOT" public/ \
212
- --include="*.html" --include="*.tsx" --include="*.css" 2>/dev/null | wc -l)
213
- ```
214
- If `cs_count` equals 0 → P2 (minor). The `color-scheme` CSS property / meta tag tells the browser to render scrollbars, form inputs, and system UI in the correct dark/light variant.
215
-
216
- **prefers-color-scheme media query:**
217
- ```bash
218
- pcs_count=$(grep -rEn "prefers-color-scheme" "$SRC_ROOT" public/ \
219
- --include="*.html" --include="*.tsx" --include="*.css" 2>/dev/null | wc -l)
220
- ```
221
- If `pcs_count` equals 0 → P2 (minor). Absence means the site ignores the OS-level dark mode preference — the user's system setting has no effect.
222
-
223
- ---
224
-
225
- ## Step 5B: Dark Mode Rendering Screenshots (when preview: available)
226
-
227
- Check `preview` status from STATE.md `<connections>` (written by the probe at stage entry).
228
-
229
- **If `preview: available`:**
230
-
231
- 1. `preview_navigate` to the primary route (e.g., `http://localhost:3000/`).
232
- 2. Capture light-mode screenshot: `preview_screenshot` → save to `.design/screenshots/darkmode/light.png`.
233
- 3. Inject dark mode using the project's toggle mechanism (check `DESIGN-CONTEXT.md` D-XX decisions):
234
- - Tailwind dark: `preview_eval("document.documentElement.classList.add('dark')")`
235
- - data-theme: `preview_eval("document.documentElement.setAttribute('data-theme','dark')")`
236
- - Custom class: `preview_eval("document.documentElement.classList.add('theme-dark')")`
237
- - If mechanism is unknown: attempt Tailwind default first; note in DARKMODE-AUDIT.md which method was used
238
- 4. `preview_screenshot` → save to `.design/screenshots/darkmode/dark.png`.
239
- 5. Record both paths (NOT base64) for embedding in `## Dark Mode Rendering` section of DARKMODE-AUDIT.md.
240
-
241
- **If `preview: unavailable` or `preview: not_configured`:**
242
-
243
- Omit `## Dark Mode Rendering` section entirely. Emit: `Visual dark mode check skipped — preview not configured.` in the Notes section.
244
-
245
- ---
246
-
247
- ## Step 6: Write DARKMODE-AUDIT.md (DARK-07)
248
-
249
- Output path: `.design/DARKMODE-AUDIT.md`
250
-
251
- Collect all flagged issues from Steps 2–5, group by priority (P0 → P1 → P2 → P3), and write:
252
-
253
- ```markdown
254
- # Dark Mode Audit
255
-
256
- **Generated:** <ISO date>
257
- **Architecture detected:** <Architecture 1 (CSS custom props) | Architecture 2 (Tailwind dark:) | Architecture 3 (JS class toggle) | Hybrid | None>
258
- **Source scanned:** <SRC_ROOT>
259
-
260
- ## Summary
261
-
262
- | Category | Status | Issues |
263
- |----------|--------|--------|
264
- | Contrast (DARK-03) | <pass / fail> | <count> |
265
- | Token Overrides (DARK-04) | <pass / fail> | <count> |
266
- | Anti-Patterns (DARK-05) | <pass / fail> | <count> |
267
- | Meta Properties (DARK-06) | <pass / fail> | <count> |
268
-
269
- ## P0 Fixes (Critical — contrast failure on body text)
270
-
271
- - [CONTRAST] <token-pair>: ratio <X:1> — required 4.5:1. File: <path>
272
-
273
- ## P1 Fixes (Major — contrast failure on large text / missing dark overrides / pure-black)
274
-
275
- - [CONTRAST-LARGE] <token-pair>: ratio <X:1> — required 3:1. File: <path>
276
- - [TOKEN-OVERRIDE] Missing dark override for <--token-name>. Light value: <hex>. File: <path>
277
- - [BAN-05] Pure-black background detected in dark context. File: <path>:line
278
-
279
- ## P2 Fixes (Minor — missing SVG variants / forced-colors / meta props)
280
-
281
- - [SVG-DARK] <image.svg> has no dark variant (no -dark.svg sibling, no dark: swap class). File: <path>
282
- - [FORCED-COLORS] No @media (forced-colors) block detected in any CSS file.
283
- - [COLOR-SCHEME] No color-scheme property or meta tag detected.
284
- - [PREFERS-COLOR-SCHEME] No prefers-color-scheme query detected (OS preference ignored).
285
-
286
- ## P3 Fixes (Cosmetic)
287
-
288
- - <cosmetic issues, if any>
289
-
290
- ## Dark Mode Rendering
291
-
292
- <One of the following:>
293
- - When preview: available: side-by-side screenshot evidence
294
- - Light: .design/screenshots/darkmode/light.png
295
- - Dark: .design/screenshots/darkmode/dark.png
296
- - Injection method used: <classList.add('dark') | setAttribute('data-theme','dark') | other>
297
- - "Visual dark mode check skipped — preview not configured."
298
-
299
- ## Notes
300
-
301
- This audit is read-only. It does NOT write scores back to DESIGN.md.
302
- To apply fixes, run the design pipeline and include dark mode decisions in DESIGN-CONTEXT.md.
303
- Score writeback (V2-05) is deferred to a future version.
304
- ```
305
-
306
- If a priority bucket has no issues, omit that section or write "None."
42
+ 1. **Architecture Detection (DARK-02)** run three greps (CSS custom props / Tailwind `dark:` / JS class toggle), classify primary architecture or `Hybrid` or `None`. If `None`, abort. Detail: `./darkmode-audit-procedure.md#step-1-architecture-detection-dark-02`.
43
+ 2. **Contrast Audit (DARK-03)** — extract dark-context token pairs for the detected architecture, compute WCAG 2.1 ratios, flag failures at 4.5:1 (body) / 3:1 (large text + UI boundaries). Cross-check with APCA from `../../reference/contrast-advanced.md` for thin / large / colored text. Detail: `./darkmode-audit-procedure.md#step-2-contrast-audit-dark-03`.
44
+ 3. **Token Override Completeness (DARK-04)** — every light-mode color token must have a dark-mode override. Flag missing overrides → P1. Detail: `./darkmode-audit-procedure.md#step-3-token-override-completeness-dark-04`.
45
+ 4. **Dark-Specific Anti-Patterns (DARK-05)** — Images/SVGs without dark variant (P2), pure-black backgrounds in dark context = BAN-05 (P1), missing `@media (forced-colors)` (P2). Detail: `./darkmode-audit-procedure.md#step-4-dark-specific-anti-patterns-dark-05`.
46
+ 5. **Meta Property Check (DARK-06)** — `color-scheme` property + `prefers-color-scheme` query. Each absent → P2. Detail: `./darkmode-audit-procedure.md#step-5-meta-property-check-dark-06`.
47
+ 6. **Visual Rendering (preview: available only)** — capture light/dark screenshot pair to `.design/screenshots/darkmode/{light,dark}.png`. Detail: `./darkmode-audit-procedure.md#step-5b-dark-mode-rendering-screenshots-when-preview-available`.
48
+ 7. **Write `.design/DARKMODE-AUDIT.md`** group flagged issues by priority (P0 → P1 → P2 → P3). Full template at `./darkmode-audit-procedure.md#step-6-darkmode-auditmd-template`.
307
49
 
308
50
  ---
309
51
 
310
52
  ## Constraints
311
53
 
312
- This command MUST NOT:
54
+ This command MUST NOT (per `../../reference/shared-preamble.md#output-contract-reminders`):
55
+
56
+ - Write to `DESIGN.md`, `DESIGN-SUMMARY.md`, `DESIGN-VERIFICATION.md`, `DESIGN-CONTEXT.md`, or `.design/STATE.md`.
57
+ - Invoke `design-auditor` (Pitfall 4 — this is a separate audit with its own inline checks).
58
+ - Execute any fixes — audit-only (V2-07 deferred).
59
+ - Write scores back to `DESIGN.md` (V2-05 deferred — two-sources-of-truth risk).
60
+ - Add rows to `DESIGN.md` or append to pipeline-owned artifacts.
313
61
 
314
- - MUST NOT write to `DESIGN.md`, `DESIGN-SUMMARY.md`, `DESIGN-VERIFICATION.md`, `DESIGN-CONTEXT.md`, or `.design/STATE.md`
315
- - MUST NOT invoke `design-auditor` (Pitfall 4 — this is a separate audit with its own inline checks, not an extension of the DESIGN-AUDIT.md pipeline)
316
- - MUST NOT execute any fixes — audit-only per V2-07 deferral (fixes belong in the design skill's color task)
317
- - MUST NOT write scores back to DESIGN.md (V2-05 deferred — two-sources-of-truth risk)
318
- - MUST write exactly one output file: `.design/DARKMODE-AUDIT.md`
319
- - MUST NOT add rows to DESIGN.md or append to pipeline-owned artifacts
62
+ MUST write exactly one output file: `.design/DARKMODE-AUDIT.md`.
320
63
 
321
64
  ---
322
65
 
323
66
  ## Completion
324
67
 
325
- After writing `.design/DARKMODE-AUDIT.md`, print:
68
+ After writing the audit, print:
326
69
 
327
70
  ```
328
71
  Dark mode audit complete. Architecture: <X>. Fixes: P0=<N>, P1=<M>, P2=<K>, P3=<J>. See .design/DARKMODE-AUDIT.md.
329
72
  ```
330
73
 
331
74
  Do not summarize individual issues in the completion message — the file contains the full detail.
75
+
76
+ ## DARKMODE AUDIT COMPLETE
@@ -0,0 +1,258 @@
1
+ ---
2
+ name: darkmode-audit-procedure
3
+ type: meta-rules
4
+ version: 1.0.0
5
+ phase: 28.5
6
+ tags: [darkmode, dark-mode, contrast, audit, procedure, extracted]
7
+ last_updated: 2026-05-18
8
+ ---
9
+
10
+ Source: extracted from `skills/darkmode/SKILL.md` (Phase 28.5 rework — D-10 extract-then-link).
11
+ The skill's load-bearing routing + decision tree stays in `../skills/darkmode/SKILL.md`; this
12
+ file holds the architecture-detection greps, contrast computation, anti-pattern grep
13
+ snippets, and the `DARKMODE-AUDIT.md` report template.
14
+
15
+ # Dark Mode Audit Procedure
16
+
17
+ Detailed procedure for the `get-design-done:darkmode` standalone audit — companion to
18
+ `../skills/darkmode/SKILL.md`. Read this file when executing a specific audit step
19
+ (architecture detection, contrast computation, anti-pattern grep, report layout). The
20
+ SKILL.md keeps the load-bearing pre-flight + step routing; this file holds the deep
21
+ methodology.
22
+
23
+ For the perceptual layer (APCA / WCAG 3 draft) sitting on top of the WCAG 2.1 ratios used
24
+ in Step 2, see `./contrast-advanced.md`. For modern OKLCH-based dark token-pair generation,
25
+ see `./color-theory.md` §OKLCH. For the cross-skill output discipline + connection-probe
26
+ pattern, see `./shared-preamble.md#output-contract-reminders` and
27
+ `./shared-preamble.md#connection-handshake-summary`.
28
+
29
+ ---
30
+
31
+ ## Step 1: Architecture Detection (DARK-02)
32
+
33
+ Run all three architecture greps against `$SRC_ROOT`. Use `2>/dev/null` on each to suppress missing-directory errors.
34
+
35
+ ```bash
36
+ # Architecture 1: CSS custom properties with dark media query
37
+ arch1_count=$(grep -rEn "prefers-color-scheme.*dark|\.dark[[:space:]]*\{" "$SRC_ROOT" \
38
+ --include="*.css" --include="*.scss" 2>/dev/null | wc -l)
39
+
40
+ # Architecture 2: Tailwind dark: prefix
41
+ arch2_count=$(grep -rEn "dark:[a-z]" "$SRC_ROOT" \
42
+ --include="*.tsx" --include="*.jsx" --include="*.html" 2>/dev/null | wc -l)
43
+
44
+ # Architecture 3: JS class toggle on <html> / <body>
45
+ arch3_count=$(grep -rEn "classList.*dark|setAttribute.*dark|document\.documentElement" "$SRC_ROOT" \
46
+ --include="*.ts" --include="*.tsx" --include="*.js" 2>/dev/null | wc -l)
47
+ ```
48
+
49
+ **Classification rules:**
50
+
51
+ | Condition | Classification |
52
+ |-----------|---------------|
53
+ | All three counts < 3 | No dark mode — abort: "No dark mode implementation detected — nothing to audit." |
54
+ | Exactly one count ≥ 3 | Primary architecture = that one |
55
+ | Two or more counts ≥ 5 | Hybrid (list all detected architectures) |
56
+ | One count ≥ 3, others < 5 | Primary = highest count |
57
+
58
+ Record `ARCH_DETECTED` as one of: `Architecture 1 (CSS custom props)`, `Architecture 2 (Tailwind dark:)`, `Architecture 3 (JS class toggle)`, or `Hybrid`.
59
+
60
+ ---
61
+
62
+ ## Step 2: Contrast Audit (DARK-03)
63
+
64
+ For the detected architecture, enumerate color token + background token pairs used in dark context, then compute WCAG contrast ratios.
65
+
66
+ **Token extraction by architecture:**
67
+
68
+ **Architecture 1 (CSS custom props):**
69
+ ```bash
70
+ grep -rEn "\.dark[[:space:]]*\{|prefers-color-scheme.*dark" "$SRC_ROOT" \
71
+ --include="*.css" --include="*.scss" -A 30 2>/dev/null \
72
+ | grep -E "^\s*--[a-z].*:\s*#[0-9a-fA-F]{3,8}|^\s*--[a-z].*:\s*rgb"
73
+ ```
74
+
75
+ **Architecture 2 (Tailwind dark:):**
76
+ ```bash
77
+ grep -rEhon "dark:(bg|text)-[a-z0-9-]+" "$SRC_ROOT" \
78
+ --include="*.tsx" --include="*.jsx" --include="*.html" 2>/dev/null | sort -u
79
+ ```
80
+
81
+ **Architecture 3 (JS class toggle):**
82
+ ```bash
83
+ grep -rEn "\.dark[[:space:]]*\{" "$SRC_ROOT" \
84
+ --include="*.css" --include="*.scss" -A 30 2>/dev/null \
85
+ | grep -E "color|background"
86
+ ```
87
+
88
+ **WCAG contrast computation:**
89
+
90
+ Use the linearized-sRGB formula from `agents/design-executor.md` Type: accessibility (pre-calibrated — do not re-derive):
91
+
92
+ 1. Convert each hex channel to linear light: `c_lin = (c/255 ≤ 0.04045) ? c/255/12.92 : ((c/255 + 0.055)/1.055)^2.4`
93
+ 2. Relative luminance: `L = 0.2126 * R_lin + 0.7152 * G_lin + 0.0722 * B_lin`
94
+ 3. Contrast ratio: `(L_lighter + 0.05) / (L_darker + 0.05)`
95
+
96
+ **Thresholds:**
97
+
98
+ | Text type | Min ratio | Fail severity |
99
+ |-----------|-----------|---------------|
100
+ | Body text (< 18pt or < 14pt bold) | 4.5:1 | P0 (critical) |
101
+ | Large text (≥ 18pt or ≥ 14pt bold) | 3:1 | P1 (major) |
102
+ | UI component boundaries | 3:1 | P1 (major) |
103
+
104
+ Flag every pair that fails its threshold. Include token names, hex values, computed ratio, and required ratio in the fix description.
105
+
106
+ For pairs that pass WCAG 2.1 but feel wrong perceptually (thin mid-gray text, large saturated text, saturated-on-saturated), cross-check with the APCA Lc thresholds in `./contrast-advanced.md` and annotate `[APCA-mismatch]` in the fix description.
107
+
108
+ ---
109
+
110
+ ## Step 3: Token Override Completeness (DARK-04)
111
+
112
+ Check that every light-mode color token has a corresponding dark-mode override.
113
+
114
+ **Enumerate light-mode tokens:**
115
+ ```bash
116
+ grep -rEhon "var\(--color-[a-z0-9-]+\)" "$SRC_ROOT" \
117
+ --include="*.css" --include="*.scss" --include="*.tsx" --include="*.jsx" 2>/dev/null \
118
+ | grep -oE "\-\-color-[a-z0-9-]+" | sort -u
119
+
120
+ grep -rEhon "(bg|text|border|ring)-[a-z]+-[0-9]+" "$SRC_ROOT" \
121
+ --include="*.tsx" --include="*.jsx" 2>/dev/null | sort -u
122
+ ```
123
+
124
+ **Check dark overrides (architecture-specific):**
125
+ - Arch 1: Token appears in `.dark { --color-* }` block or `@media (prefers-color-scheme: dark) { --color-* }`
126
+ - Arch 2: A `dark:` prefixed variant of the Tailwind class exists in the same file or a shared layout
127
+ - Arch 3: Token appears in the dark CSS block activated by JS class toggle
128
+
129
+ **Flag:** Any light-mode color token with no dark override → P1 (major). For OKLCH-based pair generation guidance, see `./color-theory.md` §OKLCH.
130
+
131
+ ---
132
+
133
+ ## Step 4: Dark-Specific Anti-Patterns (DARK-05)
134
+
135
+ **Anti-pattern A: Images and SVGs without dark variant**
136
+
137
+ ```bash
138
+ grep -rEn "<img[^>]+src=|<svg" "$SRC_ROOT" \
139
+ --include="*.tsx" --include="*.jsx" --include="*.html" --include="*.vue" 2>/dev/null \
140
+ | grep -v "dark\."
141
+ ```
142
+
143
+ For each image/SVG found, check whether any of the following exist:
144
+ - A sibling file with pattern `[name]-dark.{png,svg,webp}`
145
+ - A `dark:hidden` / `dark:block` swap class pairing in the same component
146
+ - A `<picture>` element with a `prefers-color-scheme: dark` source
147
+
148
+ Flag images/SVGs with none of the above → P2 (minor).
149
+
150
+ **Anti-pattern B: Pure-black backgrounds (BAN-05)**
151
+
152
+ ```bash
153
+ grep -rEn "#000000|#000\b|rgb\([[:space:]]*0[[:space:]]*,[[:space:]]*0[[:space:]]*,[[:space:]]*0[[:space:]]*\)|background[^:]*:[[:space:]]*black" \
154
+ "$SRC_ROOT" --include="*.css" --include="*.scss" 2>/dev/null
155
+ ```
156
+
157
+ Any match within a `.dark {}` block or `@media (prefers-color-scheme: dark)` context → P1 (major). Pure black (`#000000`) in dark mode causes visual harshness and fails accessibility in high-contrast conditions. Use near-black (`#0a0a0a` – `#1a1a1a`) instead.
158
+
159
+ **Anti-pattern C: Missing forced-colors media query**
160
+
161
+ ```bash
162
+ forced_count=$(grep -rEn "@media.*forced-colors" "$SRC_ROOT" \
163
+ --include="*.css" --include="*.scss" 2>/dev/null | wc -l)
164
+ ```
165
+
166
+ If `forced_count` equals 0 → P2 (minor). The `forced-colors` media query ensures the design respects Windows High Contrast mode and similar OS accessibility overrides.
167
+
168
+ ---
169
+
170
+ ## Step 5: Meta Property Check (DARK-06)
171
+
172
+ **color-scheme property:**
173
+ ```bash
174
+ cs_count=$(grep -rEn "color-scheme" "$SRC_ROOT" public/ \
175
+ --include="*.html" --include="*.tsx" --include="*.css" 2>/dev/null | wc -l)
176
+ ```
177
+ If `cs_count` equals 0 → P2 (minor).
178
+
179
+ **prefers-color-scheme media query:**
180
+ ```bash
181
+ pcs_count=$(grep -rEn "prefers-color-scheme" "$SRC_ROOT" public/ \
182
+ --include="*.html" --include="*.tsx" --include="*.css" 2>/dev/null | wc -l)
183
+ ```
184
+ If `pcs_count` equals 0 → P2 (minor). Absence means the site ignores the OS-level dark mode preference.
185
+
186
+ ---
187
+
188
+ ## Step 5B: Dark Mode Rendering Screenshots (when preview: available)
189
+
190
+ Check `preview` status from `.design/STATE.md <connections>` (per `./shared-preamble.md#connection-handshake-summary`).
191
+
192
+ **If `preview: available`:**
193
+
194
+ 1. `preview_navigate` to the primary route (e.g., `http://localhost:3000/`).
195
+ 2. Capture light-mode: `preview_screenshot` → `.design/screenshots/darkmode/light.png`.
196
+ 3. Inject dark mode using the project's toggle mechanism (check `DESIGN-CONTEXT.md` D-XX decisions):
197
+ - Tailwind dark: `preview_eval("document.documentElement.classList.add('dark')")`
198
+ - data-theme: `preview_eval("document.documentElement.setAttribute('data-theme','dark')")`
199
+ - Custom class: `preview_eval("document.documentElement.classList.add('theme-dark')")`
200
+ - If mechanism is unknown: attempt Tailwind default first; note in `DARKMODE-AUDIT.md` which method was used.
201
+ 4. `preview_screenshot` → `.design/screenshots/darkmode/dark.png`.
202
+ 5. Record both paths (NOT base64) for embedding in `## Dark Mode Rendering` section.
203
+
204
+ **If `preview: unavailable` or `preview: not_configured`:** omit `## Dark Mode Rendering` section entirely. Emit `Visual dark mode check skipped — preview not configured.` in Notes.
205
+
206
+ ---
207
+
208
+ ## Step 6: DARKMODE-AUDIT.md Template
209
+
210
+ Output path: `.design/DARKMODE-AUDIT.md`.
211
+
212
+ ```markdown
213
+ # Dark Mode Audit
214
+
215
+ **Generated:** <ISO date>
216
+ **Architecture detected:** <Architecture 1 (CSS custom props) | Architecture 2 (Tailwind dark:) | Architecture 3 (JS class toggle) | Hybrid | None>
217
+ **Source scanned:** <SRC_ROOT>
218
+
219
+ ## Summary
220
+
221
+ | Category | Status | Issues |
222
+ |----------|--------|--------|
223
+ | Contrast (DARK-03) | <pass / fail> | <count> |
224
+ | Token Overrides (DARK-04) | <pass / fail> | <count> |
225
+ | Anti-Patterns (DARK-05) | <pass / fail> | <count> |
226
+ | Meta Properties (DARK-06) | <pass / fail> | <count> |
227
+
228
+ ## P0 Fixes (Critical — contrast failure on body text)
229
+ - [CONTRAST] <token-pair>: ratio <X:1> — required 4.5:1. File: <path>
230
+
231
+ ## P1 Fixes (Major — large-text contrast / missing dark overrides / pure-black)
232
+ - [CONTRAST-LARGE] <token-pair>: ratio <X:1> — required 3:1. File: <path>
233
+ - [TOKEN-OVERRIDE] Missing dark override for <--token-name>. Light value: <hex>. File: <path>
234
+ - [BAN-05] Pure-black background detected in dark context. File: <path>:line
235
+
236
+ ## P2 Fixes (Minor — missing SVG variants / forced-colors / meta props)
237
+ - [SVG-DARK] <image.svg> has no dark variant. File: <path>
238
+ - [FORCED-COLORS] No @media (forced-colors) block detected in any CSS file.
239
+ - [COLOR-SCHEME] No color-scheme property or meta tag detected.
240
+ - [PREFERS-COLOR-SCHEME] No prefers-color-scheme query detected.
241
+
242
+ ## P3 Fixes (Cosmetic)
243
+ - <cosmetic issues, if any>
244
+
245
+ ## Dark Mode Rendering
246
+ <Either side-by-side screenshot references, or "Visual dark mode check skipped — preview not configured.">
247
+
248
+ ## Notes
249
+ This audit is read-only. It does NOT write scores back to DESIGN.md.
250
+ To apply fixes, run the design pipeline and include dark mode decisions in DESIGN-CONTEXT.md.
251
+ Score writeback (V2-05) is deferred.
252
+ ```
253
+
254
+ If a priority bucket has no issues, omit that section or write "None."
255
+
256
+ ---
257
+
258
+ *Imported by: `../skills/darkmode/SKILL.md`. Maintained as part of Phase 28.5 (Bucket 2 rework — D-10).*