sandi-metz-rules
Sandi Metz Rules
Overview
This skill helps apply Sandi Metz's four rules for writing maintainable object-oriented code to Ruby codebases. These rules are heuristics that encourage good design practices, making code easier to understand, test, and maintain.
The Four Rules
- Classes can be no longer than 100 lines of code
- Methods can be no longer than 5 lines of code
- Pass no more than 4 parameters into a method
- Controllers can instantiate only one object
When to Use This Skill
Apply this skill when:
- Users explicitly request applying Sandi Metz's rules
- Reviewing Ruby code for maintainability and code quality
- Refactoring existing Ruby code to improve design
More from lucianghinda/superpowers-ruby
ruby
Use when writing, reviewing, or debugging pure Ruby code — idiomatic patterns, modern 3.x+ features (pattern matching, Data.define, endless methods), error handling conventions (raise vs fail, result objects), memoization, and performance idioms. For Rails use rails-guides. For testing use minitest. For code style use sandi-metz-rules.
80rails-guides
Official Rails documentation. Use when asked about any Rails-specific topic including ActiveRecord, routing, controllers, views, mailers, jobs, Action Cable, Action Text, Active Storage, migrations, validations, callbacks, associations, caching, security, or internals.
49test-driven-development
Use when implementing any feature or bugfix, before writing implementation code
29writing-plans
Use when you have a spec or requirements for a multi-step task, before touching code
1237signals-style
Rails coding patterns derived from analysis of 37signals' Fizzy codebase. Use when writing Rails code in 37signals/Basecamp style or when asked to follow 37signals patterns. Covers controllers, models, views, Hotwire, testing, database, security, and team philosophy.
12brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
12