safe-refactoring

safe-refactoring is a skill for Claude Code, Codex from ageerle/ruoyi-ai. It costs 52 tokens per session (421 once invoked), scanned A, original, MIT.

A safety guide for changing code structure while preserving its existing behavior, such as during renames, component extraction, or API migrations. An API is the interface that other code uses to communicate with a component or service.

In plain words
What is it for?
Use it for multi-file refactors, service or component extraction, state-management changes, concurrency changes, and other structural edits that need focused checks.
Why use it?
It helps expose callers, tests, configuration, stored data, and compatibility requirements before changes are made, reducing accidental breakage.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for multi-file refactors, service or component extraction, state-management changes, concurrency changes, and other structural edits that need focused checks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ageerle/ruoyi-ai/safe-refactoring
About the project

RuoYi AI is a full-stack enterprise platform for building AI assistants and agents that combine language models, knowledge bases, visual workflows, and multiple cooperating agents. Developers and organizations use it to manage model providers, retrieve information from documents, connect tools through MCP, and orchestrate agent workflows. The catalogue includes skills for working with RuoYi AI.

ageerle/ruoyi-ai · 5,683 stars · on GitHub · doc.ruoyiai.chat

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ageerle/ruoyi-ai --skill safe-refactoring
Clone the repo
git clone --depth 1 https://github.com/ageerle/ruoyi-ai

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for safe-refactoring

README.md
[![agentmods](https://agentmods.dev/badge/skills/ageerle/ruoyi-ai/safe-refactoring/github.svg)](https://agentmods.dev/skills/ageerle/ruoyi-ai/safe-refactoring)
Your own site
<a href="https://agentmods.dev/skills/ageerle/ruoyi-ai/safe-refactoring"><img src="https://agentmods.dev/badge/skills/ageerle/ruoyi-ai/safe-refactoring/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for safe-refactoring

Your own site · 80×15
<a href="https://agentmods.dev/skills/ageerle/ruoyi-ai/safe-refactoring"><img src="https://agentmods.dev/badge/skills/ageerle/ruoyi-ai/safe-refactoring.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 421 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00052 $0.00421
Opus 5 $0.00026 $0.00211
Sonnet 5 $0.00010 $0.00084
Haiku 4.5 $0.00005 $0.00042

Measured 9d ago against content hash 2acb98892779, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

safe-refactoring scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

ruoyi-modules/ruoyi-chat/src/main/resources/coding-harness/skills/safe-refactoring/SKILL.md · 38 lines

How it starts

The opening of the file, as written. The whole thing — 38 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Safe refactoring

Change structure without losing behavior, protocol validity, or concurrent user edits.

Before mutation

  1. Establish the exact behavior to preserve and the intentional behavior change, if any.
  2. Locate callers, implementations, serialized forms, tests, configuration, and external protocol names.
  3. Check the working tree and treat unrelated modifications as user-owned.
  4. Define mechanical acceptance checks: compile, focused tests, type checks, contract tests, and diff inspection.
  5. Split the work into dependency-ordered increments when a single atomic patch would be hard to verify.

Mutation rules

  • Use expected content hashes for existing files; a mismatch means reload and reconcile instead of overwriting.
  • Prefer narrow edits and stable compatibility adapters while consumers migrate.
  • Keep persisted schema and event changes versioned; tolerate additive fields where forward compatibility is intended.
  • Preserve tool-call/result adjacency, event IDs, resource ownership, cancellation, and error semantics during agent-runtime refactors.
  • Do not mix broad formatting or unrelated cleanup into the functional diff.
  • If a generated artifact should change, update its source and regenerate it with the documented command.

Verification loop

  1. Inspect the resulting diff for accidental deletion, path drift, stale names, and expanded authority.
  2. Run the smallest fast check that catches syntax/type errors, then the focused behavior tests.
  3. Run broader integration checks when the changed boundary has multiple consumers.
  4. Treat warnings or skipped tests relevant to the change as evidence to explain, not automatic success.
  5. If verification fails, retain the diagnostic evidence, correct the implementation, and repeat.

Completion report

Report the behavioral outcome, compatibility decisions, important changed paths, and checks actually executed. Call out anything not verified. Do not describe a refactor as behavior-preserving without evidence.

Read the full file on GitHub · 38 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 38 lines · 52 tokens per session scan A 2acb98892779

Subscribe to this mod's changes

safe-refactoring is a skill published in the GitHub repository ageerle/ruoyi-ai (5,683 stars, last pushed today), licensed MIT. It adds 52 tokens to every session and 421 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

network-exam-practice

Use this skill whenever the user wants computer network exam preparation, final review, 408-style networking practice, chapter quizzes, subnetting calculations, routing table problems, TCP sequence/ACK questions, protocol analysis, answer grading, or mistake diagnosis.

mingchen666/Reviva · 54 tokens

browserwing-admin

Manage and operate BrowserWing — an intelligent browser automation platform. Install dependencies, configure LLM, create/manage/execute automation scripts, use AI-driven exploration to generate scripts, browse the script marketplace, and troubleshoot issues.

MemTensor/MemOS · 47 tokens

wegent-knowledge

Knowledge base management and search tools for Wegent. Provides capabilities to list, create, update, and search knowledge bases and documents using RAG retrieval. Use this skill when the user wants to manage knowledge bases, documents, or search for information programmatically.

wecode-ai/Wegent · 51 tokens

mindos

MindOS: local knowledge assistant & shared KB. Keeps decisions, notes, SOPs, debugging lessons, research findings, preferences across sessions/agents. Core: save notes, search KB, organize files, run workflows, review, append CSV, hand off context, distill lessons. NOT for app source or paths outside KB. Triggers…

GeminiLight/MindOS · 136 tokens

superlint

This skill describes the mandatory standard operating procedure for using our internal SuperLint tool. Use this when tasks require fixing code quality issues according to corporate standards.

mgechev/skillgrade · 0 tokens

code-review

Review diffs and change sets for bugs, regressions, risks, and missing tests.

HybridAIOne/hybridclaw · 21 tokens