viewcomponent-agent

Generate and test reusable Rails ViewComponents with slots and Lookbook previews.

Updated Mar 19, 2026
One-click install
npx skills add https://github.com/reckerswartz/resume_builder --skill viewcomponent-agent-reckerswartz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: viewcomponent-agent
Source: https://github.com/reckerswartz/resume_builder/tree/main/.windsurf/skills/viewcomponent-agent
Command: npx skills add https://github.com/reckerswartz/resume_builder --skill viewcomponent-agent-reckerswartz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Builds and tests reusable Rails ViewComponents to standardize UI elements.

Core Features & Use Cases

  • Component generation boilerplate with slots, previews, and tests to ensure consistent APIs.
  • Slot-based composition, previews for documentation, and robust test coverage with RSpec.
  • Guidance on API design, SOLID principles, and usage patterns for common UI elements like cards, modals, and tables.

Quick Start

Run the provided generator to create a new view component with tests and previews.

Frequently Asked Questions about viewcomponent-agent

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a Rails ViewComponent with RSpec tests and Lookbook previews?

Run the provided generator to create a new ViewComponent with slot-based composition, Lookbook previews, and RSpec tests. This produces boilerplate files that enforce a consistent component API and robust test coverage automatically.

What is slot-based composition in ViewComponent and when should I use it?

Slot-based composition in ViewComponent allows you to define named content areas within a component for building reusable UI elements. Use slots to standardize complex UI structures like cards, modals, and tables across your Rails application.

Do I need Lookbook and RSpec already set up to build ViewComponents with this approach?

Yes, you need a Rails project with ViewComponent, RSpec, and Lookbook already configured. The generator relies on this existing setup to enforce a strong component API, generate previews, and provide automated test coverage.

What's the best way to standardize UI components like cards and modals in a Rails app?

The best way to standardize UI components like cards and modals in a Rails app is to use ViewComponent with slot-based composition and SOLID design principles. This approach enforces a consistent API and includes Lookbook previews for documentation.

How does Lookbook preview integration work for Rails ViewComponents?

Lookbook previews work for Rails ViewComponents by rendering isolated component instances with predefined parameters for documentation. This allows developers to visualize and test component states and slot usage directly within the development environment.

Why should I use RSpec for testing ViewComponents instead of Rails default tests?

You should use RSpec for testing ViewComponents to ensure robust test coverage of component APIs and slot behavior. RSpec provides the testing framework required by this setup to validate standardized UI elements and prevent regressions across Rails apps.