From harness-claude
Detects missing required anatomy parts in component definitions and missing-anatomy-component patterns in composition. First programmatic enforcer of component-anatomy rules.
How this skill is triggered — by the user, by Claude, or both
Slash command
/harness-claude:audit-component-anatomyThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> Detect missing required anatomy parts in component definitions and missing-anatomy-component patterns in composition. First programmatic enforcer of component-anatomy rules — finds what design-component-anatomy reference content prescribes.
Detect missing required anatomy parts in component definitions and missing-anatomy-component patterns in composition. First programmatic enforcer of component-anatomy rules — finds what design-component-anatomy reference content prescribes.
.map() over data with no empty branch; async actions with no loading boundary)on_new_feature triggers fire and the feature touches a component definition or usageRead project configuration. Check harness.config.json for:
design.strictness — strict/standard/permissive (default standard)design.audit.componentAnatomy.enabled — gate for the entire audit AND the harness-accessibility deferral (default true)design.audit.componentAnatomy.catalog — "default" or path to project-supplied catalogdesign.audit.componentAnatomy.patterns — "all", "none", or explicit list of pattern codesdesign.audit.componentAnatomy.fastMode.{patterns,maxFiles} — fast-mode controlsLoad source-of-truth catalogs (resolution order, most specific wins):
@component-type X + @anatomy-slot ... etc. — file-level self-declarationdesign-system/DESIGN.md ## Component Registry + ## Component Anatomy Overrides — project-levelIdentify component type per file using the same resolution order:
@component-type X tag → file IS XRun convention audit (definition findings, ANAT-D* codes). For each catalogued component file:
ANAT-D{NNN} finding for each missing required partANAT-D000 info finding when JSDoc declaration diverges from catalog conventionRun pattern audit (pattern-presence findings, ANAT-P* codes). For each file matching pattern targets:
tree-sitter-typescript + tree-sitter-tsx).map() without an empty-branch guard)ANAT-P{NNN} finding for each matchdesign.audit.componentAnatomy.patternsCheck for harness-accessibility overlap deferral. When design.audit.componentAnatomy.enabled = true, this skill OWNS label-slot definition findings; harness-accessibility defers A11Y-010 and A11Y-050 for catalogued components. Track deferrals in meta.deferralsToHarnessDesign count.
Map finding severity using design.strictness:
strict — all findings are error severity (CI blocks)standard — required-part missing → error; optional-part missing → warn; info findings → infopermissive — all findings → info (nothing blocks)Cross-reference with graph constraints. If a graph exists at .harness/graph/:
VIOLATES_CRAFT edges via extended DesignConstraintAdapterDe-duplicate via deferral. When this skill produces a finding whose root-cause is also tracked by harness-accessibility, prefer this skill's finding (anatomy-level cause) and increment deferrals counter.
Write VIOLATES_CRAFT edges to graph. Each finding becomes:
code_file node) or component (component node)design_rule node keyed by finding code (ANAT-D023, ANAT-P001)Format the report. Grouped by component file, with finding codes linked to docs/changes/design-pipeline/audit-component-anatomy/finding-codes.md. Each finding includes:
ANAT-D023)design.strictnessEmit summary. Total findings, breakdown by severity, count of meta.deferralsToHarnessDesign, mode (fast/full), runId.
harness validate — Fast-mode audit hook (convention catalog only; patterns are opt-in via fastMode.patterns: true). Findings respect design.strictness.mcp__harness__audit_anatomy — Programmatic API (input: path, mode, files, designStrictness, catalog; output: findings, summary, catalog applied, deferrals count). Consumed by harness check-design verifier (sub-project #4) and design-pipeline orchestrator (sub-project #5).DesignConstraintAdapter — Extended to register ANAT-* rule code namespace and write VIOLATES_CRAFT edges. Mirrors how harness-accessibility uses it for A11Y-* codes.harness-accessibility — Coordinates via i18n-style deferral pattern. When design.audit.componentAnatomy.enabled = true, a11y defers A11Y-010 and A11Y-050 for catalogued components.design-component-anatomy (knowledge skill) — Source of convention vocabulary (slot, variant, state, size, exclusivity, required). This skill's catalog operationalizes that knowledge.See docs/changes/design-pipeline/audit-component-anatomy/proposal.md for the full 30 success criteria. Highlights:
Input: packages/ui/src/Button.tsx exports a Button component whose prop type omits any loading prop.
Output:
ANAT-D002 [error] Button.tsx — Button convention requires state:loading (exclusive)
File: packages/ui/src/Button.tsx
Component: Button (identified via export-name match)
Convention: APG/button + Radix Primitives Button
Fix: Add a `loading?: boolean` prop, OR add `@anatomy-state loading exclusive`
JSDoc tag to the component if loading is intentionally omitted.
Severity is error under design.strictness: standard because the missing part is required: true in the Button convention.
Input: src/pages/Dashboard.tsx contains {items.map(item => <Card item={item} />)} with no empty-state branch.
Output:
ANAT-P001 [warn] Dashboard.tsx:42 — map() over data with no empty-state branch
File: src/pages/Dashboard.tsx:42
Pattern: ANAT-P001 map-without-empty
Fix: Wrap the map in a conditional that renders <EmptyState> when items.length === 0:
items.length === 0 ? <EmptyState ... /> : items.map(...)
Or extract a guard component that handles both branches.
Severity is warn for pattern-presence findings under design.strictness: standard; error under strict.
Input: A Tabs.tsx file has @anatomy-slot trigger JSDoc but the convention library says Tabs requires both trigger AND panel.
Output:
ANAT-D000 [info] Tabs.tsx — JSDoc declaration omits 2 conventional anatomy parts
File: packages/ui/src/Tabs.tsx
Component: Tabs (identified via JSDoc @component-type)
Divergence: declared slots [trigger]; convention also expects [panel, list]
Note: JSDoc wins (resolution order #1). This is an info finding to surface
the divergence — no action required if intentional.
The ANAT-D000 info code surfaces JSDoc-vs-convention divergence so authors can confirm the divergence is intentional.
ANAT-D* (definition) and ANAT-P* (pattern) codes. Usage findings (ANAT-U*) ship in v2.design.strictness from harness.config.json; default to standard if absent.PrimaryButton instead of Button). The export-name resolver won't match. Two paths: (1) the component author adds @component-type Button JSDoc, or (2) the project adds the file to DESIGN.md ## Component Registry. Both unblock the audit without touching the catalog.## Component Anatomy Overrides. The override wins for that component type; other catalogued types behave normally.design.audit.componentAnatomy.patterns: ["-ANAT-P003"] (negated form). Report the false positive — pattern catalog evolves based on real-world signal.design.audit.componentAnatomy.enabled = true and the component IS in the catalog. If both, the a11y deferral is misfiring — file an issue; likely a getCatalogTypes() cache staleness.harness validate runtime exceeds 3 seconds. Set design.audit.componentAnatomy.fastMode.maxFiles to cap the scope, OR set design.audit.componentAnatomy.fastMode.patterns: false to skip pattern runs in fast mode (patterns are full-mode only by default).VIOLATES_CRAFT edges were not persisted. The audit's findings are still actionable; the graph is a consumer, not a gate.v1 — in implementation. See:
docs/changes/design-pipeline/audit-component-anatomy/proposal.mddocs/changes/design-pipeline/audit-component-anatomy/plans/2026-05-23-audit-component-anatomy-plan.mddocs/changes/design-pipeline/audit-component-anatomy/finding-codes.mddesign-pipeline sub-project #2 in docs/roadmap.mdnpx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeAudits design system component libraries for usage signals, complexity, duplication, and coverage gaps, producing tiered findings, inventory, and prioritized recommendations.
Scans UI components for WCAG AA violations, evaluates severity against design strictness, generates reports, and applies automated fixes for mechanical issues.
Detects design system tokens and components in code, identifying drift with paired evidence blocks. Use when auditing design system consistency across a codebase.