Skip to content
Back to skills

Plan Reduce Max Lines

ASecurity

This skill should be used when reducing the maximum class/module lines threshold and fixing all violations. It updates the RuboCop configuration, identifies classes and modules exceeding the new limit, generates a brief with refactoring strategies, and creates a plan with tasks to split oversized files.

  • 57 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 17, 2026
code-qualitybashrefactoring

Security analysis

A100/100

Scanned October 17, 2026

npx -y skills add diegosouzapw/awesome-omni-skill --skill plan-reduce-max-lines --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Plan Reduce Max Lines?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Plan Reduce Max Lines
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/diegosouzapw-plan-reduce-max-lines/badge)](https://www.skillsdirectory.com/skills/diegosouzapw-plan-reduce-max-lines)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: plan-reduce-max-lines
description: This skill should be used when reducing the maximum class/module lines threshold and fixing all violations. It updates the RuboCop configuration, identifies classes and modules exceeding the new limit, generates a brief with refactoring strategies, and creates a plan with tasks to split oversized files.
allowed-tools: ["Read", "Bash", "Glob", "Grep"]

---

# Reduce Max Lines

Target threshold: $ARGUMENTS lines per class/module

If no argument provided, prompt the user for a target.

## Step 1: Gather Requirements

1. **Read current config** from `.rubocop.yml` or `.rubocop.local.yml` (`Metrics/ClassLength` and `Metrics/ModuleLength`)
2. **Run RuboCop** with the target threshold to find violations:
   ```bash
   bundle exec rubocop --only Metrics/ClassLength,Metrics/ModuleLength --format json 2>&1
   ```
3. **Note for each violation**:
   - File path
   - Class/module name
   - Current line count

If no violations at $ARGUMENTS, report success and exit.

## Step 2: Compile Brief and Delegate

Compile the gathered information into a structured brief:

```
Reduce max class/module lines threshold to $ARGUMENTS.

Classes/modules exceeding threshold (ordered by line count):
1. [file:ClassName] - [current] lines (target: $ARGUMENTS)
2. ...

Configuration change: .rubocop.local.yml, Metrics/ClassLength Max to $ARGUMENTS, Metrics/ModuleLength Max to $ARGUMENTS

Refactoring strategies: extract concerns, extract service objects, remove duplication, delete dead code, simplify logic

Verification: `bundle exec rubocop --only Metrics/ClassLength,Metrics/ModuleLength --format simple 2>&1 | grep "offense" | wc -l` -> Expected: 0
```

Invoke `/plan-execute` with this brief to create the implementation plan.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.