@hegemonart/get-design-done 1.27.7 → 1.28.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +2 -2
- package/CHANGELOG.md +142 -0
- package/SKILL.md +1 -1
- package/agents/design-verifier.md +17 -0
- package/hooks/gdd-decision-injector.js +149 -3
- package/package.json +1 -1
- package/reference/accessibility.md +4 -0
- package/reference/adr-format.md +96 -0
- package/reference/apply-reflections-procedure.md +68 -0
- package/reference/architecture-vocabulary.md +102 -0
- package/reference/audit-scoring.md +14 -0
- package/reference/cache-policy.md +126 -0
- package/reference/color-theory.md +279 -0
- package/reference/compare-rubric.md +171 -0
- package/reference/composition.md +349 -0
- package/reference/connections-onboarding.md +417 -0
- package/reference/context-md-format.md +106 -0
- package/reference/contrast-advanced.md +205 -0
- package/reference/darkmode-audit-procedure.md +258 -0
- package/reference/debug-feedback-loops.md +119 -0
- package/reference/design-procedure.md +304 -0
- package/reference/design-system-guidance.md +2 -0
- package/reference/discover-procedure.md +204 -0
- package/reference/explore-procedure.md +267 -0
- package/reference/form-patterns.md +2 -0
- package/reference/health-mcp-detection.md +44 -0
- package/reference/health-skill-length-report.md +69 -0
- package/reference/heuristics.md +84 -0
- package/reference/i18n.md +554 -0
- package/reference/iconography.md +2 -0
- package/reference/milestone-completeness-rubric.md +87 -0
- package/reference/motion-interpolate.md +1 -0
- package/reference/palette-catalog.md +2 -0
- package/reference/peer-cli-protocol.md +161 -0
- package/reference/plan-procedure.md +278 -0
- package/reference/proportion-systems.md +267 -0
- package/reference/registry.json +204 -1
- package/reference/registry.schema.json +1 -1
- package/reference/router-rules.md +84 -0
- package/reference/rtl-cjk-cultural.md +2 -0
- package/reference/scan-procedure.md +731 -0
- package/reference/shared-preamble.md +78 -6
- package/reference/skill-authoring-contract.md +128 -0
- package/reference/start-procedure.md +115 -0
- package/reference/style-doc-procedure.md +150 -0
- package/reference/style-vocabulary.md +2 -0
- package/reference/threat-modeling.md +101 -0
- package/reference/typography.md +4 -0
- package/reference/verify-procedure.md +512 -0
- package/reference/visual-hierarchy-layout.md +4 -0
- package/scripts/validate-skill-length.cjs +283 -0
- package/skills/add-backlog/SKILL.md +1 -0
- package/skills/analyze-dependencies/SKILL.md +33 -122
- package/skills/apply-reflections/SKILL.md +1 -40
- package/skills/audit/SKILL.md +3 -1
- package/skills/bandit-status/SKILL.md +31 -66
- package/skills/benchmark/SKILL.md +15 -55
- package/skills/brief/SKILL.md +12 -1
- package/skills/cache-manager/SKILL.md +3 -57
- package/skills/check-update/SKILL.md +38 -75
- package/skills/compare/SKILL.md +29 -269
- package/skills/complete-cycle/SKILL.md +1 -1
- package/skills/connections/SKILL.md +21 -427
- package/skills/continue/SKILL.md +1 -0
- package/skills/darkmode/SKILL.md +32 -287
- package/skills/debug/SKILL.md +11 -8
- package/skills/design/SKILL.md +27 -245
- package/skills/discover/SKILL.md +26 -133
- package/skills/discuss/SKILL.md +18 -2
- package/skills/explore/SKILL.md +42 -176
- package/skills/fast/SKILL.md +1 -0
- package/skills/figma-write/SKILL.md +2 -2
- package/skills/health/SKILL.md +11 -33
- package/skills/help/SKILL.md +1 -0
- package/skills/list-assumptions/SKILL.md +1 -0
- package/skills/map/SKILL.md +8 -31
- package/skills/new-cycle/SKILL.md +3 -1
- package/skills/next/SKILL.md +1 -0
- package/skills/note/SKILL.md +1 -0
- package/skills/optimize/SKILL.md +21 -44
- package/skills/pause/SKILL.md +1 -0
- package/skills/peer-cli-add/SKILL.md +26 -108
- package/skills/peer-cli-customize/SKILL.md +22 -42
- package/skills/peers/SKILL.md +33 -57
- package/skills/plan/SKILL.md +33 -220
- package/skills/plant-seed/SKILL.md +1 -0
- package/skills/pr-branch/SKILL.md +1 -0
- package/skills/progress/SKILL.md +1 -7
- package/skills/quality-gate/SKILL.md +34 -166
- package/skills/quick/SKILL.md +1 -0
- package/skills/reapply-patches/SKILL.md +1 -0
- package/skills/recall/SKILL.md +1 -0
- package/skills/resume/SKILL.md +1 -0
- package/skills/review-backlog/SKILL.md +1 -0
- package/skills/router/SKILL.md +3 -59
- package/skills/scan/SKILL.md +36 -675
- package/skills/settings/SKILL.md +1 -0
- package/skills/ship/SKILL.md +1 -0
- package/skills/sketch/SKILL.md +1 -1
- package/skills/sketch-wrap-up/SKILL.md +13 -54
- package/skills/spike/SKILL.md +1 -1
- package/skills/spike-wrap-up/SKILL.md +12 -46
- package/skills/start/SKILL.md +13 -112
- package/skills/stats/SKILL.md +1 -0
- package/skills/style/SKILL.md +18 -140
- package/skills/synthesize/SKILL.md +1 -0
- package/skills/timeline/SKILL.md +1 -0
- package/skills/todo/SKILL.md +1 -0
- package/skills/turn-closeout/SKILL.md +36 -56
- package/skills/undo/SKILL.md +1 -0
- package/skills/update/SKILL.md +1 -0
- package/skills/verify/SKILL.md +42 -457
- package/skills/warm-cache/SKILL.md +3 -35
- package/skills/zoom-out/SKILL.md +26 -0
package/skills/darkmode/SKILL.md
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: get-design-done:darkmode
|
|
3
|
-
description: "Audit dark mode implementation
|
|
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
|
|
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 `../../reference/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
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
40
|
+
## Workflow
|
|
144
41
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
**
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
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: `../../reference/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: `../../reference/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: `../../reference/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: `../../reference/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: `../../reference/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: `../../reference/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 `../../reference/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
|
-
|
|
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
|
|
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
|
package/skills/debug/SKILL.md
CHANGED
|
@@ -1,33 +1,36 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: gdd-debug
|
|
3
|
-
description: "Symptom-driven design
|
|
3
|
+
description: "Symptom-driven design debugger with persistent state. Phase 1 builds a feedback loop; Phase 2 hypothesizes. Writes findings to .design/DEBUG.md. Use when a symptom needs systematic, one-variable-at-a-time tracking."
|
|
4
4
|
argument-hint: "[<symptom description>]"
|
|
5
5
|
tools: Read, Write, Grep, Glob, AskUserQuestion, Task
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# /gdd:debug
|
|
9
9
|
|
|
10
|
-
Systematic, checkpoint-driven design debugger. Loads
|
|
10
|
+
Systematic, checkpoint-driven design debugger. Loads framing from `./../reference/debugger-philosophy.md` (five principles) and the feedback-loop construction catalog from `./../reference/debug-feedback-loops.md` (10 priority-ordered loop paths). Phase 1 builds the loop; Phase 2 generates hypotheses. Writes every step to `.design/DEBUG.md` so killed sessions can resume.
|
|
11
11
|
|
|
12
12
|
## Steps
|
|
13
13
|
|
|
14
|
-
1. **Load philosophy**: Read `reference/debugger-philosophy.md` and
|
|
14
|
+
1. **Load philosophy + feedback-loop catalog**: Read `reference/debugger-philosophy.md` (five principles) and `./../reference/debug-feedback-loops.md` (10 construction paths; iterate-on-loop discipline). Keep both in mind for the entire session.
|
|
15
15
|
2. **Symptom**: If no symptom argument was passed, ask (AskUserQuestion): "What design symptom are you investigating? (observable only — 'cards look crowded', not 'padding is wrong')"
|
|
16
16
|
3. **Resume check**: Read `.design/DEBUG.md` if it exists. If there is an open session with no `### Fix Proposal` block, ask: "Resume existing session '<symptom>' or start a new one?"
|
|
17
|
-
4. **Ground truth load**: Read `.design/DESIGN-PLAN.md` (goals), `.design/STATE.md` `<decisions>` block (D-XX items), and any
|
|
18
|
-
5. **
|
|
19
|
-
6. **
|
|
17
|
+
4. **Ground truth load**: Read `.design/DESIGN-PLAN.md` (goals), `.design/STATE.md` `<decisions>` block (D-XX items), and any source files pointed at by the symptom.
|
|
18
|
+
5. **Phase 1 — Build a feedback loop**: Before ANY hypothesizing, build a deterministic, fast, agent-runnable pass/fail signal that reproduces the symptom. See `./../reference/debug-feedback-loops.md` for the 10 construction paths in priority order (failing test > curl > CLI fixture > headless browser > trace replay > throwaway harness > fuzz > bisect > differential > HITL bash). Iterate on the loop itself (cache setup, narrow scope, pin time, seed RNG, isolate filesystem, freeze network) before iterating on the bug. For non-deterministic bugs: raise reproduction rate to at least 30%, not clean repro. **Do not proceed to Phase 2 (hypothesis generation) until you have a loop you believe in.**
|
|
19
|
+
6. **Optional rendered-output check**: Use ToolSearch to see if Playwright/Preview MCP tools are available. If yes, capture rendered state. If no, fall back to code-only analysis.
|
|
20
|
+
7. **Phase 2 — Investigation loop** (one hypothesis at a time) — for each step:
|
|
20
21
|
- Form one hypothesis (one variable).
|
|
21
|
-
- Investigate (read files, grep, measure).
|
|
22
|
+
- Investigate (read files, grep, measure). Re-run the Phase 1 feedback loop to confirm the hypothesis pinpoints the symptom.
|
|
22
23
|
- Append to `.design/DEBUG.md`:
|
|
24
|
+
|
|
23
25
|
```markdown
|
|
24
26
|
## <symptom> — <date>
|
|
25
27
|
### Hypothesis <N>
|
|
26
28
|
### Investigation
|
|
27
29
|
### Finding
|
|
28
30
|
```
|
|
31
|
+
|
|
29
32
|
- Ask (AskUserQuestion): "Continue investigating? (yes / found it / dead end)"
|
|
30
|
-
|
|
33
|
+
8. **When found**: Write `### Fix Proposal` block with a concrete patch description. Re-run the Phase 1 loop to confirm the fix flips it from fail to pass. Ask: "Create a todo with `/gdd:todo add`, or execute the fix now?"
|
|
31
34
|
|
|
32
35
|
## Do Not
|
|
33
36
|
|