Files
pbakaus_impeccable/.gitignore
T
8cf2be110d feat(cli): interactive hook consent + unified .impeccable/config.json (#245)
* feat(cli): interactive hook consent + unified .impeccable/config.json

Make the design-hook install a conscious choice and unify scattered config
into one file.

Interactive consent
- On an interactive `skills install`/`update`, the CLI explains what the hook
  does and offers to install it (default yes), then records the per-developer
  decision in the gitignored `.impeccable/config.local.json`, so it never
  re-asks. A recorded decision or an already-installed hook short-circuits;
  `-y`/non-TTY keeps the historical install-by-default behavior; `--no-hooks`
  is a one-off skip that records nothing. The trigger keys on "is the hook
  installed?" + "is there a recorded decision?", not a brittle version check.

Unified config
- `.impeccable/config.json` (shared) and `.impeccable/config.local.json`
  (gitignored) now hold all Impeccable settings: hook settings under a `hook`
  key, plus top-level `updateCheck`. `/impeccable hooks` writes the `hook`
  subtree, preserving siblings. The hook runtime reads `hook.quiet` and
  `hook.auditLog`; context boot reads `updateCheck`. The legacy
  `IMPECCABLE_HOOK_DISABLED|QUIET|LOG` and `IMPECCABLE_NO_UPDATE_CHECK` env vars
  still work and override config; docs now lead with config and treat env vars
  as a legacy note.
- No backward compat for the pre-unification `hook.json`/`hook.local.json`
  (the hook shipped an hour ago; nothing in the wild uses it). This repo's own
  hook config is migrated to `.impeccable/config.json`.

The CLI and skill scripts are separate trees, so a small CLI-side config module
(cli/lib/impeccable-config.mjs) duplicates the config-path and .git/info/exclude
handling; comments flag the duplication.

Tests: new cli config unit test; skills-cli consent tests (declined skips,
accepted installs, --no-hooks records nothing); hook.test.mjs back-compat
removed and quiet/auditLog-from-config + gitexclude coverage added. Full suite
green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(hooks): preserve sibling config fields + resolve audit log from event cwd (Bugbot)

Two Bugbot findings:

- High: `/impeccable hooks` edits replaced the whole `hook` object with the
  merge-helper output, dropping fields those helpers don't manage — so an
  `ignore-value --local` could wipe the recorded install consent and make the
  CLI re-prompt. writeConfig now merges over the existing hook object, keeping
  consent/quiet/auditLog.
- Medium: config-based audit logging resolved hook.auditLog from process.cwd(),
  which can differ from the hook event's project root (and Cursor's pre-edit
  hook passed no cwd). The hook now stamps the resolved project root on the
  audit entry, and writeAuditLog reads config from entry.cwd when present.

Tests: a /impeccable hooks edit preserves consent + quiet; writeAuditLog
resolves config auditLog from entry.cwd, not the fallback cwd.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(hooks): resolve a relative auditLog path against the project root (Bugbot)

A relative hook.auditLog was read from the project root but written relative to
the hook process cwd, so when those differ the log went to the wrong place.
writeAuditLog now resolves a relative target (from env or config) against the
same project root it reads config from. Absolute and ~/ paths are unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Fix hook consent recovery and smoke config

* Fix hook consent explainer for Cursor

* Fix empty hook target consent

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 02:42:19 -07:00

131 lines
3.9 KiB
Plaintext

# Dependencies
node_modules/
# npm lockfile (project uses bun.lock; npm may regenerate this as a side
# effect of npm subprocesses, but it should not be tracked)
package-lock.json
# Generated files
dist/
build/
# Test fixtures simulate "generated dist" trees; keep them tracked so tests
# can copy them into tmp git repos and assert is-generated behavior.
!tests/framework-fixtures/**/dist/
!tests/framework-fixtures/**/dist/**
# Build artifacts
*.log
# OS files
.DS_Store
Thumbs.db
# IDE
.vscode/
.idea/
# Claude Code local state
.claude/projects/
.claude/scheduled_tasks.lock
.claude/settings.local.json
# Environment
.env
.env.local
# Cloudflare
.wrangler/
# Impeccable-owned project files are split: generated sidecars/config may be
# tracked, but runtime recovery state and local assets should stay local.
.impeccable/live/server.json
.impeccable/hook.cache.json
.impeccable/live/sessions/
.impeccable/live/previews/
.impeccable/live/annotations/
.impeccable/live/cache/
.impeccable/live/manual-edit-apply-transaction.json
.impeccable/live/manual-edit-events.jsonl
.impeccable/live/manual-edit-evidence/
.impeccable/live/pending-manual-edits.json
.impeccable/live/deferred-svelte-component-accepts.json
.impeccable/history/
.impeccable/config.local.json
.impeccable/hook.pending.json
.impeccable/provider-smoke/
src/__impeccable_provider_smoke_*.html
# Per-run critique snapshots are local artifacts. ignore.md (also under
# this dir) carries deferrals the user may want to share, so it's
# explicitly re-included below.
.impeccable/critique/
!.impeccable/critique/ignore.md
# Legacy live mode session file + annotation screenshots
.impeccable-live.json
.impeccable-live/
src/lib/impeccable/ImpeccableLiveRoot.svelte
src/lib/impeccable/__runtime.js
# Legacy per-project live mode injection config. New installs use
# .impeccable/live/config.json in the project root instead.
**/skills/impeccable/scripts/config.json
# Extension build artifacts
extension/detector/
# Legacy design context (pre-v3.1, auto-migrated to PRODUCT.md by load-context.mjs)
.impeccable.md
# Note: PRODUCT.md and DESIGN.md are INTENTIONALLY tracked in this repo —
# they serve as reference implementations for users installing impeccable.
# Users of impeccable in their own projects can choose whether to track them.
# Evals (private, commercial)
evals/
tests/evals-v2/
# Video backlog & scripts (local working files, not for distribution)
videos/
# Talk decks & speaker materials (local working files, not for distribution)
talks/
# Generated sub-pages (legacy, now replaced by Astro content collections)
site/public/docs/
site/public/anti-patterns/
site/public/tutorials/
site/public/visual-mode/
site/public/slop/
# Build artifacts written to site/public/ so Astro copies them to build/
site/public/_data/
site/public/_headers
site/public/_redirects
site/public/_routes.json
site/public/js/detect-antipatterns-browser.js
site/public/js/generated/
# Note: harness skill directories (.claude/skills/, .cursor/skills/, etc.)
# are intentionally tracked. npx skills reads them from this repo at install
# time, and they enable clean submodule use. Run `bun run build` to refresh
# them after editing skill/.
#
# Codex CLI consumes `.agents/skills/`; the asset-producer subagent ships
# nested inside that skill (agents/*.toml), auto-discovered on install.
# The project-local hook manifest is the one tracked `.codex/` artifact.
.codex/*
!.codex/hooks.json
.astro/
# Local-only scratch for exploratory scripts, parked pages, and unused asset candidates.
tmp/
# Isolated ablation staging (impeccable-evals copies the built staged skill here
# per rule, removes one rule, points a worker at it). Throwaway; never committed.
.ablate-stage/
# Local scratch from iterating on the OG card (weight comparisons, intermediate
# PNGs, the old card backup). The canonical generator is `bun run og-image`
# (scripts/generate-og-image.js); this dir is throwaway and safe to delete.
.og-build/