RubyCritic Code Quality Analysis

A Claude Code skill that uses RubyCritic to inspect Ruby and Rails code for code smells, complexity, and refactoring opportunities. RubyCritic also assigns letter grades to files and can compare code quality between branches.

In plain words
What is it for?
Use it to analyze a Ruby or Rails project, inspect a chosen file or directory, summarize quality metrics, find the worst files, or compare the current branch with another branch.
Why use it?
It turns a large codebase or pull request into measurable quality findings, making technical debt and the files needing attention easier to locate. It can also show a quick summary or focus on the worst-rated files.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/esparkman/claude-rubycritic-skill/rubycritic-skill
Any agent
npx skills add esparkman/claude-rubycritic-skill --skill rubycritic-skill
Clone the repo
git clone --depth 1 https://github.com/esparkman/claude-rubycritic-skill

Made for: Claude Code, Codex.

Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,737 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00068 $0.01737
Opus 5 $0.00034 $0.00869
Sonnet 5 $0.00014 $0.00347
Haiku 4.5 $0.00007 $0.00174

Measured 2d ago against content hash e0430028ec6b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

RubyCritic Code Quality Analysis scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/rubycritic-skill/SKILL.md · 264 lines

How it starts

The opening of the file, as written. The whole thing — 264 lines — stays where its author put it; the contents beside it link to each section on GitHub.

RubyCritic Code Quality Analysis Skill

A Claude Code skill for analyzing Ruby and Rails code quality using RubyCritic.

Description

This skill integrates RubyCritic to provide comprehensive code quality analysis for Ruby and Rails projects. It helps identify code smells, complexity issues, and areas for refactoring with detailed metrics and actionable insights.

Commands

/rubycritic [path]

Analyze code quality for the specified path or entire project.

Options:

  • path (optional): Specific file or directory to analyze. Defaults to current directory.

Examples:

/rubycritic
/rubycritic app/models
/rubycritic app/controllers/users_controller.rb

/rubycritic-summary

Get a quick summary of code quality metrics without detailed file breakdowns.

/rubycritic-worst

Show only the worst-rated files that need immediate attention.

Options:

  • --limit N: Number of worst files to show (default: 10)

Examples:

/rubycritic-worst
/rubycritic-worst --limit 5

/rubycritic-compare [branch]

Compare code quality between current branch and specified branch.

Options:

  • branch: Branch to compare against (default: main/master)

Examples:

/rubycritic-compare main
/rubycritic-compare develop

Usage Guidelines

When to Use This Skill

  1. Before Code Reviews: Run analysis on changed files to catch issues early
  2. After Refactoring: Verify improvements in code quality metrics
  3. Regular Health Checks: Weekly or sprint-based quality assessments
  4. Legacy Code: Identify technical debt and prioritize refactoring efforts
  5. Onboarding: Help new developers understand code quality standards

Interpretation of Results

Score Ranges:

  • A (90-100): Excellent - minimal issues
  • B (80-89): Good - minor improvements needed
  • C (70-79): Fair - consider refactoring
  • D (60-69): Poor - refactoring recommended
  • F (<60): Critical - immediate attention required

Key Metrics:

  • Churn: How frequently files change (high churn + low quality = priority)
  • Complexity: Cyclomatic complexity (aim for < 10 per method)
  • Duplication: Code duplication percentage (aim for < 5%)
  • Smells: Code smell count by type (Long Method, Feature Envy, etc.)

Read the full file on GitHub · 264 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 264 lines · 68 tokens per session scan A e0430028ec6b

Subscribe to this mod's changes

RubyCritic Code Quality Analysis is a skill published in the GitHub repository esparkman/claude-rubycritic-skill (17 stars, last pushed 9mo ago), licensed MIT. It adds 68 tokens to every session and 1,737 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

nuke-on-rails

Full health and security audit for Rails apps, the review a principal engineer would do. Runs rubycritic, Brakeman, bundler-audit and rubyaudit, triages every finding with the LLM as judge, brings an OWASP Top 10 arsenal of checks for what scanners miss, and returns one impact-ranked action plan. Use for a Rails…

nuke-on-rails/nuke-on-rails · 105 tokens

aposd-audit

Quantitative design audit. Counts pass-throughs, duplication, doc gaps, naming issues, and exceptions across 5 dimensions, scored 0-4.

mhenke/john-ousterhout-skills · 36 tokens

refactor-engineer

Enforces characterize-before-change discipline with continuous green tests, separating structural changes from behavioral ones.

Kshitijpalsinghtomar/depth-skills · 23 tokens

tech-debt-management

系统化识别、评估、偿还技术债务。把隐性成本显性化,避免项目被债务拖垮。.

Vincent-crypto-coder/tech-debt-management-skill · 36 tokens

code-refactoring-advisor

Enterprise code refactoring advisor that detects code smells, anti-patterns, and complexity issues with specific refactoring recommendations, test generation, and maintainability metrics.

XSpoonAi/spoon-awesome-skill · 36 tokens

software-code-refactoring

Improve production code quality while preserving all existing test behavior. Commonly used for the Refactor phase of TDD red-green-refactor, but applicable to any codebase with tests. Use when production code works but needs cleanup — reducing duplication, improving naming, simplifying complexity, aligning with…

stencila/stencila · 102 tokens