Rails Application UI Blocks
Use this skill to choose, adapt, and integrate premium UI blocks from templates/application-ui into Rails views.
Workflow
- Determine mode:
- new-page for brand new features/pages
- refactor-page for existing views/partials
- Identify constraints first:
- Required interactions (Turbo Frames/Streams, Stimulus targets/actions, form semantics)
- Accessibility constraints (labels, keyboard flow, ARIA)
- Existing component boundaries (partials, helpers, shared layouts)
- Pick candidate blocks from catalog:
- Read
references/selection-playbook.md
- Query
references/template-catalog.json
- Integrate minimally:
- Keep existing routes/controllers/domain logic unchanged
- Replace markup in thin steps (shell first, then sections, then micro-components)
- Verify:
- Ensure no loss of behavior, accessibility, or test coverage
- Keep existing design tokens and class conventions where required by project standards
Selection Order
For new-page:
- Start with
ui.page-examples.* to anchor page structure.
- Choose shell from
ui.application-shells.*.
- Add page/section headings from
ui.headings.*.
- Add core body blocks (
ui.forms.*, ui.lists.*, ui.data-display.*, ui.feedback.*).
- Finish with navigation and overlay details (
ui.navigation.*, ui.overlays.*).
For refactor-page:
- Preserve current information architecture and interaction contracts.
- Map each existing UI region to one candidate catalog block.
- Replace one region at a time and run relevant tests.
- Extract repeated markup into partials only after reuse is proven.
Guardrails
- Do not change controllers/models/policies unless explicitly requested.
- Do not remove
data-controller, data-action, data-turbo-*, aria-*, or form field names without replacement.
- Prefer adapting blocks to project styles over introducing conflicting visual systems.
- Avoid block insertion that duplicates existing design-system components when native components already solve the same need.
Output Expectations
When completing a task with this skill, include:
- Selected catalog IDs (for traceability)
- Source template paths used
- Any behavior/accessibility deltas introduced
- What was intentionally not replaced and why
Resources
references/selection-playbook.md
- Decision rules for what template families to check first, and when not to use them.
references/template-catalog.json
- Canonical block IDs with aliases and source paths.
scripts/build_template_catalog.py
- Regenerates the catalog after template updates.
Maintenance
Regenerate the catalog when files under templates/application-ui change:
python3 .agents/skills/rails-application-ui-blocks/scripts/build_template_catalog.py \
--root .
1---2name: rails-application-ui-blocks3description: Rails Application UI Blocks4---5# Rails Application UI Blocks67Use this skill to choose, adapt, and integrate premium UI blocks from `templates/application-ui` into Rails views.89## Workflow10111. Determine mode:12- new-page for brand new features/pages13- refactor-page for existing views/partials142. Identify constraints first:15- Required interactions (Turbo Frames/Streams, Stimulus targets/actions, form semantics)16- Accessibility constraints (labels, keyboard flow, ARIA)17- Existing component boundaries (partials, helpers, shared layouts)183. Pick candidate blocks from catalog:19- Read `references/selection-playbook.md`20- Query `references/template-catalog.json`214. Integrate minimally:22- Keep existing routes/controllers/domain logic unchanged23- Replace markup in thin steps (shell first, then sections, then micro-components)245. Verify:25- Ensure no loss of behavior, accessibility, or test coverage26- Keep existing design tokens and class conventions where required by project standards2728## Selection Order2930For `new-page`:311. Start with `ui.page-examples.*` to anchor page structure.322. Choose shell from `ui.application-shells.*`.333. Add page/section headings from `ui.headings.*`.344. Add core body blocks (`ui.forms.*`, `ui.lists.*`, `ui.data-display.*`, `ui.feedback.*`).355. Finish with navigation and overlay details (`ui.navigation.*`, `ui.overlays.*`).3637For `refactor-page`:381. Preserve current information architecture and interaction contracts.392. Map each existing UI region to one candidate catalog block.403. Replace one region at a time and run relevant tests.414. Extract repeated markup into partials only after reuse is proven.4243## Guardrails4445- Do not change controllers/models/policies unless explicitly requested.46- Do not remove `data-controller`, `data-action`, `data-turbo-*`, `aria-*`, or form field names without replacement.47- Prefer adapting blocks to project styles over introducing conflicting visual systems.48- Avoid block insertion that duplicates existing design-system components when native components already solve the same need.4950## Output Expectations5152When completing a task with this skill, include:53- Selected catalog IDs (for traceability)54- Source template paths used55- Any behavior/accessibility deltas introduced56- What was intentionally not replaced and why5758## Resources5960- `references/selection-playbook.md`61 - Decision rules for what template families to check first, and when not to use them.62- `references/template-catalog.json`63 - Canonical block IDs with aliases and source paths.64- `scripts/build_template_catalog.py`65 - Regenerates the catalog after template updates.6667## Maintenance6869Regenerate the catalog when files under `templates/application-ui` change:7071```bash72python3 .agents/skills/rails-application-ui-blocks/scripts/build_template_catalog.py \73 --root .74```