presenter-agent

Wrap models with presenters to isolate view logic in Rails apps.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Keeps view-specific formatting and display logic out of models by providing Presenter objects that wrap models and expose view-focused helpers.

Core Features & Use Cases

  • Encapsulates view logic using SimpleDelegator to keep models lean.
  • Provides formatting, display helpers, and safe nil handling for views.
  • Includes guidance and tests to ensure presenters are used correctly in Rails apps.

Quick Start

Instantiate a presenter with a model and optional view context, then call its methods in your views.

Frequently Asked Questions about presenter-agent

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

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

Rails presenters isolate view logic from models by wrapping models with SimpleDelegator to expose view-focused helpers. This keeps models lean by moving formatting and conditional rendering into dedicated presenter objects.

How do I test Rails presenters with RSpec?

You test Rails presenters with RSpec by enforcing the Presenter pattern and Single Responsibility Principle through a dedicated test suite. This ensures view helpers and formatting logic behave correctly outside the model layer.

What is the best way to handle view-specific formatting in Rails?

The best way to handle view-specific formatting in Rails is using presenter objects that wrap models to provide formatting and display helpers. This approach safely handles nil values and manages conditional rendering across views and partials.

Do I need SimpleDelegator to implement the presenter pattern in Rails?

Yes, you need SimpleDelegator to implement the presenter pattern in Rails. Presenters use SimpleDelegator to wrap model objects, exposing view-specific methods while delegating underlying business logic back to the model.

When should I use a presenter instead of a helper in Rails?

You should use a presenter instead of a helper in Rails when you need to encapsulate view logic with safe nil handling and conditional rendering tied to a specific model. Helpers remain generic, while presenters wrap individual model instances.

Can I access Rails view helpers from inside a presenter object?

Yes, you can access Rails view helpers from inside a presenter by passing an optional view context during instantiation. This allows the presenter to build display helpers and format values directly within its wrapped methods.