ruby-standards
Use when writing, reviewing, testing, formatting, or configuring any Ruby code (.rb files, Gemfile, .gemspec) in a touchstone repo — version-manager + .ruby-version pin, Bundler with committed Gemfile.lock, RuboCop (+performance/+rspec), RBS/Steep or Sorbet, RSpec, YJIT. Invoke before adding gems, editing specs, touching types, or changing error handling. Rails-specific concerns (controllers, ActiveRecord, migrations) → rails-standards skill.
- License 许可
- MIT
- 最近更新
- 2026-08-26
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- ruby-standards
- license
- MIT
- metadata
- { "author": "touchstone", "version": "0.2.0" }
- description
- Use when writing, reviewing, testing, formatting, or configuring any Ruby code (.rb files, Gemfile, .gemspec) in a touchstone repo — version-manager + .ruby-version pin, Bundler with committed Gemfile.lock, RuboCop (+performance/+rspec), RBS/Steep or Sorbet, RSpec, YJIT. Invoke before adding gems, editing specs, touching types, or changing error handling. Rails-specific concerns (controllers, ActiveRecord, migrations) → rails-standards skill.
03 SKILL.md 正文
Ruby Standards
Full standard: standards/languages/ruby.md in the touchstone repo. This skill inlines the
load-bearing rules so it stays useful even when installed standalone in ~/.claude/skills/:
Always
- Bundler only (
bundle add/install/exec). CommitGemfile.lock(apps and gems); CI runsbundle install --frozen. - Pin Ruby in
.ruby-version(3.3 floor, target 3.4) via mise/rbenv — never the system Ruby; same string CI installs. - Lint + format with RuboCop (
+rubocop-performance +rubocop-rspec,NewCops: enable); CI runsrubocopwith no autocorrect — a red cop is a red build. # frozen_string_literal: trueat the top of every.rbfile.- Type-check with RBS + Steep (default) or Sorbet — one per repo, new code at the strict bar.
Don't get burned
- Never bare
rescue(orrescue Exception) — it swallows signals/SystemExit;rescue => escopes toStandardError. No rescue-log-continue; re-raise or record. Errors under one base class. Data.definefor immutable value objects (not mutableStruct); pattern matching (case/in) to parse API/JSON shapes; explicit keyword args (not splatted hashes).- Don't over-mock: stub at the boundary (WebMock/VCR, the clock), real objects inward;
verify_partial_doubles = true. Run specs order-randomized;pendingis a tripwire, not a graveyard. - GVL: threads/Fibers for I/O-bound, processes for CPU-bound; Ractor only (scale-up) for isolated compute. Profile with stackprof before optimizing; YJIT on in prod.
standardis the escape hatch from RuboCop config — but you lose the performance/security cops, so it's a deliberate trade.bundler-audit check --updateclean; pin gems pessimistically (~>); publish via MFA + OIDC.
Done
rubocop clean · every file frozen-string · steep check (or srb tc) clean · rspec green (randomized, coverage ≥ floor) · bundle install --frozen passes, Gemfile.lock committed · bundler-audit clean. See standards/languages/ruby.md.
04 同仓库更多 Skills
ok-standards
Use when writing shell, per standards/languages/shell.md.
demo-standards
Use when editing demo code in a touchstone fixture repo, a deliberately ordinary description that is long enough to clear the forty character minimum.
demo-standards
Use when editing demo code in a touchstone fixture repo, a deliberately ordinary description that is long enough to clear the forty character minimum.
demo-standards
Use when editing demo code in a touchstone fixture repo, a deliberately ordinary description that is long enough to clear the forty character minimum.
demo-standards
Use when editing demo code in a touchstone fixture repo, a deliberately ordinary description that is long enough to clear the forty character minimum.
demo-standards
Use when editing demo code in a touchstone fixture repo, a deliberately ordinary description that is long enough to clear the forty character minimum.