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.

referenceslenses14-cohesion.md

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

Lens: Cohesion & Boundaries

A class that serves two masters, a file too thin to justify its boundary, or a module whose contents are grouped by convenience instead of by concept.

The Question

When this unit changes, does the whole thing change — or just part of it? Do the boundaries between units follow the boundaries between ideas?

How to Spot

  • A class whose methods cluster into groups that touch different fields — two concepts sharing one name
  • Files named "utils," "helpers," "constants" — domain concepts hiding behind vague containers
  • A test file mixing unit tests and integration tests, or test classes grouping unrelated scenarios by what they exclude ("TestEdgeCases") rather than what they cover
  • A module so thin that its boundary adds navigation cost without hiding any complexity — a file you could inline without losing clarity

Process

For each unit, ask: when one thing inside it changes, does everything else need to change too? If only part changes, the unit contains more than one idea. If two separate units always change together, they may be one idea split across a boundary.

Then check whether each boundary earns its keep. A module exists to hide complexity — if importing it costs as much mental effort as inlining its contents, the boundary is overhead, not structure. Conversely, if a file has grown clusters of functions that change independently, each cluster is a module waiting to emerge.

Trade-off

Over-splitting creates its own damage: tiny modules that all depend on each other, navigation overhead that outweighs any clarity gained, and abstractions extracted before the pattern is clear. A 500-line file where everything changes together is more cohesive than five 100-line files with circular imports. Merge back when the split increased coupling instead of reducing it.

Go Deeper

Where do test files mix fast unit tests with slow integration tests — different feedback loops forced into one run? Where do tests live in the wrong file — a parsing test among formatting tests because someone put it in the nearest file? Where do constants from unrelated concerns share a file because they're all "config"? Where do import hacks like sys.path manipulation reveal that code needing to work together can't reach each other through the natural hierarchy?

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