Repository navigation
Commit 1f4da76
step 5 recalibrated: vendor + slim detector + split rules into detector vs review-prompt
Wholesale rewrite of the detector after a 4-subagent audit surfaced
substantial gaps in the original 26-rule set. Key reframe: not every
"slop rule" should be a deterministic detector rule. Some are
vocab-unbounded, brand-and-register-dependent, or structural-pattern
judgment calls that LLM judgment in the /visualize:review prompt
handles better than regex thresholds.
# What got split
DETECTOR (kept, all mechanical):
fossil: lorem-ipsum, citation-artifact (incl. 【N†source】 /
ASSISTANT: / model_assistant: variants), agent-attribution
("Generated by Claude / by AI / with AI assistance")
slop: generic-gradient (now incl. radial- / conic-gradient + OKLCH-
aware corridor detection via culori), gradient-text, dark-glow
(blur threshold lowered to 12px; chroma via culori), glassmorphism
(NEW: backdrop-filter + translucent surface), emoji-heading (first
char only), monotonous-spacing, bounce-easing (now catches
spring-style y1>1 overshoot), side-tab (now matches longhand
border-X-width/-color), system-default-font (brand-aware, fires
only when DESIGN.md fonts declared)
a11y: missing-alt (incl. lazy-alt detection: "image" / "DSC_0042" /
" " / filenames), missing-lang (rejects lang=""), empty-link,
low-contrast (REAL — culori-powered WCAG ratio; skips
transparent / .is-pending / opacity:0), heading-structure (NEW:
missing h1 / multiple h1 / skipped levels)
meta: missing-title, missing-favicon, missing-og (rejects empty
content=""), external-script (allowlist now mermaid + chart.js
on jsdelivr, plus unpkg + displaydev per spec; PROMOTED to
error severity per oracle review)
perf: layout-thrash (catches `transition: all` plus width/height/
top/left; progress-bar shapes allowlisted via class-name
regex), img-no-dimensions (NEW: CLS risk)
MOVED TO REVIEW-PROMPT (LLM judgment in SKILL.md):
- fossil/mock-identity (real names vs invented unbounded)
- fossil/slop-opener (vocab unbounded — "leverage / streamline /
empower / cutting-edge / In conclusion / TL;DR:")
- fossil/sycophant-footer (vocab unbounded — "Best, Claude /
Hopefully this addresses / Generated with AI")
- fossil/imperative-tricolon (sloppy vs poetic — judgment call)
- slop/ai-color-palette (genuine palette vs brand identity)
- slop/icon-tile-stack (structural pattern, register-dependent)
- slop/center-everything (Bauhaus / Swiss / academic FP)
- slop/uppercase-body (acronyms vs body — HTML / POST / WCAG
flooded the corpus with false positives)
- triple-feature-card / trust-signal slop / infinite animation /
responsive overflow (no clean detection pattern)
# Vendored libs
visualize/scripts/vendor/node-html-parser.mjs (~381KB, MIT) +
visualize/scripts/vendor/culori.mjs (~95KB, MIT). Bundled inline via
esbuild from npm packages node-html-parser@7.1.0 and culori@4.0.2.
No package.json, no `npm install` step — `npx skills add display-dev/
visualize` brings everything. Re-bundle command documented in
visualize/scripts/vendor/README.md.
# Bug fixes from subagent audit
- Per-locator dedup collapsed N findings to 1 when locator was static.
Fixed by including the rule's finding-index in the dedup key.
- brandProfile never flowed through CLI. Now auto-loads DESIGN.md from
any ancestor of the artifact path; --brand <path> overrides.
- a11y/low-contrast was a placeholder emitting noisy info-skip lines.
Now actually computes contrast via culori; skips intentionally-invisible
selectors (.is-pending / transparent / opacity:0 / .visually-hidden).
- meta/external-script allowlist updated to spec (unpkg + displaydev
added; promoted from warn to error per oracle).
- CSS comments now stripped before selector matching (prevented
false positive on slide-deck where the brand-overlay comment
matched a perf/layout-thrash rule).
# Smoke results
- Adversarial slop fixture (lorem-ipsum + gradient text + AI palette +
citation comment + missing alt + missing title + dark glow + …):
8 errors / 4 warnings / 2 info. --strict exits 2.
- Full 46-file template catalogue: 0 errors. Only 1 legitimate warning
remains (api-reference template's real h1→h4 heading skip — worth
fixing in a separate template-polish pass, not a detector issue).
- detect.mjs runs <30ms per template (well under the 100ms budget).
# What's new in /visualize:review
SKILL.md section "Review verb procedure" rewritten as two distinct
layers: (1) deterministic detect.mjs findings, (2) LLM judgment with
the moved rules listed explicitly so the agent reads them and applies
register awareness / brand context / semantic judgment the detector
deliberately doesn't try.
Replaces the 26-rule single-layer detector from c6a2408.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent c6a2408 commit 1f4da76
22 files changed
Lines changed: 40516 additions & 2269 deletions
File tree
- .github/workflows
- hermes/design/visualize
- scripts
- vendor
- pi/agent/skills/visualize
- scripts
- vendor
- skills/visualize
- scripts
- vendor
- visualize
- scripts
- vendor
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
48 | 47 | | |
49 | 48 | | |
50 | | - | |
| 49 | + | |
51 | 50 | | |
52 | | - | |
| 51 | + | |
53 | 52 | | |
54 | 53 | | |
55 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
34 | 38 | | |
35 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
36 | 54 | | |
37 | 55 | | |
38 | 56 | | |
39 | | - | |
| 57 | + | |
40 | 58 | | |
41 | 59 | | |
42 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
43 | 63 | | |
44 | 64 | | |
45 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
| 122 | + | |
127 | 123 | | |
128 | | - | |
| 124 | + | |
129 | 125 | | |
130 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
131 | 156 | | |
132 | 157 | | |
133 | 158 | | |
| |||
0 commit comments