safe-refactor — adapters safe-refactor, morpho-vault-v2-adapters, community, adapters, ide skills, curation, ethereum, fork-testing, foundry, morpho-blockchain-lending

v1.0.0

About this Skill

Perfect for Solidity Analysis Agents needing advanced code refactoring capabilities for Ethereum, Morpho, and Foundry protocols. Refactor non-upgradeable Solidity contracts for clarity and maintainability without changing observable behavior, interfaces, or tests. Use when behavior is locked and you need structural cleanup.

# Core Topics

mgnfy-view mgnfy-view
[1]
[0]
Updated: 1/28/2026

Killer-Skills Review

Decision support comes first. Repository text comes second.

Reference-Only Page Review Score: 7/11

This page remains useful for operators, but Killer-Skills treats it as reference material instead of a primary organic landing page.

Original recommendation layer Concrete use-case guidance Explicit limitations and caution Locale and body language aligned
Review Score
7/11
Quality Score
47
Canonical Locale
en
Detected Body Locale
en

Perfect for Solidity Analysis Agents needing advanced code refactoring capabilities for Ethereum, Morpho, and Foundry protocols. Refactor non-upgradeable Solidity contracts for clarity and maintainability without changing observable behavior, interfaces, or tests. Use when behavior is locked and you need structural cleanup.

Core Value

Empowers agents to refactor non-upgradeable Solidity contracts, improving code clarity and maintainability without altering semantics, using protocols like Ethereum and leveraging tools such as Foundry.

Ideal Agent Persona

Perfect for Solidity Analysis Agents needing advanced code refactoring capabilities for Ethereum, Morpho, and Foundry protocols.

Capabilities Granted for safe-refactor

Refactoring legacy Solidity contracts for better readability
Simplifying contract logic after locking behavior with tests
Preparing DeFi protocol code for audit or review

! Prerequisites & Limits

  • Limited to non-upgradeable Solidity contracts
  • Must not alter contract semantics or interfaces

Why this page is reference-only

  • - The underlying skill quality score is below the review floor.

Source Boundary

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

After The Review

Decide The Next Action Before You Keep Reading Repository Material

Killer-Skills should not stop at opening repository instructions. It should help you decide whether to install this skill, when to cross-check against trusted collections, and when to move into workflow rollout.

Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is safe-refactor?

Perfect for Solidity Analysis Agents needing advanced code refactoring capabilities for Ethereum, Morpho, and Foundry protocols. Refactor non-upgradeable Solidity contracts for clarity and maintainability without changing observable behavior, interfaces, or tests. Use when behavior is locked and you need structural cleanup.

How do I install safe-refactor?

Run the command: npx killer-skills add mgnfy-view/morpho-vault-v2-adapters/safe-refactor. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for safe-refactor?

Key use cases include: Refactoring legacy Solidity contracts for better readability, Simplifying contract logic after locking behavior with tests, Preparing DeFi protocol code for audit or review.

Which IDEs are compatible with safe-refactor?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for safe-refactor?

Limited to non-upgradeable Solidity contracts. Must not alter contract semantics or interfaces.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add mgnfy-view/morpho-vault-v2-adapters/safe-refactor. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use safe-refactor immediately in the current project.

! Reference-Only Mode

This page remains useful for installation and reference, but Killer-Skills no longer treats it as a primary indexable landing page. Read the review above before relying on the upstream repository instructions.

Upstream Repository Material

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

Upstream Source

safe-refactor

Install safe-refactor, an AI agent skill for AI agent workflows and automation. Review the use cases, limitations, and setup path before rollout.

SKILL.md
Readonly
Upstream Repository Material
The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.
Supporting Evidence

Skill: safe-refactor

Purpose

Refactor non-upgradeable Solidity contracts to improve clarity, maintainability, and internal structure without changing any observable behavior.

This skill is purely structural. It must not alter semantics, interfaces, or externally visible effects.

When to Invoke

  • Code cleanup
  • Duplication removal
  • Readability or maintainability improvements
  • Preparing code for audit or review
  • Simplifying logic after behavior has been locked by tests

Inputs Required

  • Target Solidity contracts
  • Existing test suite covering the affected behavior

Actions

Permitted actions include:

  • Extracting internal helper functions
  • Renaming variables and internal functions for clarity
  • Simplifying control flow without semantic change
  • Removing dead code or unreachable branches
  • Reorganizing code to follow repository layout conventions

Refactors must preserve:

  • execution order
  • revert behavior
  • event emission
  • state transitions
  • external call behavior

Constraints and Safety Rules

  • Must not change observable behavior
  • Must not change public or external APIs
  • Must not change custom errors or error parameters
  • Must not introduce or remove external calls
  • Must not introduce new dependencies
  • Must not modify storage semantics
  • Must comply with all rules in .codex/constraints/solidity-style.md
  • Tests must pass unchanged
  • No new tests may be added as justification for behavior changes

If a refactor would benefit from behavior changes, use a different skill.

Outputs

  • Refactored Solidity source files with identical behavior

Verification

  • forge build passes
  • forge test passes with no test changes
  • Behavior is identical under existing unit tests

Handoff

If refactoring reveals unclear or risky logic, consider:

  • security-review for deeper analysis
  • docs-generator to improve documentation without changing code

Example Prompts

  • “Use safe-refactor to simplify withdraw logic without changing behavior.”
  • “Refactor internal helpers in VaultMath for readability while preserving semantics.”

Related Skills

Looking for an alternative to safe-refactor or another community skill for your workflow? Explore these related open-source skills.

View All

openclaw-release-maintainer

Logo of openclaw
openclaw

Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞

333.8k
0
AI

widget-generator

Logo of f
f

Generate customizable widget plugins for the prompts.chat feed system

149.6k
0
AI

flags

Logo of vercel
vercel

The React Framework

138.4k
0
Browser

pr-review

Logo of pytorch
pytorch

Tensors and Dynamic neural networks in Python with strong GPU acceleration

98.6k
0
Developer