# Improve Max Lines

> reducing the maximum…

- Skill: `codyswanngt/improve-max-lines` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add codyswanngt/improve-max-lines`
- Raw SKILL.md: https://api.skillmd.com/api/skills/codyswanngt/improve-max-lines/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: codyswanngt (https://skillmd.com/u/codyswanngt)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/codyswanngt/improve-max-lines

---


# 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 `/implement` with this brief to create the implementation plan.

