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.

referenceslenses08-duplication.md

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

Lens: Duplication

Knowledge that exists in more than one place — not just copied code, but shared algorithm skeletons, re-tested behavior, and rules re-derived where they don't belong.

The Question

What knowledge exists in more than one place? Where would a single conceptual change require editing multiple locations?

How to Spot

  • Same algorithm shape with different details: multiple functions that all find-split-recurse or validate-transform-return — the skeleton is duplicated even though the specifics differ
  • Same behavior tested in multiple places: one test class already proves it, another re-verifies it with overlapping scenarios
  • Tests that recompute production logic: the assertion re-derives what the code computes instead of stating an expected value, coupling test and production to the same knowledge
  • Parallel structures that must stay in sync: two lists, two maps, two switch statements encoding the same set of things

Process

Shift from looking at code similarity to looking at knowledge ownership. For each piece of domain knowledge — a business rule, a format, a set of valid values — ask: how many places encode this? If more than one, a change to that knowledge forces multiple edits. Would these change together, for the same reason? That's the duplication that matters.

Trade-off

Duplication is far cheaper than the wrong abstraction. Don't consolidate until you've seen the pattern three times and the reason to change is clearly shared. Premature DRY creates abstractions that accumulate conditionals and parameters to serve divergent callers — then the cure is worse than the disease.

Go Deeper

Where are tests encoding knowledge that production code already owns? Where does structural similarity hide behind different variable names — functions that don't look alike but follow the same skeleton? Where has past DRY-ing already gone wrong — an abstraction straining under conditionals because the callers diverged?

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