writing-affordances

Community

Refactor fat Rails models into focused affordances

AuthorZempTime
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Refactor fat Rails models by extracting PORO wrappers that group 3+ operations around a noun/concept, enabling a focused, reusable API.

Core Features & Use Cases

  • Affordance: cluster 3+ related methods under a single noun to expose a clean API.
  • PORO-based: extract operations into a plain Ruby object (PORO) for testability and reuse.
  • Entry Point Options: provide an explicit entry via a Concern or a direct PORO class, keeping the parent model lean.
  • Use Case: convert entropy_* prefixes into card.entropy.* affordances for clearer code.

Quick Start

  1. Identify a fat model with 3+ methods sharing a prefix (e.g., entropy_).
  2. Extract a PORO wrapper named after the noun (e.g., Entropy) and wire an entry method on the parent (e.g., entropy) that returns the PORO instance.
  3. Use the new affordance at call sites like card.entropy.auto_clean_at and card.entropy.days_before_reminder.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: writing-affordances
Download link: https://github.com/ZempTime/zemptime-marketplace/archive/main.zip#writing-affordances

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.