/ui-component-expert:contract --workspace <run-path> [--contract <contract-path>]from ui-component-expert
Extract and validate a strongly typed DesignContract from quarantined Claude Design artifacts, verifying tokens, 8 states, and WAI-ARIA semantics.
Ships in ui-component-expert. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Replace <plugin-root> in CLI examples with the absolute directory two levels above this skill file (skills/contract/SKILL.md); Claude Code may use ${CLAUDE_PLUGIN_ROOT} instead. Never execute the literal placeholder.
Transforms statically inspected Claude Design tokens, layouts, and slot patterns from quarantined export artifacts into a strongly-typed, versioned DesignContract. The contract establishes the single source of truth for component generation, defining 3-tier tokens, component anatomy, 8 canonical states, and WAI-ARIA authoring practices.
node "<plugin-root>/scripts/cli.mjs" extract-contract --workspace "<workspace-path>"
Parses quarantined assets and outputs a draft contract at <workspace>/contract-<uuid>.json. Captures the exact output path printed by the CLI.
node "<plugin-root>/scripts/cli.mjs" validate-contract --contract "<contract-file-path>" [--workspace "<workspace-path>"]
Validates the contract against the deterministic JSON schema and verifies that source hashes match the workspace receipt.json.
The contract adheres to the local TypeScript interfaces defined in contracts/types.d.ts and validated by contracts/schema.json:
import {
CanonicalState, // 'default' | 'hover' | 'focus' | 'active' | 'disabled' | 'loading' | 'error' | 'selected'
StateMatrix, // Record<CanonicalState, ApplicableState<T> | NonApplicableState>
ComponentDefinition,
TokenArchitecture,
ContractMetadata,
UnknownEntry
} from './contracts/types.js';
export interface DesignContract {
schemaVersion: 1;
metadata: ContractMetadata; // runId, createdAt, sourceHashes, confidence, reviewStatus, approvedBy, approvedAt
tokens: TokenArchitecture; // primitive, semantic, component, themes
assets: AssetManifestEntry[];
hierarchy: ViewHierarchy;
components: ComponentDefinition[]; // stableId, anatomy, props, events, backend, states, keyboard, accessibility
themes?: ThemeContract | null;
rtl?: RtlContract | null;
reducedMotion?: ReducedMotionContract | null;
responsive?: ResponsiveContract | null;
unknowns: UnknownEntry[];
evidence: Record<string, SourceEvidenceRef> | SourceEvidenceRef[];
unmappedArtifacts?: UnmappedEntry[];
}
A -> B -> A or multi-tier cycles like primitive -> semantic -> component -> primitive).default, hover, focus, active, disabled, loading, error, selected):
applicable: true and an explicit visual/token value object.applicable: false with a non-empty reason explaining the exclusion (e.g. NOT_A_TOGGLE for a submit button).aria-invalid="true" applies strictly to input elements with validation failures.aria-disabled="true" when native disabled attribute is present.aria-selected, aria-checked, aria-pressed) apply strictly to role-appropriate controls.DRAFT (reviewStatus: "draft").validate-contract on an unapproved draft exits non-zero with CONTRACT_NOT_READY, reporting structuralValid: true in the details. This is expected behavior reflecting the draft state, not an unexpected system failure.unknowns representing inferred assumptions and missing design specifications.resolved: true.reviewStatus is set to "approved" with non-empty approvedBy and approvedAt values.Contract validation checks schema conformance and structural relationships. It does NOT claim to prove runtime accessibility. Full accessibility proof requires dynamic DOM tree inspection and axe-core execution in an authorized browser runtime (BrowserOS neo).
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub andrewr303/ultimate-ai-plugins --plugin ui-component-expert11 skills in this plugin
/briefGenerate a portable Claude Design brief prompt specifying target description, 4 viewports, 3 token tiers, component anatomy, 8 states, and deliverables./buildGenerate bespoke, accessible TypeScript components and 8-state harnesses from an approved DesignContract./ingestIngest, validate boundaries, and statically inspect a downloaded Claude Design export on Windows, creating a unique run directory with byte-identical quarantine.