draper-decorators

draper-decorators is a skill for Claude Code from hoblin/claude-ruby-marketplace. It costs 131 tokens per session (2,045 once invoked), scanned A, original, MIT.

Guidance for creating Draper decorators in Rails. A decorator wraps a model to hold presentation logic, such as formatting text or generating display-specific HTML, while keeping the model focused on data and business rules.

In plain words
What is it for?
Use it when creating, moving, or testing logic for names, dates, numbers, status labels, CSS classes, and other presentation details in Rails applications.
Why use it?
It helps keep views clean and prevents display formatting from being mixed into models or duplicated across templates.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the draper plugin — 1 skill shipped together

Good fit Use it when creating, moving, or testing logic for names, dates, numbers, status labels, CSS classes, and other presentation details in Rails applications.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hoblin/claude-ruby-marketplace/draper-decorators
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add hoblin/claude-ruby-marketplace --skill draper-decorators
Clone the repo
git clone --depth 1 https://github.com/hoblin/claude-ruby-marketplace

Made for: Claude Code.

Or install draper, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for draper-decorators

README.md
[![agentmods](https://agentmods.dev/badge/skills/hoblin/claude-ruby-marketplace/draper-decorators/github.svg)](https://agentmods.dev/skills/hoblin/claude-ruby-marketplace/draper-decorators)
Your own site
<a href="https://agentmods.dev/skills/hoblin/claude-ruby-marketplace/draper-decorators"><img src="https://agentmods.dev/badge/skills/hoblin/claude-ruby-marketplace/draper-decorators/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for draper-decorators

Your own site · 80×15
<a href="https://agentmods.dev/skills/hoblin/claude-ruby-marketplace/draper-decorators"><img src="https://agentmods.dev/badge/skills/hoblin/claude-ruby-marketplace/draper-decorators.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 131 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,045 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00131 $0.02045
Opus 5 $0.00066 $0.01022
Sonnet 5 $0.00026 $0.00409
Haiku 4.5 $0.00013 $0.00204

Measured 10d ago against content hash af486f8691c1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

draper-decorators scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (examples/application_decorator.rb, examples/decorator_spec.rb, examples/model_decorator.rb), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/draper/skills/draper-decorators/SKILL.md · 354 lines

How it starts

The opening of the file, as written. The whole thing — 354 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Draper Decorators for Rails

This skill provides guidance for creating effective Draper decorators in Rails applications.

Philosophy

Decorators implement separation of concerns between business logic (models) and presentation logic (views). A decorator wraps a model to add view-specific methods without polluting the model.

What belongs in decorators:

  • Date/time formatting (created_at.strftime("%B %d, %Y"))
  • String concatenation ("#{first_name} #{last_name}")
  • HTML generation (h.content_tag(:span, status, class: css_class))
  • Conditional rendering based on state
  • Number formatting (currency, percentages)
  • CSS class generation based on object state

What does NOT belong in decorators:

  • Business logic (validations, calculations, state changes)
  • Database queries (use includes in controllers)
  • Anything not directly related to presentation

Basic Structure

# app/decorators/user_decorator.rb
class UserDecorator < ApplicationDecorator
  delegate_all

  def full_name
    "#{first_name} #{last_name}"
  end

  def formatted_created_at
    created_at.strftime("%B %d, %Y")
  end

  def status_badge
    css_class = active? ? "badge-success" : "badge-secondary"
    h.content_tag(:span, status, class: "badge #{css_class}")
  end
end

Delegation Strategies

Option 1: delegate_all (Convenient)

Delegates all methods to the wrapped object via method_missing. Use for most decorators.

class ProductDecorator < ApplicationDecorator
  delegate_all

  def formatted_price
    h.number_to_currency(price)
  end
end

Option 2: Explicit Delegation (Strict)

Explicitly declare which methods to delegate. Use for larger apps where control matters.

class ProductDecorator < ApplicationDecorator
  delegate :id, :name, :price, :created_at, :persisted?

  def formatted_price
    h.number_to_currency(price)
  end
end

Accessing the Wrapped Object

Three equivalent ways to access the model:

class ArticleDecorator < ApplicationDecorator
  delegate_all

  def display_title
    object.title.upcase      # via 'object'
    model.title.upcase       # via 'model' (alias)
    article.title.upcase     # via model name (auto-generated)
  end
end

Read the full file on GitHub · 354 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 354 lines · 131 tokens per session scan A af486f8691c1

Subscribe to this mod's changes

draper-decorators is a skill published in the GitHub repository hoblin/claude-ruby-marketplace (37 stars, last pushed 2d ago), licensed MIT. It adds 131 tokens to every session and 2,045 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories