From afcff7eea0b79334e184c5a5f04f5fe771843ea7 Mon Sep 17 00:00:00 2001 From: Paul Bakaus Date: Thu, 19 Mar 2026 00:27:14 -0700 Subject: [PATCH] Add impeccable CLI with detect subcommand Usage: npx impeccable detect [file-or-dir-or-url...] Subcommand structure designed for future expansion. The detect subcommand delegates to the existing detection engine with all its modes (jsdom, regex, Puppeteer). - bin/impeccable.mjs: CLI entry point with bun shebang - package.json: bin field added - Export detectCli (main) from detection script - Updated help text to show impeccable detect usage - Updated CLAUDE.md and README.md with CLI docs Co-Authored-By: Claude Opus 4.6 (1M context) --- CLAUDE.md | 16 +++++++ README.md | 13 ++++++ bin/impeccable.mjs | 43 +++++++++++++++++++ package.json | 3 ++ .../critique/scripts/detect-antipatterns.mjs | 16 ++++--- 5 files changed, 84 insertions(+), 7 deletions(-) create mode 100755 bin/impeccable.mjs diff --git a/CLAUDE.md b/CLAUDE.md index 33de089a2..4c4112753 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -42,6 +42,22 @@ Source files use placeholders that get replaced per-provider: - `{{config_file}}` - Config file name (CLAUDE.md, .cursorrules, etc.) - `{{ask_instruction}}` - How to ask user questions +## CLI + +Impeccable includes a CLI for running anti-pattern detection outside of AI harnesses: + +```bash +bun bin/impeccable.mjs detect [file-or-dir-or-url...] # detect anti-patterns +bun bin/impeccable.mjs detect --fast --json src/ # regex-only, JSON output +bun bin/impeccable.mjs --help # show help +``` + +The detection script is at `source/skills/critique/scripts/detect-antipatterns.mjs`. It auto-detects browser vs Node and works as both: +- **CLI/Node**: jsdom for HTML, regex for CSS/JSX/TSX, Puppeteer for URLs +- **Browser**: visual overlays injected via `