impeccable 3.2.1 → 3.3.1
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 +30 -9
- package/cli/bin/commands/ignores.mjs +27 -6
- package/cli/bin/commands/skills.mjs +168 -22
- package/cli/engine/browser/injected/index.mjs +84 -6
- package/cli/engine/cli/main.mjs +143 -26
- package/cli/engine/design-system.mjs +181 -12
- package/cli/engine/detect-antipatterns-browser.js +2877 -138
- package/cli/engine/engines/browser/detect-url.mjs +67 -4
- package/cli/engine/engines/regex/detect-text.mjs +266 -70
- package/cli/engine/engines/static-html/css-cascade.mjs +161 -5
- package/cli/engine/engines/static-html/detect-html.mjs +18 -5
- package/cli/engine/findings.mjs +7 -1
- package/cli/engine/registry/antipatterns.mjs +142 -37
- package/cli/engine/rules/checks.mjs +2706 -127
- package/cli/engine/shared/constants.mjs +11 -0
- package/cli/lib/download-providers.js +2 -0
- package/cli/lib/impeccable-config.mjs +20 -5
- package/package.json +7 -19
|
@@ -68,6 +68,15 @@ const GENERIC_FONTS = new Set([
|
|
|
68
68
|
const WCAG_LARGE_TEXT_PX = 18 * (96 / 72);
|
|
69
69
|
const WCAG_LARGE_BOLD_TEXT_PX = 14 * (96 / 72);
|
|
70
70
|
|
|
71
|
+
// Em-dash overuse (advisory) thresholds, shared by the regex/static-HTML
|
|
72
|
+
// analyzer and the browser DOM check so both fire on the same saturation
|
|
73
|
+
// pattern. Two gates must hold: an absolute floor of EM_DASH_FLOOR dashes, and
|
|
74
|
+
// a density of at least one dash per EM_DASH_CHARS_PER_DASH characters of body
|
|
75
|
+
// text. A long article that uses a few em-dashes is left alone; a short,
|
|
76
|
+
// dash-per-clause page is not.
|
|
77
|
+
const EM_DASH_FLOOR = 8;
|
|
78
|
+
const EM_DASH_CHARS_PER_DASH = 500;
|
|
79
|
+
|
|
71
80
|
// Serif faces that show up in italic-display heroes. The rule also fires when
|
|
72
81
|
// the primary face is unknown but the stack ends in the generic `serif` token,
|
|
73
82
|
// which catches custom/private faces with a serif fallback.
|
|
@@ -97,5 +106,7 @@ export {
|
|
|
97
106
|
GENERIC_FONTS,
|
|
98
107
|
WCAG_LARGE_TEXT_PX,
|
|
99
108
|
WCAG_LARGE_BOLD_TEXT_PX,
|
|
109
|
+
EM_DASH_FLOOR,
|
|
110
|
+
EM_DASH_CHARS_PER_DASH,
|
|
100
111
|
KNOWN_SERIF_FONTS,
|
|
101
112
|
};
|
|
@@ -5,10 +5,12 @@ export const FILE_DOWNLOAD_PROVIDER_CONFIG_DIRS = Object.freeze({
|
|
|
5
5
|
codex: '.codex',
|
|
6
6
|
agents: '.agents',
|
|
7
7
|
github: '.github',
|
|
8
|
+
grok: '.grok',
|
|
8
9
|
kiro: '.kiro',
|
|
9
10
|
opencode: '.opencode',
|
|
10
11
|
pi: '.pi',
|
|
11
12
|
qoder: '.qoder',
|
|
13
|
+
vibe: '.vibe',
|
|
12
14
|
});
|
|
13
15
|
|
|
14
16
|
export const FILE_DOWNLOAD_PROVIDERS = Object.freeze(
|
|
@@ -43,7 +43,7 @@ function detectorSection(raw) {
|
|
|
43
43
|
return raw && raw.detector && typeof raw.detector === 'object' && !Array.isArray(raw.detector) ? raw.detector : null;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
const DETECTOR_CONFIG_KEYS = new Set(['ignoreRules', 'ignoreFiles', 'ignoreValues', 'designSystem']);
|
|
46
|
+
const DETECTOR_CONFIG_KEYS = new Set(['ignoreRules', 'ignoreFiles', 'ignoreValues', 'designSystem', 'advisoryRules']);
|
|
47
47
|
|
|
48
48
|
const DEFAULT_DETECTION_CONFIG = Object.freeze({
|
|
49
49
|
ignoreRules: [],
|
|
@@ -71,6 +71,11 @@ function cloneRawDetectionConfig() {
|
|
|
71
71
|
|
|
72
72
|
function applyDetectionConfigSource(config, raw) {
|
|
73
73
|
if (!raw || typeof raw !== 'object') return config;
|
|
74
|
+
// Advisory rules are opt-in for the design hook; the CLI carries the setting
|
|
75
|
+
// so config round-trips (e.g. `impeccable hooks ignore-value`) preserve it.
|
|
76
|
+
if (raw.advisoryRules === 'include' || raw.advisoryRules === 'exclude') {
|
|
77
|
+
config.advisoryRules = raw.advisoryRules;
|
|
78
|
+
}
|
|
74
79
|
if (raw.designSystem && typeof raw.designSystem === 'object' && !Array.isArray(raw.designSystem)) {
|
|
75
80
|
config.designSystem = {
|
|
76
81
|
...config.designSystem,
|
|
@@ -151,6 +156,9 @@ function normalizeDetectionConfigForWrite(config) {
|
|
|
151
156
|
out.ignoreFiles = uniqueStrings(config.ignoreFiles.filter(v => typeof v === 'string' && v.trim()).map(v => v.trim()));
|
|
152
157
|
}
|
|
153
158
|
out.ignoreValues = normalizeIgnoreValueEntries(config?.ignoreValues || []);
|
|
159
|
+
if (config?.advisoryRules === 'include' || config?.advisoryRules === 'exclude') {
|
|
160
|
+
out.advisoryRules = config.advisoryRules;
|
|
161
|
+
}
|
|
154
162
|
if (config?.designSystem && typeof config.designSystem === 'object' && !Array.isArray(config.designSystem)) {
|
|
155
163
|
out.designSystem = {
|
|
156
164
|
enabled: config.designSystem.enabled === false ? false : true,
|
|
@@ -346,12 +354,16 @@ export function normalizeIgnoreValueEntries(entries) {
|
|
|
346
354
|
...(Array.isArray(entry.files) ? entry.files.filter(v => typeof v === 'string' && v.trim()).map(v => v.trim()) : []),
|
|
347
355
|
]);
|
|
348
356
|
if (files.length > 0) normalized.files = files;
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
357
|
+
// Key order is rule, value, files, createdAt, reason and must stay that way:
|
|
358
|
+
// normalizing runs on every write, so emitting a different order than the one
|
|
359
|
+
// already on disk rewrites every untouched entry and churns the diff. Keep in
|
|
360
|
+
// step with normalizeIgnoreValueEntries in skill/scripts/hook-lib.mjs.
|
|
352
361
|
if (typeof entry.createdAt === 'string' && entry.createdAt.trim()) {
|
|
353
362
|
normalized.createdAt = entry.createdAt.trim();
|
|
354
363
|
}
|
|
364
|
+
if (typeof entry.reason === 'string' && entry.reason.trim()) {
|
|
365
|
+
normalized.reason = entry.reason.trim();
|
|
366
|
+
}
|
|
355
367
|
out.push(normalized);
|
|
356
368
|
}
|
|
357
369
|
return out;
|
|
@@ -369,7 +381,9 @@ function mergeIgnoreValues(existing, incoming) {
|
|
|
369
381
|
}
|
|
370
382
|
|
|
371
383
|
function ignoreValueFilesKey(files) {
|
|
372
|
-
|
|
384
|
+
// Sort before joining: a scope is a set, so an entry already on disk in another
|
|
385
|
+
// order must compare equal rather than dedup as two distinct entries.
|
|
386
|
+
return Array.isArray(files) && files.length > 0 ? [...files].sort().join('\x1f') : '';
|
|
373
387
|
}
|
|
374
388
|
|
|
375
389
|
// Glob -> RegExp. Supports `**`, `*`, `?`, and `{a,b}` alternation.
|
|
@@ -494,6 +508,7 @@ export function extractFindingIgnoreValue(finding) {
|
|
|
494
508
|
'design-system-font',
|
|
495
509
|
'design-system-color',
|
|
496
510
|
'design-system-radius',
|
|
511
|
+
'design-system-font-size',
|
|
497
512
|
]);
|
|
498
513
|
if (!directValueRules.has(rule)) return '';
|
|
499
514
|
return normalizeIgnoreValue(extractFindingIgnoreValueRaw(finding, rule));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "impeccable",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.1",
|
|
4
4
|
"author": "Paul Bakaus",
|
|
5
5
|
"description": "Design skills, commands, and anti-pattern detection for AI coding agents",
|
|
6
6
|
"keywords": [
|
|
@@ -42,17 +42,13 @@
|
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build:skills": "bun run scripts/build.js --skip-root-sync",
|
|
44
44
|
"build:skills:release": "bun run scripts/build.js",
|
|
45
|
-
"build
|
|
46
|
-
"build": "bun run build:skills &&
|
|
47
|
-
"build:release": "bun run build:skills:release && bun run build:site && cp -R dist build/_data/dist",
|
|
45
|
+
"build": "bun run build:skills && mkdir -p build/_data && rm -rf build/_data/dist && cp -R dist build/_data/dist",
|
|
46
|
+
"build:release": "bun run build:skills:release && mkdir -p build/_data && rm -rf build/_data/dist && cp -R dist build/_data/dist",
|
|
48
47
|
"build:browser": "node scripts/build-browser-detector.js",
|
|
49
48
|
"build:extension": "node scripts/build-extension.js",
|
|
50
49
|
"clean": "rm -rf dist build",
|
|
51
50
|
"rebuild": "bun run clean && bun run build",
|
|
52
51
|
"rebuild:release": "bun run clean && bun run build:release",
|
|
53
|
-
"dev": "bun run scripts/gen-dev-api.mjs && npx astro dev",
|
|
54
|
-
"preview": "bun run build && npx astro preview",
|
|
55
|
-
"deploy": "bun run build && wrangler pages deploy build/",
|
|
56
52
|
"test": "node scripts/run-tests.mjs default",
|
|
57
53
|
"test:core": "node scripts/run-tests.mjs core",
|
|
58
54
|
"test:detector": "node scripts/run-tests.mjs detector",
|
|
@@ -62,6 +58,7 @@
|
|
|
62
58
|
"test:cli-remote-e2e": "node scripts/run-tests.mjs cli-remote-e2e",
|
|
63
59
|
"test:live-e2e": "node scripts/run-tests.mjs live-e2e",
|
|
64
60
|
"test:live-e2e-accept-cleanup": "node scripts/run-tests.mjs live-e2e-accept-cleanup",
|
|
61
|
+
"test:new-work-e2e": "node scripts/run-tests.mjs new-work-e2e",
|
|
65
62
|
"test:live-e2e-agent": "node scripts/run-tests.mjs live-e2e-agent",
|
|
66
63
|
"test:skill-behavior": "node scripts/run-tests.mjs skill-behavior",
|
|
67
64
|
"test:live-svelte-adapter-deepseek": "node scripts/run-tests.mjs live-svelte-adapter-deepseek",
|
|
@@ -73,9 +70,7 @@
|
|
|
73
70
|
"postpack": "cp README.repo.md README.md && rm README.repo.md",
|
|
74
71
|
"release:skill": "node scripts/release.mjs skill",
|
|
75
72
|
"release:cli": "node scripts/release.mjs cli",
|
|
76
|
-
"release:ext": "node scripts/release.mjs extension"
|
|
77
|
-
"screenshot": "bun run scripts/screenshot-antipatterns.js",
|
|
78
|
-
"og-image": "bun run scripts/generate-og-image.js"
|
|
73
|
+
"release:ext": "node scripts/release.mjs extension"
|
|
79
74
|
},
|
|
80
75
|
"dependencies": {
|
|
81
76
|
"css-select": "^7.0.0",
|
|
@@ -93,18 +88,11 @@
|
|
|
93
88
|
"@ai-sdk/google": "^4.0.8",
|
|
94
89
|
"@ai-sdk/openai": "^4.0.7",
|
|
95
90
|
"@anthropic-ai/claude-agent-sdk": "^0.3.165",
|
|
96
|
-
"@anthropic-ai/sdk": "^0.
|
|
97
|
-
"@
|
|
98
|
-
"@paper-design/shaders": "^0.0.77",
|
|
91
|
+
"@anthropic-ai/sdk": "^0.112.3",
|
|
92
|
+
"@babel/parser": "^7.29.3",
|
|
99
93
|
"ai": "^7.0.14",
|
|
100
94
|
"archiver": "^8.0.0",
|
|
101
|
-
"astro": "^7.0.0",
|
|
102
|
-
"fontkit": "^2.0.4",
|
|
103
|
-
"modern-screenshot": "^4.7.0",
|
|
104
|
-
"motion": "^12.38.0",
|
|
105
|
-
"opentype.js": "^2.0.0",
|
|
106
95
|
"playwright": "^1.59.1",
|
|
107
|
-
"wrangler": "^4.85.0",
|
|
108
96
|
"zod": "^4.3.6"
|
|
109
97
|
}
|
|
110
98
|
}
|