@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
@@ -7,91 +7,69 @@ tools: Read, Write, Bash, Task
7
7
 
8
8
  # /gdd:check-update
9
9
 
10
- **Role:** Manual entry point for the plugin-update checker. The SessionStart hook (`hooks/update-check.sh`) already runs on its own 24h cadence and writes `.design/update-cache.json` + `.design/update-available.md`. This command lets the user inspect / force / dismiss / enrich that state on demand.
10
+ **Role:** Manual entry point for the plugin-update checker. The SessionStart hook (`hooks/update-check.sh`) already runs on its own 24h cadence and writes `.design/update-cache.json` + `.design/update-available.md`. This command lets the user inspect / force / dismiss / enrich that state on demand. See `./reference/heuristics.md` §"Version-cadence" for the off-cadence / preview-suffix handling background.
11
11
 
12
12
  ## Flags
13
13
 
14
14
  | Flag | Effect |
15
- |---|---|
16
- | *(none)* | Print cached state (latest_tag, delta, is_newer). If the cache is older than 24h, trigger `--refresh` implicitly. |
15
+ |------|--------|
16
+ | *(none)* | Print cached state. If cache is older than 24h, trigger `--refresh` implicitly. |
17
17
  | `--refresh` | Invoke `hooks/update-check.sh --refresh` — bypasses the 24h TTL and re-fetches immediately. |
18
18
  | `--dismiss` | Write `update_dismissed: "<latest_tag>"` to `.design/config.json` atomically and delete `.design/update-available.md`. Sticky until a newer release ships. |
19
19
  | `--prompt` | Spawn `design-update-checker` agent (Haiku) to produce a 3–5-line "what this release changes for you" summary. Does not alter the banner or cache. |
20
20
 
21
- Flags can be combined: `--refresh --prompt` is valid (re-fetch, then enrich). `--dismiss` is the only flag that mutates `.design/config.json`.
21
+ Flags combine: `--refresh --prompt` is valid (re-fetch, then enrich). `--dismiss` is the only flag that mutates `.design/config.json`.
22
22
 
23
23
  ## Steps
24
24
 
25
- 1. **Parse flags.** Detect `--refresh`, `--dismiss`, `--prompt` in `$ARGUMENTS`. Any unknown flag: print `Unknown flag: <flag>` and exit.
25
+ 1. **Parse flags.** Detect `--refresh`, `--dismiss`, `--prompt` in `$ARGUMENTS`. Unknown flag `Unknown flag: <flag>` and exit.
26
+
27
+ 2. **`--refresh` path** (if set):
26
28
 
27
- 2. **--refresh path** (if `--refresh` in flags):
28
- Run the hot-path hook with the refresh flag:
29
29
  ```bash
30
30
  bash "${CLAUDE_PLUGIN_ROOT:-$(pwd)}/hooks/update-check.sh" --refresh
31
31
  ```
32
- This re-fetches `/releases/latest`, rewrites `.design/update-cache.json`, and re-renders `.design/update-available.md` subject to the same state/dismissal gates.
33
32
 
34
- 3. **Read cache.** After any optional refresh, read `.design/update-cache.json`. If it does not exist:
35
- - Print: `No cache. Network may be unreachable or the hook has not run yet. Try /gdd:check-update --refresh.`
36
- - Exit.
33
+ This re-fetches `/releases/latest`, rewrites `.design/update-cache.json`, and re-renders `.design/update-available.md` subject to state/dismissal gates.
37
34
 
38
- <!-- markdownlint-disable MD025 -->
35
+ 3. **Read cache.** After any optional refresh, read `.design/update-cache.json`. If missing: print `No cache. Network may be unreachable or the hook has not run yet. Try /gdd:check-update --refresh.` and exit.
39
36
 
