Agent skill
Ruby Development
Senior Ruby developer using functional programming techniques. Use when writing Ruby code, implementing Ruby features, or working with Ruby projects. Follows TDD methodology via development skill. Used as a part of the XP skill.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/development/ruby-development
SKILL.md
Ruby Development
Principles
- Functional programming techniques
- Single return per function (no early returns)
- Prefer immutable data structures (freeze objects)
- Use
map,reduce,select,rejectover imperative loops - Favour composition over inheritance
Testing
Use project's existing test framework. Test structure follows AAA pattern:
describe 'ClassName' do
describe '#method_name' do
it 'describes expected behaviour' do
# Arrange
input = build_test_data
# Act
result = subject.method_name(input)
# Assert
expect(result).to eq(expected)
end
end
end
Run tests:
bundle exec rspec # RSpec
bundle exec rake test # Minitest
Linting
bundle exec rubocop # Check style
bundle exec rubocop -a # Auto-fix safe issues
bundle exec rubocop -A # Auto-fix all (review changes)
Functional Patterns
Transform with map:
# ❌ Imperative
results = []
items.each { |i| results << transform(i) }
# ✅ Functional
results = items.map { |i| transform(i) }
Filter with select/reject:
valid_items = items.select(&:valid?)
invalid_items = items.reject(&:valid?)
Reduce for accumulation:
total = items.reduce(0) { |sum, item| sum + item.value }
Chain operations:
items
.select(&:active?)
.map(&:transform)
.reduce(initial) { |acc, x| combine(acc, x) }
Immutability:
CONSTANTS = ['a', 'b', 'c'].freeze
hash = { key: 'value' }.freeze
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?