From 0d4d6b4f5668460d53dc3bb0133298c25663c7e3 Mon Sep 17 00:00:00 2001 From: Paul Bakaus Date: Fri, 3 Apr 2026 08:05:49 -0700 Subject: [PATCH] Add build-time count validation, fix all stale count references Build system now computes authoritative counts from source (22 commands, 24 detection rules) and warns about mismatches in HTML, README, plugin configs. Generates public/js/generated/counts.js for frontend use. Fixed 15 stale references across index.html, cheatsheet.html, README.md, NOTICE.md, AGENTS.md, plugin.json, and marketplace.json. Changed all "20 commands" to "22", "25 rules" to "24". Fixed v1.6.0 changelog date (was March 24, after v2.0.0's March 20; now March 18). Changelog entries are excluded from validation since historical counts were correct at time of release. Co-Authored-By: Claude Opus 4.6 (1M context) --- .claude-plugin/marketplace.json | 4 +- .claude-plugin/plugin.json | 2 +- AGENTS.md | 2 +- NOTICE.md | 2 +- README.md | 8 ++-- public/cheatsheet.html | 4 +- public/index.html | 12 ++--- public/js/generated/counts.js | 3 ++ scripts/build.js | 83 +++++++++++++++++++++++++++++++++ 9 files changed, 103 insertions(+), 17 deletions(-) create mode 100644 public/js/generated/counts.js diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 97a620925..250127e84 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -2,7 +2,7 @@ "$schema": "https://anthropic.com/claude-code/marketplace.schema.json", "name": "impeccable", "metadata": { - "description": "Design fluency for AI harnesses. 1 skill, 20 commands, and curated anti-patterns for impeccable frontend design." + "description": "Design fluency for AI harnesses. 1 skill, 22 commands, and curated anti-patterns for impeccable frontend design." }, "owner": { "name": "Paul Bakaus", @@ -11,7 +11,7 @@ "plugins": [ { "name": "impeccable", - "description": "Design vocabulary and skills for frontend development. Includes 20 commands (/polish, /distill, /audit, /typeset, /overdrive, etc.) and an enhanced impeccable skill with curated anti-patterns.", + "description": "Design vocabulary and skills for frontend development. Includes 22 commands (/polish, /distill, /audit, /typeset, /overdrive, etc.) and an enhanced impeccable skill with curated anti-patterns.", "version": "2.0.2", "author": { "name": "Paul Bakaus", diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index ae53a9256..2e88961bb 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "impeccable", - "description": "Design vocabulary and skills for frontend development. Includes 21 skills (20 user-invocable: /polish, /distill, /audit, /typeset, /overdrive, etc.) and an enhanced impeccable skill with curated anti-patterns.", + "description": "Design vocabulary and skills for frontend development. Includes 22 commands (/polish, /distill, /audit, /typeset, /overdrive, etc.) and an enhanced impeccable skill with curated anti-patterns.", "version": "2.0.2", "author": { "name": "Paul Bakaus", diff --git a/AGENTS.md b/AGENTS.md index 6252f0cb8..e40d6419c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,6 +1,6 @@ # Impeccable -The vocabulary you didn't know you needed. 1 skill, 20 commands, and curated anti-patterns for impeccable style. Works with Cursor, Claude Code, Gemini CLI, and Codex CLI. +The vocabulary you didn't know you needed. 1 skill, 22 commands, and curated anti-patterns for impeccable style. Works with Cursor, Claude Code, Gemini CLI, and Codex CLI. ## Repository Purpose diff --git a/NOTICE.md b/NOTICE.md index 37948f257..6df63d325 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -13,5 +13,5 @@ The `impeccable` skill in this project builds on Anthropic's original frontend-d This project extends the original with: - 7 domain-specific reference files (typography, color-and-contrast, spatial-design, motion-design, interaction-design, responsive-design, ux-writing) -- 20 steering commands +- 22 steering commands - Expanded patterns and anti-patterns diff --git a/README.md b/README.md index d5c1b70f6..48cdd4c02 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Impeccable -The vocabulary you didn't know you needed. 1 skill, 20 commands, and curated anti-patterns for impeccable frontend design. +The vocabulary you didn't know you needed. 1 skill, 22 commands, and curated anti-patterns for impeccable frontend design. > **Quick start:** Visit [impeccable.style](https://impeccable.style) to download ready-to-use bundles. @@ -12,7 +12,7 @@ Every LLM learned from the same generic templates. Without guidance, you get the Impeccable fights that bias with: - **An expanded skill** with 7 domain-specific reference files ([view source](source/skills/impeccable/)) -- **20 steering commands** to audit, review, polish, distill, animate, and more +- **22 steering commands** to audit, review, polish, distill, animate, and more - **Curated anti-patterns** that explicitly tell the AI what NOT to do ## What's Included @@ -31,7 +31,7 @@ A comprehensive design skill with 7 domain-specific references ([view skill](sou | [responsive-design](source/skills/impeccable/reference/responsive-design.md) | Mobile-first, fluid design, container queries | | [ux-writing](source/skills/impeccable/reference/ux-writing.md) | Button labels, error messages, empty states | -### 20 Commands +### 22 Commands | Command | What it does | |---------|--------------| @@ -208,7 +208,7 @@ bun bin/impeccable detect https://example.com # scan a URL (Puppeteer) bun bin/impeccable detect --fast --json . # regex-only, JSON output ``` -The detector catches 25 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). +The detector catches 24 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). ## Supported Tools diff --git a/public/cheatsheet.html b/public/cheatsheet.html index 931d1eca4..7d0b357d0 100644 --- a/public/cheatsheet.html +++ b/public/cheatsheet.html @@ -13,7 +13,7 @@ Impeccable Command Cheatsheet - + @@ -169,7 +169,7 @@

Impeccable Commands

-

Quick reference for all 20 design commands

+

Quick reference for all 22 design commands

← Back to impeccable.style
diff --git a/public/index.html b/public/index.html index d924d13e9..0e91c23f8 100644 --- a/public/index.html +++ b/public/index.html @@ -13,7 +13,7 @@ Impeccable: The missing upgrade to Anthropic's impeccable skill - + @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@ - + @@ -313,7 +313,7 @@
1

Install the skills Recommended

-

24 commands that steer your AI toward better design, in real time. The full Impeccable experience.

+

22 commands that steer your AI toward better design, in real time. The full Impeccable experience.

@@ -486,7 +486,7 @@ March 20, 2026
    -
  • Anti-pattern detection engine: 25 rules across typography, color, layout, visual details, motion, and design quality
  • +
  • Anti-pattern detection engine: 24 rules across typography, color, layout, visual details, motion, and design quality
  • CLI tool: npx impeccable detect [target] for standalone scanning outside AI harnesses
  • Browser visualizer: live overlays highlighting detected anti-patterns directly on the page
  • /critique overhaul: sub-agent architecture with scoring, personas, and cognitive load assessment
  • @@ -497,7 +497,7 @@
    v1.6.0 - March 24, 2026 + March 18, 2026
    • New provider: Trae (China + International)
    • diff --git a/public/js/generated/counts.js b/public/js/generated/counts.js new file mode 100644 index 000000000..7473a08f3 --- /dev/null +++ b/public/js/generated/counts.js @@ -0,0 +1,3 @@ +// GENERATED by build.js — do not edit +export const COMMAND_COUNT = 22; +export const DETECTION_COUNT = 24; diff --git a/scripts/build.js b/scripts/build.js index 3544bafe8..537e36070 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -22,6 +22,86 @@ import { createTransformer, PROVIDERS } from './lib/transformers/index.js'; import { createAllZips } from './lib/zip.js'; import { execSync } from 'child_process'; +/** + * Generate authoritative counts from source data and write to public/js/generated/counts.js. + * Also validates that key HTML files reference the correct numbers. + */ +function generateCounts(rootDir, skills, buildDir) { + // Count active (non-deprecated) user-invocable commands + const activeCommands = skills.filter(s => { + if (!s.userInvocable) return false; + const content = fs.readFileSync(s.filePath, 'utf-8'); + return !content.includes('DEPRECATED'); + }); + const commandCount = activeCommands.length; + + // Count detection rules from source + const detectorSrc = fs.readFileSync( + path.join(rootDir, 'source/skills/critique/scripts/detect-antipatterns.mjs'), 'utf-8' + ); + const ruleIds = new Set(); + for (const match of detectorSrc.matchAll(/^\s+id: '([^']+)'/gm)) { + ruleIds.add(match[1]); + } + const detectionCount = ruleIds.size; + + // Write generated counts module + const genDir = path.join(rootDir, 'public/js/generated'); + fs.mkdirSync(genDir, { recursive: true }); + fs.writeFileSync(path.join(genDir, 'counts.js'), + `// GENERATED by build.js — do not edit\n` + + `export const COMMAND_COUNT = ${commandCount};\n` + + `export const DETECTION_COUNT = ${detectionCount};\n` + ); + + // Validate counts in key files + const filesToCheck = [ + 'public/index.html', + 'public/cheatsheet.html', + 'README.md', + 'NOTICE.md', + 'AGENTS.md', + '.claude-plugin/plugin.json', + '.claude-plugin/marketplace.json', + ]; + + let warnings = 0; + for (const relPath of filesToCheck) { + const absPath = path.join(rootDir, relPath); + if (!fs.existsSync(absPath)) continue; + const content = fs.readFileSync(absPath, 'utf-8'); + + // Check for stale command counts (look for "N commands" or "N skills" patterns) + // Strip changelog list content to avoid flagging historical counts + const strippedContent = content.replace(/
        [\s\S]*?<\/ul>/g, ''); + const countPattern = /\b(\d+)\s+(design\s+)?(commands|skills|steering commands)/gi; + for (const match of strippedContent.matchAll(countPattern)) { + const num = parseInt(match[1]); + // Allow 1 (for "1 skill") and the correct count + if (num !== commandCount && num !== 1) { + console.warn(` ⚠️ ${relPath}: found "${match[0]}" but active command count is ${commandCount}`); + warnings++; + } + } + + // Check for stale detection counts + const detectPattern = /\b(\d+)\s+(deterministic\s+)?(checks|patterns|rules|detections)/gi; + for (const match of content.matchAll(detectPattern)) { + const num = parseInt(match[1]); + if (num !== detectionCount && num > 10) { // ignore small numbers like "3 patterns" + console.warn(` ⚠️ ${relPath}: found "${match[0]}" but detection count is ${detectionCount}`); + warnings++; + } + } + } + + if (warnings > 0) { + console.warn(`\n⚠️ ${warnings} stale count reference(s) found. Update them to match source of truth.`); + } + + console.log(`✓ Generated counts: ${commandCount} commands, ${detectionCount} detection rules`); +} + /** * Copy directory recursively */ @@ -361,6 +441,9 @@ async function build() { console.log(`📋 Synced skills to: ${syncConfigs.map(p => p.configDir).join(', ')}`); + // Generate authoritative counts and validate references + generateCounts(ROOT_DIR, skills, buildDir); + // Generate browser anti-pattern detector (after skill sync so it doesn't get overwritten) try { execSync('node scripts/build-browser-detector.js', { cwd: ROOT_DIR, stdio: 'inherit' });