presenter-agent

Generate view-focused presenter objects for Rails models using SimpleDelegator.

Updated Nov 1, 2025
One-click install
npx skills add https://github.com/nschneble/rails-superstack --skill presenter-agent-nschneble
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: presenter-agent
Source: https://github.com/nschneble/rails-superstack/tree/main/.agents/skills/presenter-agent
Command: npx skills add https://github.com/nschneble/rails-superstack --skill presenter-agent-nschneble

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a Presenter/Decorator pattern implementation to encapsulate view formatting and display logic for Rails apps.

Core Features & Use Cases

  • Organizes formatting and view-specific methods in dedicated presenter classes.
  • Supports common patterns like ApplicationPresenter and specific presenters (UserPresenter, PostPresenter, CollectionPresenter), plus integration with Rails helpers.
  • Promotes nil safety, delegation, and helper usage to keep models slim and views expressive.
  • Use cases include extracting view logic from models, building reusable UI components, and composing complex displays across controllers and views.

Quick Start

Create a Presenter for a given model by wrapping it with a presenter class and write RSpec tests to verify formatting and display methods.

Frequently Asked Questions about presenter-agent

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

FAQPage Schema
How do I extract view logic from Rails models using presenters?

To extract view logic from Rails models using presenters, wrap your model with a SimpleDelegator-based class in an app/presenters hierarchy. This encapsulates formatting and display methods, keeping models slim and views expressive through clean separation of concerns.

What is the best way to organize Rails view formatting and display logic?

The best way to organize Rails view formatting is using the Presenter pattern. You create dedicated presenter classes like ApplicationPresenter or UserPresenter to centralize formatting, enabling reusable UI components and nil-safe delegation across views and controllers.

Does the Rails presenter pattern work with RSpec tests?

Yes, the Rails presenter pattern works with RSpec tests. You write RSpec tests to verify formatting and display methods within your presenter objects, ensuring that the extracted presentation logic behaves correctly and remains maintainable.

Can I use Rails helpers inside a presenter object?

Yes, you can use Rails helpers inside a presenter object. Presenters support integration with Rails helpers, allowing you to build reusable display components and compose complex displays while maintaining nil safety and clean delegation.

When should I not use a presenter for view logic in Rails?

You should avoid using a presenter for view logic in Rails when your display requirements are minimal or purely static. Presenters are designed for extracting complex presentation concerns from models and building reusable UI components, so simple views may not need this layer.