Project

rails-cto

0.0
The project is in a healthy, maintained state
rails-cto bundles the quality toolchain (RuboCop, Reek, Flog, Flay, Brakeman, bundler-audit, SimpleCov, Herb) that the rails-cto Claude plugin expects, and ships matching configuration templates you can drop into any Rails app with `rails-cto init`. It also provides a custom RuboCop cop that enforces the Minitest::Spec `subject` convention used by the plugin's skills.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

>= 7.0, < 9
>= 0.9, < 2
>= 2.13, < 4
>= 4.8, < 6
>= 0.5, < 2
>= 1.1, < 2
>= 6.3, < 8
>= 1.72
>= 0.35, < 2
>= 0.22, < 2
>= 1.3, < 2
 Project Readme

rails-cto

Companion Ruby gem to the rails-cto Claude plugin. Bundles the quality toolchain the plugin's skills depend on (RuboCop, Reek, Flog, Flay, Brakeman, bundler-audit, SimpleCov, Herb) and ships matching configuration templates you can drop into any Rails app with a single command.

Install

Add to your Gemfile:

group :development, :test do
  gem "rails-cto"
  gem "rubocop-rails", require: false  # optional companion — see note below
end

Note on rubocop-rails: it is not a hard dependency of rails-cto because it transitively pulls in activesupport (and connection_pool), which can conflict with host-app pins. The bundled .rubocop.yml still references plugins: - rubocop-rails, so add it to your own Gemfile if you want the Rails cops. Drop that line from your .rubocop.yml if you don't.

Then:

bundle install
bundle exec rails-cto init

What rails-cto init does

  • Copies config templates into your project (skipping any that already exist):
    • .rubocop.yml
    • .reek.yml
    • .bundler-audit.yml
    • config/brakeman.yml
    • .herb/rewriters/align-attributes.mjs
    • .herb/rules/no-inline-styles.mjs
  • Patches test/test_helper.rb to boot SimpleCov with the JSON formatter (so the plugin's QA skill can read coverage/coverage.json).
  • Appends a short block to CLAUDE.md telling Claude Code this project uses the rails-cto plugin.

Pass --force to overwrite existing files.

Commands

Command Purpose
rails-cto init Install configs and templates (skip existing).
rails-cto init --force Install configs, overwriting existing files.
rails-cto doctor Report which configs are present, missing, or drifted from the bundled templates. Exits non-zero if anything is missing.
rails-cto version Print the gem version.

Custom RuboCop cop: RailsCTO/MinitestSubject

The bundled .rubocop.yml auto-enables this cop. It enforces the mandatory Minitest::Spec subject rule from the plugin:

  • Every *_test.rb class must define subject { ... } exactly once at the top of the class.
  • subject must not be reassigned inside nested describe/it blocks.

Disable per file with a standard RuboCop comment:

# rubocop:disable RailsCTO/MinitestSubject

Links

License

MIT.