WORK-076
ID:WORK-076Status:done

Extract Shared Layout Meta Tag Utility

Priority:highComplexity:simpleSource:SPEC-028
changeset-release/main View source

Criteria completion

No incremental history — criteria tracking started on Apr 19.

Branches 2
changeset-release/main current done
main doneclaude/file-naming-convention-LJdwR done
History 5
  1. f2b3512
    Content editedby Claude
    Add {ID}-{slug}.md filename convention + migrate filenames subcommand
  2. 59ded4a
    Content editedby Claude
    Implement SPEC-037 plan package hardening: all 7 work items
  3. f262d7b
    Content editedby Claude
    Backfill source attributes on all 123 work items
  4. bfa195e
    Content editedby Claude
    Mark WORK-076, WORK-077, WORK-078 as done
  5. 9aff526
    Created (done)by Claude
    Add work items WORK-076 through WORK-082 for SPEC-028

Summary

Runes that extend SplitLayoutModel all emit identical boilerplate for layout meta tags (layout, ratio, valign, gap, collapse). Extract this into a shared utility in @refrakt-md/runes so each rune's transform calls one function instead of copy-pasting the conditional logic.

Acceptance Criteria

  • New buildLayoutMetas() utility exported from packages/runes/src/common.ts (or a new layout-helpers.ts)
  • Utility accepts the split layout attrs object and returns { metas: Tag[], properties: Record<string, Tag> }
  • Handles the layout !== 'stacked' guard, gap/collapse conditionals, and all five meta tags (layout, ratio, valign, gap, collapse)
  • recipe.ts in @refrakt-md/learning refactored to use the shared utility
  • realm.ts and faction.ts in @refrakt-md/storytelling refactored to use the shared utility
  • playlist.ts in @refrakt-md/media refactored to use the shared utility
  • All existing tests pass — no change to identity transform output

Approach

  1. Study the layout meta tag block in recipe.ts (reference implementation) and compare with realm.ts, faction.ts, playlist.ts
  2. Extract the shared pattern into a utility function
  3. Replace the inline blocks in all four runes with calls to the utility
  4. Run tests to verify output is unchanged

References

  • SPEC-028 (Standard 6 — Layout Meta Tag Emission Should Be Shared)