Files
pbakaus_impeccable/scripts/lib/transformers/claude-code.js
T
Paul BakausandClaude Opus 4.6 f9bfe18d26 Add anti-pattern detection CLI, browser visualizer, gallery page, and build DRY refactor
- Anti-pattern detector script (source/skills/critique/scripts/detect-antipatterns.mjs):
  CLI tool that scans files/dirs for UI anti-patterns via regex. Detects side-tab
  accent borders and border-accent-on-rounded patterns across Tailwind, CSS, JSX.
  Context-aware: skips safe elements (blockquotes, nav, inputs, code), neutral
  colors, and adjusts thresholds based on border-radius co-occurrence.

- Browser visualizer (public/js/detect-antipatterns-browser.js):
  Drop-in script that highlights anti-patterns directly in the browser with
  labeled overlays. Two modes: "static" (regex, matches CLI) and "computed"
  (getComputedStyle, catches CSS cascade). Scans both inline styles and
  <style> blocks.

- Gallery of Shame (public/gallery.html):
  Standalone page showcasing 11 AI anti-pattern examples with thumbnails
  and links. Anti-pattern example pages updated from 1080x1080 Twitter
  format to responsive layouts, labels removed, screenshots retaken at 16:10.

- Critique skill updated to run detector before manual review.

- Build system: skills now support scripts/ directories alongside reference/.
  All 8 provider transformers refactored to use shared.js (DRY).

- 58 new tests covering detection logic, fixtures, CLI integration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 10:54:06 -07:00

24 lines
885 B
JavaScript

import { transformProvider } from './shared.js';
/**
* Claude Code Transformer
* Output: .claude/skills/{name}/SKILL.md
*/
export function transformClaudeCode(skills, distDir, patterns = null, options = {}) {
transformProvider({
provider: 'claude-code',
displayName: 'Claude Code',
configDir: '.claude',
buildFrontmatter: (skill, skillName) => {
const obj = { name: skillName, description: skill.description };
if (skill.userInvokable) obj['user-invokable'] = true;
if (skill.args && skill.args.length > 0) obj.args = skill.args;
if (skill.license) obj.license = skill.license;
if (skill.compatibility) obj.compatibility = skill.compatibility;
if (skill.metadata) obj.metadata = skill.metadata;
if (skill.allowedTools) obj['allowed-tools'] = skill.allowedTools;
return obj;
},
}, skills, distDir, options);
}