impeccable 3.6.0 → 4.0.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 +26 -21
- package/README.npm.md +26 -21
- package/README.repo.md +51 -17
- package/cli/bin/cli.js +77 -92
- package/package.json +16 -22
- package/cli/bin/commands/ignores.mjs +0 -351
- package/cli/bin/commands/skills.mjs +0 -2337
- package/cli/engine/browser/injected/index.mjs +0 -2073
- package/cli/engine/cli/main.mjs +0 -438
- package/cli/engine/design-system.mjs +0 -1121
- package/cli/engine/detect-antipatterns-browser.js +0 -8730
- package/cli/engine/detect-antipatterns.mjs +0 -51
- package/cli/engine/engines/browser/detect-url.mjs +0 -372
- package/cli/engine/engines/regex/detect-text.mjs +0 -1171
- package/cli/engine/engines/static-html/css-cascade.mjs +0 -1192
- package/cli/engine/engines/static-html/detect-html.mjs +0 -290
- 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 -617
- package/cli/engine/rules/checks.mjs +0 -5536
- package/cli/engine/shared/color.mjs +0 -588
- package/cli/engine/shared/constants.mjs +0 -112
- 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 -34
- 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":
|
|
@@ -56,32 +57,36 @@ npx impeccable detect --fast src/
|
|
|
56
57
|
|
|
57
58
|
**Quality**: tiny body text, cramped padding, long line lengths, small touch targets
|
|
58
59
|
|
|
59
|
-
|
|
60
|
+
61 deterministic detector rules in total. See the full catalog at [impeccable.style/slop](https://impeccable.style/slop).
|
|
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
|
|
|
84
|
-
This CLI is part of [Impeccable](https://impeccable.style), a cross-provider design skill pack for AI-powered development tools. The full suite includes 23 commands for Claude, Cursor, GitHub Copilot, Gemini, Codex, and more.
|
|
89
|
+
This CLI is part of [Impeccable](https://impeccable.style), a cross-provider design skill pack for AI-powered development tools. The full suite includes 23 commands for Claude, Cursor, GitHub Copilot, Gemini, Codex, Hermes Agent, Veto, and more.
|
|
85
90
|
|
|
86
91
|
## License
|
|
87
92
|
|
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":
|
|
@@ -56,32 +57,36 @@ npx impeccable detect --fast src/
|
|
|
56
57
|
|
|
57
58
|
**Quality**: tiny body text, cramped padding, long line lengths, small touch targets
|
|
58
59
|
|
|
59
|
-
|
|
60
|
+
61 deterministic detector rules in total. See the full catalog at [impeccable.style/slop](https://impeccable.style/slop).
|
|
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
|
|
|
84
|
-
This CLI is part of [Impeccable](https://impeccable.style), a cross-provider design skill pack for AI-powered development tools. The full suite includes 23 commands for Claude, Cursor, GitHub Copilot, Gemini, Codex, and more.
|
|
89
|
+
This CLI is part of [Impeccable](https://impeccable.style), a cross-provider design skill pack for AI-powered development tools. The full suite includes 23 commands for Claude, Cursor, GitHub Copilot, Gemini, Codex, Hermes Agent, Veto, and more.
|
|
85
90
|
|
|
86
91
|
## License
|
|
87
92
|
|
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 61 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
|
|
|
@@ -11,9 +11,9 @@ Anthropic's [frontend-design](https://github.com/anthropics/skills/tree/main/ski
|
|
|
11
11
|
Every model trained on the same SaaS templates. Skip the guidance and you get the same handful of tells on every project: Inter for everything, purple-to-blue gradients, cards nested in cards, gray text on colored backgrounds, the rounded-square icon tile above every heading.
|
|
12
12
|
|
|
13
13
|
Impeccable adds:
|
|
14
|
-
- **One setup flow.** `/impeccable init`
|
|
14
|
+
- **One setup flow.** `/impeccable init` records durable product truth in `PRODUCT.md`, so later commands know the audience, purpose, operating context, constraints, voice, and evidence without confusing those facts with surface-level visual direction.
|
|
15
15
|
- **23 commands.** A shared design vocabulary with your AI: `polish`, `audit`, `critique`, `distill`, `animate`, `bolder`, `quieter`, and more.
|
|
16
|
-
- **
|
|
16
|
+
- **61 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
|
|
|
@@ -31,7 +31,7 @@ Start every new project with:
|
|
|
31
31
|
/impeccable init
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
`init`
|
|
34
|
+
`init` inspects the project, asks only for material gaps in durable product truth, and writes `PRODUCT.md`. Visitor mode and visual direction are chosen later for each surface; incumbent or newly built visual systems are recorded separately in `DESIGN.md`.
|
|
35
35
|
|
|
36
36
|
### 23 Commands
|
|
37
37
|
|
|
@@ -40,7 +40,7 @@ All commands are accessed through `/impeccable`:
|
|
|
40
40
|
| Command | What it does |
|
|
41
41
|
|---------|--------------|
|
|
42
42
|
| `/impeccable craft` | Full shape-then-build flow with visual iteration |
|
|
43
|
-
| `/impeccable init` | One-time setup: gather
|
|
43
|
+
| `/impeccable init` | One-time setup: gather durable product context, write PRODUCT.md, configure live mode when applicable, recommend next steps |
|
|
44
44
|
| `/impeccable document` | Generate root DESIGN.md from existing project code |
|
|
45
45
|
| `/impeccable extract` | Pull reusable components and tokens into the design system |
|
|
46
46
|
| `/impeccable shape` | Plan UX/UI before writing code |
|
|
@@ -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:
|
|
@@ -103,7 +105,7 @@ From the root of your project, run:
|
|
|
103
105
|
npx impeccable install
|
|
104
106
|
```
|
|
105
107
|
|
|
106
|
-
This shows the harness folders it detected (for example `~/.claude`, `~/.codex`, `~/.grok`, or project-local `.cursor`), lets you keep the detected set or customize providers, then asks whether to install into the current project or globally. Use `--providers=claude,codex,cursor,grok` and `--scope=project|global` to skip those choices in scripts. On Claude Code, Cursor, Codex, GitHub Copilot, and Grok Build, it also installs the provider-native hook manifest for the current project. Works with Cursor, Claude Code, Gemini CLI, Codex CLI, Grok Build, and every other supported tool. Reload your harness afterward.
|
|
108
|
+
This shows the harness folders or installed CLIs it detected (for example `~/.claude`, `~/.codex`, `~/.grok`, `~/.hermes`, `~/.veto`, or project-local `.cursor`), lets you keep the detected set or customize providers, then asks whether to install into the current project or globally. Use `--providers=claude,codex,cursor,grok,hermes,veto` and `--scope=project|global` to skip those choices in scripts. On Claude Code, Cursor, Codex, GitHub Copilot, and Grok Build, it also installs the provider-native hook manifest for the current project. Veto receives the packaged skill under `~/.veto/skills/` and does not run native Impeccable edit hooks. Works with Cursor, Claude Code, Gemini CLI, Codex CLI, Grok Build, Hermes Agent, Veto, and every other supported tool. Reload your harness afterward.
|
|
107
109
|
|
|
108
110
|
To refresh an existing install, run:
|
|
109
111
|
|
|
@@ -113,6 +115,8 @@ npx impeccable update
|
|
|
113
115
|
|
|
114
116
|
Codex users should open `/hooks` after install or update and approve the project hook when prompted. Codex tracks trust by hook definition, so updates that change `.codex/hooks.json` can require approval again. Grok Build users need project folder trust (`/hooks-trust` or launch with `--trust`) before `.grok/hooks/` scripts run.
|
|
115
117
|
|
|
118
|
+
See [Allow the hook in your harness](https://impeccable.style/docs/hooks#allow-the-hook-in-your-harness) for harness-specific trust and verification steps.
|
|
119
|
+
|
|
116
120
|
### Option 2: Git Submodule
|
|
117
121
|
|
|
118
122
|
For teams that want to keep Impeccable vendored and updated through Git, add this repo as a submodule and link the compiled provider build into your harness folders:
|
|
@@ -124,7 +128,7 @@ git add .gitmodules .impeccable .claude .cursor
|
|
|
124
128
|
git commit -m "Add Impeccable skills"
|
|
125
129
|
```
|
|
126
130
|
|
|
127
|
-
Use the providers your project needs, for example `claude`, `cursor`, `gemini`, `codex`, `github`, `grok`, `opencode`, `pi`, `qoder`, `trae`, `trae-cn`, `rovo-dev`, or `
|
|
131
|
+
Use the providers your project needs, for example `claude`, `cursor`, `gemini`, `codex`, `github`, `grok`, `hermes`, `opencode`, `pi`, `qoder`, `trae`, `trae-cn`, `rovo-dev`, `vibe`, or `veto`. The command links individual skill folders from `.impeccable/dist/universal/` and leaves existing real skill directories untouched unless you pass `--force`.
|
|
128
132
|
|
|
129
133
|
To update later:
|
|
130
134
|
|
|
@@ -180,6 +184,26 @@ cp -r dist/claude-code/.claude/* ~/.claude/
|
|
|
180
184
|
cp -r dist/opencode/.opencode your-project/
|
|
181
185
|
```
|
|
182
186
|
|
|
187
|
+
**Hermes Agent:**
|
|
188
|
+
```bash
|
|
189
|
+
# Global (applies to all projects; uses the active profile, or ~/.hermes by default)
|
|
190
|
+
cp -r dist/hermes/.hermes/skills/* "${HERMES_HOME:-$HOME/.hermes}/skills/"
|
|
191
|
+
|
|
192
|
+
# Or project-specific
|
|
193
|
+
cp -r dist/hermes/.hermes your-project/
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
> **Note:** Hermes gates project-local skills behind a per-repo trust decision
|
|
197
|
+
> (they are procedure documents, so auto-loading them from any cloned repo is
|
|
198
|
+
> treated as a prompt-injection vector). After a project-scoped install, run
|
|
199
|
+
> `hermes skills trust` once from the project root. Global installs into the
|
|
200
|
+
> active `$HERMES_HOME/skills/` (or `~/.hermes/skills/` when unset) load without
|
|
201
|
+
> a trust step. `/impeccable <command>` then
|
|
202
|
+
> routes through the skill's Commands table; the design hook does not install
|
|
203
|
+
> on Hermes (no hook surface).
|
|
204
|
+
>
|
|
205
|
+
> [Learn more about Hermes skills](https://hermes-agent.nousresearch.com/docs/user-guide/features/skills)
|
|
206
|
+
|
|
183
207
|
**Pi:**
|
|
184
208
|
```bash
|
|
185
209
|
cp -r dist/pi/.pi your-project/
|
|
@@ -314,11 +338,13 @@ As you run commands, Impeccable writes working files under `.impeccable/`: criti
|
|
|
314
338
|
# Unanchored: .impeccable may sit at the repo root or under a nested
|
|
315
339
|
# workspace (apps/web/.impeccable/...); anchored patterns would miss it.
|
|
316
340
|
# Shared artifacts stay tracked: config.json, live/config.json,
|
|
317
|
-
# design.json, critique/*.md.
|
|
341
|
+
# design.json, surfaces/*.md, critique/*.md.
|
|
318
342
|
.impeccable/config.local.json
|
|
319
343
|
.impeccable/hook.cache.json
|
|
320
344
|
.impeccable/hook.pending.json
|
|
321
345
|
.impeccable/*.png
|
|
346
|
+
.impeccable/review/
|
|
347
|
+
.impeccable/questions/
|
|
322
348
|
.impeccable/live/server.json
|
|
323
349
|
.impeccable/live/sessions/
|
|
324
350
|
.impeccable/live/previews/
|
|
@@ -340,20 +366,24 @@ The block is wrapped in `# impeccable-ignore-start` / `# impeccable-ignore-end`
|
|
|
340
366
|
- `.impeccable/config.json` (unified shared config)
|
|
341
367
|
- `.impeccable/live/config.json` (live-mode framework wiring)
|
|
342
368
|
- `.impeccable/design.json` (shared design spec)
|
|
369
|
+
- `.impeccable/surfaces/*.md` (route- or artifact-specific strategy and direction contracts)
|
|
343
370
|
- `.impeccable/critique/*.md` (review reports)
|
|
344
371
|
|
|
345
372
|
If an ephemeral file (a screenshot, `config.local.json`) was committed before you added the block, `.gitignore` will not untrack it automatically. Run `git rm --cached <path>` to stop tracking it without deleting your local copy.
|
|
346
373
|
|
|
347
374
|
## Design hook
|
|
348
375
|
|
|
349
|
-
On Claude Code, GitHub Copilot, Codex, Cursor, and Grok Build, `npx impeccable install` and `npx impeccable update` install a provider-native hook manifest along with the skill payload. The hook runs the Impeccable design detector on direct UI file edits and surfaces findings back into the agent flow. Claude Code, GitHub Copilot,
|
|
376
|
+
On Claude Code, GitHub Copilot, Codex, Cursor, and Grok Build, `npx impeccable install` and `npx impeccable update` install a provider-native hook manifest along with the skill payload. The hook runs the Impeccable design detector on direct UI file edits and surfaces findings back into the agent flow. Claude Code, GitHub Copilot, and Codex surface findings after the edit (and run a deeper pass on Stop where supported). Grok Build scans after the edit to warm Stop, then surfaces on Stop; PostToolUse stdout never reaches the model. Cursor blocks bad proposed writes before they land.
|
|
350
377
|
|
|
351
378
|
Installed hook surfaces:
|
|
352
379
|
|
|
353
|
-
- Claude Code: `.claude/settings.local.json` (gitignored, machine-local) runs `${CLAUDE_PROJECT_DIR}/.claude/skills/impeccable/scripts/hook
|
|
354
|
-
- GitHub Copilot: `.github/hooks/impeccable.json` (committed, shared by the Copilot CLI and the cloud agent) runs `.github/skills/impeccable/scripts/hook
|
|
355
|
-
- Cursor: `.cursor/hooks.json` runs `.cursor/skills/impeccable/scripts/hook-before-edit
|
|
356
|
-
- Codex: `.codex/hooks.json` runs `.agents/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.
|
|
357
387
|
|
|
358
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.
|
|
359
389
|
|
|
@@ -363,7 +393,7 @@ For debugging, set `hook.auditLog` in `.impeccable/config.json` to a path (or th
|
|
|
363
393
|
|
|
364
394
|
## Build path: comp-first or code-first
|
|
365
395
|
|
|
366
|
-
When a new surface gets designed, Impeccable either generates a full-fidelity comp first and builds to match it, or builds straight in code with the ambition written into
|
|
396
|
+
When a new surface gets designed, Impeccable either generates a full-fidelity comp first and builds to match it, or builds straight in code with the ambition written into a development-only direction contract in the surface brief and checked at the finish. Comp-first composes bolder and takes longer; code-first is leaner and faster. `/impeccable init` asks once and records the answer as `buildPath` in `.impeccable/config.json`:
|
|
367
397
|
|
|
368
398
|
```json
|
|
369
399
|
{ "buildPath": "comp" }
|
|
@@ -386,12 +416,12 @@ npx impeccable update
|
|
|
386
416
|
|
|
387
417
|
## CLI
|
|
388
418
|
|
|
389
|
-
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.
|
|
390
420
|
|
|
391
421
|
```bash
|
|
392
422
|
npx impeccable detect src/ # scan a directory
|
|
393
423
|
npx impeccable detect index.html # scan an HTML file
|
|
394
|
-
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)
|
|
395
425
|
npx impeccable detect --json . # CI-friendly JSON output
|
|
396
426
|
npx impeccable detect --no-config src/ # raw scan, ignoring project config/context
|
|
397
427
|
npx impeccable ignores list # show detector ignores
|
|
@@ -399,7 +429,9 @@ npx impeccable ignores add-file "src/legacy/**"
|
|
|
399
429
|
npx impeccable ignores add-value overused-font Inter --reason "Brand font"
|
|
400
430
|
```
|
|
401
431
|
|
|
402
|
-
The detector catches
|
|
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).
|
|
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.
|
|
403
435
|
|
|
404
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.
|
|
405
437
|
|
|
@@ -415,6 +447,7 @@ Full detector docs: [impeccable.style/docs/detector](https://impeccable.style/do
|
|
|
415
447
|
- [Gemini CLI](https://github.com/google-gemini/gemini-cli)
|
|
416
448
|
- [Codex CLI](https://github.com/openai/codex)
|
|
417
449
|
- [Grok Build](https://x.ai/cli)
|
|
450
|
+
- [Hermes Agent](https://hermes-agent.nousresearch.com)
|
|
418
451
|
- [OpenCode](https://opencode.ai)
|
|
419
452
|
- [Pi](https://pi.dev)
|
|
420
453
|
- [Kiro](https://kiro.dev)
|
|
@@ -422,6 +455,7 @@ Full detector docs: [impeccable.style/docs/detector](https://impeccable.style/do
|
|
|
422
455
|
- [Rovo Dev](https://www.atlassian.com/software/rovo)
|
|
423
456
|
- [Qoder](https://qoder.com)
|
|
424
457
|
- [Mistral Vibe](https://docs.mistral.ai/vibe/code/overview)
|
|
458
|
+
- [Veto](https://github.com/oleg-koval/veto)
|
|
425
459
|
- [Google Antigravity](https://antigravity.google)
|
|
426
460
|
|
|
427
461
|
## Community & Ecosystem
|
package/cli/bin/cli.js
CHANGED
|
@@ -1,102 +1,87 @@
|
|
|
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
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
71
|
+
const bin = await locate();
|
|
72
|
+
if (!bin) {
|
|
73
|
+
process.stderr.write(
|
|
74
|
+
`impeccable: no binary for ${TARGET}. Install ${PLATFORM_PKG}@${VERSION}, set IMPECCABLE_BIN, `
|
|
75
|
+
+ `or download impeccable-${TARGET} v${VERSION} from ${BASE} into ${CACHED}.\n`,
|
|
76
|
+
);
|
|
77
|
+
process.exit(127);
|
|
78
|
+
}
|
|
79
|
+
const result = spawnSync(bin, process.argv.slice(2), {
|
|
80
|
+
stdio: 'inherit',
|
|
81
|
+
env: { IMPECCABLE_SELF: 'npx impeccable', ...process.env },
|
|
102
82
|
});
|
|
83
|
+
if (result.error) {
|
|
84
|
+
process.stderr.write(`impeccable: failed to run ${bin}: ${result.error.message}\n`);
|
|
85
|
+
process.exit(127);
|
|
86
|
+
}
|
|
87
|
+
process.exit(result.status === null ? 1 : result.status);
|