macalbert/envilder/code-refactoring

Claude Code and agent skill by macalbert/envilder

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Code-smell detection and safe incremental refactoring patterns. Use when reviewing or implementing a PURE_REFACTOR contract, reducing technical debt, or assessing structural findings. Covers SOLID principles and behavior-preserving execution.

Install

npx vskill@latest install macalbert/envilder/code-refactoring

SKILL.md

Code Refactoring

Detect concrete code smells and improve structure while preserving all observable behavior. common-verification-first governs intent, protected artifacts, and evidence.

When to Use

  • Implementing an approved PURE_REFACTOR.
  • Reviewing a candidate for justified structural findings.
  • Reducing technical debt within approved scope.
  • Reducing complexity flagged by CRAP evidence.

Preconditions

  • Establish an existing-suite baseline before solution edits.
  • Freeze and protect behavioral verification; do not rewrite it for the

refactor.

  • State architecture constraints and the behavior that must remain unchanged.
  • Only @Implementer applies workflow changes. @Reviewer remains read-only

and reports findings to the orchestrator.

Smell Catalog

SmellIndicator
Long methodExcessive branches, mixed levels, or multiple responsibilities
Large classMultiple independent reasons to change
Duplicated logicThe same decision or transformation exists in multiple places
Tight couplingHigh-level behavior depends directly on replaceable details
Mixed abstractionPolicy and low-level mechanics are interleaved
Architecture violationA dependency crosses a prohibited layer boundary
Feature envyBehavior primarily manipulates another owner's data
Shallow moduleInterface complexity approaches implementation complexity
Primitive obsessionDomain concepts lack meaningful types and invariants
Speculative generalityAbstraction exists without a current requirement

Review Method

  1. Read target files, callers, verification contract, and architecture rules.
  2. Identify only concrete smells with maintenance or correctness risk.
  3. Apply the deletion test to shallow modules: retain an abstraction when

removing it concentrates complexity; inline it when removal merely shortens the call path.

  1. Report location, evidence, proposed structural outcome, and risk.
  2. Accept no changes required when the candidate is already clear and

cohesive.

Implementation Method

For each approved structural change:

  1. Make one coherent transformation.
  2. Keep protected verification artifacts unchanged.
  3. Run the targeted existing verification.
  4. Run the stack formatter and static or build checks in the appropriate mode.
  5. Continue only while behavior and architecture constraints remain protected.
  6. Run the broader relevant suite before completion.

If a behavioral test must change, stop. The task may be a behavior change, the test may be coupled to private structure, or the contract may be defective. Route that decision to the orchestrator instead of silently reclassifying it.

Stack Checks

StackTypical verificationFormatter
TypeScript core, Node.js SDK, websiteTargeted Vitest or build, type checkpnpm format
.NET SDKTargeted and broader dotnet test, builddotnet format
Python SDKTargeted and broader pytest, mypymake format-sdk-python

Constraints

  • Never change observable outputs, side effects, compatibility, or domain

invariants.

  • Respect Domain -> Application -> Infrastructure dependency rules.
  • Do not add tests merely to raise coverage or satisfy a refactoring ritual.
  • If important behavior truly lacks evidence, report a separate verification

need; do not expand the frozen refactor contract.

  • Do not force a modification after review; no findings is valid.

SOLID Reference

PrincipleCheck
Single ResponsibilityDoes this unit have one reason to change?
Open/ClosedCan required variation be added without unstable branching?
Liskov SubstitutionCan subtypes replace the abstraction without surprises?
Interface SegregationDo clients depend only on operations they need?
Dependency InversionDoes policy depend on abstractions rather than details?

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
135
Repository forks
4
7-day trend score
25

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/macalbert/envilder/code-refactoring/badge)](https://verified-skill.com/skills/macalbert/envilder/code-refactoring)

Something wrong with this skill or its page? Tell us.