40
- 4. **Dismiss path** (if `--dismiss` in flags):
41
- Compute new config contents and write atomically. The python heredoc receives CONFIG_PATH and LATEST_TAG via the ENVIRONMENT (env-prefix form — `KEY=VALUE python3 <<PY`), NOT via trailing argv. Passing `python3 -c '...' KEY=VALUE` makes Python treat the assignments as `sys.argv`, which the old draft did incorrectly; env-prefix form is the portable fix.
37
+ 4. **`--dismiss` path** (if set): Compute new config contents and write atomically via the env-prefix Python heredoc pattern below. The pattern is load-bearing — passing variables as trailing `KEY=VALUE` argv treats them as `sys.argv`, not `os.environ`. Use env-prefix form only.
42
38
 
43
39
  ```bash
44
40
  CONFIG_PATH=".design/config.json"
45
41
  LATEST_TAG="$(grep -E '"latest_tag"' .design/update-cache.json | head -n1 | sed -E 's/.*"latest_tag"[[:space:]]*:[[:space:]]*"([^"]+)".*/\1/')"
46
42
  [ -n "$LATEST_TAG" ] || { echo 'No latest_tag in cache — nothing to dismiss.'; exit 0; }
47
-
48
43
  mkdir -p .design
49
-
50
- # Env-prefix form: CONFIG_PATH and LATEST_TAG are placed into the child process env,
51
- # then python3 reads them via os.environ. Heredoc body is flat at column 0 (required —
52
- # any leading indentation breaks Python parsing in a heredoc).
53
44
  CONFIG_PATH="$CONFIG_PATH" LATEST_TAG="$LATEST_TAG" python3 <<'PY'
54
- import json, os, sys, tempfile
55
-
56
- config_path = os.environ['CONFIG_PATH']
57
- latest_tag = os.environ['LATEST_TAG']
58
-
59
- # Load existing config if present; otherwise start fresh. Preserve every unknown key.
60
- try:
61
- with open(config_path, 'r', encoding='utf-8') as f:
62
- data = json.load(f)
63
- if not isinstance(data, dict):
64
- data = {}
65
- except (FileNotFoundError, json.JSONDecodeError):
66
- data = {}
67
-
68
- # Set ONLY the dismissal key — every other pre-existing key is preserved verbatim.
69
- data['update_dismissed'] = latest_tag
70
-
71
- # Atomic write: write to tmp on the SAME filesystem, then os.replace() (POSIX rename(2)).
72
- target_dir = os.path.dirname(config_path) or '.'
73
- fd, tmp_path = tempfile.mkstemp(prefix='config.', suffix='.tmp', dir=target_dir)
74
- try:
75
- with os.fdopen(fd, 'w', encoding='utf-8') as f:
76
- json.dump(data, f, indent=2)
77
- f.write('\n')
78
- os.replace(tmp_path, config_path) # atomic on same filesystem
79
- except Exception as exc:
45
+ import json, os, sys, tempfile
46
+ config_path = os.environ['CONFIG_PATH']
47
+ latest_tag = os.environ['LATEST_TAG']
80
48
  try:
81
- os.unlink(tmp_path)
82
- except OSError:
83
- pass
84
- sys.exit(1)
85
- PY
86
-
87
- # Remove the rendered banner (user dismissed — stop showing it until a newer release ships).
49
+ with open(config_path, 'r', encoding='utf-8') as f:
50
+ data = json.load(f)
51
+ if not isinstance(data, dict): data = {}
52
+ except (FileNotFoundError, json.JSONDecodeError): data = {}
53
+ data['update_dismissed'] = latest_tag
54
+ target_dir = os.path.dirname(config_path) or '.'
55
+ fd, tmp_path = tempfile.mkstemp(prefix='config.', suffix='.tmp', dir=target_dir)
56
+ try:
57
+ with os.fdopen(fd, 'w', encoding='utf-8') as f:
58
+ json.dump(data, f, indent=2); f.write('\n')
59
+ os.replace(tmp_path, config_path)
60
+ except Exception:
61
+ try: os.unlink(tmp_path)
62
+ except OSError: pass
63
+ sys.exit(1)
64
+ PY
88
65
  rm -f .design/update-available.md
89
66
  echo "Dismissed $LATEST_TAG. The nudge will return when a newer release ships."
90
67
  ```
