All skills
lexler avatar

/refactoring-team

@628d2e9
by Lada Kesselerlexler/skill-factory238 stars
61

Iterative code refactoring through progressive lenses via a worker-reviewer agent team.

Use this Skill: https://skilld.dev/gh/lexler/skill-factory/refactoring-team

This session only. Nothing lands on disk.

referenceslenses03-method-length.md

≈463 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Lens: Method Length

Functions that do unnamed work — phases, details, or side-jobs hiding inside a body that claims to do one thing.

The Question

Does each function do one thing that its name honestly describes? Or is work hiding inside that deserves its own name?

How to Spot

  • Blank-line "paragraphs" inside a function — the developer already sensed separate concerns
  • Comments explaining what the next block does — each is an extraction waiting for a name
  • Mixed abstraction levels: orchestration calls next to inline detail work in the same body
  • A function whose body has phases: setup, then processing, then formatting output

Process

Read each function's name, then its body, one function at a time. Where the body does work the name doesn't promise, something needs extracting.

Look for the seams: blank lines, comments, and shifts in abstraction level are natural cut points. For each potential extraction, ask: can I name this piece after WHAT it does, not HOW? If the name would just restate the code (loopAndSum, parseAndValidate), the boundary is wrong — look for a different cut.

Trade-off

Length is not the signal — a flat sequence of steps at one abstraction level can be long and clear. The smell is mixed levels or unnamed phases. Don't split a coherent story into pieces that must be read together — two methods that only make sense as a pair are worse than one longer method. If you can't name the extracted piece honestly, don't extract yet.

Go Deeper

Where do functions mix computation with presentation — calculating a result AND formatting it? Where do sibling functions handle the same structure at different depths — one recurses, another doesn't, and nothing explains why? In tests: where do multiple act-assert cycles live in one method instead of being separate tests?

Source: SKILL.md on GitHub

No alerts6d3 checks · Risk SAFE
  • Gen Agent Trust Hub6d

    The skill facilitates an automated, iterative refactoring workflow using a worker-reviewer agent team. It processes local source code and executes user-provided test commands to verify changes. The skill operates using local scripts and standard development tools without any detected malicious behaviors or obfuscation.

  • Socket6d

    No alerts

  • Snyk6d

    Risk: LOW · No issues

Signed by skilld at 628d2e9. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 7 months ago
disable-model-invocation
true
argument-hint
[target-path]
Other metadata
hooks
{
  "TeammateIdle": [
    {
      "hooks": [
        {
          "type": "command",
          "command": "${CLAUDE_SKILL_DIR}/references/guard-idle-worker.sh"
        }
      ]
    }
  ]
}

README badge

README badge for lexler/skill-factory/refactoring-team