agentleFS
martinstreichermartinstreicher/claude-skills/ruby/Skill.md

ruby

Skill0 starsChanged 9 months agoMITView on GitHub

name: Ruby Coding Preferences description: Preferences for developing and maintaining Ruby code dependencies: ruby>=3.4.8, mise Apply these rules when developing and maintaining Ruby projects. - Use white space such as blank lines to make code more readable. - If a code statement spans multiple lines, add a blank line before and after the statement to make it easier to read. - Class self. methods should appear first, followed by initialize (if needed), then instance methods, then private instance methods. -…

11 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use grill-me.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • GoogleSkill

    grill-me

    A relentless interview to sharpen a plan or design.

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. 0 are common, 10 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 10

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use single quotes for strings unless interpolation is required.

    line 15
  2. Distinctive:

    Prefer early returns (also known as guard clauses)over nested conditionals.

    line 17
  3. Distinctive:

    Use white space such as blank lines to make code more readable.

    line 19
  4. Distinctive:

    If a code statement spans multiple lines, add a blank line before and after the statement to make it easier to read.

    line 20
  5. Very specific:

    Use freeze on constant arrays and hashes.

    line 23
  6. Distinctive:

    If an attr_reader is not used outside of the class, define it in the private section of the class.

    line 28
  7. Distinctive:

    When a method call spans multiple lines, use parentheses after the method name and indent each argument two spaces on subsequent lines.

    line 31
  8. Distinctive:

    When an assignment is multiline, add a blank line before and after the block of code, insert a newline after the equal sign and follow …

    line 34
  9. Very specific:

    Use %w[] for word arrays (not %w{}).

    line 38
  10. Very specific:

    Use is_a? instead of kind_of?

    line 40
  11. Distinctive:

    Use .tap (if possible)if a method is used to build a single return value.

    line 42
  12. Very specific:

    Add spaces around default parameters: def method(arg = default).

    line 44
  13. Very specific:

    If an array of literals is defined with %w or %i and contains more than five elements, put each element on its own line in the form %w[ …

    line 48
  14. Distinctive:

    If Rubocop is installed, use it to enforce other coding standards.

    line 57
  15. Distinctive:

    If a method has named paramaters, alphabetize the order of the named parameters.

    line 67

“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
Skill.md

Metadata

name: Ruby Coding Preferences description: Preferences for developing and maintaining Ruby code dependencies: ruby>=3.4.8, mise

When to Apply

Apply these rules when developing and maintaining Ruby projects.

Rules for Ruby Usage

  • Order methods, functions, and variables alphabetically by name.
  • Use single quotes for strings unless interpolation is required.
  • Prefer early returns (also known as guard clauses)over nested conditionals.
  • Use white space such as blank lines to make code more readable.
    • If a code statement spans multiple lines, add a blank line before and after the statement to make it easier to read.
  • Use freeze on constant arrays and hashes.
  • Class self. methods should appear first, followed by initialize (if needed), then instance methods, then private instance methods.
  • If an attr_reader is not used outside of the class, define it in the private section of the class.
  • When a method call spans multiple lines, use parentheses after the method name and indent each argument two spaces on subsequent lines.
  • When an assignment is multiline, add a blank line before and after the block of code, insert a newline after the equal sign and follow other rules listed here to format the rest of the statement.
  • Use %w[] for word arrays (not %w{}).
  • Use is_a? instead of kind_of?.
  • Use .tap (if possible)if a method is used to build a single return value.
  • Add spaces around default parameters: def method(arg = default).
  • Alphabetize arrays in ransackable methods.
  • If an array of literals is defined with %w or %i and contains more than five elements, put each element on its own line in the form %w[ followed by a new line, indent 2, list an item, new line, etc, and close with ].freeze.
  • Align scope arrows (->) vertically when there are many scopes.
  • Try to align the assignment operator (=) vertically when there are many assignments in sequence.
  • If Rubocop is installed, use it to enforce other coding standards. If Rubocop's styles conflict with these guidelines, use Rubocop's configuration file to override the conflicting rules, but provide an alert about the discrepancies.
  • Alphabetize constants when possible. If a constant is dependent on another constant, it obvously must appear out of order.
  • Alphabetize the keys of a hash whenever possible.
  • If a method has named paramaters, alphabetize the order of the named parameters.

Resources

See the skills file for Rails Coding Preferences.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.