Agent skill
plan-reduce-max-lines-per-function
This skill should be used when reducing the maximum lines per function threshold and fixing all violations. It updates the eslint threshold configuration, identifies functions exceeding the new limit, generates a brief with refactoring strategies, and creates a plan with tasks to split oversized functions.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/plan-reduce-max-lines-per-function-codyswanngt-lisa
SKILL.md
Reduce Max Lines Per Function
Target threshold: $ARGUMENTS lines per function
If no argument provided, prompt the user for a target.
Step 1: Gather Requirements
- Read current config from eslint thresholds (eslint.thresholds.json or similar)
- Run lint with the new threshold to find violations:
bash
bun run lint 2>&1 | grep "max-lines-per-function" - Note for each violation:
- File path and line number
- Function 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 lines per function threshold to $ARGUMENTS.
Functions exceeding threshold (ordered by line count):
1. [file:function] (lines: X, target: $ARGUMENTS) - Line Y
2. ...
Configuration change: eslint.thresholds.json, maxLinesPerFunction to $ARGUMENTS
Refactoring strategies: extract functions, early returns, extract conditions, use lookup tables, consolidate logic
Verification: `bun run lint 2>&1 | grep "max-lines-per-function" | wc -l` → Expected: 0
Invoke /plan-execute with this brief to create the implementation plan.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?