impeccable 3.3.1 → 3.5.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 +2 -2
- package/README.npm.md +2 -2
- package/README.repo.md +3 -3
- package/cli/bin/commands/skills.mjs +145 -13
- package/cli/engine/browser/injected/index.mjs +12 -4
- package/cli/engine/detect-antipatterns-browser.js +410 -111
- package/cli/engine/engines/browser/detect-url.mjs +35 -3
- package/cli/engine/engines/regex/detect-text.mjs +23 -24
- package/cli/engine/engines/static-html/css-cascade.mjs +27 -12
- package/cli/engine/engines/static-html/detect-html.mjs +23 -6
- package/cli/engine/node/file-system.mjs +16 -2
- package/cli/engine/registry/antipatterns.mjs +13 -15
- package/cli/engine/rules/checks.mjs +395 -97
- package/cli/lib/impeccable-config.mjs +3 -0
- package/package.json +3 -2
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
- **
|
|
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
|
|
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';
|
|
@@ -56,7 +56,7 @@ const PROVIDER_DISPLAY = {
|
|
|
56
56
|
'.grok': { name: 'Grok Build', input: 'grok' },
|
|
57
57
|
'.kiro': { name: 'Kiro', input: 'kiro' },
|
|
58
58
|
'.opencode': { name: 'OpenCode', input: 'opencode' },
|
|
59
|
-
'.pi': { name: '
|
|
59
|
+
'.pi': { name: 'Pi Coding Agent', input: 'pi' },
|
|
60
60
|
'.qoder': { name: 'Qoder', input: 'qoder' },
|
|
61
61
|
'.rovodev': { name: 'Rovo Dev', input: 'rovo-dev' },
|
|
62
62
|
'.trae': { name: 'Trae', input: 'trae' },
|
|
@@ -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
|
-
//
|
|
69
|
-
//
|
|
70
|
-
//
|
|
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
|
-
|
|
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
|
|
865
|
-
const
|
|
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 =
|
|
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,11 +1158,102 @@ 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;
|
|
1143
1190
|
}
|
|
1144
1191
|
|
|
1192
|
+
// Native subagent definitions that ship in the bundle next to a provider's
|
|
1193
|
+
// skills. GitHub Copilot's live at `.github/agents/impeccable-*.agent.md`:
|
|
1194
|
+
// project installs commit them at `<repo>/.github/agents/`, user-level
|
|
1195
|
+
// installs go to `~/.copilot/agents/` (Copilot's user-scope dir, NOT
|
|
1196
|
+
// `~/.github/`). On a name conflict Copilot lets the user-level file shadow
|
|
1197
|
+
// the project one, so both paths overwrite existing impeccable-* copies and a
|
|
1198
|
+
// project install reports any same-named user-level agents that would shadow
|
|
1199
|
+
// it. Cursor's live at `.cursor/agents/impeccable-*.md`, user scope
|
|
1200
|
+
// `~/.cursor/agents/`; project agents take precedence there, so no shadow
|
|
1201
|
+
// warning is needed.
|
|
1202
|
+
const PROVIDER_AGENT_ARTIFACTS = {
|
|
1203
|
+
'.github': {
|
|
1204
|
+
ext: '.agent.md',
|
|
1205
|
+
userDir: home => join(home, '.copilot', 'agents'),
|
|
1206
|
+
userShadowsProject: true,
|
|
1207
|
+
},
|
|
1208
|
+
'.cursor': {
|
|
1209
|
+
ext: '.md',
|
|
1210
|
+
userDir: home => join(home, '.cursor', 'agents'),
|
|
1211
|
+
userShadowsProject: false,
|
|
1212
|
+
},
|
|
1213
|
+
};
|
|
1214
|
+
|
|
1215
|
+
function copyProviderAgents(bundleDir, root, providers, { scope, home = homedir() } = {}) {
|
|
1216
|
+
const targets = Array.isArray(providers) ? providers : [providers];
|
|
1217
|
+
const results = [];
|
|
1218
|
+
for (const provider of targets) {
|
|
1219
|
+
const artifact = PROVIDER_AGENT_ARTIFACTS[provider];
|
|
1220
|
+
if (!artifact) continue;
|
|
1221
|
+
const srcDir = join(bundleDir, provider, 'agents');
|
|
1222
|
+
if (!existsSync(srcDir)) continue;
|
|
1223
|
+
const agentFiles = readdirSync(srcDir).filter(name => name.endsWith(artifact.ext));
|
|
1224
|
+
if (agentFiles.length === 0) continue;
|
|
1225
|
+
|
|
1226
|
+
const destDir = scope === 'user'
|
|
1227
|
+
? artifact.userDir(root)
|
|
1228
|
+
: join(root, provider, 'agents');
|
|
1229
|
+
mkdirSync(destDir, { recursive: true });
|
|
1230
|
+
for (const name of agentFiles) {
|
|
1231
|
+
writeFileSync(join(destDir, name), readFileSync(join(srcDir, name)));
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
// A project install can be shadowed by same-named agents in the user-level
|
|
1235
|
+
// dir; surface them so the freshly installed project agents actually apply.
|
|
1236
|
+
const userDir = artifact.userDir(home);
|
|
1237
|
+
const shadowed = artifact.userShadowsProject && scope !== 'user'
|
|
1238
|
+
? agentFiles.filter(name => existsSync(join(userDir, name)))
|
|
1239
|
+
: [];
|
|
1240
|
+
|
|
1241
|
+
results.push({ provider, written: agentFiles.length, destDir, userDir, shadowed });
|
|
1242
|
+
}
|
|
1243
|
+
return results;
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
function reportProviderAgents(results) {
|
|
1247
|
+
for (const result of results || []) {
|
|
1248
|
+
if (result.written === 0) continue;
|
|
1249
|
+
console.log(`Installed ${providerDisplayName(result.provider)} agents into: ${formatPathForDisplay(result.destDir)}`);
|
|
1250
|
+
if (result.shadowed.length > 0) {
|
|
1251
|
+
console.warn(`Warning: user-level agents in ${formatPathForDisplay(result.userDir)} shadow the project copies just installed: ${result.shadowed.join(', ')}.`);
|
|
1252
|
+
console.warn('Run `npx impeccable update --user` to refresh them, or remove them so the project agents apply.');
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1145
1257
|
function refreshProviderSkills(bundleDir, root, providers, scope) {
|
|
1146
1258
|
const unique = deduplicateProviders(root, providers, scope);
|
|
1147
1259
|
let updated = 0;
|
|
@@ -1179,6 +1291,19 @@ function hookArtifactsForProvider(bundleDir, root, provider) {
|
|
|
1179
1291
|
});
|
|
1180
1292
|
}
|
|
1181
1293
|
|
|
1294
|
+
// The project-relative hook command path for a provider, used for project-scope
|
|
1295
|
+
// installs (skillRoot === root). Derived rather than copied from the bundle: the
|
|
1296
|
+
// Codex bundle ships a `.codex/skills/...` command (correct for a `.codex`-
|
|
1297
|
+
// directory install), but the CLI lays Codex's skill down at `.agents/skills/`,
|
|
1298
|
+
// so preserving the bundle token would point the hook at a nonexistent file and
|
|
1299
|
+
// silently no-op it. Claude keeps its ${CLAUDE_PROJECT_DIR} token so a manifest
|
|
1300
|
+
// read from a nested cwd (or copied into settings.local.json) still resolves.
|
|
1301
|
+
function hookScriptRelPathForProvider(provider) {
|
|
1302
|
+
const script = provider === '.cursor' ? 'hook-before-edit.mjs' : 'hook.mjs';
|
|
1303
|
+
const rel = `${provider}/skills/impeccable/scripts/${script}`;
|
|
1304
|
+
return provider === '.claude' ? '${CLAUDE_PROJECT_DIR}/' + rel : rel;
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1182
1307
|
function hookScriptPathForProvider(skillRoot, provider) {
|
|
1183
1308
|
// `.github` is intentionally absent: its hook manifest (`.github/hooks/
|
|
1184
1309
|
// impeccable.json`) is a committed, team-shared file that the Copilot cloud
|
|
@@ -1228,9 +1353,10 @@ function rewriteHookCommandsForSkillRoot(value, provider, { skillRoot, absolute
|
|
|
1228
1353
|
if (absolute) {
|
|
1229
1354
|
quotedPath = JSON.stringify(hookScript);
|
|
1230
1355
|
} else {
|
|
1231
|
-
//
|
|
1232
|
-
|
|
1233
|
-
|
|
1356
|
+
// Project-scope install: derive the provider's own project-relative path
|
|
1357
|
+
// rather than trusting the bundle token, which for Codex points at
|
|
1358
|
+
// `.codex/skills/...` while the CLI installs the skill at `.agents/skills/`.
|
|
1359
|
+
quotedPath = JSON.stringify(hookScriptRelPathForProvider(provider));
|
|
1234
1360
|
}
|
|
1235
1361
|
return guardHookCommand(quotedPath);
|
|
1236
1362
|
}
|
|
@@ -1674,6 +1800,7 @@ async function install(flags) {
|
|
|
1674
1800
|
if (!updateCheckSkipped && copyTargets.length > 0 && !isUpToDate(installRoot, copyTargets, bundleDir, scope)) {
|
|
1675
1801
|
migrateUnprefixImpeccable(installRoot, scope);
|
|
1676
1802
|
updated = refreshProviderSkills(bundleDir, installRoot, copyTargets, scope);
|
|
1803
|
+
reportProviderAgents(copyProviderAgents(bundleDir, installRoot, copyTargets, { scope }));
|
|
1677
1804
|
const v = getSkillsVersion(installRoot, scope);
|
|
1678
1805
|
console.log(`Updated ${updated} skill(s)${v ? ` to v${v}` : ''}.`);
|
|
1679
1806
|
}
|
|
@@ -1730,8 +1857,10 @@ async function install(flags) {
|
|
|
1730
1857
|
|
|
1731
1858
|
let written = 0;
|
|
1732
1859
|
let hookTargets = [];
|
|
1860
|
+
let agentResults = [];
|
|
1733
1861
|
try {
|
|
1734
1862
|
written = copyProviderSkills(bundleDir, installRoot, targets, { scope });
|
|
1863
|
+
agentResults = copyProviderAgents(bundleDir, installRoot, targets, { scope });
|
|
1735
1864
|
hookTargets = wantHooks ? copyProviderHooks(bundleDir, hookRoot, targets, { force, skillRoot: installRoot }) : [];
|
|
1736
1865
|
} catch (e) {
|
|
1737
1866
|
rmSync(bundleDir, { recursive: true, force: true });
|
|
@@ -1745,6 +1874,7 @@ async function install(flags) {
|
|
|
1745
1874
|
process.exit(1);
|
|
1746
1875
|
}
|
|
1747
1876
|
console.log(`Installed impeccable into: ${targets.join(', ')} (${scope === 'user' ? 'global' : 'project'})`);
|
|
1877
|
+
reportProviderAgents(agentResults);
|
|
1748
1878
|
if (hookTargets.length > 0) console.log(`Installed hooks into: ${hookTargets.join(', ')}`);
|
|
1749
1879
|
|
|
1750
1880
|
console.log('\nDone! Run /impeccable init in your AI harness to set up design context.\n');
|
|
@@ -2001,6 +2131,7 @@ async function update(flags = []) {
|
|
|
2001
2131
|
if (migrated > 0) console.log('Migrated a prefixed install back to /impeccable (the i- prefix is no longer used).');
|
|
2002
2132
|
|
|
2003
2133
|
const updated = refreshProviderSkills(tmpDir, root, copyProviders, scope);
|
|
2134
|
+
reportProviderAgents(copyProviderAgents(tmpDir, root, copyProviders, { scope }));
|
|
2004
2135
|
const wantHooks = installHooks && await decideHookInstall(root, providers, { yes });
|
|
2005
2136
|
const hookTargets = wantHooks ? copyProviderHooks(tmpDir, root, providers, { force }) : [];
|
|
2006
2137
|
|
|
@@ -2035,6 +2166,7 @@ function copyDirSync(src, dest) {
|
|
|
2035
2166
|
// reimplementation in a helper script (which is how bugs slip through).
|
|
2036
2167
|
export {
|
|
2037
2168
|
collectInstallDetections,
|
|
2169
|
+
copyProviderAgents,
|
|
2038
2170
|
copyProviderHooks,
|
|
2039
2171
|
copyProviderSkills,
|
|
2040
2172
|
decideHookInstall,
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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 =
|
|
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) {
|