- Ruby 3.2+,
frozen_string_literal: true,.ruby-versionfile. - 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 prototypefor 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-auditfor dependency CVE scanning. - Error handling: specific exceptions inheriting
StandardError, no barerescue. - Composition over inheritance,
Comparable/Enumerablemixins,case/inpattern matching. - Dependencies:
bundler, commitGemfile.lock, pessimistic~>constraints. - Gem packaging: use
gemspecwithbundlergem template,rake releasefor distribution. &:method_nameblock shorthand,=>pattern matching destructuring (3.2+).- Anti-patterns: monkey patching,
method_missingwithoutrespond_to_missing?,evalwith user input.
Ruby Conventions
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.
Ruby Conventions by goldziher · acbf329
npx skillmds@latest add goldziher/ruby-conventions File contents
---name: ruby-conventionsdescription: 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.---- 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.
goldziher/ai-rulez/tree/main/internal/builtins/languages/ruby/skills/ruby-conventions commit acbf329956
Frequently asked questions
Run npx skillmds@latest add goldziher/ruby-conventions in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
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. It is listed under Security on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
goldziher (@goldziher) published this skill. Their other Agent Skills are listed on their SkillMD profile.