Detector: add italic-serif display headline + hero eyebrow chip rules (#127)#129
Merged
pbakaus merged 4 commits intopbakaus:mainfrom May 2, 2026
Merged
Conversation
…w chips (pbakaus#127) Two new rules covering the structural tells of late-2025/early-2026 AI-generated marketing pages. - italic-serif-display: oversized italic serif (Fraunces, Recoleta, Newsreader, Playfair, Cormorant, Tiempos, ...) as the primary hero headline. Anchored on h1 (or h2 at >= 48px) with font-style: italic and a serif primary face. - hero-eyebrow-chip: uppercase letter-spaced label sitting as the previousElementSibling of a hero h1 (font-size >= 48px). Bounded text length 2-30 chars, letter-spacing >= 1.6px, font-size <= 14px. The pill-chip variant (background + border-radius: 999px) falls out of the same gates for free. Both follow the existing icon-tile-stack pattern: pure check function + browser DOM adapter + jsdom adapter, wired into both element loops. Two-column fixtures (4 flag / 6 pass each) drive the jsdom tests. Skill copy in source/skills/impeccable/reference/typography.md and critique.md calls out the patterns by name. The italic-serif rule's description acknowledges that editorial/magazine register may legitimately want the pattern -- judge by context. Closes pbakaus#127 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Owner
|
Nice addition, thank you! I merged in the latest from main (did a big refactor to Astro for the site), and I removed the new sections in the skill files - those were too verbose. Otherwise excellent. Flags Impeccable's own branding of course, but I think that's OK. there will always be legitimate reasons to use italic (Impeccable's brand is inspired by "Devil Wears Prada" fashion/editorial aesthetic). |
8 tasks
Contributor
Author
|
Thanks for the merge |
pbakaus
pushed a commit
that referenced
this pull request
May 4, 2026
- Detector: italic-serif display heroes and hero eyebrow chips (#129, contributed by @vinaypokharkar). - Live mode: durable session journal, status/resume/complete commands (#125, contributed by @nqh-packages). - Reference files: stripped "Remember:" closer chants, brochure-style openers (12 files), and 419 em-dashes. Less context per command load, less repetition the model reads past. Refresh harness output dirs and plugin/ subtree. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #127.
Summary
Two new structural anti-pattern rules covering the category-defining tells of late-2025/early-2026 AI-generated marketing pages, both visible side-by-side on the Lumina demo page referenced in the issue.
italic-serif-displayh1.hero-eyebrow-chipAI-NATIVE WORKFLOWS) — or pill-chip variant — sitting aspreviousElementSiblingof a heroh1.Both follow the existing
icon-tile-stackpattern: pure check function + browser DOM adapter + jsdom adapter, wired into both element loops. Two-column fixtures drive the jsdom tests.Implementation map
src/detect-antipatterns.mjsKNOWN_SERIF_FONTSconstant; twoANTIPATTERNSentries; purecheckItalicSerif/checkHeroEyebrow+resolveSerifhelper; browser adapters (checkElementItalicSerifDOM,checkElementHeroEyebrowDOM); jsdom adapters (checkElementItalicSerif,checkElementHeroEyebrow); wired into both element loops (if (IS_BROWSER) ...~L2562 anddetectHtml(...)~L2969).tests/fixtures/antipatterns/italic-serif-display.htmltests/fixtures/antipatterns/hero-eyebrow-chip.htmltests/detect-antipatterns-fixtures.test.mjsdescribeblocks, snippet-extraction pattern matches existingicon-tile-stacktest.source/skills/impeccable/reference/typography.mdsource/skills/impeccable/reference/critique.mdpublic/index.html,README.npm.md,public/js/generated/counts.js.claude/,.cursor/,.gemini/, ...)bun run buildfrom the source skill files above.src/detect-antipatterns-browser.jsbun run build:browserto include the new browser DOM adapters.Detection gates
italic-serif-displayh1, ORh2with computedfont-size >= 48px.font-style === 'italic'.font-size >= 48px.KNOWN_SERIF_FONTS, OR the stack ends in the genericseriftoken.hero-eyebrow-chipAnchored on a hero
h1(font-size >= 48px), gates onpreviousElementSibling:text.lengthbetween 2 and 30 chars.text-transform: uppercaseOR content typed uppercase.letter-spacing >= 1.6px(jsdom path resolves em → px via existingresolveLengthPxhelper).font-size <= 14px.Test plan
node --test tests/detect-antipatterns-fixtures.test.mjs— 22/22 passing (includes two new describe blocks).bun test tests/detect-antipatterns.test.js— 160/160 passing, no regressions.bun run build— clean, generates27 detection rules, all build validators pass (counts, em-dashes, site headers).bun run build:browser— clean output, browser DOM adapters present.bun run build:extension— extension reports 27 rules.bun run dev+ browser inject — every left-column case gets a labeled overlay, every right-column case stays clean.hero-eyebrow-chipdoes not fire on any of the uppercase tracked labels in nav/section kickers (no false positives).Notes for review
italic-serif-displayflags the impeccable homepage's own Cormorant-Garamond italic hero. This is a true positive on the pattern matcher — the homepage uses the exact pattern the rule catches. Whether to (a) accept the self-reflexive flag, (b) update the homepage hero, or (c) add the impeccable domain to a register-allowed list (mirroringBRAND_FONT_DOMAINSatsrc/detect-antipatterns.mjs:77) is a maintainer call I deliberately left open.hero-eyebrow-chipis DOM/jsdom-only. Same asicon-tile-stack— sibling-relationship rules need DOM context that regex on raw source can't reliably reconstruct.--fastmode and JSX/Vue/Svelte source scans don't fire this rule, consistent with existing precedent.<em>inside an otherwise-romanh1(would need richer DOM walking), mesh / radial gradient hero backgrounds, border-radius monotony.Note
Medium Risk
Adds two new DOM-based detection rules and wires them into both the jsdom and browser scanning paths, which can change scan output and introduce false positives/negatives. Updates multiple generated/docs surfaces and counts, so regressions are mostly around detector behavior and consistency checks rather than runtime safety.
Overview
Adds two new deterministic anti-pattern rules to the detector:
italic-serif-display(hero-scale italic serif headlines using a known/serif-fallback font stack) andhero-eyebrow-chip(small uppercase, tracked eyebrow/pill immediately preceding a heroh1), including font-stack parsing viaKNOWN_SERIF_FONTS/resolveSerif.Wires both rules into the browser overlay scanner and the jsdom
detectHtmlpath, with new fixtures and fixture tests to lock expected flag/pass behavior. Updates rule-count references across docs/site/README/generated counts (25 → 27) and adds sandbox workflow notes inAGENTS.md.Reviewed by Cursor Bugbot for commit 4807abb. Bugbot is set up for automated code reviews on this repo. Configure here.