ID:WORK-080Status:done
Refactor Realm and Faction Transforms to Use Shared Utilities
Priority:highComplexity:moderateSource:SPEC-028
Summary
Realm and Faction share ~90% identical transform code (scene image extraction, description rendering, layout meta tags, content building, createComponentRenderable structure). Refactor both to use the shared utilities from WORK-076 and WORK-077, align their section structure to the standard 3-section pattern, and fix Faction's missing mediaSlots config.
Acceptance Criteria
- Realm transform uses shared
buildLayoutMetas()from WORK-076 - Faction transform uses shared
buildLayoutMetas()from WORK-076 - Both transforms use shared
extractMediaImage()from WORK-077 (replacing ~15-line inline unwrap loops) - Shared storytelling helpers extracted for any remaining duplicated patterns between Realm and Faction
- Faction config declares
mediaSlots: { scene: 'cover' }and correspondingsectionsentry forscene: 'media' - Both runes follow standard 3-section structure (meta, content with preamble, media)
- Realm config sections aligned to standard pattern (preamble inside content)
- All existing tests pass (update snapshots if structure changes)
Approach
- Apply shared utilities from WORK-076 and WORK-077 to both transforms
- Extract any remaining duplicated storytelling-specific logic into package helpers
- Fix Faction's missing
mediaSlotsandsectionsconfig - Align section structure to standard pattern
- Update test snapshots
References
- Rune Output Standards (Standard 2 — Preamble Groups with Content)
- Rune Output Standards (Standard 3 — Config Must Match Schema Capabilities)
- Rune Output Standards (Standard 4 — Avoid Duplicated Transform Logic)
- Extract Shared Layout Meta Tag Utility (shared layout meta utility)
- Extract Shared Media Image Unwrap Utility (shared media unwrap utility)
Relationships
Related
ID:SPEC-037Status:accepted
Plan Package Hardening
Version:1.0
ID:WORK-076Status:done0/7
Extract Shared Layout Meta Tag Utility
Priority:highComplexity:simple
ID:WORK-077Status:done0/7
Extract Shared Media Image Unwrap Utility
Priority:highComplexity:simple
ID:WORK-082Status:done0/14
Shared Split Layout CSS with Two-Mode Mobile Collapse
Priority:highComplexity:moderate