From rails-agent-skills
Orchestrates three-phase Rails code quality workflow: conventions review, safe refactoring with tests, and YARD documentation generation. Use for pre-PR sweeps, quality audits, or production-readiness reviews.
npx claudepluginhub igmarin/rails-agent-skills --plugin rails-agent-skillsThis skill uses the workspace's default tool permissions.
Orchestrates systematic code quality checks, safe refactoring, and documentation updates across three phases. Use this instead of individual refactoring or documentation skills when full production-readiness is required end-to-end.
Applies checklist for clean Rails code: design principles (DRY, YAGNI, PORO, CoC, KISS), per-path rules (models, services, workers, controllers), structured logging, comment discipline. Defers style to project linters. Use for writing, reviewing, refactoring.
Reviews Rails code changes: strict for modifications to existing code, pragmatic for new isolated code. Flags regressions, convention violations, and provides actionable feedback with approval status.
Writes and reviews Rails code following DHH's 37signals style guide; advises on architecture while respecting existing conventions like Tailwind or RSpec.
Share bugs, ideas, or general feedback.
Orchestrates systematic code quality checks, safe refactoring, and documentation updates across three phases. Use this instead of individual refactoring or documentation skills when full production-readiness is required end-to-end.
Check code against Rails standards via skills/code-quality/rails-code-conventions (DRY/YAGNI/PORO/CoC/KISS compliance, linter as style source of truth, structured logging) and skills/code-quality/rails-stack-conventions (Rails + PostgreSQL patterns, Hotwire + Tailwind conventions, security best practices).
Example — DRY violation extracted to shared PORO:
# Before: discount logic duplicated across OrderService and CartService
def apply_discount(price, pct) = price - (price * pct / 100.0)
# After
class DiscountCalculator
def self.apply(price, pct) = price - (price * pct / 100.0)
end
Output: Convention violations list with severity (must-fix / should-fix / nice-to-have)
Decision Gate — Need Refactoring?
Follow skills/code-quality/refactor-safely (write characterization tests first, extract methods/classes, verify no behavioral changes before continuing).
HARD GATE — Tests Pass:
bundle exec rspec # All tests must pass before proceeding
Document public APIs via skills/patterns/yard-documentation (annotate all public methods with params, return values, and examples; update README/diagrams for architecture or API changes).
Output: Updated YARD comments, refreshed README sections
rails-code-conventions.refactor-safely.yard-documentation.rails-skills-orchestrator.NEVER open PR before:
bundle exec rubocop # Linter must pass
bundle exec erblint --lint-all # ERB linter must pass
bundle exec rspec # All tests must pass
bundle exec brakeman # Security scan must pass
Plus: YARD docs complete for all public APIs.
# Quality Report — [Date]
## Conventions Check
- [x] DRY: No duplication found
- [x] PORO: Service objects properly structured
- [ ] YAGNI: Remove unused method `calculate_total`?
## Refactoring
- Characterization tests added, methods extracted, all tests passing
## Documentation
- YARD coverage: 87% (improved from 65%)
- README updated: YES