agentleFS
45ck45ck/refactoring-code-smells-skills/.agents/skills/extract-method-advisor/SKILL.md

extract-method-advisor

Skill4 starsChanged 8 months agoMITView on GitHub

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 8 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not recommend refactors with no clear payoff, safety story, or validation path.

    line 39
  2. Distinctive:

    Prefer incremental, reversible changes over speculative rewrites.

    line 41
  3. Distinctive:

    Prefer structured findings over narrative filler.

    line 51
  4. Distinctive:

    Use severity, priority, or confidence labels when useful.

    line 53
  5. Distinctive:

    Do not equate unfamiliar style with a smell or anti-pattern.

    line 56
  6. Distinctive:

    Do not prescribe rewrites when a smaller refactor would solve the problem.

    line 57
  7. Distinctive:

    Do not hide uncertainty about dynamic behavior, framework constraints, or missing context.

    line 58
  8. Distinctive:

    Do not ignore validation steps when suggesting structural changes.

    line 59

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

extract-method-advisor

Purpose

Identify long, mixed-responsibility methods and propose safe extract-method refactors with clear seams and expected outcomes.

Trigger this skill when

  • You need a focused refactoring analysis or artifact rather than generic commentary.
  • Code quality, maintainability, or testability concerns are affecting delivery.
  • You need a reusable output another developer or agent can extend safely.

Expected inputs

  • code, module, diff, or architecture slice under review
  • known pain points or goals
  • constraints or risk tolerance
  • existing tests or validation signals

Deliverables

  • refactor plan or advisory output
  • ranked recommendations or plan
  • assumptions and unresolved questions
  • recommended next skill

Operating procedure

  1. Clarify the target artifact, pain point, and what successful improvement would look like.
  2. Separate explicit evidence from assumptions, missing context, or inference.
  3. Apply the relevant smell, anti-pattern, dependency, or refactor framing consistently.
  4. Produce compact findings that support prioritization, safe change, and validation.
  5. Recommend the next most useful refactoring, review, or testability step.

Quality gates

  • Do not recommend refactors with no clear payoff, safety story, or validation path.
  • Make uncertainty, evidence quality, and likely blast radius explicit.
  • Prefer incremental, reversible changes over speculative rewrites.
  • Tie recommendations to maintainability, correctness, testability, or delivery risk.

Handoff targets

  • code-smell-detector
  • testability-refactor-planner
  • dependency-simplifier

Output style

  • Be explicit about evidence quality and uncertainty.
  • Prefer structured findings over narrative filler.
  • Tie recommendations to maintenance cost, defect risk, or delivery consequence.
  • Use severity, priority, or confidence labels when useful.

Failure modes to avoid

  • Do not equate unfamiliar style with a smell or anti-pattern.
  • Do not prescribe rewrites when a smaller refactor would solve the problem.
  • Do not hide uncertainty about dynamic behavior, framework constraints, or missing context.
  • Do not ignore validation steps when suggesting structural changes.

Minimum output skeleton

## Summary
## Findings
## Structured outputs
## Evidence / confidence
## Assumptions
## Open questions
## Recommended next skill

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.