presenter-agent

Generate Ruby presenter objects with SimpleDelegator and RSpec tests for Rails.

Updated Feb 8, 2026
One-click install
npx skills add https://github.com/mlbright/notes --skill presenter-agent
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: presenter-agent
Source: https://github.com/mlbright/notes/tree/main/.github/skills/presenter-agent
Command: npx skills add https://github.com/mlbright/notes --skill presenter-agent

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you extract view-specific logic from your Rails models into dedicated presenter objects, leading to cleaner, more maintainable code and simpler views.

Core Features & Use Cases

  • Encapsulate View Logic: Move formatting, conditional display, and presentation-specific methods out of models and into presenters.
  • Improve Readability: Keep your views concise by delegating complex display logic to presenters.
  • Use Case: You have a User model with methods like display_name and status_badge_class that are only used in the UI. This Skill will help you move that logic into a UserPresenter.

Quick Start

Use the presenter-agent skill to create a presenter for the Product model that formats the price as currency and provides a status_label method.

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-specific logic from Rails models into presenters?

To extract view-specific logic from Rails models into presenters, you generate Ruby presenter objects using SimpleDelegator. This moves presentation methods into dedicated classes, cleanly separating display concerns from core model logic.

What is the best way to clean up formatting methods in Ruby on Rails views?

The best way to clean up formatting methods in Ruby on Rails views is moving that logic into dedicated presenter classes. Encapsulating view-specific formatting like currency display or status labels in presenters keeps your views concise and maintainable.

How does SimpleDelegator work for creating Rails view models?

SimpleDelegator works for creating Rails view models by delegating undefined method calls back to the wrapped model object. This allows presenters to inherit model behavior while adding presentation-specific formatting and display logic.

Do I need RSpec to test Rails presenters generated with SimpleDelegator?

RSpec tests are written alongside each Rails presenter generated with SimpleDelegator. You need RSpec to verify that the encapsulated view-specific formatting and display logic behaves correctly within the dedicated presenter classes.

Can I move conditional display logic like status badges out of my Rails models?

Yes, you can move conditional display logic like status badge classes out of your Rails models. By creating a dedicated presenter object, you encapsulate UI-specific presentation code, ensuring models remain strictly for domain logic.