agentsclimarketplace

Refactor engine

Skill Razaib-khan/ForgeWeave/src/forgeweave/templates/claude/.claude/skills/refactor-engine

Behavioral execution framework for AI agents — define deterministic, portable skills & agents across OpenCode, Claude Code, Gemini CLI, and Qwen Code.

Install
npx -y skills add Razaib-khan/ForgeWeave --skill refactor-engine

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Improves existing codebases by restructuring for clarity, performance, and maintainability without changing external behavior

SKILL.md

2.6 KB, as published. Nobody here has run it

Refactor Engine

Purpose

Restructure existing code to improve readability, performance, and maintainability while preserving exact external behavior. Every refactor is verified by ensuring existing tests continue to pass and no observable behavior changes.

When to Use

  • Code has duplicated logic that should be extracted
  • A function or module is too long or does too many things
  • Naming is unclear or inconsistent with project conventions
  • Performance can be improved by algorithmic changes
  • Dead code, commented-out code, or unused imports need removal

When Not to Use

  • The code has a bug — use debugger first
  • New features need to be added — use code-builder
  • The code works fine and doesn't need changes

Inputs

InputTypeRequiredDescription
targetstringYesFile, module, or code area to refactor
goalenumYesclarity, performance, maintainability, or all
constraintsstringNoWhat must NOT change (public API, performance bounds)

Expected Outputs

OutputDescription
Refactored codeRestructured code preserving external behavior
Diff summaryWhat changed and why
VerificationTest results confirming no behavior change

Exact Workflow Steps

  1. Read and understand the target code fully
  2. Run existing tests to establish baseline
  3. Identify refactoring opportunities (duplication, complexity, naming)
  4. Apply one refactoring at a time (small, atomic changes)
  5. Run tests after each change to confirm no regression
  6. Repeat until all planned refactorings are applied

Required Checks

  • All existing tests pass before and after
  • No public API changed unless explicitly requested
  • Each change is atomic (one concern per change)
  • No dead code or debug artifacts left behind

Failure Modes

Failure ConditionResponse
Test fails after refactorRevert last change and re-approach differently
Refactor touches too many filesBreak into smaller, focused refactors
Goal is unclearAsk for specific examples of what to improve

References

ReferencePath
Test Generator skill../test-generator/SKILL.md
Code Builder skill../code-builder/SKILL.md

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.