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.

referenceslenses11-conditionals.md

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

Lens: Conditionals & Boolean Logic

Branching logic that obscures the main path, booleans that require mental gymnastics, or type-switching scattered across the codebase.

The Question

Can the reader see the main path at a glance? Is branching logic as simple as it can be?

How to Spot

  • Deep nesting: the happy path is buried under layers of if/else
  • Complex booleans: if a && !b || c && d — conditions that lack a name for what they mean
  • Repeated switching: the same type-check in multiple places — a single switch is not a smell
  • Null checks scattered through domain code instead of handling absence once at the boundary

Process

Stand back from each function. Can you see the main path — what this code normally does — without reading every branch?

Work from the outside in: flatten nesting with guard clauses first, then name the conditions that remain. If multiple conditions produce the same result, they are one concept — consolidate and name it. If a conditional is a value mapping, a lookup table replaces the branching entirely. If the same type-switching repeats across the codebase, that's the signal for polymorphism.

Trade-off

A simple conditional is not a smell. Guard clauses and if/else both have their place — use guards when one path is clearly exceptional, if/else when both paths are equally important. Converting symmetric branches into guards misrepresents the logic. If a function has 7+ guard clauses, the problem is not the conditionals — the function does too much.

Go Deeper

Where do booleans checked in combination encode a hidden state machine — valid states masquerading as independent flags? Where do boolean parameters control branching — a type you haven't named? Where do null checks inside trusted code reveal a boundary that isn't doing its job?

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