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-guides05-primitive-obsession.reviewer.md

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

Lens: Primitive Obsession (Reviewer Guide)

When to Apply

After abstraction consistency. Now that functions are clean and cohesive, hidden concepts become visible — primitives carrying meaning the code doesn't name.

What to Look For in Diffs

  • Tuples or parallel parameters replaced with named types (NamedTuple, dataclass)
  • Strings with structure replaced by parsed representations
  • Scattered validation or parsing consolidated into a type's constructor
  • Type signatures narrowed from generic primitives to domain-specific types

First Pass

Worker should find the obvious: values that travel together as separate primitives, strings parsed or validated the same way in multiple places, dicts with known keys accessed repeatedly.

Check for false positives: if the worker wrapped a primitive that has no validation, no formatting, and no behavior, push back — a Name class wrapping a bare string with zero logic is overhead, not design. If the worker created types for purely local values or simple algorithmic counters, those are fine as primitives.

Second Pass

Do the description test yourself: pick a module and explain what it does in domain language. Any noun you use that doesn't exist as a type is a concept the worker may have missed. Then look for:

  • Raw strings flowing through the system that could be parsed into structured form at the boundary
  • Groups of primitives always passed together — remove one, do the others make sense alone? If not, they're a type
  • The same format assumption scattered across functions — every place that splits on a delimiter or checks for a prefix is a missing parser

Check for wrong fixes: types introduced but all logic left external (the type should attract behavior, not just rename the data). Watch for parsing scattered across call sites when a single parse-once point at the boundary would suffice.

When Done

Move on when primitives feel intentional — domain concepts have names, values that travel together are grouped, and no parsing logic is scattered across the codebase.

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