impeccable 3.2.0 → 3.3.0

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.
@@ -21,6 +21,7 @@ const ANTIPATTERNS = [
21
21
  {
22
22
  id: 'overused-font',
23
23
  category: 'slop',
24
+ scopes: ['type'],
24
25
  name: 'Overused font',
25
26
  description:
26
27
  'Inter, Roboto, Fraunces, Geist, Plus Jakarta Sans, and Space Grotesk are used on so many sites they no longer feel distinctive. Each new wave of AI-generated UIs converges on the same handful of faces. Choose a face that gives your interface personality.',
@@ -30,15 +31,17 @@ const ANTIPATTERNS = [
30
31
  {
31
32
  id: 'single-font',
32
33
  category: 'slop',
33
- name: 'Single font for everything',
34
+ scopes: ['type'],
35
+ name: 'Single font without hierarchy',
34
36
  description:
35
- 'Only one font family is used for the entire page. Pair a distinctive display font with a refined body font to create typographic hierarchy.',
37
+ 'Only one font family is used for the entire page. A single family can work when weight and size contrast carry the hierarchy; otherwise pair a distinctive display font with a refined body font.',
36
38
  skillSection: 'Typography',
37
39
  skillGuideline: 'only one font family for the entire page',
38
40
  },
39
41
  {
40
42
  id: 'flat-type-hierarchy',
41
43
  category: 'slop',
44
+ scopes: ['type'],
42
45
  name: 'Flat type hierarchy',
43
46
  description:
44
47
  'Font sizes are too close together — no clear visual hierarchy. Use fewer sizes with more contrast (aim for at least a 1.25 ratio between steps).',
@@ -75,6 +78,7 @@ const ANTIPATTERNS = [
75
78
  {
76
79
  id: 'nested-cards',
77
80
  category: 'slop',
81
+ scopes: ['layout'],
78
82
  name: 'Nested cards',
79
83
  description:
80
84
  'Cards inside cards create visual noise and excessive depth. Flatten the hierarchy — use spacing, typography, and dividers instead of nesting containers.',
@@ -84,6 +88,7 @@ const ANTIPATTERNS = [
84
88
  {
85
89
  id: 'monotonous-spacing',
86
90
  category: 'slop',
91
+ scopes: ['layout'],
87
92
  name: 'Monotonous spacing',
88
93
  description:
89
94
  'The same spacing value used everywhere — no rhythm, no variation. Use tight groupings for related items and generous separations between sections.',
@@ -99,18 +104,64 @@ const ANTIPATTERNS = [
99
104
  skillSection: 'Motion',
100
105
  skillGuideline: 'bounce or elastic easing',
101
106
  },
107
+ {
108
+ id: 'pulsing-dot',
109
+ category: 'slop',
110
+ name: 'Pulsing status dot',
111
+ description:
112
+ 'Small pulsing status dots simulate liveness decoratively. Reserve pulse animation for indicators tied to genuinely live, changing data; a static indicator with clear labeling is honest and calmer.',
113
+ skillSection: 'Motion',
114
+ skillGuideline: 'decorative pulsing status dot',
115
+ },
116
+ {
117
+ id: 'blinking-cursor',
118
+ category: 'slop',
119
+ severity: 'advisory',
120
+ name: 'Decorative blinking cursor',
121
+ description:
122
+ 'A blinking text cursor animated into a hero or landing section simulates typing where no input exists. It borrows the dev-tool aesthetic as decoration. Real editable fields draw their own caret; anywhere else, let the composition hold attention without a fake prompt.',
123
+ skillSection: 'Motion',
124
+ },
125
+ {
126
+ id: 'shape-assembled-illustration',
127
+ category: 'slop',
128
+ severity: 'advisory',
129
+ name: 'Shape-assembled illustration',
130
+ description:
131
+ 'A large inline SVG that builds a pictorial scene from a pile of primitive shapes reads as placeholder clip art, not illustration. Icons, logos, and data graphics are fine at their scale; a hero-sized visual deserves real artwork, a photograph, or a deliberately drawn graphic.',
132
+ skillSection: 'Imagery',
133
+ },
102
134
  {
103
135
  id: 'dark-glow',
104
136
  category: 'slop',
105
- name: 'Dark mode with glowing accents',
137
+ name: 'Glowing shadow accents',
106
138
  description:
107
- 'Dark backgrounds with colored box-shadow glows are the default "cool" look of AI-generated UIs. Use subtle, purposeful lighting instead — or skip the dark theme entirely.',
139
+ 'Colored glow shadows — a zero-offset chromatic halo (box- or text-shadow) on any background, or any colored blurred shadow on a dark background — are the default "cool" look of AI-generated UIs. Use neutral elevation shadows and subtle, purposeful lighting instead.',
108
140
  skillSection: 'Color & Contrast',
109
141
  skillGuideline: 'dark mode with glowing accents',
110
142
  },
143
+ {
144
+ id: 'radial-halo',
145
+ category: 'slop',
146
+ name: 'Radial-gradient background halo',
147
+ description:
148
+ 'A chromatic radial-gradient wash — saturated at the center, fading to transparent — used as a decorative background glow on a dark page. Same tell as glowing shadows, drawn with a gradient instead of a shadow. Ground the surface with a solid or subtly shifted background instead.',
149
+ skillSection: 'Color & Contrast',
150
+ skillGuideline: 'dark mode with glowing accents',
151
+ },
152
+ {
153
+ id: 'marquee',
154
+ category: 'slop',
155
+ name: 'Auto-scrolling marquee',
156
+ description:
157
+ 'Continuously auto-scrolling content demands attention it has not earned and hides half its content at any moment. Reserve motion for content that changes; let readers move at their own pace.',
158
+ skillSection: 'Motion',
159
+ skillGuideline: 'auto-scrolling marquee',
160
+ },
111
161
  {
112
162
  id: 'icon-tile-stack',
113
163
  category: 'slop',
164
+ scopes: ['layout'],
114
165
  name: 'Icon tile stacked above heading',
115
166
  description:
116
167
  'A small rounded-square icon container above a heading is the universal AI feature-card template — every generator outputs this exact shape. Try a side-by-side icon and heading, or let the icon sit in flow without its own container.',
@@ -120,6 +171,7 @@ const ANTIPATTERNS = [
120
171
  {
121
172
  id: 'italic-serif-display',
122
173
  category: 'slop',
174
+ scopes: ['type'],
123
175
  name: 'Italic serif display headline',
124
176
  description:
125
177
  'Oversized italic serif (Fraunces, Recoleta, Playfair, Newsreader-italic) as the primary hero headline reads as taste in isolation but has become the universal AI-startup landing page hero. Set roman, or move to a non-serif display face. Editorial / magazine register may legitimately want this — judge by context.',
@@ -129,6 +181,7 @@ const ANTIPATTERNS = [
129
181
  {
130
182
  id: 'hero-eyebrow-chip',
131
183
  category: 'slop',
184
+ scopes: ['type'],
132
185
  name: 'Hero eyebrow / pill chip',
133
186
  description:
134
187
  'A tiny uppercase letter-spaced label sitting immediately above an oversized hero headline — or the same shape rendered as a pill chip — is now the default AI SaaS hero. Drop the eyebrow, integrate the kicker into the headline, or run it as a navigation breadcrumb instead.',
@@ -138,6 +191,7 @@ const ANTIPATTERNS = [
138
191
  {
139
192
  id: 'repeated-section-kickers',
140
193
  category: 'slop',
194
+ scopes: ['type'],
141
195
  severity: 'advisory',
142
196
  name: 'Repeated section kicker labels',
143
197
  description:
@@ -146,12 +200,13 @@ const ANTIPATTERNS = [
146
200
  skillGuideline: 'repeated eyebrow or kicker labels as section scaffolding',
147
201
  },
148
202
  {
149
- id: 'numbered-section-markers',
203
+ id: 'numbered-section-labels',
150
204
  category: 'slop',
205
+ scopes: ['type'],
151
206
  severity: 'advisory',
152
- name: 'Numbered section markers (01 / 02 / 03)',
207
+ name: 'Tiny numbered section labels',
153
208
  description:
154
- 'Numbered display markers as section labels (01, 02, 03) are the AI editorial scaffold one tier deeper than tracked eyebrow chips. If you find yourself reaching for them, choose a different section cadence.',
209
+ 'Small numeric index labels riding next to section headings, repeated section after section, are AI editorial scaffolding — a page numbering its own chapters instead of earning structure. Let hierarchy, content, and rhythm carry the sequence.',
155
210
  skillSection: 'Layout & Space',
156
211
  skillGuideline: 'numbered section markers',
157
212
  },
@@ -185,6 +240,7 @@ const ANTIPATTERNS = [
185
240
  {
186
241
  id: 'oversized-h1',
187
242
  category: 'slop',
243
+ scopes: ['type'],
188
244
  name: 'Oversized hero headline',
189
245
  description:
190
246
  'A full-sentence headline set at display size ends up dominating the viewport, leaving no room for anything else above the fold. A punchy one- or two-word headline at that size is fine — the problem is a long headline blown up too large. Set long headlines smaller, or tighten the copy.',
@@ -194,6 +250,7 @@ const ANTIPATTERNS = [
194
250
  {
195
251
  id: 'extreme-negative-tracking',
196
252
  category: 'slop',
253
+ scopes: ['type'],
197
254
  name: 'Crushed letter spacing',
198
255
  description:
199
256
  'Letter-spacing pulled tighter than the point where characters keep their own shapes costs legibility. Tighten display type optically, not destructively.',
@@ -211,6 +268,49 @@ const ANTIPATTERNS = [
211
268
  },
212
269
 
213
270
  // ── Quality: general design and accessibility issues ──
271
+ {
272
+ id: 'script-error',
273
+ category: 'quality',
274
+ severity: 'error',
275
+ name: 'Uncaught script error on load',
276
+ description:
277
+ 'A script threw an uncaught exception or failed to parse while the page loaded. Broken JavaScript silently kills reveals, interactions, and dynamic content, and can leave most of a page invisible. Fix the error before judging anything else.',
278
+ },
279
+ {
280
+ id: 'content-hidden-at-rest',
281
+ category: 'quality',
282
+ severity: 'error',
283
+ scopes: ['layout'],
284
+ name: 'Content invisible at rest',
285
+ description:
286
+ 'A large share of the page text sits at opacity 0 or visibility hidden even after every reveal handler had a chance to run. This is the failed-reveal signature: the content shipped but never becomes visible. Make content visible by default and let JavaScript enhance its entrance instead of gating its existence.',
287
+ },
288
+ {
289
+ id: 'edge-flush-cards',
290
+ category: 'quality',
291
+ scopes: ['layout'],
292
+ name: 'Cards flush against the scroller edge',
293
+ description:
294
+ 'Cards inside a horizontal scroller or tab panel sit flush against the container edge at rest while keeping a gutter on the other side, so their edges and rounded corners get cut off. Usually the panel is sized wider than its clip box. Keep a consistent inset on both sides.',
295
+ },
296
+ {
297
+ id: 'text-occlusion',
298
+ category: 'quality',
299
+ scopes: ['layout'],
300
+ name: 'Text occluded by an overlapping element',
301
+ description:
302
+ 'Text is painted under an opaque element or a second text run, so part of it cannot be read. A decorative box, a stacked layer, or an inline element with leaked padding lands on the words instead of beside them. Give overlapping layers room, or move the text out from under the layer above it.',
303
+ skillSection: 'Layout & Space',
304
+ },
305
+ {
306
+ id: 'first-viewport-column-overflow',
307
+ category: 'quality',
308
+ scopes: ['layout'],
309
+ name: 'One column stretches the first viewport',
310
+ description:
311
+ 'A multi-column opening section lets one column run far past the fold while its sibling fits in a single viewport, so the short column floats in dead space and the fold falls deep inside one section. Balance the columns, cap the tall one, or let the long content flow below the opening row.',
312
+ skillSection: 'Layout & Space',
313
+ },
214
314
  {
215
315
  id: 'gray-on-color',
216
316
  category: 'quality',
@@ -239,6 +339,7 @@ const ANTIPATTERNS = [
239
339
  {
240
340
  id: 'line-length',
241
341
  category: 'quality',
342
+ scopes: ['type', 'layout'],
242
343
  name: 'Line length too long',
243
344
  description:
244
345
  'Text lines wider than ~80 characters are hard to read. The eye loses its place tracking back to the start of the next line. Add a max-width (65ch to 75ch) to text containers.',
@@ -248,6 +349,7 @@ const ANTIPATTERNS = [
248
349
  {
249
350
  id: 'cramped-padding',
250
351
  category: 'quality',
352
+ scopes: ['layout'],
251
353
  name: 'Cramped padding',
252
354
  description:
253
355
  'Text is too close to the edge of its container. Two shapes: (1) an element with its own text where the padding is too low for the font size, and (2) a wrapper with text-bearing children and near-zero padding against a visible boundary (border, outline, or non-transparent background) — children land flush against the boundary line. Add at least 8px (ideally 12–16px) of padding inside bordered, outlined, or colored containers.',
@@ -257,6 +359,7 @@ const ANTIPATTERNS = [
257
359
  {
258
360
  id: 'body-text-viewport-edge',
259
361
  category: 'quality',
362
+ scopes: ['layout'],
260
363
  name: 'Body text touching viewport edge',
261
364
  description:
262
365
  'Body paragraphs render flush against the left or right viewport edge with no container providing horizontal padding. Wrap content in a container with at least 16px (ideally 24-32px) of horizontal padding, or apply max-width with mx-auto.',
@@ -264,6 +367,7 @@ const ANTIPATTERNS = [
264
367
  {
265
368
  id: 'tight-leading',
266
369
  category: 'quality',
370
+ scopes: ['type'],
267
371
  name: 'Tight line height',
268
372
  description:
269
373
  'Line height below 1.3x the font size makes multi-line text hard to read. Use 1.5 to 1.7 for body text so lines have room to breathe.',
@@ -271,13 +375,24 @@ const ANTIPATTERNS = [
271
375
  {
272
376
  id: 'skipped-heading',
273
377
  category: 'quality',
378
+ scopes: ['type'],
274
379
  name: 'Skipped heading level',
275
380
  description:
276
381
  'Heading levels should not skip (e.g. h1 then h3 with no h2). Screen readers use heading hierarchy for navigation. Skipping levels breaks the document outline.',
277
382
  },
383
+ {
384
+ id: 'heading-rhythm',
385
+ category: 'quality',
386
+ scopes: ['layout', 'type'],
387
+ name: 'Heading crowded against the previous block',
388
+ description:
389
+ 'A heading binds to the content it introduces, so the rendered space above it should exceed the space below it. When headings across a page sit as close or closer to the block above than to their own content, every section reads as if it captions the previous one. Open up the space above each heading.',
390
+ skillSection: 'Layout & Space',
391
+ },
278
392
  {
279
393
  id: 'justified-text',
280
394
  category: 'quality',
395
+ scopes: ['type'],
281
396
  name: 'Justified text',
282
397
  description:
283
398
  'Justified text without hyphenation creates uneven word spacing ("rivers of white"). Use text-align: left for body text, or enable hyphens: auto if you must justify.',
@@ -285,6 +400,7 @@ const ANTIPATTERNS = [
285
400
  {
286
401
  id: 'tiny-text',
287
402
  category: 'quality',
403
+ scopes: ['type'],
288
404
  name: 'Tiny body text',
289
405
  description:
290
406
  'Body text below 12px is hard to read, especially on high-DPI screens. Use at least 14px for body content, 16px is ideal.',
@@ -292,6 +408,7 @@ const ANTIPATTERNS = [
292
408
  {
293
409
  id: 'all-caps-body',
294
410
  category: 'quality',
411
+ scopes: ['type'],
295
412
  name: 'All-caps body text',
296
413
  description:
297
414
  'Long passages in uppercase are hard to read. We recognize words by shape (ascenders and descenders), which all-caps removes. Reserve uppercase for short labels and headings.',
@@ -301,6 +418,7 @@ const ANTIPATTERNS = [
301
418
  {
302
419
  id: 'wide-tracking',
303
420
  category: 'quality',
421
+ scopes: ['type'],
304
422
  name: 'Wide letter spacing on body text',
305
423
  description:
306
424
  'Letter spacing above 0.05em on body text disrupts natural character groupings and slows reading. Reserve wide tracking for short uppercase labels only.',
@@ -308,15 +426,24 @@ const ANTIPATTERNS = [
308
426
  {
309
427
  id: 'text-overflow',
310
428
  category: 'quality',
429
+ scopes: ['layout'],
311
430
  name: 'Content overflowing its container',
312
431
  description:
313
432
  'Content renders wider than its container, spilling out or forcing a horizontal scrollbar. Let text wrap, constrain widths, or give the region a deliberate scroll affordance.',
314
433
  skillSection: 'Layout & Space',
315
434
  skillGuideline: 'content wider than its container',
316
435
  },
436
+ {
437
+ id: 'repeated-container-text',
438
+ category: 'quality',
439
+ name: 'Same text repeated inside one container',
440
+ description:
441
+ 'The same literal text rendered three or more times in structurally different spots inside a single card or panel is redundant messaging — usually a status or label wired into every slot of a template. Say it once, in the slot where it matters most.',
442
+ },
317
443
  {
318
444
  id: 'clipped-overflow-container',
319
445
  category: 'quality',
446
+ scopes: ['layout'],
320
447
  name: 'Positioned child clipped by overflow container',
321
448
  description:
322
449
  'A clipping container (overflow hidden or clip) wrapping an absolutely-positioned child cuts off tooltips, menus, and popovers that need to escape. Let the overflow be visible, or move the positioned layer out of the clip.',
@@ -326,6 +453,7 @@ const ANTIPATTERNS = [
326
453
  {
327
454
  id: 'design-system-font',
328
455
  category: 'quality',
456
+ scopes: ['type'],
329
457
  name: 'Font outside DESIGN.md',
330
458
  description:
331
459
  'A font is used that is not declared in DESIGN.md typography. Use the documented type system or update DESIGN.md if this is an intentional brand addition.',
@@ -352,13 +480,23 @@ const ANTIPATTERNS = [
352
480
  skillSection: 'Visual Details',
353
481
  skillGuideline: 'border radius outside the project design system',
354
482
  },
483
+ {
484
+ id: 'design-system-font-size',
485
+ category: 'quality',
486
+ severity: 'advisory',
487
+ scopes: ['type'],
488
+ name: 'Font size outside DESIGN.md',
489
+ description:
490
+ 'A literal font-size is off the type ramp documented in DESIGN.md typography. Use a documented size step or update the design system if the new step is intentional.',
491
+ skillSection: 'Typography',
492
+ skillGuideline: 'font size outside the project design system',
493
+ },
355
494
 
356
- // ── Provider tells: opt-in via --gpt / --gemini (gated off by default) ──
495
+ // ── Common generated-UI tells ───────────────────────────────────────────
357
496
  {
358
497
  id: 'gpt-thin-border-wide-shadow',
359
498
  category: 'slop',
360
499
  severity: 'advisory',
361
- gated: 'gpt',
362
500
  name: 'Hairline border with wide shadow',
363
501
  description:
364
502
  'A hairline border paired with a wide, diffuse shadow is a recurring generated-UI signature. Commit to one — a defined edge or a soft elevation — rather than both at once.',
@@ -369,7 +507,6 @@ const ANTIPATTERNS = [
369
507
  id: 'repeating-stripes-gradient',
370
508
  category: 'slop',
371
509
  severity: 'advisory',
372
- gated: 'gpt',
373
510
  name: 'Repeating-gradient stripes',
374
511
  description:
375
512
  'Repeating-gradient stripes used as surface decoration are a recurring generated-UI signature. Reach for a deliberate texture or leave the surface plain.',
@@ -380,10 +517,9 @@ const ANTIPATTERNS = [
380
517
  id: 'codex-grid-background',
381
518
  category: 'slop',
382
519
  severity: 'advisory',
383
- gated: 'gpt',
384
520
  name: 'Decorative grid-line background',
385
521
  description:
386
- 'A two-axis grid drawn with hairline linear-gradient layers ("1px, transparent 1px" on both axes) is a recurring generated-UI signature. Reserve grid overlays for actual canvas, map, blueprint, or measurement surfaces; elsewhere use product structure or a plain surface.',
522
+ 'A decorative grid or line-field background drawn with hairline linear-gradient layers tiled by a fixed pixel cell is a recurring generated-UI signature. Reserve grid overlays for actual canvas, map, blueprint, or measurement surfaces; elsewhere use product structure or a plain surface.',
387
523
  skillSection: 'Visual Details',
388
524
  skillGuideline: 'two-axis grid-line gradient background',
389
525
  },
@@ -391,7 +527,6 @@ const ANTIPATTERNS = [
391
527
  id: 'theater-slop-phrase',
392
528
  category: 'slop',
393
529
  severity: 'advisory',
394
- gated: 'gpt',
395
530
  name: 'Theater framing copy',
396
531
  description:
397
532
  'Dismissing something as "theater" is a recurring generated-copy tic. Say plainly what the thing does or does not do.',
@@ -402,7 +537,6 @@ const ANTIPATTERNS = [
402
537
  id: 'image-hover-transform',
403
538
  category: 'slop',
404
539
  severity: 'advisory',
405
- gated: 'gemini',
406
540
  name: 'Image hover transform',
407
541
  description:
408
542
  'Scaling or rotating an image on hover is a recurring generated-UI signature. Let imagery sit still, or use a subtler, purposeful interaction.',
@@ -430,30 +564,29 @@ function getRuleEngineSupport(engine) {
430
564
  return RULE_ENGINE_SUPPORT[engine] || new Set();
431
565
  }
432
566
 
433
- // Set of provider tags that gate rules off by default (e.g. 'gpt', 'gemini').
434
- const GATED_PROVIDERS = new Set(
435
- ANTIPATTERNS.map(rule => rule.gated).filter(Boolean),
567
+ // Set of scope tags rules can declare (e.g. 'type', 'layout'). Used by the
568
+ // CLI --scope flag to narrow output to one design domain.
569
+ const RULE_SCOPES = new Set(
570
+ ANTIPATTERNS.flatMap(rule => rule.scopes || []),
436
571
  );
437
572
 
438
- // Drop findings for rules gated behind a provider tag unless that provider
439
- // was explicitly enabled (CLI --gpt / --gemini). Non-gated findings always
440
- // pass through. `findings` carry the rule id on `.antipattern`.
441
- function filterByProviders(findings, providers = []) {
442
- const enabled = new Set(providers || []);
443
- if (!GATED_PROVIDERS.size) return findings;
573
+ // Keep only findings whose rule declares at least one of the requested
574
+ // scopes. An empty scope list means no filtering (default CLI behavior).
575
+ function filterByScopes(findings, scopes = []) {
576
+ if (!scopes || scopes.length === 0) return findings;
577
+ const enabled = new Set(scopes);
444
578
  return findings.filter(f => {
445
579
  const rule = getAntipattern(f.antipattern);
446
- if (!rule || !rule.gated) return true;
447
- return enabled.has(rule.gated);
580
+ return (rule?.scopes || []).some(scope => enabled.has(scope));
448
581
  });
449
582
  }
450
583
 
451
584
  export {
452
585
  ANTIPATTERNS,
586
+ RULE_SCOPES,
453
587
  RULE_ENGINE_SUPPORT,
454
- GATED_PROVIDERS,
455
588
  getAntipattern,
456
589
  getRulesForCategory,
457
590
  getRuleEngineSupport,
458
- filterByProviders,
591
+ filterByScopes,
459
592
  };