ruby-conventions

Solid

Ruby code conventions covering Ruby 3.2+, RuboCop, RBS type checking, RSpec/Minitest, security scanning, exception handling, composition, Bundler, and gem packaging. Load when writing or reviewing Ruby code.

Data & Documents 141 stars 12 forks Updated 3 days ago MIT

Install

View on GitHub

Quality Score: 85/100

Stars 20%
72
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
53
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

- Ruby 3.2+, `frozen_string_literal: true`, `.ruby-version` file. - Linting: a linter/formatter (e.g., RuboCop) with auto-fix (120 char max), plus its RSpec/performance plugins. - Type checking: RBS with a type checker (e.g., steep). Use `rbs prototype` for scaffolding type signatures. - Testing: RSpec (or Minitest) with `describe`/`context`/`it`, factories over fixtures, a coverage tool (e.g., SimpleCov) at 80%+. - Security: a SAST tool (e.g., Brakeman for Rails), `bundler-audit` for dependency CVE scanning. - Error handling: specific exceptions inheriting `StandardError`, no bare `rescue`. - Composition over inheritance, `Comparable`/`Enumerable` mixins, `case/in` pattern matching. - Dependencies: `bundler`, commit `Gemfile.lock`, pessimistic `~>` constraints. - Gem packaging: use `gemspec` with `bundler` gem template, `rake release` for distribution. - `&:method_name` block shorthand, `=>` pattern matching destructuring (3.2+). - Anti-patterns: monkey patching, `method_missing` without `respond_to_missing?`, `eval` with user input.

Details

Author
Goldziher
Repository
Goldziher/ai-rulez
Created
1 years ago
Last Updated
3 days ago
Language
Go
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category