91
68
 
92
- D-14 atomic-write invariant: `os.replace()` (POSIX `rename(2)`) is atomic on the same filesystem — an interrupted write leaves the original config intact. The `json.load → set single key → json.dump` round-trip guarantees every unknown top-level key (e.g. `model_profile`, `parallelism`) is preserved verbatim.
69
+ D-14 atomic-write invariant: `os.replace()` (POSIX `rename(2)`) is atomic on the same filesystem. The `json.load → set single key → json.dump` round-trip preserves every unknown top-level key (e.g. `model_profile`, `parallelism`) verbatim.
70
+
71
+ 5. **Print default state** (always, unless exited early):
93
72
 
94
- 5. **Print default state** (always, unless the skill exited early):
95
73
  ```
96
74
  ━━━ /gdd:check-update ━━━
97
75
  Current: v<X.Y.Z>
@@ -101,35 +79,20 @@ PY
101
79
  Dismissed: <tag or "no">
102
80
  ━━━━━━━━━━━━━━━━━━━━━━━━━━
103
81
  ```
104
- Parse these fields from `.design/update-cache.json` using `grep + sed` (no jq dependency). Read dismissal from `.design/config.json` via the same pattern as hooks/update-check.sh:
105
- ```bash
106
- [ -f .design/config.json ] && grep -E '"update_dismissed"' .design/config.json | sed -E 's/.*"update_dismissed"[[:space:]]*:[[:space:]]*"([^"]+)".*/\1/'
107
- ```
108
-
109
- 6. **--prompt path** (if `--prompt` in flags):
110
- Spawn the `design-update-checker` agent via the Task tool. Pass as context:
111
- - `current_tag` — from `.design/update-cache.json`
112
- - `latest_tag` — from `.design/update-cache.json`
113
- - `delta` — from `.design/update-cache.json`
114
- - `release_body` — the `changelog_excerpt` from the cache (may be pre-truncated to 500 chars; that's fine — the agent knows)
115
82
 
116
- Display the agent's inline response verbatim below the state banner. The agent ends with `## UPDATE-CHECKER COMPLETE` the skill's own completion marker (below) is the final line.
83
+ Parse fields from `.design/update-cache.json` via `grep + sed` (no jq dep). Read dismissal from `.design/config.json` via the same pattern as `hooks/update-check.sh`.
117
84
 
118
- ## Defaults
119
-
120
- - No flags → behave as: `--refresh (only if cache >24h old) → print state`. Silent no-op if cache is fresh and there is no newer version.
85
+ 6. **`--prompt` path** (if set): Spawn `design-update-checker` via Task tool with context `{current_tag, latest_tag, delta, release_body}`. Display response verbatim below the banner. Agent ends with `## UPDATE-CHECKER COMPLETE`.
121
86
 
122
87
  ## Do Not
123
88
 
124
- - Do not fetch from GitHub in this skill directly — always go through `hooks/update-check.sh --refresh` so the caching + state-guard + dismissal logic stays in one place.
125
- - Do not modify `.design/update-available.md` except to delete it on `--dismiss`. The hot-path hook is the only writer of that banner (D-06).
126
- - Do not rewrite `.design/config.json` wholesale — the atomic python rewrite preserves every unknown key (D-14).
127
- - Do not pass variables to the python heredoc via trailing `KEY=VALUE` argv — that assigns to `sys.argv`, not `os.environ`. Use env-prefix form only.
89
+ - Do not fetch from GitHub directly — always go through `hooks/update-check.sh --refresh` so caching + state-guard + dismissal logic stays in one place.
90
+ - Do not modify `.design/update-available.md` except to delete on `--dismiss`.
91
+ - Do not rewrite `.design/config.json` wholesale — the atomic Python rewrite preserves every unknown key (D-14).
92
+ - Do not pass variables to the Python heredoc via trailing `KEY=VALUE` argv — env-prefix form only.
128
93
 
129
94
  ## Completion marker
130
95
 
131
- Last line of output:
132
-
133
96
  ```
134
97
  ## CHECK-UPDATE COMPLETE
135
98
  ```
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: get-design-done:compare
3
- description: "Compute delta between DESIGN.md baseline (from scan) and DESIGN-VERIFICATION.md result (from verify). Reports per-category score delta, anti-pattern delta (resolved vs new), must-have pass/fail change, and design drift (regressions without covering tasks in DESIGN-PLAN.md). Writes .design/COMPARE-REPORT.md."
3
+ description: "Compute the delta between the `DESIGN.md` baseline (from scan) and the `DESIGN-VERIFICATION.md` result (from verify), reporting per-category score delta, anti-pattern delta (resolved vs new), must-have pass/fail change, and design drift (regressions without covering tasks in `DESIGN-PLAN.md`). Use after `verify` to measure whether a design pipeline cycle actually improved the design. Writes `.design/COMPARE-REPORT.md`."
4
4
  argument-hint: ""
5
5
  user-invocable: true
6
6
  ---
@@ -9,6 +9,8 @@ user-invocable: true
9
9
 
10
10
  Standalone delta command. Computes the difference between the scan baseline (`DESIGN.md`) and the verification result (`DESIGN-VERIFICATION.md`), and flags design drift for any regression not covered by an explicit task in `DESIGN-PLAN.md`. Writes one artifact: `.design/COMPARE-REPORT.md`.
11
11
 
12
+ For the full step-by-step methodology (score parsing, set arithmetic for anti-patterns, drift-coverage map, screenshot-delta probe, and `COMPARE-REPORT.md` template), see `./compare-rubric.md`. For the cross-skill output discipline (artifact prefix, completion marker, MUST-NOT-write list, connection-probe pattern), see `../../reference/shared-preamble.md#output-contract-reminders` and `../../reference/shared-preamble.md#connection-handshake-summary`. For the underlying 0–10 category-scoring rubric the delta is computed against, see `../../reference/audit-scoring.md`.
13
+
12
14
  ---
13
15
 
14
16
  ## Scope
@@ -19,7 +21,7 @@ This command is **standalone** — not a pipeline stage:
19
21
  - Does NOT require or implement a snapshot mechanism — multi-run history is deferred to V2-06.
20
22
  - Does NOT mutate any pipeline artifact (`DESIGN.md`, `DESIGN-VERIFICATION.md`, `DESIGN-SUMMARY.md`, `DESIGN-CONTEXT.md`, `DESIGN-PLAN.md`, `.design/STATE.md`).
21
23
  - Writes exactly ONE file: `.design/COMPARE-REPORT.md`.
22
- - Output artifact prefix is `COMPARE-REPORT` distinct from the pipeline namespace (`DESIGN-*.md`). No naming conflict.
24
+ - Output artifact prefix `COMPARE-REPORT` is distinct from the pipeline namespace (`DESIGN-*.md`). No naming conflict.
23
25
 
24
26
  ---
25
27
 
@@ -27,282 +29,43 @@ This command is **standalone** — not a pipeline stage:
27
29
 
28
30
  Required files — abort if either is missing:
29
31
 
30
- ```
31
- .design/DESIGN.md baseline from scan
32
- .design/DESIGN-VERIFICATION.md — result from verify
33
- ```
34
-
35
- **Abort conditions:**
36
-
37
- - If `.design/DESIGN.md` is missing:
38
- > "No baseline found. Run /get-design-done scan first."
39
-
40
- - If `.design/DESIGN-VERIFICATION.md` is missing:
41
- > "No verification result found. Run /get-design-done verify first to produce DESIGN-VERIFICATION.md."
42
-
43
- **Optional files** (graceful degradation if absent):
44
-
45
- - `.design/DESIGN-CONTEXT.md` — used for must-have delta (COMP-03). If missing, skip the Must-Have Status section and emit note: "Must-have delta skipped: DESIGN-CONTEXT.md not found."
46
- - `.design/DESIGN-PLAN.md` — used for drift detection (COMP-04). If missing, skip DRIFT flagging and emit note: "Drift detection skipped: no DESIGN-PLAN.md."
47
-
48
- Confirm `.design/` directory exists. If absent, create it: `mkdir -p .design/`
49
-
50
- ### Probe Preview connection
51
-
52
- Run at stage entry, after pre-flight checks:
53
-
54
- ```
55
- Step P1 — ToolSearch check:
56
- ToolSearch({ query: "Claude_Preview", max_results: 5 })
57
- → Empty result → preview: not_configured (skip Screenshot Delta section)
58
- → Non-empty result → proceed to Step P2
59
-
60
- Step P2 — Live tool call:
61
- call mcp__Claude_Preview__preview_list
62
- → Success → preview: available
63
- → Error → preview: unavailable
64
-
65
- Write preview status to .design/STATE.md <connections>.
66
- ```
67
-
68
- ---
69
-
70
- ## Step 1: Parse Category Scores
71
-
72
- **Extract baseline scores from `.design/DESIGN.md`:**
73
-
74
- Locate the category score table. Expected format:
75
-
76
- ```
77
- | Category | Score | Notes |
78
- |----------|-------|-------|
79
- | Accessibility | 6/10 | ... |
80
- ```
81
-
82
- Parse each row: extract category name and numeric score (e.g., `6` from `6/10`).
83
-
84
- Store as `baseline_scores` map: `{ "Accessibility": 6, "Visual Hierarchy": 5, ... }`
85
-
86
- **Extract result scores from `.design/DESIGN-VERIFICATION.md`:**
87
-
88
- Locate the category score table in the Phase 1 output section. Same format as above.
89
-
90
- Store as `result_scores` map: `{ "Accessibility": 8, "Visual Hierarchy": 6, ... }`
91
-
92
- **Normalize category names:**
93
- - Strip leading/trailing whitespace
94
- - Apply title-case normalization (e.g., `anti-patterns` → `Anti-Patterns`)
95
- - Match categories case-insensitively between the two tables
96
-
97
- **Unmatched categories:**
98
- - If a category appears in `DESIGN.md` but not `DESIGN-VERIFICATION.md` → flag as `[UNMATCHED-BASELINE]` and exclude from score delta
99
- - If a category appears in `DESIGN-VERIFICATION.md` but not `DESIGN.md` → flag as `[UNMATCHED-RESULT]` and exclude from score delta
100
- - Report all unmatched categories in the Notes section of `COMPARE-REPORT.md`
101
- - Do NOT silently paper over category name mismatches
102
-
103
- ---
104
-
105
- ## Step 2: Compute Score Delta (COMP-03)
106
-
107
- For each matched category:
108
-
109
- ```
110
- delta = result_scores[category] - baseline_scores[category]
111
- ```
112
-
113
- Classify each delta:
114
- - `improvement` — delta > 0
115
- - `no_change` — delta == 0
116
- - `regression` — delta < 0
117
-
118
- Record per category:
119
- - `category` — name
120
- - `baseline` — numeric score from DESIGN.md
121
- - `result` — numeric score from DESIGN-VERIFICATION.md
122
- - `delta` — signed integer
123
- - `classification` — improvement / no_change / regression
124
-
125
- Collect all regressed categories for drift detection in Step 5.
126
-
127
- ---
128
-
129
- ## Step 3: Anti-Pattern Delta (COMP-03)
130
-
131
- **Enumerate anti-patterns in DESIGN.md (baseline):**
132
-
133
- Scan for entries identified by BAN-*, SLOP-*, or labeled as anti-patterns in DESIGN.md. Collect identifiers or descriptions as `baseline_anti_patterns` set.
134
-
135
- **Enumerate anti-patterns in DESIGN-VERIFICATION.md (result):**
136
-
137
- Same scan against DESIGN-VERIFICATION.md. Collect as `result_anti_patterns` set.
138
-
139
- **Compute delta:**
140
-
141
- ```
142
- resolved = baseline_anti_patterns - result_anti_patterns
143
- (present in baseline, absent in result — fixed)
144
-
145
- new = result_anti_patterns - baseline_anti_patterns
146
- (absent in baseline, present in result — introduced)
32
+ - `.design/DESIGN.md` missing → `"No baseline found. Run /get-design-done scan first."`
33
+ - `.design/DESIGN-VERIFICATION.md` missing `"No verification result found. Run /get-design-done verify first to produce DESIGN-VERIFICATION.md."`
147
34
 
148
- unchanged = intersection of both sets
149
- (still present in both)
150
- ```
151
-
152
- Report all three groups.
153
-
154
- ---
155
-
156
- ## Step 4: Must-Have Pass/Fail Change (COMP-03)
157
-
158
- **Skip condition:** If `.design/DESIGN-CONTEXT.md` is absent → emit note and skip this section.
159
-
160
- **Extract must-haves:**
161
- - Read `.design/DESIGN-CONTEXT.md` `<must_haves>` section
162
- - Enumerate each declared must-have (ID + description)
163
-
164
- **Read pass/fail status from DESIGN-VERIFICATION.md:**
165
- - Locate the must-have status table in the verification output
166
- - For each must-have: record status as `pass`, `fail`, or `not-evaluated`
167
-
168
- **Report:**
169
- - Each must-have's current status (pass | fail | not-evaluated)
170
- - If DESIGN.md contained a must-have status section from a prior verify, compute change (pass→fail, fail→pass); otherwise report current status only
171
-
172
- ---
173
-
174
- ## Step 5: Design Drift Detection (COMP-04)
175
-
176
- **Skip condition:** If `.design/DESIGN-PLAN.md` is absent → emit note: "Drift detection skipped: DESIGN-PLAN.md not found."
177
-
178
- **Coverage map:**
179
-
180
- Read `.design/DESIGN-PLAN.md` and extract the `Type:` field from each task entry. Build a coverage map of which design categories have at least one task of matching type:
181
-
182
- ```
183
- Example: Type: accessibility → covers "Accessibility" category
184
- Type: color → covers "Color" category
185
- Type: typography → covers "Typography" category
186
- ```
187
-
188
- Category-to-Type matching is case-insensitive and normalized (e.g., `visual-hierarchy` matches `Visual Hierarchy`).
189
-
190
- **Drift check:**
191
-
192
- For each category classified as `regression` in Step 2:
193
-
194
- ```
195
- If category NOT in coverage_map:
196
- → flag: DRIFT: [category] regressed from <baseline> to <result> without a design task of Type:<category>
197
- ```
198
-
199
- If all regressed categories are covered by tasks → emit: "No drift detected. All regressed categories are covered by tasks in DESIGN-PLAN.md."
200
-
201
- If no regressions in Step 2 → emit: "No drift detected. No score regressions found."
35
+ **Optional files (graceful degradation if absent):**
202
36
 
203
- ---
204
-
205
- ## Step 5B: Screenshot Delta (when preview: available)
206
-
207
- Check `preview` status from STATE.md `<connections>` (written by the probe at stage entry).
208
-
209
- **If `preview: available`:**
37
+ - `.design/DESIGN-CONTEXT.md` — used for must-have delta. If missing, skip the Must-Have Status section and emit note: `"Must-have delta skipped: DESIGN-CONTEXT.md not found."`
38
+ - `.design/DESIGN-PLAN.md` — used for drift detection. If missing, skip DRIFT flagging and emit note: `"Drift detection skipped: no DESIGN-PLAN.md."`
210
39
 
211
- 1. Call `preview_start` if no session is already running.
212
- 2. For each route inferred from DESIGN-PLAN.md tasks or `src/app/` / `src/pages/` file structure:
213
- a. `preview_navigate` to route URL (e.g., `http://localhost:3000/<route>`)
214
- b. `preview_screenshot` → save to `.design/screenshots/before/<route>.png` (pre-design baseline — only if a prior run's screenshot exists at this path) and `.design/screenshots/after/<route>.png` (current render)
215
- c. Record the reference path (NOT base64) for embedding in `## Screenshot Delta` section of COMPARE-REPORT.md
216
- 3. Call `preview_stop` when all routes are captured.
40
+ Confirm `.design/` directory exists. If absent: `mkdir -p .design/`.
217
41
 
218
- **If `preview: unavailable` or `preview: not_configured`:**
219
-
220
- Emit exactly: `Screenshot delta skipped — preview not configured.` in the `## Screenshot Delta` section of COMPARE-REPORT.md.
42
+ Probe `preview` connection per `../../reference/shared-preamble.md#connection-handshake-summary` (ToolSearch → live call → STATE.md write). Result drives Step 5B (screenshot delta).
221
43
 
222
44
  ---
223
45
 
224
- ## Step 6: Write COMPARE-REPORT.md (COMP-05)
225
-
226
- Output path: `.design/COMPARE-REPORT.md`
227
-
228
- This file MUST NOT be written to any of the pipeline-reserved paths (`DESIGN.md`, `DESIGN-VERIFICATION.md`, `DESIGN-SUMMARY.md`, `DESIGN-CONTEXT.md`, `DESIGN-PLAN.md`).
229
-
230
- **Report structure:**
231
-
232
- ```markdown
233
- # Compare Report: Baseline vs Result
234
-
235
- **Generated:** <ISO 8601 date>
236
- **Baseline:** .design/DESIGN.md
237
- **Result:** .design/DESIGN-VERIFICATION.md
238
-
239
- ## Score Delta by Category
240
-
241
- | Category | Baseline | Result | Delta | Status |
242
- |----------|----------|--------|-------|--------|
243
- | Accessibility | 6 | 8 | +2 | improvement |
244
- | Visual Hierarchy | 5 | 5 | 0 | no_change |
245
- | Anti-Patterns | 4 | 3 | -1 | regression |
246
- | ... | ... | ... | ... | ... |
247
-
248
- ## Anti-Pattern Delta
46
+ ## Workflow
249
47
 
250
- **Resolved** (present in baseline, absent in result):
251
- - <anti-pattern id or description>
252
-
253
- **New** (absent in baseline, present in result):
254
- - <anti-pattern id or description>
255
-
256
- **Unchanged:**
257
- - <anti-pattern id or description>
258
-
259
- ## Must-Have Status
260
-
261
- | Must-Have | Status |
262
- |-----------|--------|
263
- | <id / description> | pass |
264
- | <id / description> | fail |
265
- | <id / description> | not-evaluated |
266
-
267
- ## Design Drift
268
-
269
- <One of the following:>
270
- - "No drift detected. No score regressions found."
271
- - "No drift detected. All regressed categories are covered by tasks in DESIGN-PLAN.md."
272
- - "DRIFT: [Category] regressed from <baseline> to <result> without a design task of Type:<category>"
273
- - "Drift detection skipped: DESIGN-PLAN.md not found."
274
-
275
- ## Screenshot Delta
276
-
277
- <One of the following:>
278
- - Per-route screenshot pairs (when preview: available): reference paths to .design/screenshots/before/<route>.png and .design/screenshots/after/<route>.png
279
- - "Screenshot delta skipped — preview not configured."
280
-
281
- ## Notes
282
-
283
- Scope: delta between two existing artifacts (.design/DESIGN.md → .design/DESIGN-VERIFICATION.md).
284
- No snapshot mechanism — multi-snapshot compare deferred to V2-06.
285
- This report does not modify DESIGN.md, DESIGN-VERIFICATION.md, or any other pipeline artifact.
286
- <List any UNMATCHED-BASELINE or UNMATCHED-RESULT categories here, if any.>
287
- <If must-have section was skipped: "Must-have delta skipped: DESIGN-CONTEXT.md not found.">
288
- <If drift detection was skipped: "Drift detection skipped: DESIGN-PLAN.md not found.">
289
- ```
290
-
291
- If a section has no items (e.g., no anti-patterns in baseline), write "None."
48
+ 1. **Parse Category Scores** extract baseline + result score tables, normalize names, flag unmatched. Detail: `./compare-rubric.md#step-1--parse-category-scores`.
49
+ 2. **Compute Score Delta** — `delta = result - baseline`, classify (`improvement`/`no_change`/`regression`). Detail: `./compare-rubric.md#step-2--compute-score-delta-comp-03`.
50
+ 3. **Anti-Pattern Delta** — set arithmetic on baseline vs result anti-pattern sets (resolved / new / unchanged). Detail: `./compare-rubric.md#step-3--anti-pattern-delta`.
51
+ 4. **Must-Have Pass/Fail Change** read `<must_haves>` from `DESIGN-CONTEXT.md`, status from `DESIGN-VERIFICATION.md`. Detail: `./compare-rubric.md#step-4--must-have-passfail-change`.
52
+ 5. **Design Drift Detection (COMP-04)** — build coverage map from `DESIGN-PLAN.md` `Type:` fields; for each `regression` not in coverage_map → emit `DRIFT: [category] ...`. Detail: `./compare-rubric.md#step-5--design-drift-detection-comp-04`.
53
+ 6. **Screenshot Delta (preview: available only)** — capture per-route screenshots to `.design/screenshots/{before,after}/<route>.png`. Detail: `./compare-rubric.md#step-5b--screenshot-delta-when-preview-available`.
54
+ 7. **Write `.design/COMPARE-REPORT.md`** — full template at `./compare-rubric.md#step-6--compare-reportmd-template`.
292
55
 
293
56
  ---
294
57
 
295
58
  ## Constraints
296
59
 
297
- This command MUST NOT:
60
+ This command MUST NOT (per `../../reference/shared-preamble.md#output-contract-reminders`):
61
+
62
+ - Write to `DESIGN.md`, `DESIGN-VERIFICATION.md`, `DESIGN-SUMMARY.md`, `DESIGN-CONTEXT.md`, `DESIGN-PLAN.md`, or `.design/STATE.md`.
63
+ - Require or implement a snapshot system (V2-06 deferred).
64
+ - Reinterpret or silently normalize category names that do not match between files — report mismatches in the Notes section.
65
+ - Invoke `design-auditor` or any other pipeline agent.
66
+ - Produce more than one output file: `.design/COMPARE-REPORT.md`.
298
67
 
299
- - MUST NOT write to `DESIGN.md`, `DESIGN-VERIFICATION.md`, `DESIGN-SUMMARY.md`, `DESIGN-CONTEXT.md`, `DESIGN-PLAN.md`, or `.design/STATE.md`
300
- - MUST NOT require or implement a snapshot system (V2-06 deferred)
301
- - MUST abort with a clear actionable error message if `DESIGN-VERIFICATION.md` is missing (Pitfall 3)
302
- - MUST abort with a clear actionable error message if `DESIGN.md` (baseline) is missing
303
- - MUST produce exactly one output file: `.design/COMPARE-REPORT.md`
304
- - MUST NOT reinterpret or silently normalize category names that do not match between files — report mismatches explicitly in the Notes section
305
- - MUST NOT invoke design-auditor or any other pipeline agent
68
+ Must abort with a clear actionable error message if either input file (`DESIGN.md` baseline, `DESIGN-VERIFICATION.md` result) is missing.
306
69
 
307
70
  ---
308
71
 
@@ -314,9 +77,6 @@ After writing `.design/COMPARE-REPORT.md`, print a summary:
314
77
  Compare complete. Improvements: N. Regressions: M. Drift flags: K. See .design/COMPARE-REPORT.md.
315
78
  ```
316
79
 
317
- Where:
318
- - `N` = count of categories classified as `improvement`
319
- - `M` = count of categories classified as `regression`
320
- - `K` = count of DRIFT flags emitted (0 if drift detection was skipped or no regressions)
80
+ Where `N` = improvement count, `M` = regression count, `K` = DRIFT-flag count (0 if drift detection was skipped or no regressions). Do not summarize individual issues — the file contains the full detail.
321
81
 
322
- Do not summarize individual issues in the completion message — the file contains the full detail.
82
+ ## COMPARE COMPLETE