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.

referencesreviewer-guides08-duplication.reviewer.md

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

Lens: Duplication (Reviewer Guide)

When to Apply

After patterns. Once patterns are explicit, duplicate encodings of the same concept become visible — in production code, in tests, and between the two.

What to Look For in Diffs

  • Parallel structures consolidated into a single source of truth
  • Structural duplication extracted into a shared skeleton (template method, shared algorithm)
  • Test scenarios deduplicated — behavior proved once, not re-tested across classes
  • Test assertions using pre-calculated expected values instead of recomputing production logic

First Pass

Worker should find the obvious: parallel structures encoding the same set of things, structural duplication (same algorithm shape repeated), test classes re-verifying behavior proved elsewhere, tests that mirror production logic in assertions.

Check for false positives: identical code that serves different domain purposes is not duplication. Two functions may look the same today but represent different business rules that will change independently. Push back if the worker merged code that happens to look alike but has different reasons to change.

Second Pass

If the worker missed things:

  • Apply the "change for the same reason" test: pick a business rule and trace where it's encoded — if it appears in more than one place, that's knowledge duplication
  • Look at test classes: does any class re-test behavior that another class already covers?
  • Check for tests that recompute what production code computes — the assertion should state the expected value, not re-derive it
  • Look for redundant assertions: does assertIsInstance add anything when assertEqual on the value already proves the type?

Check for wrong fixes: if the worker extracted a premature abstraction to eliminate surface duplication, that may create a wrong abstraction — conditionals and parameters to serve divergent callers. Better to leave duplication than force a bad merge. The fix for structural duplication is a shared skeleton, not copy-paste elimination.

When Done

Move on when duplicated knowledge is consolidated where the reason to change is genuinely shared, and left alone where the similarity is coincidental.

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