impeccable 3.6.0 → 3.6.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 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 59 deterministic rules, including AI-generated UI tells, accessibility violations, and general design quality problems.
3
+ Detect UI anti-patterns and design quality issues from the command line. Scans HTML, CSS, JSX, TSX, Vue, and Svelte files for 61 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 deterministic detector rules in total. See the full catalog at [impeccable.style/slop](https://impeccable.style/slop).
59
+ 61 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
 
@@ -81,7 +81,7 @@ impeccable detect [options] [file-or-dir-or-url...]
81
81
 
82
82
  ## Part of Impeccable
83
83
 
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.
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, Hermes Agent, Veto, and more.
85
85
 
86
86
  ## License
87
87
 
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 59 deterministic rules, including AI-generated UI tells, accessibility violations, and general design quality problems.
3
+ Detect UI anti-patterns and design quality issues from the command line. Scans HTML, CSS, JSX, TSX, Vue, and Svelte files for 61 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 deterministic detector rules in total. See the full catalog at [impeccable.style/slop](https://impeccable.style/slop).
59
+ 61 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
 
@@ -81,7 +81,7 @@ impeccable detect [options] [file-or-dir-or-url...]
81
81
 
82
82
  ## Part of Impeccable
83
83
 
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.
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, Hermes Agent, Veto, and more.
85
85
 
86
86
  ## License
87
87
 
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 59 deterministic detector rules for AI-generated frontend design.
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` writes `PRODUCT.md` and offers `DESIGN.md`, so later commands know the audience, brand/product lane, voice, anti-references, colors, type, and components.
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
- - **59 deterministic detector rules** plus LLM-only critique checks. The CLI and browser extension run the deterministic rules with no LLM and no API key.
16
+ - **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` asks whether the surface is brand (marketing, landing, portfolio) or product (app UI, dashboard, tool), then writes design context that every later command reads.
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 design context, write PRODUCT.md and DESIGN.md, configure live mode, recommend next steps |
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 |
@@ -103,7 +103,7 @@ From the root of your project, run:
103
103
  npx impeccable install
104
104
  ```
105
105
 
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.
106
+ 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
107
 
108
108
  To refresh an existing install, run:
109
109
 
@@ -113,6 +113,8 @@ npx impeccable update
113
113
 
114
114
  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
115
 
116
+ 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.
117
+
116
118
  ### Option 2: Git Submodule
117
119
 
118
120
  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 +126,7 @@ git add .gitmodules .impeccable .claude .cursor
124
126
  git commit -m "Add Impeccable skills"
125
127
  ```
126
128
 
127
- Use the providers your project needs, for example `claude`, `cursor`, `gemini`, `codex`, `github`, `grok`, `opencode`, `pi`, `qoder`, `trae`, `trae-cn`, `rovo-dev`, or `vibe`. The command links individual skill folders from `.impeccable/dist/universal/` and leaves existing real skill directories untouched unless you pass `--force`.
129
+ 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
130
 
129
131
  To update later:
130
132
 
@@ -180,6 +182,26 @@ cp -r dist/claude-code/.claude/* ~/.claude/
180
182
  cp -r dist/opencode/.opencode your-project/
181
183
  ```
182
184
 
185
+ **Hermes Agent:**
186
+ ```bash
187
+ # Global (applies to all projects; uses the active profile, or ~/.hermes by default)
188
+ cp -r dist/hermes/.hermes/skills/* "${HERMES_HOME:-$HOME/.hermes}/skills/"
189
+
190
+ # Or project-specific
191
+ cp -r dist/hermes/.hermes your-project/
192
+ ```
193
+
194
+ > **Note:** Hermes gates project-local skills behind a per-repo trust decision
195
+ > (they are procedure documents, so auto-loading them from any cloned repo is
196
+ > treated as a prompt-injection vector). After a project-scoped install, run
197
+ > `hermes skills trust` once from the project root. Global installs into the
198
+ > active `$HERMES_HOME/skills/` (or `~/.hermes/skills/` when unset) load without
199
+ > a trust step. `/impeccable <command>` then
200
+ > routes through the skill's Commands table; the design hook does not install
201
+ > on Hermes (no hook surface).
202
+ >
203
+ > [Learn more about Hermes skills](https://hermes-agent.nousresearch.com/docs/user-guide/features/skills)
204
+
183
205
  **Pi:**
184
206
  ```bash
185
207
  cp -r dist/pi/.pi your-project/
@@ -314,11 +336,13 @@ As you run commands, Impeccable writes working files under `.impeccable/`: criti
314
336
  # Unanchored: .impeccable may sit at the repo root or under a nested
315
337
  # workspace (apps/web/.impeccable/...); anchored patterns would miss it.
316
338
  # Shared artifacts stay tracked: config.json, live/config.json,
317
- # design.json, critique/*.md.
339
+ # design.json, surfaces/*.md, critique/*.md.
318
340
  .impeccable/config.local.json
319
341
  .impeccable/hook.cache.json
320
342
  .impeccable/hook.pending.json
321
343
  .impeccable/*.png
344
+ .impeccable/review/
345
+ .impeccable/questions/
322
346
  .impeccable/live/server.json
323
347
  .impeccable/live/sessions/
324
348
  .impeccable/live/previews/
@@ -340,13 +364,14 @@ The block is wrapped in `# impeccable-ignore-start` / `# impeccable-ignore-end`
340
364
  - `.impeccable/config.json` (unified shared config)
341
365
  - `.impeccable/live/config.json` (live-mode framework wiring)
342
366
  - `.impeccable/design.json` (shared design spec)
367
+ - `.impeccable/surfaces/*.md` (route- or artifact-specific strategy and direction contracts)
343
368
  - `.impeccable/critique/*.md` (review reports)
344
369
 
345
370
  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
371
 
347
372
  ## Design hook
348
373
 
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, Codex, and Grok Build surface findings after the edit (and run a deeper pass on Stop where supported). Cursor blocks bad proposed writes before they land.
374
+ 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
375
 
351
376
  Installed hook surfaces:
352
377
 
@@ -354,6 +379,7 @@ Installed hook surfaces:
354
379
  - GitHub Copilot: `.github/hooks/impeccable.json` (committed, shared by the Copilot CLI and the cloud agent) runs `.github/skills/impeccable/scripts/hook.mjs`. The Copilot CLI activates it once the file is on the repository's default branch and the folder is trusted.
355
380
  - Cursor: `.cursor/hooks.json` runs `.cursor/skills/impeccable/scripts/hook-before-edit.mjs`.
356
381
  - Codex: `.codex/hooks.json` runs `.agents/skills/impeccable/scripts/hook.mjs`.
382
+ - Grok Build: `.grok/hooks/impeccable.json` runs `.grok/skills/impeccable/scripts/hook.mjs`. Requires `/hooks-trust` or `--trust`. Findings reach the model on Stop, not after each edit.
357
383
 
358
384
  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
385
 
@@ -363,7 +389,7 @@ For debugging, set `hook.auditLog` in `.impeccable/config.json` to a path (or th
363
389
 
364
390
  ## Build path: comp-first or code-first
365
391
 
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 the direction contract 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`:
392
+ 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
393
 
368
394
  ```json
369
395
  { "buildPath": "comp" }
@@ -399,7 +425,7 @@ npx impeccable ignores add-file "src/legacy/**"
399
425
  npx impeccable ignores add-value overused-font Inter --reason "Brand font"
400
426
  ```
401
427
 
402
- The detector catches 59 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).
428
+ 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).
403
429
 
404
430
  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
431
 
@@ -415,6 +441,7 @@ Full detector docs: [impeccable.style/docs/detector](https://impeccable.style/do
415
441
  - [Gemini CLI](https://github.com/google-gemini/gemini-cli)
416
442
  - [Codex CLI](https://github.com/openai/codex)
417
443
  - [Grok Build](https://x.ai/cli)
444
+ - [Hermes Agent](https://hermes-agent.nousresearch.com)
418
445
  - [OpenCode](https://opencode.ai)
419
446
  - [Pi](https://pi.dev)
420
447
  - [Kiro](https://kiro.dev)
@@ -422,6 +449,7 @@ Full detector docs: [impeccable.style/docs/detector](https://impeccable.style/do
422
449
  - [Rovo Dev](https://www.atlassian.com/software/rovo)
423
450
  - [Qoder](https://qoder.com)
424
451
  - [Mistral Vibe](https://docs.mistral.ai/vibe/code/overview)
452
+ - [Veto](https://github.com/oleg-koval/veto)
425
453
  - [Google Antigravity](https://antigravity.google)
426
454
 
427
455
  ## Community & Ecosystem
@@ -7,6 +7,7 @@ import {
7
7
  readDetectionConfig,
8
8
  readRawDetectionConfig,
9
9
  writeDetectionConfig,
10
+ extractFindingIgnoreValue,
10
11
  } from '../../lib/impeccable-config.mjs';
11
12
 
12
13
  const ACTION_ALIASES = new Map([
@@ -235,6 +236,9 @@ function addFile(cwd, args) {
235
236
  function addValue(cwd, args) {
236
237
  const { local, rest } = parseScope(args);
237
238
  const parsed = parseValueArgs(rest);
239
+ if (parsed.value !== '*' && !extractFindingIgnoreValue({ antipattern: parsed.rule, ignoreValue: parsed.value })) {
240
+ throw new Error(`${parsed.rule} has no extractable ignore value. Use impeccable ignores add-value ${parsed.rule} "*" --file <glob> to suppress it in matching files.`);
241
+ }
238
242
  const config = readScopeConfig(cwd, local);
239
243
  const key = ignoreValueKey(parsed);
240
244
  const existing = config.ignoreValues.find((entry) => ignoreValueKey(entry) === key);
@@ -9,11 +9,12 @@
9
9
  */
10
10
 
11
11
  import { execSync } from 'node:child_process';
12
- import { existsSync, readFileSync, readdirSync, statSync, lstatSync, unlinkSync, mkdirSync, writeFileSync, rmSync, rmdirSync, renameSync, createWriteStream, realpathSync, symlinkSync, readlinkSync, cpSync } from 'node:fs';
13
- import { join, resolve, dirname, relative, isAbsolute, sep } from 'node:path';
12
+ import { existsSync, readFileSync, readdirSync, statSync, accessSync, constants, lstatSync, unlinkSync, mkdirSync, mkdtempSync, writeFileSync, rmSync, rmdirSync, renameSync, createWriteStream, realpathSync, symlinkSync, readlinkSync, cpSync } from 'node:fs';
13
+ import { join, resolve, dirname, relative, isAbsolute, sep, delimiter } from 'node:path';
14
14
  import { createInterface, emitKeypressEvents } from 'node:readline';
15
+ import { Readable } from 'node:stream';
16
+ import { pipeline } from 'node:stream/promises';
15
17
  import { fileURLToPath } from 'node:url';
16
- import { get } from 'node:https';
17
18
  import { createHash } from 'node:crypto';
18
19
  import { tmpdir, homedir } from 'node:os';
19
20
  import { unzipSync } from 'fflate';
@@ -23,7 +24,7 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
23
24
  const API_BASE = 'https://impeccable.style';
24
25
 
25
26
  // Provider folder names in project roots
26
- const PROVIDER_DIRS = ['.claude', '.cursor', '.gemini', '.agents', '.agent', '.github', '.grok', '.hermes', '.kiro', '.opencode', '.pi', '.qoder', '.trae', '.trae-cn', '.rovodev', '.vibe'];
27
+ const PROVIDER_DIRS = ['.claude', '.cursor', '.gemini', '.agents', '.agent', '.github', '.grok', '.hermes', '.kiro', '.opencode', '.pi', '.qoder', '.trae', '.trae-cn', '.rovodev', '.vibe', '.veto'];
27
28
  const PROVIDER_ALIASES = {
28
29
  agent: '.agent',
29
30
  agents: '.agents',
@@ -48,6 +49,7 @@ const PROVIDER_ALIASES = {
48
49
  trae: '.trae',
49
50
  'trae-cn': '.trae-cn',
50
51
  vibe: '.vibe',
52
+ veto: '.veto',
51
53
  };
52
54
 
53
55
  const PROVIDER_DISPLAY = {
@@ -67,8 +69,9 @@ const PROVIDER_DISPLAY = {
67
69
  '.trae': { name: 'Trae', input: 'trae' },
68
70
  '.trae-cn': { name: 'Trae CN', input: 'trae-cn' },
69
71
  '.vibe': { name: 'Mistral Vibe', input: 'vibe' },
72
+ '.veto': { name: 'Veto', input: 'veto' },
70
73
  };
71
- const PROVIDER_INPUT_ORDER = ['antigravity', 'claude', 'codex', 'cursor', 'gemini', 'github', 'grok', 'hermes', 'kiro', 'opencode', 'pi', 'qoder', 'trae', 'trae-cn', 'rovo-dev', 'vibe'];
74
+ const PROVIDER_INPUT_ORDER = ['antigravity', 'claude', 'codex', 'cursor', 'gemini', 'github', 'grok', 'hermes', 'kiro', 'opencode', 'pi', 'qoder', 'trae', 'trae-cn', 'rovo-dev', 'vibe', 'veto'];
72
75
 
73
76
  // OpenCode reads global skills from its config directory, not ~/.opencode:
74
77
  // $OPENCODE_CONFIG_DIR, else $XDG_CONFIG_HOME/opencode, else
@@ -163,6 +166,10 @@ const GLOBAL_HARNESS_HINTS = [
163
166
  { home: '.qoder', provider: '.qoder' },
164
167
  { home: '.rovodev', provider: '.rovodev' },
165
168
  { home: '.vibe', provider: '.vibe' },
169
+ // Veto is a CLI harness whose managed skill directory is ~/.veto/skills.
170
+ // Require its managed state directory as well as the executable so an
171
+ // unrelated `veto` binary on PATH does not change project install defaults.
172
+ { command: 'veto', provider: '.veto' },
166
173
  ];
167
174
 
168
175
  // Last-resort default when nothing is detected: Claude Code + the universal
@@ -622,13 +629,17 @@ async function downloadAndExtractBundle() {
622
629
  const localBundle = process.env.IMPECCABLE_BUNDLE_PATH;
623
630
  if (localBundle) return copyOrExtractLocalBundle(localBundle);
624
631
 
625
- const tmpZip = join(tmpdir(), `impeccable-update-${Date.now()}.zip`);
626
- const tmpDir = join(tmpdir(), `impeccable-update-${Date.now()}`);
627
- await downloadFile(`${API_BASE}/api/download/bundle/universal`, tmpZip);
628
- mkdirSync(tmpDir, { recursive: true });
629
- await extractZip(tmpZip, tmpDir);
630
- rmSync(tmpZip, { force: true });
631
- return tmpDir;
632
+ const staging = mkdtempSync(join(tmpdir(), 'impeccable-update-'));
633
+ const tmpZip = join(staging, 'bundle.zip');
634
+ try {
635
+ await downloadFile(`${API_BASE}/api/download/bundle/universal`, tmpZip);
636
+ await extractZip(tmpZip, staging);
637
+ rmSync(tmpZip, { force: true });
638
+ return staging;
639
+ } catch (e) {
640
+ rmSync(staging, { recursive: true, force: true });
641
+ throw e;
642
+ }
632
643
  }
633
644
 
634
645
  async function copyOrExtractLocalBundle(sourceValue) {
@@ -637,16 +648,18 @@ async function copyOrExtractLocalBundle(sourceValue) {
637
648
  throw new Error(`Local bundle not found: ${source}`);
638
649
  }
639
650
 
640
- const tmpDir = join(tmpdir(), `impeccable-local-bundle-${process.pid}-${Date.now()}`);
641
- mkdirSync(tmpDir, { recursive: true });
642
-
643
- if (statSync(source).isDirectory()) {
644
- cpSync(source, tmpDir, { recursive: true });
645
- return tmpDir;
651
+ const staging = mkdtempSync(join(tmpdir(), 'impeccable-local-bundle-'));
652
+ try {
653
+ if (statSync(source).isDirectory()) {
654
+ cpSync(source, staging, { recursive: true });
655
+ } else {
656
+ await extractZip(source, staging);
657
+ }
658
+ return staging;
659
+ } catch (e) {
660
+ rmSync(staging, { recursive: true, force: true });
661
+ throw e;
646
662
  }
647
-
648
- await extractZip(source, tmpDir);
649
- return tmpDir;
650
663
  }
651
664
 
652
665
  /**
@@ -659,7 +672,7 @@ async function copyOrExtractLocalBundle(sourceValue) {
659
672
  */
660
673
  function normalizeForHash(content) {
661
674
  return content
662
- .replace(/\.(claude|cursor|agents|agent|github|gemini|codex|grok|hermes|kiro|opencode|pi|qoder|trae|trae-cn|rovodev|vibe)\/skills\//g, '.PROVIDER/skills/');
675
+ .replace(/\.(claude|cursor|agents|agent|github|gemini|codex|grok|hermes|kiro|opencode|pi|qoder|trae|trae-cn|rovodev|vibe|veto)\/skills\//g, '.PROVIDER/skills/');
663
676
  }
664
677
 
665
678
  function hashSkillFile(filePath) {
@@ -699,7 +712,7 @@ function deduplicateProviders(root, providers, scope) {
699
712
  * SKILL.md, so script-only fixes and removed files are detected.
700
713
  * Returns true if every bundle skill matches the local copy.
701
714
  */
702
- function isUpToDate(root, providers, bundleDir, scope) {
715
+ function isUpToDate(root, providers, bundleDir, scope, agentScope = scope) {
703
716
  const unique = deduplicateProviders(root, providers, scope);
704
717
  if (unique.length === 0) return false;
705
718
 
@@ -724,6 +737,8 @@ function isUpToDate(root, providers, bundleDir, scope) {
724
737
  if (bundleHash !== localHash) return false;
725
738
  }
726
739
  }
740
+
741
+ if (!providerAgentsUpToDate(bundleDir, root, provider, agentScope)) return false;
727
742
  }
728
743
  return true;
729
744
  }
@@ -745,7 +760,8 @@ async function check() {
745
760
  console.log('Checking for updates...\n');
746
761
  try {
747
762
  const bundleDir = await downloadAndExtractBundle();
748
- const upToDate = isUpToDate(root, providers, bundleDir);
763
+ const agentScope = isHomeDir(root) ? 'user' : undefined;
764
+ const upToDate = isUpToDate(root, providers, bundleDir, undefined, agentScope);
749
765
  rmSync(bundleDir, { recursive: true, force: true });
750
766
 
751
767
  if (upToDate) {
@@ -922,6 +938,25 @@ function userSkillProbePaths(home, harnessDir, provider) {
922
938
  ]);
923
939
  }
924
940
 
941
+ function commandOnPath(command) {
942
+ const candidates = process.platform === 'win32'
943
+ ? [`${command}.exe`, `${command}.cmd`, `${command}.bat`]
944
+ : [command];
945
+ for (const directory of String(process.env.PATH || '').split(delimiter)) {
946
+ if (!directory) continue;
947
+ for (const candidate of candidates) {
948
+ const path = resolve(directory, candidate);
949
+ try {
950
+ if (statSync(path).isFile()) {
951
+ accessSync(path, constants.X_OK);
952
+ return path;
953
+ }
954
+ } catch {}
955
+ }
956
+ }
957
+ return null;
958
+ }
959
+
925
960
  function collectInstallDetections(root, home = homedir()) {
926
961
  const detections = [];
927
962
  for (const provider of PROVIDER_DIRS) {
@@ -942,9 +977,14 @@ function collectInstallDetections(root, home = homedir()) {
942
977
  const { provider } = hint;
943
978
  // A hint is either a fixed dir under home or a resolver for harnesses
944
979
  // whose location depends on the environment (OpenCode's config dir).
945
- const foundPath = hint.resolve ? hint.resolve(home) : join(home, hint.home);
946
- if (!existsSync(foundPath)) continue;
947
- const skillProbePaths = hint.resolve
980
+ const foundPath = hint.command
981
+ ? commandOnPath(hint.command)
982
+ : hint.resolve ? hint.resolve(home) : join(home, hint.home);
983
+ if (!foundPath || (!hint.command && !existsSync(foundPath))) continue;
984
+ if (hint.command && !existsSync(join(home, '.veto'))) continue;
985
+ const skillProbePaths = hint.command
986
+ ? [userProviderSkillsDir(home, provider)]
987
+ : hint.resolve
948
988
  ? uniquePaths([userProviderSkillsDir(home, provider), join(foundPath, 'skills')])
949
989
  : userSkillProbePaths(home, hint.home, provider);
950
990
  detections.push({
@@ -955,7 +995,7 @@ function collectInstallDetections(root, home = homedir()) {
955
995
  installPath: userProviderSkillsDir(home, provider),
956
996
  skillProbePaths,
957
997
  hasRealSkills: skillProbePaths.some(hasRealSkillEntries),
958
- reason: 'user harness folder',
998
+ reason: hint.command ? 'CLI on PATH' : 'user harness folder',
959
999
  });
960
1000
  }
961
1001
  return detections;
@@ -1251,7 +1291,9 @@ function copyProviderSkills(bundleDir, root, targets, { scope } = {}) {
1251
1291
  }
1252
1292
 
1253
1293
  // Native subagent definitions that ship in the bundle next to a provider's
1254
- // skills. GitHub Copilot's live at `.github/agents/impeccable-*.agent.md`:
1294
+ // skills. Claude Code's live at `.claude/agents/impeccable-*.md`; project
1295
+ // agents take precedence over user agents. GitHub Copilot's live at
1296
+ // `.github/agents/impeccable-*.agent.md`:
1255
1297
  // project installs commit them at `<repo>/.github/agents/`, user-level
1256
1298
  // installs go to `~/.copilot/agents/` (Copilot's user-scope dir, NOT
1257
1299
  // `~/.github/`). On a name conflict Copilot lets the user-level file shadow
@@ -1261,6 +1303,11 @@ function copyProviderSkills(bundleDir, root, targets, { scope } = {}) {
1261
1303
  // `~/.cursor/agents/`; project agents take precedence there, so no shadow
1262
1304
  // warning is needed.
1263
1305
  const PROVIDER_AGENT_ARTIFACTS = {
1306
+ '.claude': {
1307
+ ext: '.md',
1308
+ userDir: home => join(home, '.claude', 'agents'),
1309
+ userShadowsProject: false,
1310
+ },
1264
1311
  '.github': {
1265
1312
  ext: '.agent.md',
1266
1313
  userDir: home => join(home, '.copilot', 'agents'),
@@ -1273,6 +1320,23 @@ const PROVIDER_AGENT_ARTIFACTS = {
1273
1320
  },
1274
1321
  };
1275
1322
 
1323
+ function providerAgentsUpToDate(bundleDir, root, provider, scope) {
1324
+ const artifact = PROVIDER_AGENT_ARTIFACTS[provider];
1325
+ if (!artifact) return true;
1326
+ const srcDir = join(bundleDir, provider, 'agents');
1327
+ if (!existsSync(srcDir)) return true;
1328
+
1329
+ const destDir = scope === 'user'
1330
+ ? artifact.userDir(root)
1331
+ : join(root, provider, 'agents');
1332
+ const agentFiles = readdirSync(srcDir).filter(name => name.endsWith(artifact.ext));
1333
+ return agentFiles.every(name => {
1334
+ const localPath = join(destDir, name);
1335
+ return existsSync(localPath)
1336
+ && hashSkillFile(join(srcDir, name)) === hashSkillFile(localPath);
1337
+ });
1338
+ }
1339
+
1276
1340
  function copyProviderAgents(bundleDir, root, providers, { scope, home = homedir() } = {}) {
1277
1341
  const targets = Array.isArray(providers) ? providers : [providers];
1278
1342
  const results = [];
@@ -1375,7 +1439,7 @@ function hookScriptPathForProvider(skillRoot, provider) {
1375
1439
  if (provider === '.cursor') {
1376
1440
  return join(skillRoot, provider, 'skills', 'impeccable', 'scripts', 'hook-before-edit.mjs');
1377
1441
  }
1378
- if (provider === '.claude' || provider === '.agents') {
1442
+ if (provider === '.claude' || provider === '.agents' || provider === '.grok') {
1379
1443
  return join(skillRoot, provider, 'skills', 'impeccable', 'scripts', 'hook.mjs');
1380
1444
  }
1381
1445
  return null;
@@ -1451,8 +1515,8 @@ function guardHookCommand(quotedPath, provider) {
1451
1515
  // entries additionally get a `commandWindows` sibling for cmd.exe.
1452
1516
  function rewriteHookCommandsForSkillRoot(value, provider, { skillRoot, absolute }) {
1453
1517
  const hookScript = hookScriptPathForProvider(skillRoot, provider);
1454
- // Providers we don't own a `node "PATH"` command hook for (.github, .grok)
1455
- // carry their own portable command forms; leave them untouched.
1518
+ // Providers we don't own a `node "PATH"` command hook for (.github) carry
1519
+ // their own portable command forms; leave them untouched.
1456
1520
  if (!hookScript) return value;
1457
1521
 
1458
1522
  // Project-scope installs derive the provider's own project-relative path
@@ -1534,7 +1598,8 @@ function hookInstalledForProvider(root, provider) {
1534
1598
 
1535
1599
  function valueHasImpeccableHookMarker(value) {
1536
1600
  if (typeof value === 'string') {
1537
- return IMPECCABLE_HOOK_COMMAND_MARKERS.some(marker => value.includes(marker));
1601
+ const normalized = value.replace(/\\/g, '/');
1602
+ return IMPECCABLE_HOOK_COMMAND_MARKERS.some(marker => normalized.includes(marker));
1538
1603
  }
1539
1604
  if (Array.isArray(value)) return value.some(valueHasImpeccableHookMarker);
1540
1605
  if (value && typeof value === 'object') {
@@ -2072,7 +2137,9 @@ function resolveUpdateTarget({ projectRoot, home, explicitScope }) {
2072
2137
  const homeRooted = isHomeDir(projectRoot);
2073
2138
  if (homeRooted && !explicitScope) {
2074
2139
  const providers = findInstalledProviders(home);
2075
- return providers.length ? { root: home, scope: undefined, providers, scopeLabel: 'user level' } : null;
2140
+ return providers.length
2141
+ ? { root: home, scope: undefined, agentScope: 'user', providers, scopeLabel: 'user level' }
2142
+ : null;
2076
2143
  }
2077
2144
 
2078
2145
  const projectProviders = homeRooted ? [] : findImpeccableProviders(projectRoot, 'project');
@@ -2133,26 +2200,35 @@ function getModifiedSkillFiles(root, providerDirs) {
2133
2200
  return modified;
2134
2201
  }
2135
2202
 
2136
- function downloadFile(url, dest) {
2137
- return new Promise((resolve, reject) => {
2138
- const file = createWriteStream(dest);
2139
- get(url, (res) => {
2140
- if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
2141
- // Follow redirect
2142
- get(res.headers.location, (res2) => {
2143
- res2.pipe(file);
2144
- file.on('finish', () => { file.close(); resolve(); });
2145
- }).on('error', reject);
2146
- return;
2147
- }
2148
- if (res.statusCode !== 200) {
2149
- reject(new Error(`HTTP ${res.statusCode}`));
2150
- return;
2151
- }
2152
- res.pipe(file);
2153
- file.on('finish', () => { file.close(); resolve(); });
2154
- }).on('error', reject);
2155
- });
2203
+ async function downloadFile(url, dest, { fetchImpl = globalThis.fetch } = {}) {
2204
+ let current = url;
2205
+ let hopsLeft = 5;
2206
+ while (true) {
2207
+ const parsed = new URL(current);
2208
+ if (parsed.protocol !== 'https:') {
2209
+ throw new Error('Refusing non-HTTPS URL');
2210
+ }
2211
+ const res = await fetchImpl(current, { redirect: 'manual' });
2212
+ if (res.status >= 300 && res.status < 400) {
2213
+ const location = res.headers.get('location');
2214
+ if (!location) throw new Error(`HTTP ${res.status}`);
2215
+ if (hopsLeft <= 0) throw new Error('Too many redirects');
2216
+ hopsLeft -= 1;
2217
+ current = new URL(location, current).href;
2218
+ continue;
2219
+ }
2220
+ if (res.status !== 200) {
2221
+ throw new Error(`HTTP ${res.status}`);
2222
+ }
2223
+ if (!res.body) throw new Error('Empty response body');
2224
+ try {
2225
+ await pipeline(Readable.fromWeb(res.body), createWriteStream(dest, { flags: 'wx' }));
2226
+ } catch (e) {
2227
+ if (e.code !== 'EEXIST') rmSync(dest, { force: true });
2228
+ throw e;
2229
+ }
2230
+ return;
2231
+ }
2156
2232
  }
2157
2233
 
2158
2234
  async function update(flags = []) {
@@ -2203,7 +2279,7 @@ async function update(flags = []) {
2203
2279
  : { root: projectRoot, scope: 'project', providers: target.projectProviders, scopeLabel: 'this project' };
2204
2280
  }
2205
2281
 
2206
- const { root, scope } = target;
2282
+ const { root, scope, agentScope = scope } = target;
2207
2283
  console.log(`Updating the ${target.scopeLabel} install: ${formatPathForDisplay(root)} (${target.providers.join(', ')})`);
2208
2284
  const providers = target.providers;
2209
2285
  const linkedProviders = findLinkedProviders(root, providers, scope);
@@ -2227,7 +2303,7 @@ async function update(flags = []) {
2227
2303
  }
2228
2304
 
2229
2305
  // Compare local vs remote -- skip if already up to date
2230
- if (isUpToDate(root, copyProviders, tmpDir, scope)) {
2306
+ if (isUpToDate(root, copyProviders, tmpDir, scope, agentScope)) {
2231
2307
  try {
2232
2308
  const wantHooks = installHooks && await decideHookInstall(root, copyProviders, { yes });
2233
2309
  const hookTargets = wantHooks ? copyProviderHooks(tmpDir, root, copyProviders, { force }) : [];
@@ -2263,7 +2339,7 @@ async function update(flags = []) {
2263
2339
  if (migrated > 0) console.log('Migrated a prefixed install back to /impeccable (the i- prefix is no longer used).');
2264
2340
 
2265
2341
  const updated = refreshProviderSkills(tmpDir, root, copyProviders, scope);
2266
- reportProviderAgents(copyProviderAgents(tmpDir, root, copyProviders, { scope }));
2342
+ reportProviderAgents(copyProviderAgents(tmpDir, root, copyProviders, { scope: agentScope }));
2267
2343
  const wantHooks = installHooks && await decideHookInstall(root, providers, { yes });
2268
2344
  const hookTargets = wantHooks ? copyProviderHooks(tmpDir, root, providers, { force }) : [];
2269
2345
 
@@ -2302,6 +2378,8 @@ export {
2302
2378
  copyProviderHooks,
2303
2379
  copyProviderSkills,
2304
2380
  decideHookInstall,
2381
+ downloadAndExtractBundle,
2382
+ downloadFile,
2305
2383
  expectedHookDests,
2306
2384
  extractZip,
2307
2385
  formatInstallDetectionLines,