/harness-claude:harness:audit-component-anatomy runs instead · from harness-claude
Detects missing required anatomy parts in component definitions and missing-anatomy-component patterns in composition. Reads harness.config.json and built-in component catalogs.
This skill never runs in Claude Code
It ships in harness-claude at agents/, but /harness-claude:harness:audit-component-anatomy (a command, or a skill Claude Code finds first) has the same name: typing it, or Claude choosing it, runs that one instead.
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 usageVerifier<F, Cat, Meta> interface (packages/cli/src/shared/verifier.ts) it conforms to, alongside detect-design-drift and audit-brand-compliance.AuditAnatomyOutput = Verifier<AnatomyFinding> (packages/cli/src/mcp/tools/audit-anatomy.ts).harness-design-pipeline / harness check-design, which compose it generically via VerifierRegistry.Read 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 and design-pipeline orchestrator.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:
These are common rationalizations that sound reasonable but lead to incorrect results. When you catch yourself thinking any of these, stop and follow the documented process instead.
| Rationalization | Why It Is Wrong |
|---|---|
"This Button's prop type omits a loading state, but the component renders fine, so I'll pass it." | Detecting exactly that gap is the point of the audit. The Button convention marks state:loading as required, so a missing required part must emit ANAT-D002. Passing it defeats the enforcement — surface the finding with its fix hint. |
| "This file isn't in the catalog, but it looks like a Modal, so I'll audit it as one." | Component type is resolved by JSDoc → DESIGN.md Registry → export-name match. No match means silent skip — that is how the audit keeps zero false positives. Guessing a type produces findings against conventions the author never adopted. |
"The .map() has no empty-state branch and the fix is one line, so I'll just add <EmptyState>." | This skill never modifies source. ANAT-P* findings carry concrete fix-hint text only; autofix is out of scope. Emit ANAT-P001 and leave the code untouched. |
| "harness-accessibility already flags the missing label association, so I'll skip owning it here." | When componentAnatomy.enabled = true, this skill OWNS label-slot definition findings and a11y DEFERS A11Y-010/A11Y-050 for catalogued components — one finding per root cause. Skipping it means the anatomy-level cause goes unreported. |
| "The convention catalog won't load, so I'll emit findings from what I remember of the conventions." | No findings without a parsed catalog. If the convention library or DESIGN.md catalog cannot be loaded, stop with an explanatory error — never emit speculative findings from memory. |
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 initiative in docs/roadmap.mdWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claude793 skills in this plugin
/a11y-aria-patternsARIA Patterns> Apply ARIA roles, states, and properties correctly to enhance assistive technology support for custom widgets/a11y-color-contrastColor Contrast and Color Independence> Ensure sufficient color contrast ratios and never use color as the sole means of conveying information/a11y-form-patternsAccessible Form Patterns> Build accessible forms with proper labeling, grouped controls, inline validation, and clear error communicationOther plugins' skills for the same job