impeccable 3.3.1 → 3.4.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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Impeccable CLI
2
2
 
3
- Detect UI anti-patterns and design quality issues from the command line. Scans HTML, CSS, JSX, TSX, Vue, and Svelte files for 58 deterministic rules, including AI-generated UI tells, accessibility violations, and general design quality problems.
3
+ Detect UI anti-patterns and design quality issues from the command line. Scans HTML, CSS, JSX, TSX, Vue, and Svelte files for 60 deterministic rules, including AI-generated UI tells, accessibility violations, and general design quality problems.
4
4
 
5
5
  ## Quick Start
6
6
 
@@ -56,7 +56,7 @@ npx impeccable detect --fast src/
56
56
 
57
57
  **Quality**: tiny body text, cramped padding, long line lengths, small touch targets
58
58
 
59
- 58 deterministic detector rules in total. See the full catalog at [impeccable.style/slop](https://impeccable.style/slop).
59
+ 60 deterministic detector rules in total. See the full catalog at [impeccable.style/slop](https://impeccable.style/slop).
60
60
 
61
61
  ## Exit Codes
62
62
 
package/README.npm.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Impeccable CLI
2
2
 
3
- Detect UI anti-patterns and design quality issues from the command line. Scans HTML, CSS, JSX, TSX, Vue, and Svelte files for 58 deterministic rules, including AI-generated UI tells, accessibility violations, and general design quality problems.
3
+ Detect UI anti-patterns and design quality issues from the command line. Scans HTML, CSS, JSX, TSX, Vue, and Svelte files for 60 deterministic rules, including AI-generated UI tells, accessibility violations, and general design quality problems.
4
4
 
5
5
  ## Quick Start
6
6
 
@@ -56,7 +56,7 @@ npx impeccable detect --fast src/
56
56
 
57
57
  **Quality**: tiny body text, cramped padding, long line lengths, small touch targets
58
58
 
59
- 58 deterministic detector rules in total. See the full catalog at [impeccable.style/slop](https://impeccable.style/slop).
59
+ 60 deterministic detector rules in total. See the full catalog at [impeccable.style/slop](https://impeccable.style/slop).
60
60
 
61
61
  ## Exit Codes
62
62
 
package/README.repo.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Impeccable
2
2
 
3
- Design guidance for AI coding agents. 1 skill, 23 commands, live browser iteration, and 58 deterministic detector rules for AI-generated frontend design.
3
+ Design guidance for AI coding agents. 1 skill, 23 commands, live browser iteration, and 60 deterministic detector rules for AI-generated frontend design.
4
4
 
5
5
  > **Quick start:** From your project root, run `npx impeccable install`, then run `/impeccable init` inside your AI coding tool. Full docs: [impeccable.style](https://impeccable.style).
6
6
 
@@ -13,7 +13,7 @@ Every model trained on the same SaaS templates. Skip the guidance and you get th
13
13
  Impeccable adds:
14
14
  - **One setup flow.** `/impeccable init` writes `PRODUCT.md` and offers `DESIGN.md`, so later commands know the audience, brand/product lane, voice, anti-references, colors, type, and components.
15
15
  - **23 commands.** A shared design vocabulary with your AI: `polish`, `audit`, `critique`, `distill`, `animate`, `bolder`, `quieter`, and more.
16
- - **58 deterministic detector rules** plus LLM-only critique checks. The CLI and browser extension run the deterministic rules with no LLM and no API key.
16
+ - **60 deterministic detector rules** plus LLM-only critique checks. The CLI and browser extension run the deterministic rules with no LLM and no API key.
17
17
 
18
18
  ## What's Included
19
19
 
@@ -377,7 +377,7 @@ npx impeccable ignores add-file "src/legacy/**"
377
377
  npx impeccable ignores add-value overused-font Inter --reason "Brand font"
378
378
  ```
379
379
 
380
- The detector catches 49 deterministic issues across AI slop (side-tab borders, purple gradients, bounce easing, dark glows) and general design quality (line length, cramped padding, small touch targets, skipped headings, and more).
380
+ The detector catches 60 deterministic issues across AI slop (side-tab borders, purple gradients, bounce easing, dark glows) and general design quality (line length, cramped padding, small touch targets, skipped headings, and more).
381
381
 
382
382
  By default, `detect` respects the same `.impeccable/config.json` and `.impeccable/config.local.json` detector config as the design hook: `detector.ignoreRules`, `detector.ignoreFiles`, `detector.ignoreValues`, and `detector.designSystem.enabled`. Hook lifecycle settings such as `hook.enabled` only affect automatic hook execution.
383
383
 
@@ -9,7 +9,7 @@
9
9
  */
10
10
 
11
11
  import { execSync } from 'node:child_process';
12
- import { existsSync, readFileSync, readdirSync, statSync, lstatSync, unlinkSync, mkdirSync, writeFileSync, rmSync, renameSync, createWriteStream, realpathSync, symlinkSync, readlinkSync, cpSync } from 'node:fs';
12
+ import { existsSync, readFileSync, readdirSync, statSync, lstatSync, unlinkSync, mkdirSync, writeFileSync, rmSync, rmdirSync, renameSync, createWriteStream, realpathSync, symlinkSync, readlinkSync, cpSync } from 'node:fs';
13
13
  import { join, resolve, dirname, relative, isAbsolute, sep } from 'node:path';
14
14
  import { createInterface, emitKeypressEvents } from 'node:readline';
15
15
  import { fileURLToPath } from 'node:url';
@@ -65,11 +65,23 @@ const PROVIDER_DISPLAY = {
65
65
  };
66
66
  const PROVIDER_INPUT_ORDER = ['claude', 'codex', 'cursor', 'gemini', 'github', 'grok', 'kiro', 'opencode', 'pi', 'qoder', 'trae', 'trae-cn', 'rovo-dev', 'vibe'];
67
67
 
68
- // Providers whose GLOBAL (home) skills dir is not `<provider>/skills`.
69
- // Pi discovers global skills from ~/.pi/agent/skills/; project scope
70
- // stays .pi/skills/. See issue #327.
68
+ // OpenCode reads global skills from its config directory, not ~/.opencode:
69
+ // $OPENCODE_CONFIG_DIR, else $XDG_CONFIG_HOME/opencode, else
70
+ // ~/.config/opencode. Writing to ~/.opencode/skills produced an install
71
+ // `opencode debug skill` never listed. See issue #406.
72
+ function opencodeGlobalConfigDir(home) {
73
+ if (process.env.OPENCODE_CONFIG_DIR) return process.env.OPENCODE_CONFIG_DIR;
74
+ if (process.env.XDG_CONFIG_HOME) return join(process.env.XDG_CONFIG_HOME, 'opencode');
75
+ return join(home, '.config', 'opencode');
76
+ }
77
+
78
+ // Providers whose GLOBAL (home) skills dir is not `<provider>/skills`,
79
+ // as a function of the home dir. Pi discovers global skills from
80
+ // ~/.pi/agent/skills/ (issue #327); OpenCode from its config dir (issue
81
+ // #406). Project scope stays `<provider>/skills` for both.
71
82
  const HOME_SKILLS_DIR_OVERRIDES = {
72
- '.pi': join('.pi', 'agent', 'skills'),
83
+ '.pi': (home) => join(home, '.pi', 'agent', 'skills'),
84
+ '.opencode': (home) => join(opencodeGlobalConfigDir(home), 'skills'),
73
85
  };
74
86
 
75
87
  // When a project has no harness folder yet, infer the target from globally
@@ -83,6 +95,9 @@ const GLOBAL_HARNESS_HINTS = [
83
95
  { home: '.grok', provider: '.grok' },
84
96
  { home: '.kiro', provider: '.kiro' },
85
97
  { home: '.opencode', provider: '.opencode' },
98
+ // OpenCode's real global config dir (issue #406); the ~/.opencode entry
99
+ // above keeps recognizing machines that only have the legacy dir.
100
+ { resolve: opencodeGlobalConfigDir, provider: '.opencode' },
86
101
  { home: '.pi', provider: '.pi' },
87
102
  { home: '.qoder', provider: '.qoder' },
88
103
  { home: '.rovodev', provider: '.rovodev' },
@@ -134,7 +149,8 @@ const PROVIDER_HOOK_ARTIFACTS = {
134
149
  };
135
150
 
136
151
  function userProviderSkillsDir(home, provider) {
137
- if (HOME_SKILLS_DIR_OVERRIDES[provider]) return join(home, HOME_SKILLS_DIR_OVERRIDES[provider]);
152
+ const override = HOME_SKILLS_DIR_OVERRIDES[provider];
153
+ if (override) return override(home);
138
154
  return join(home, provider, 'skills');
139
155
  }
140
156
 
@@ -861,10 +877,15 @@ function collectInstallDetections(root, home = homedir()) {
861
877
  });
862
878
  }
863
879
 
864
- for (const { home: h, provider } of GLOBAL_HARNESS_HINTS) {
865
- const foundPath = join(home, h);
880
+ for (const hint of GLOBAL_HARNESS_HINTS) {
881
+ const { provider } = hint;
882
+ // A hint is either a fixed dir under home or a resolver for harnesses
883
+ // whose location depends on the environment (OpenCode's config dir).
884
+ const foundPath = hint.resolve ? hint.resolve(home) : join(home, hint.home);
866
885
  if (!existsSync(foundPath)) continue;
867
- const skillProbePaths = userSkillProbePaths(home, h, provider);
886
+ const skillProbePaths = hint.resolve
887
+ ? uniquePaths([userProviderSkillsDir(home, provider), join(foundPath, 'skills')])
888
+ : userSkillProbePaths(home, hint.home, provider);
868
889
  detections.push({
869
890
  provider,
870
891
  scope: 'user',
@@ -1137,6 +1158,32 @@ function copyProviderSkills(bundleDir, root, targets, { scope } = {}) {
1137
1158
  copyDirSync(src, dest);
1138
1159
  written++;
1139
1160
  }
1161
+ // A pre-#406 global OpenCode install lived at ~/.opencode/skills, a
1162
+ // location OpenCode never reads. Now that the real copy sits in the
1163
+ // config dir, drop exactly the skills just written from the stranded
1164
+ // location; sibling skills and everything else in ~/.opencode stay.
1165
+ // Guards (both flagged in review): a symlinked skills dir is shared
1166
+ // storage whose target must not be emptied through the link, the
1167
+ // just-written dir must be compared by realpath rather than string,
1168
+ // and a home-rooted repo makes `.opencode/skills` a live
1169
+ // project-scope install rather than a stranded global one.
1170
+ if (scope === 'user' && provider === '.opencode') {
1171
+ const legacyDir = join(root, '.opencode', 'skills');
1172
+ let migratable = false;
1173
+ try {
1174
+ migratable = existsSync(legacyDir)
1175
+ && !lstatSync(legacyDir).isSymbolicLink()
1176
+ && realpathSync(legacyDir) !== realpathSync(localSkillsDir)
1177
+ && !existsSync(join(root, '.git'));
1178
+ } catch { migratable = false; }
1179
+ if (migratable) {
1180
+ for (const skill of readdirSync(srcDir, { withFileTypes: true })) {
1181
+ if (!skill.isDirectory()) continue;
1182
+ rmSync(join(legacyDir, skill.name), { recursive: true, force: true });
1183
+ }
1184
+ try { rmdirSync(legacyDir); } catch { /* not empty: siblings stay */ }
1185
+ }
1186
+ }
1140
1187
  }
1141
1188
  }
1142
1189
  return written;
@@ -1179,6 +1226,19 @@ function hookArtifactsForProvider(bundleDir, root, provider) {
1179
1226
  });
1180
1227
  }
1181
1228
 
1229
+ // The project-relative hook command path for a provider, used for project-scope
1230
+ // installs (skillRoot === root). Derived rather than copied from the bundle: the
1231
+ // Codex bundle ships a `.codex/skills/...` command (correct for a `.codex`-
1232
+ // directory install), but the CLI lays Codex's skill down at `.agents/skills/`,
1233
+ // so preserving the bundle token would point the hook at a nonexistent file and
1234
+ // silently no-op it. Claude keeps its ${CLAUDE_PROJECT_DIR} token so a manifest
1235
+ // read from a nested cwd (or copied into settings.local.json) still resolves.
1236
+ function hookScriptRelPathForProvider(provider) {
1237
+ const script = provider === '.cursor' ? 'hook-before-edit.mjs' : 'hook.mjs';
1238
+ const rel = `${provider}/skills/impeccable/scripts/${script}`;
1239
+ return provider === '.claude' ? '${CLAUDE_PROJECT_DIR}/' + rel : rel;
1240
+ }
1241
+
1182
1242
  function hookScriptPathForProvider(skillRoot, provider) {
1183
1243
  // `.github` is intentionally absent: its hook manifest (`.github/hooks/
1184
1244
  // impeccable.json`) is a committed, team-shared file that the Copilot cloud
@@ -1228,9 +1288,10 @@ function rewriteHookCommandsForSkillRoot(value, provider, { skillRoot, absolute
1228
1288
  if (absolute) {
1229
1289
  quotedPath = JSON.stringify(hookScript);
1230
1290
  } else {
1231
- // Preserve the bundle's own path token (e.g. ${CLAUDE_PROJECT_DIR}/...).
1232
- const match = value.match(/"([^"]+)"/);
1233
- quotedPath = match ? JSON.stringify(match[1]) : JSON.stringify(hookScript);
1291
+ // Project-scope install: derive the provider's own project-relative path
1292
+ // rather than trusting the bundle token, which for Codex points at
1293
+ // `.codex/skills/...` while the CLI installs the skill at `.agents/skills/`.
1294
+ quotedPath = JSON.stringify(hookScriptRelPathForProvider(provider));
1234
1295
  }
1235
1296
  return guardHookCommand(quotedPath);
1236
1297
  }
@@ -530,7 +530,11 @@ if (IS_BROWSER) {
530
530
  function generateSelector(el) {
531
531
  if (el === document.body) return 'body';
532
532
  if (el === document.documentElement) return 'html';
533
- if (el.id) return '#' + CSS.escape(el.id);
533
+ // Read via getAttribute when `el.id` is not a string — a <form> with a
534
+ // named control (e.g. <input name="id">) shadows the builtin getter and
535
+ // returns the element, producing a garbage `#[object …]` selector (#407).
536
+ const elId = typeof el.id === 'string' ? el.id : (el.getAttribute('id') || '');
537
+ if (elId) return '#' + CSS.escape(elId);
534
538
 
535
539
  const parts = [];
536
540
  let current = el;
@@ -1467,8 +1471,11 @@ if (IS_BROWSER) {
1467
1471
  for (const el of document.querySelectorAll('*')) {
1468
1472
  // Skip impeccable's own elements and any descendants (overlays, labels, banner, nav buttons)
1469
1473
  if (el.closest('.impeccable-overlay, .impeccable-label, .impeccable-banner, .impeccable-tooltip')) continue;
1470
- // Skip browser extension elements (Claude, etc.)
1471
- const elId = el.id || '';
1474
+ // Skip browser extension elements (Claude, etc.). Use getAttribute when
1475
+ // `el.id` is not a string: a <form> with a named control like
1476
+ // <input name="id"> shadows the builtin `id` getter and returns the
1477
+ // element, whose `.startsWith` throws (issue #407).
1478
+ const elId = typeof el.id === 'string' ? el.id : (el.getAttribute('id') || '');
1472
1479
  if (elId.startsWith('claude-') || elId.startsWith('cic-')) continue;
1473
1480
  // Skip the impeccable live-mode overlay (highlight, tooltip, bar, picker, toast).
1474
1481
  // These are inspector chrome, not part of the user's design.
@@ -1483,6 +1490,7 @@ if (IS_BROWSER) {
1483
1490
  ...checkElementMotionDOM(el).map(f => ({ type: f.id, detail: f.snippet })),
1484
1491
  ...checkElementGlowDOM(el).map(f => ({ type: f.id, detail: f.snippet })),
1485
1492
  ...checkElementAIPaletteDOM(el).map(f => ({ type: f.id, detail: f.snippet })),
1493
+ ...checkElementRadialSpotlightDOM(el).map(f => ({ type: f.id, detail: f.snippet })),
1486
1494
  ...checkElementIconTileDOM(el).map(f => ({ type: f.id, detail: f.snippet })),
1487
1495
  ...checkElementItalicSerifDOM(el).map(f => ({ type: f.id, detail: f.snippet })),
1488
1496
  ...checkElementQualityDOM(el).map(f => ({ type: f.id, detail: f.snippet })),
@@ -1521,7 +1529,7 @@ if (IS_BROWSER) {
1521
1529
  addBrowserFindings(groupMap, document.body, typoFindings);
1522
1530
  }
1523
1531
 
1524
- const sectionKickerFindings = checkRepeatedSectionKickersDOM()
1532
+ const sectionKickerFindings = checkKickerAboveHeadingDOM()
1525
1533
  .map(f => ({ type: f.id, detail: f.snippet }))
1526
1534
  .filter(f => _ruleOk(f.type));
1527
1535
  if (sectionKickerFindings.length > 0) {