impeccable 3.6.1 → 4.0.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 +24 -19
- package/README.npm.md +24 -19
- package/README.repo.md +13 -7
- package/cli/bin/cli.js +84 -91
- package/package.json +15 -21
- package/cli/bin/commands/ignores.mjs +0 -355
- package/cli/bin/commands/skills.mjs +0 -2415
- package/cli/engine/browser/injected/index.mjs +0 -2204
- package/cli/engine/cli/main.mjs +0 -432
- package/cli/engine/design-system.mjs +0 -1311
- package/cli/engine/detect-antipatterns-browser.js +0 -9043
- package/cli/engine/detect-antipatterns.mjs +0 -51
- package/cli/engine/engines/browser/detect-url.mjs +0 -434
- package/cli/engine/engines/regex/detect-text.mjs +0 -1319
- package/cli/engine/engines/static-html/css-cascade.mjs +0 -1241
- package/cli/engine/engines/static-html/detect-html.mjs +0 -288
- package/cli/engine/engines/visual/screenshot-contrast.mjs +0 -189
- package/cli/engine/findings.mjs +0 -18
- package/cli/engine/node/file-system.mjs +0 -213
- package/cli/engine/profile/profiler.mjs +0 -166
- package/cli/engine/registry/antipatterns.mjs +0 -635
- package/cli/engine/rules/checks.mjs +0 -5681
- package/cli/engine/shared/color.mjs +0 -596
- package/cli/engine/shared/constants.mjs +0 -127
- package/cli/engine/shared/fonts.mjs +0 -30
- package/cli/engine/shared/inline-ignores.mjs +0 -148
- package/cli/engine/shared/page.mjs +0 -7
- package/cli/lib/download-providers.js +0 -35
- package/cli/lib/impeccable-config.mjs +0 -640
package/README.md
CHANGED
|
@@ -1,44 +1,45 @@
|
|
|
1
1
|
# Impeccable CLI
|
|
2
2
|
|
|
3
|
-
Detect UI anti-patterns and design quality issues from the command line.
|
|
3
|
+
Detect UI anti-patterns and design quality issues from the command line, and install the Impeccable design skill into your AI coding harness. The detector scans HTML, CSS, JSX, TSX, Vue, and Svelte files for 61 deterministic rules, including AI-generated UI tells, accessibility violations, and general design quality problems.
|
|
4
|
+
|
|
5
|
+
The npm package is a small launcher. It runs the `impeccable` engine binary for your platform, installed alongside it as an optional dependency (`@impeccable/cli-<os>-<arch>`), and falls back to a per-user cache or a one-time download when that package is missing.
|
|
4
6
|
|
|
5
7
|
## Quick Start
|
|
6
8
|
|
|
7
9
|
```bash
|
|
8
10
|
# Install skills into your AI harness (Claude, Cursor, Gemini, etc.)
|
|
9
|
-
npx impeccable
|
|
11
|
+
npx impeccable install
|
|
10
12
|
|
|
11
13
|
# Non-interactive install for a specific scope
|
|
12
|
-
npx impeccable
|
|
14
|
+
npx impeccable install -y --providers=claude,codex --scope=project
|
|
13
15
|
|
|
14
16
|
# First command to run inside your AI harness
|
|
15
17
|
/impeccable init
|
|
16
18
|
|
|
17
19
|
# Update skills to the latest version
|
|
18
|
-
npx impeccable
|
|
20
|
+
npx impeccable update
|
|
19
21
|
|
|
20
22
|
# Install or update skills without hook manifests
|
|
21
|
-
npx impeccable
|
|
23
|
+
npx impeccable install --no-hooks
|
|
22
24
|
|
|
23
25
|
# Link skills from a Git submodule checkout
|
|
24
|
-
npx impeccable
|
|
26
|
+
npx impeccable link --source=.impeccable --providers=claude,cursor
|
|
25
27
|
|
|
26
28
|
# List all available commands
|
|
27
|
-
npx impeccable
|
|
29
|
+
npx impeccable help
|
|
28
30
|
|
|
29
31
|
# Scan files or directories for anti-patterns
|
|
30
32
|
npx impeccable detect src/
|
|
31
33
|
|
|
32
|
-
# Scan a live URL (
|
|
34
|
+
# Scan a live URL (uses an installed Chrome, Chromium, or Edge)
|
|
33
35
|
npx impeccable detect https://example.com
|
|
34
36
|
|
|
35
37
|
# JSON output for CI/tooling
|
|
36
38
|
npx impeccable detect --json src/
|
|
37
|
-
|
|
38
|
-
# Deprecated compatibility flag; full scan still runs
|
|
39
|
-
npx impeccable detect --fast src/
|
|
40
39
|
```
|
|
41
40
|
|
|
41
|
+
`npx impeccable skills <command>` is the legacy namespace and still works.
|
|
42
|
+
|
|
42
43
|
## What It Detects
|
|
43
44
|
|
|
44
45
|
**AI Slop Tells**: patterns that scream "AI generated this":
|
|
@@ -60,24 +61,28 @@ npx impeccable detect --fast src/
|
|
|
60
61
|
|
|
61
62
|
## Exit Codes
|
|
62
63
|
|
|
63
|
-
- `0`: no
|
|
64
|
-
- `
|
|
64
|
+
- `0`: scan completed with no primary findings (advisories may still be listed)
|
|
65
|
+
- `1`: at least one requested target could not be scanned
|
|
66
|
+
- `2`: scan completed with primary findings
|
|
67
|
+
|
|
68
|
+
Operational failure takes precedence when a multi-target scan is partial. In JSON mode, stdout remains a findings array and diagnostics are written to stderr.
|
|
65
69
|
|
|
66
70
|
## Options
|
|
67
71
|
|
|
68
72
|
```
|
|
69
73
|
impeccable detect [options] [file-or-dir-or-url...]
|
|
70
74
|
|
|
71
|
-
--
|
|
72
|
-
--
|
|
73
|
-
--help
|
|
75
|
+
--json Output findings as JSON
|
|
76
|
+
--scope Only report rules in a design domain (type, layout)
|
|
77
|
+
--help Show help
|
|
74
78
|
```
|
|
75
79
|
|
|
76
80
|
## Requirements
|
|
77
81
|
|
|
78
|
-
- Node.js 22.18+
|
|
79
|
-
-
|
|
80
|
-
|
|
82
|
+
- Node.js 22.18+ to run `npx impeccable`. The engine itself is a self-contained binary and needs no runtime; the skill installed into your harness calls it directly.
|
|
83
|
+
- For URL scans, an installed Chrome, Chromium, or Edge (set `IMPECCABLE_BROWSER` to point at one).
|
|
84
|
+
|
|
85
|
+
Binary lookup order: `IMPECCABLE_BIN`, the platform package, `~/.impeccable/bin/<version>/`, then a download of the pinned version into that cache. Set `IMPECCABLE_BIN` to a local build to skip all of that.
|
|
81
86
|
|
|
82
87
|
## Part of Impeccable
|
|
83
88
|
|
package/README.npm.md
CHANGED
|
@@ -1,44 +1,45 @@
|
|
|
1
1
|
# Impeccable CLI
|
|
2
2
|
|
|
3
|
-
Detect UI anti-patterns and design quality issues from the command line.
|
|
3
|
+
Detect UI anti-patterns and design quality issues from the command line, and install the Impeccable design skill into your AI coding harness. The detector scans HTML, CSS, JSX, TSX, Vue, and Svelte files for 61 deterministic rules, including AI-generated UI tells, accessibility violations, and general design quality problems.
|
|
4
|
+
|
|
5
|
+
The npm package is a small launcher. It runs the `impeccable` engine binary for your platform, installed alongside it as an optional dependency (`@impeccable/cli-<os>-<arch>`), and falls back to a per-user cache or a one-time download when that package is missing.
|
|
4
6
|
|
|
5
7
|
## Quick Start
|
|
6
8
|
|
|
7
9
|
```bash
|
|
8
10
|
# Install skills into your AI harness (Claude, Cursor, Gemini, etc.)
|
|
9
|
-
npx impeccable
|
|
11
|
+
npx impeccable install
|
|
10
12
|
|
|
11
13
|
# Non-interactive install for a specific scope
|
|
12
|
-
npx impeccable
|
|
14
|
+
npx impeccable install -y --providers=claude,codex --scope=project
|
|
13
15
|
|
|
14
16
|
# First command to run inside your AI harness
|
|
15
17
|
/impeccable init
|
|
16
18
|
|
|
17
19
|
# Update skills to the latest version
|
|
18
|
-
npx impeccable
|
|
20
|
+
npx impeccable update
|
|
19
21
|
|
|
20
22
|
# Install or update skills without hook manifests
|
|
21
|
-
npx impeccable
|
|
23
|
+
npx impeccable install --no-hooks
|
|
22
24
|
|
|
23
25
|
# Link skills from a Git submodule checkout
|
|
24
|
-
npx impeccable
|
|
26
|
+
npx impeccable link --source=.impeccable --providers=claude,cursor
|
|
25
27
|
|
|
26
28
|
# List all available commands
|
|
27
|
-
npx impeccable
|
|
29
|
+
npx impeccable help
|
|
28
30
|
|
|
29
31
|
# Scan files or directories for anti-patterns
|
|
30
32
|
npx impeccable detect src/
|
|
31
33
|
|
|
32
|
-
# Scan a live URL (
|
|
34
|
+
# Scan a live URL (uses an installed Chrome, Chromium, or Edge)
|
|
33
35
|
npx impeccable detect https://example.com
|
|
34
36
|
|
|
35
37
|
# JSON output for CI/tooling
|
|
36
38
|
npx impeccable detect --json src/
|
|
37
|
-
|
|
38
|
-
# Deprecated compatibility flag; full scan still runs
|
|
39
|
-
npx impeccable detect --fast src/
|
|
40
39
|
```
|
|
41
40
|
|
|
41
|
+
`npx impeccable skills <command>` is the legacy namespace and still works.
|
|
42
|
+
|
|
42
43
|
## What It Detects
|
|
43
44
|
|
|
44
45
|
**AI Slop Tells**: patterns that scream "AI generated this":
|
|
@@ -60,24 +61,28 @@ npx impeccable detect --fast src/
|
|
|
60
61
|
|
|
61
62
|
## Exit Codes
|
|
62
63
|
|
|
63
|
-
- `0`: no
|
|
64
|
-
- `
|
|
64
|
+
- `0`: scan completed with no primary findings (advisories may still be listed)
|
|
65
|
+
- `1`: at least one requested target could not be scanned
|
|
66
|
+
- `2`: scan completed with primary findings
|
|
67
|
+
|
|
68
|
+
Operational failure takes precedence when a multi-target scan is partial. In JSON mode, stdout remains a findings array and diagnostics are written to stderr.
|
|
65
69
|
|
|
66
70
|
## Options
|
|
67
71
|
|
|
68
72
|
```
|
|
69
73
|
impeccable detect [options] [file-or-dir-or-url...]
|
|
70
74
|
|
|
71
|
-
--
|
|
72
|
-
--
|
|
73
|
-
--help
|
|
75
|
+
--json Output findings as JSON
|
|
76
|
+
--scope Only report rules in a design domain (type, layout)
|
|
77
|
+
--help Show help
|
|
74
78
|
```
|
|
75
79
|
|
|
76
80
|
## Requirements
|
|
77
81
|
|
|
78
|
-
- Node.js 22.18+
|
|
79
|
-
-
|
|
80
|
-
|
|
82
|
+
- Node.js 22.18+ to run `npx impeccable`. The engine itself is a self-contained binary and needs no runtime; the skill installed into your harness calls it directly.
|
|
83
|
+
- For URL scans, an installed Chrome, Chromium, or Edge (set `IMPECCABLE_BROWSER` to point at one).
|
|
84
|
+
|
|
85
|
+
Binary lookup order: `IMPECCABLE_BIN`, the platform package, `~/.impeccable/bin/<version>/`, then a download of the pinned version into that cache. Set `IMPECCABLE_BIN` to a local build to skip all of that.
|
|
81
86
|
|
|
82
87
|
## Part of Impeccable
|
|
83
88
|
|
package/README.repo.md
CHANGED
|
@@ -95,6 +95,8 @@ Visit [the Neo Mirai case study](https://impeccable.style/cases/neo-mirai) to se
|
|
|
95
95
|
|
|
96
96
|
## Installation
|
|
97
97
|
|
|
98
|
+
The skill needs no runtime of its own. Every skill copy ships a small launcher (`scripts/impeccable`, plus `impeccable.cmd` for Windows) that runs the Impeccable engine, a self-contained binary that either sits next to the launcher or is downloaded once on first run into `~/.impeccable/bin/`. Node is only involved if you use the `npx impeccable` installer, which is a shim around the same binary; the manual and Git options below work without it.
|
|
99
|
+
|
|
98
100
|
### Option 1: CLI installer (Recommended)
|
|
99
101
|
|
|
100
102
|
From the root of your project, run:
|
|
@@ -375,11 +377,13 @@ On Claude Code, GitHub Copilot, Codex, Cursor, and Grok Build, `npx impeccable i
|
|
|
375
377
|
|
|
376
378
|
Installed hook surfaces:
|
|
377
379
|
|
|
378
|
-
- Claude Code: `.claude/settings.local.json` (gitignored, machine-local) runs `${CLAUDE_PROJECT_DIR}/.claude/skills/impeccable/scripts/hook
|
|
379
|
-
- GitHub Copilot: `.github/hooks/impeccable.json` (committed, shared by the Copilot CLI and the cloud agent) runs `.github/skills/impeccable/scripts/hook
|
|
380
|
-
- Cursor: `.cursor/hooks.json` runs `.cursor/skills/impeccable/scripts/hook-before-edit
|
|
381
|
-
- Codex: `.codex/hooks.json` runs `.agents/skills/impeccable/scripts/hook.
|
|
382
|
-
- Grok Build: `.grok/hooks/impeccable.json` runs `.grok/skills/impeccable/scripts/hook
|
|
380
|
+
- Claude Code: `.claude/settings.local.json` (gitignored, machine-local) runs `${CLAUDE_PROJECT_DIR}/.claude/skills/impeccable/scripts/impeccable hook`. A hook moved into the shared `settings.json` is honored in place.
|
|
381
|
+
- GitHub Copilot: `.github/hooks/impeccable.json` (committed, shared by the Copilot CLI and the cloud agent) runs `.github/skills/impeccable/scripts/impeccable hook`. The Copilot CLI activates it once the file is on the repository's default branch and the folder is trusted.
|
|
382
|
+
- Cursor: `.cursor/hooks.json` runs `.cursor/skills/impeccable/scripts/impeccable hook-before-edit`.
|
|
383
|
+
- Codex: `.codex/hooks.json` runs `.agents/skills/impeccable/scripts/impeccable hook`, with a `commandWindows` sibling that calls `impeccable.cmd` for cmd.exe.
|
|
384
|
+
- Grok Build: `.grok/hooks/impeccable.json` runs `.grok/skills/impeccable/scripts/impeccable hook`. Requires `/hooks-trust` or `--trust`. Findings reach the model on Stop, not after each edit.
|
|
385
|
+
|
|
386
|
+
Every command goes through the launcher shipped in the skill's `scripts/` directory (`impeccable`, or `impeccable.cmd` on Windows), guarded so a missing launcher is a silent no-op. The launcher runs the engine binary that ships next to it, or downloads the pinned version once into `~/.impeccable/bin/`. No Node or other runtime is required for the hook or the skill.
|
|
383
387
|
|
|
384
388
|
The installer preserves unrelated hook entries and settings. If a hook manifest is malformed, install/update aborts by default; rerun with `--force` to back up the malformed file as `.bak` and replace it.
|
|
385
389
|
|
|
@@ -412,12 +416,12 @@ npx impeccable update
|
|
|
412
416
|
|
|
413
417
|
## CLI
|
|
414
418
|
|
|
415
|
-
Impeccable includes a standalone CLI for detecting anti-patterns without an AI harness
|
|
419
|
+
Impeccable includes a standalone CLI for detecting anti-patterns without an AI harness. `npx impeccable` is a small shim that runs the same engine binary the skill uses (installed as a platform-specific optional dependency, or fetched once into `~/.impeccable/bin/`); Node is needed only for `npx` itself, and you can also download the binary directly and put it on your PATH.
|
|
416
420
|
|
|
417
421
|
```bash
|
|
418
422
|
npx impeccable detect src/ # scan a directory
|
|
419
423
|
npx impeccable detect index.html # scan an HTML file
|
|
420
|
-
npx impeccable detect https://example.com # scan a URL (
|
|
424
|
+
npx impeccable detect https://example.com # scan a URL (uses an installed Chrome, Chromium, or Edge)
|
|
421
425
|
npx impeccable detect --json . # CI-friendly JSON output
|
|
422
426
|
npx impeccable detect --no-config src/ # raw scan, ignoring project config/context
|
|
423
427
|
npx impeccable ignores list # show detector ignores
|
|
@@ -427,6 +431,8 @@ npx impeccable ignores add-value overused-font Inter --reason "Brand font"
|
|
|
427
431
|
|
|
428
432
|
The detector catches 61 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).
|
|
429
433
|
|
|
434
|
+
Human-readable findings are diagnostics written to stderr, so redirect them with `2> findings.txt`. Use `--json` for machine-readable results on stdout. Exit `0` means the scan completed without primary findings, exit `2` means it completed with primary findings, and exit `1` means at least one requested target could not be scanned; operational failure takes precedence for a partial multi-target scan. URL scans inspect the rendered DOM, computed layout, and accessible linked stylesheets; browser security still prevents reading cross-origin CSS without CORS. A clean detector run is evidence, not proof of visual or accessibility quality: it does not replace inspecting the rendered experience across relevant viewports.
|
|
435
|
+
|
|
430
436
|
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.
|
|
431
437
|
|
|
432
438
|
For a waiver that should travel with one file instead of the repo config, add an inline comment in the file: `<!-- impeccable-disable overused-font: exported brand doc -->`. The marker works in any comment syntax, scopes to the whole file (or one line with `impeccable-disable-line` / `impeccable-disable-next-line`), and is bypassed by `--no-inline-ignores` or `--no-config`.
|
package/cli/bin/cli.js
CHANGED
|
@@ -1,102 +1,95 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
// `impeccable` npm shim: finds the platform binary and execs it with argv.
|
|
3
|
+
// Order: $IMPECCABLE_BIN, the @impeccable/cli-<os>-<arch> optional dependency,
|
|
4
|
+
// the version-pinned user cache (~/.impeccable/bin/<version>/), then a
|
|
5
|
+
// download into that cache from the public release channel.
|
|
6
|
+
import { spawnSync } from 'node:child_process';
|
|
7
|
+
import { createHash } from 'node:crypto';
|
|
8
|
+
import fs from 'node:fs';
|
|
9
|
+
import { createRequire } from 'node:module';
|
|
10
|
+
import os from 'node:os';
|
|
11
|
+
import path from 'node:path';
|
|
2
12
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
const require = createRequire(import.meta.url);
|
|
14
|
+
const pkg = require('../../package.json');
|
|
15
|
+
const OS = { darwin: 'darwin', linux: 'linux', win32: 'windows' }[process.platform] || process.platform;
|
|
16
|
+
const ARCH = { arm64: 'arm64', x64: 'x64' }[process.arch] || process.arch;
|
|
17
|
+
const TARGET = `${OS}-${ARCH}`;
|
|
18
|
+
const EXE = OS === 'windows' ? 'impeccable.exe' : 'impeccable';
|
|
19
|
+
const PLATFORM_PKG = `@impeccable/cli-${TARGET}`;
|
|
20
|
+
// The engine version travels as the pinned optionalDependency range.
|
|
21
|
+
const VERSION = String(pkg.optionalDependencies?.[PLATFORM_PKG] || Object.values(pkg.optionalDependencies || {})[0] || '').replace(/^[^\d]*/, '');
|
|
22
|
+
const CACHE_ROOT = process.env.IMPECCABLE_HOME || path.join(os.homedir(), '.impeccable');
|
|
23
|
+
const CACHED = path.join(CACHE_ROOT, 'bin', VERSION, EXE);
|
|
24
|
+
const BASE = (process.env.IMPECCABLE_DOWNLOAD_BASE || 'https://github.com/pbakaus/impeccable/releases/download').replace(/\/$/, '');
|
|
25
|
+
const URL = `${BASE}/engine-v${VERSION}/impeccable-${TARGET}${OS === 'windows' ? '.exe' : ''}`;
|
|
12
26
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
18
|
-
const SKILL_COMMANDS = new Set(['help', 'install', 'link', 'update', 'check']);
|
|
19
|
-
|
|
20
|
-
// Is this a detect target (the `npx impeccable src/` shorthand) or a mistyped
|
|
21
|
-
// command? Flags, URLs, path-shaped args, and real files/dirs (e.g. an
|
|
22
|
-
// extension-less `Dockerfile`) are targets; anything else is an unknown command.
|
|
23
|
-
function looksLikeDetectTarget(arg) {
|
|
24
|
-
const isFlag = arg.startsWith('-');
|
|
25
|
-
const isUrl = /^https?:\/\//i.test(arg);
|
|
26
|
-
const isPathShaped = arg.includes('/') || arg.includes('\\') || arg.includes('.');
|
|
27
|
-
const isExistingPath = existsSync(resolve(arg));
|
|
28
|
-
return isFlag || isUrl || isPathShaped || isExistingPath;
|
|
27
|
+
function exists(p) { try { return !!p && fs.statSync(p).isFile(); } catch { return false; } }
|
|
28
|
+
function fromPackage() {
|
|
29
|
+
try { return path.join(path.dirname(require.resolve(`${PLATFORM_PKG}/package.json`)), 'bin', EXE); } catch { return null; }
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
Options:
|
|
48
|
-
--help Show this help message
|
|
49
|
-
--version Show version number
|
|
50
|
-
|
|
51
|
-
Compatibility:
|
|
52
|
-
impeccable skills <command> Legacy namespace; still supported.`);
|
|
53
|
-
process.exit(0);
|
|
31
|
+
async function download() {
|
|
32
|
+
if (!VERSION) return null;
|
|
33
|
+
const res = await fetch(URL, { redirect: 'follow' });
|
|
34
|
+
if (!res.ok) return null;
|
|
35
|
+
const buf = Buffer.from(await res.arrayBuffer());
|
|
36
|
+
// Fail closed, like the skill launcher and `impeccable install`: a sidecar
|
|
37
|
+
// that cannot be fetched, or that carries no hash, refuses the download
|
|
38
|
+
// instead of caching an unverified binary. Nothing is written until the
|
|
39
|
+
// hash matches, so a refusal leaves the cache dir untouched.
|
|
40
|
+
const sum = await fetch(`${URL}.sha256`, { redirect: 'follow' }).then(r => (r.ok ? r.text() : ''), () => '');
|
|
41
|
+
const expected = sum.trim().split(/\s+/)[0].toLowerCase();
|
|
42
|
+
if (!expected) {
|
|
43
|
+
throw new Error(
|
|
44
|
+
`cannot verify ${URL} against ${URL}.sha256 (sidecar unavailable or empty); `
|
|
45
|
+
+ 'refusing the unverified download',
|
|
46
|
+
);
|
|
54
47
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const pkg = JSON.parse(readFileSync(join(__dirname, '..', '..', 'package.json'), 'utf8'));
|
|
58
|
-
console.log(pkg.version);
|
|
59
|
-
process.exit(0);
|
|
48
|
+
if (createHash('sha256').update(buf).digest('hex') !== expected) {
|
|
49
|
+
throw new Error(`checksum mismatch downloading ${URL}`);
|
|
60
50
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
} else if (command === 'skills') {
|
|
70
|
-
const { run } = await import('./commands/skills.mjs');
|
|
71
|
-
await run(args.slice(1));
|
|
72
|
-
} else if (SKILL_COMMANDS.has(command)) {
|
|
73
|
-
const { run } = await import('./commands/skills.mjs');
|
|
74
|
-
await run(args);
|
|
75
|
-
} else if (looksLikeDetectTarget(command)) {
|
|
76
|
-
// Default: treat as detect arguments (allow `npx impeccable src/` shorthand)
|
|
77
|
-
process.argv = [process.argv[0], process.argv[1], ...args];
|
|
78
|
-
const { detectCli } = await import('../engine/detect-antipatterns.mjs');
|
|
79
|
-
await detectCli();
|
|
80
|
-
} else if (command === 'init') {
|
|
81
|
-
// The follow-up mistake from issue #472: `/impeccable init` belongs in an AI
|
|
82
|
-
// coding agent's chat, and a user who typed it into their shell is likely to
|
|
83
|
-
// retry it here as `npx impeccable init`.
|
|
84
|
-
console.error(`"init" is not a CLI command. Type /impeccable init in your AI coding agent's chat (Claude Code, Cursor, Codex, ...), not in this terminal.`);
|
|
85
|
-
process.exit(1);
|
|
86
|
-
} else {
|
|
87
|
-
// An unknown bareword: a mistyped command (or an old cached version run
|
|
88
|
-
// against newer docs). Fail loudly instead of silently statting it as a path.
|
|
89
|
-
console.error(`Unknown command: "${command}"\n\nTo see a list of supported commands, run:\n impeccable --help`);
|
|
90
|
-
process.exit(1);
|
|
51
|
+
fs.mkdirSync(path.dirname(CACHED), { recursive: true });
|
|
52
|
+
const tmp = `${CACHED}.part.${process.pid}`;
|
|
53
|
+
try {
|
|
54
|
+
fs.writeFileSync(tmp, buf, { mode: 0o755 });
|
|
55
|
+
fs.renameSync(tmp, CACHED);
|
|
56
|
+
} catch (err) {
|
|
57
|
+
try { fs.rmSync(tmp, { force: true }); } catch { /* best effort */ }
|
|
58
|
+
throw err;
|
|
91
59
|
}
|
|
60
|
+
return CACHED;
|
|
61
|
+
}
|
|
62
|
+
async function locate() {
|
|
63
|
+
const envBin = process.env.IMPECCABLE_BIN;
|
|
64
|
+
if (exists(envBin)) return envBin;
|
|
65
|
+
const fromPkg = fromPackage();
|
|
66
|
+
if (exists(fromPkg)) return fromPkg;
|
|
67
|
+
if (exists(CACHED)) return CACHED;
|
|
68
|
+
return download().catch((err) => { process.stderr.write(`impeccable: ${err.message}\n`); return null; });
|
|
92
69
|
}
|
|
93
70
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
71
|
+
// `--version` / `-v` is answered by the shim itself: the number users mean
|
|
72
|
+
// is this npm package's version, not the engine's (docs/CLI-CONTRACT.md).
|
|
73
|
+
const argv = process.argv.slice(2);
|
|
74
|
+
if (argv[0] === '--version' || argv[0] === '-v') {
|
|
75
|
+
process.stdout.write(`${pkg.version}\n`);
|
|
76
|
+
process.exit(0);
|
|
77
|
+
}
|
|
99
78
|
|
|
100
|
-
|
|
101
|
-
|
|
79
|
+
const bin = await locate();
|
|
80
|
+
if (!bin) {
|
|
81
|
+
process.stderr.write(
|
|
82
|
+
`impeccable: no binary for ${TARGET}. Install ${PLATFORM_PKG}@${VERSION}, set IMPECCABLE_BIN, `
|
|
83
|
+
+ `or download impeccable-${TARGET} v${VERSION} from ${BASE} into ${CACHED}.\n`,
|
|
84
|
+
);
|
|
85
|
+
process.exit(127);
|
|
86
|
+
}
|
|
87
|
+
const result = spawnSync(bin, argv, {
|
|
88
|
+
stdio: 'inherit',
|
|
89
|
+
env: { IMPECCABLE_SELF: 'npx impeccable', ...process.env },
|
|
102
90
|
});
|
|
91
|
+
if (result.error) {
|
|
92
|
+
process.stderr.write(`impeccable: failed to run ${bin}: ${result.error.message}\n`);
|
|
93
|
+
process.exit(127);
|
|
94
|
+
}
|
|
95
|
+
process.exit(result.status === null ? 1 : result.status);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "impeccable",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"author": "Paul Bakaus",
|
|
5
5
|
"description": "Design skills, commands, and anti-pattern detection for AI coding agents",
|
|
6
6
|
"keywords": [
|
|
@@ -30,13 +30,8 @@
|
|
|
30
30
|
"bin": {
|
|
31
31
|
"impeccable": "cli/bin/cli.js"
|
|
32
32
|
},
|
|
33
|
-
"main": "./cli/engine/detect-antipatterns.mjs",
|
|
34
|
-
"exports": {
|
|
35
|
-
".": "./cli/engine/detect-antipatterns.mjs",
|
|
36
|
-
"./browser": "./cli/engine/detect-antipatterns-browser.js"
|
|
37
|
-
},
|
|
38
33
|
"files": [
|
|
39
|
-
"cli/",
|
|
34
|
+
"cli/bin/",
|
|
40
35
|
"LICENSE"
|
|
41
36
|
],
|
|
42
37
|
"scripts": {
|
|
@@ -44,17 +39,18 @@
|
|
|
44
39
|
"build:skills:release": "bun run scripts/build.js",
|
|
45
40
|
"build": "bun run build:skills && mkdir -p build/_data && rm -rf build/_data/dist && cp -R dist build/_data/dist",
|
|
46
41
|
"build:release": "bun run build:skills:release && mkdir -p build/_data && rm -rf build/_data/dist && cp -R dist build/_data/dist",
|
|
47
|
-
"build:browser": "node scripts/build-browser-detector.js",
|
|
48
42
|
"build:extension": "node scripts/build-extension.js",
|
|
43
|
+
"fetch:engine": "node scripts/fetch-engine.mjs",
|
|
49
44
|
"clean": "rm -rf dist build",
|
|
50
45
|
"rebuild": "bun run clean && bun run build",
|
|
51
46
|
"rebuild:release": "bun run clean && bun run build:release",
|
|
52
47
|
"test": "node scripts/run-tests.mjs default",
|
|
53
48
|
"test:core": "node scripts/run-tests.mjs core",
|
|
49
|
+
"test:oracle": "node scripts/run-tests.mjs oracle",
|
|
54
50
|
"test:detector": "node scripts/run-tests.mjs detector",
|
|
55
51
|
"test:framework": "node scripts/run-tests.mjs framework",
|
|
56
52
|
"test:live": "node scripts/run-tests.mjs live",
|
|
57
|
-
"test:
|
|
53
|
+
"test:cleanup": "node scripts/run-tests.mjs --cleanup",
|
|
58
54
|
"test:cli-remote-e2e": "node scripts/run-tests.mjs cli-remote-e2e",
|
|
59
55
|
"test:plugin-e2e": "node scripts/run-tests.mjs plugin-e2e",
|
|
60
56
|
"test:live-e2e": "node scripts/run-tests.mjs live-e2e",
|
|
@@ -64,25 +60,22 @@
|
|
|
64
60
|
"test:skill-behavior": "node scripts/run-tests.mjs skill-behavior",
|
|
65
61
|
"test:live-svelte-adapter-deepseek": "node scripts/run-tests.mjs live-svelte-adapter-deepseek",
|
|
66
62
|
"smoke:hooks": "node scripts/smoke-provider-hooks.mjs",
|
|
67
|
-
"bench:detector": "node scripts/benchmark-detector.mjs",
|
|
68
|
-
"bench:detector:browser": "node scripts/benchmark-detector.mjs --browser",
|
|
69
63
|
"audit": "bun audit --audit-level=moderate",
|
|
70
64
|
"prepack": "cp README.md README.repo.md && cp README.npm.md README.md",
|
|
71
65
|
"postpack": "cp README.repo.md README.md && rm README.repo.md",
|
|
72
66
|
"release:skill": "node scripts/release.mjs skill",
|
|
73
67
|
"release:cli": "node scripts/release.mjs cli",
|
|
74
|
-
"release:ext": "node scripts/release.mjs extension"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"
|
|
78
|
-
"css-tree": "^3.2.1",
|
|
79
|
-
"domutils": "^4.0.2",
|
|
80
|
-
"fflate": "^0.8.3",
|
|
81
|
-
"htmlparser2": "^12.0.0",
|
|
82
|
-
"marked": "^18.0.5"
|
|
68
|
+
"release:ext": "node scripts/release.mjs extension",
|
|
69
|
+
"release:engine": "node scripts/release.mjs engine",
|
|
70
|
+
"release:platform-packages": "node scripts/publish-platform-packages.mjs",
|
|
71
|
+
"check:engine-release": "node scripts/check-engine-release.mjs"
|
|
83
72
|
},
|
|
84
73
|
"optionalDependencies": {
|
|
85
|
-
"
|
|
74
|
+
"@impeccable/cli-darwin-arm64": "0.1.0",
|
|
75
|
+
"@impeccable/cli-darwin-x64": "0.1.0",
|
|
76
|
+
"@impeccable/cli-linux-x64": "0.1.0",
|
|
77
|
+
"@impeccable/cli-linux-arm64": "0.1.0",
|
|
78
|
+
"@impeccable/cli-windows-x64": "0.1.0"
|
|
86
79
|
},
|
|
87
80
|
"devDependencies": {
|
|
88
81
|
"@ai-sdk/anthropic": "^4.0.7",
|
|
@@ -94,6 +87,7 @@
|
|
|
94
87
|
"ai": "^7.0.14",
|
|
95
88
|
"archiver": "^8.0.0",
|
|
96
89
|
"playwright": "^1.59.1",
|
|
90
|
+
"puppeteer": "^25.1.0",
|
|
97
91
|
"svelte": "^5",
|
|
98
92
|
"zod": "^4.3.6"
|
|
99
93
|
}
|