ID:WORK-121Status:done
Add component interface view to refrakt inspect
Priority:mediumComplexity:simpleMilestone:v1.0.0Source:ADR-008
Summary
Extend refrakt inspect to show the component override interface for a rune — what props and slots a component would receive. This makes the contract discoverable from the CLI without reading source code.
Acceptance Criteria
refrakt inspect <rune> --interface(or similar flag) outputs the component interface- Output shows property names with their types (string, number, union values)
- Output shows slot names (top-level ref names)
- Output shows which slots are always present vs conditional
- Works for both core and community package runes
--jsonflag produces machine-readable output of the interface
Approach
- After running the identity transform for the inspected rune, call the extraction utility on the output
- Collect property names from
propertieskeys, types from schema attribute definitions - Collect slot names from top-level
refskeys - Format and display
Resolution
Completed: 2026-04-04
Branch: claude/adr-008-implementation-nBN9K
What was done
- Added
--interfaceflag topackages/cli/src/bin.tsargument parser - Added
showComponentInterface()function inpackages/cli/src/commands/inspect.ts - Added
findRuneTag()andfindFirstRuneTag()helpers for tree search - Human-readable output shows Properties, Slots, and Svelte 5 Usage example
- JSON output includes rune name, typeName, properties with types/examples, slots, and hasAnonymousContent
- Updated CLI help text with --interface flag and example
Notes
- Uses the serialized (pre-identity-transform) tree since properties are consumed by the engine
- Falls back to findFirstRuneTag when data-rune doesn't match CLI name (e.g., tabs → tab-group)
- Schema attribute types used for richer type info in output (union literals for enum matches)
Relationships
Implements
History
- 1676387complexitylow→simple
- f262d7bsource+ADR-008
- c435d57statusready→done
- ☑ `refrakt inspect <rune> --interface` (or similar flag) outputs the component interface
- ☑ Output shows property names with their types (string, number, union values)
- ☑ Output shows slot names (top-level ref names)
- +3 more criteria
- dca6250milestone+v1.0.0
- ece282cCreated (ready, medium, low, cli, tooling, dx)