AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Refactoring Code

skill-alexei-led-cc-thingz-refactoring-code · by alexei-led

Batch behavior-preserving refactors for multi-file, repeated-pattern,

— No reviews yet
0 installs
42 views
0.0% view→install

Install

$ agentstack add skill-alexei-led-cc-thingz-refactoring-code

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • ✓ Prompt-injection patterns
  • ✓ Secret / credential exfiltration
  • ✓ Dangerous shell & filesystem operations
  • ✓ Untrusted network calls
  • ✓ Known-malicious package signatures

What it can access

  • ✓ Network access No
  • ✓ Filesystem access No
  • ✓ Shell / process execution No
  • ✓ Environment & secrets No
  • ✓ Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-alexei-led-cc-thingz-refactoring-code)

Reliability & compatibility

✓ Security review passed
0 installs to date
— no reviews yet
● 2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Refactoring Code? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Batch Refactoring

Use this when many edits must preserve externally observable behavior. Stop if you cannot name the maintenance value and the behavior that must stay unchanged.

Role-gated action

Detect capability from tools:

  • Write-capable role: map scope, apply one batch, run verification.
  • Read-only role: map scope and emit the refactor in the Proposed Changes contract. Apply nothing; run nothing.

Route elsewhere

Do not use this for:

  • one small edit that normal coding tools can handle
  • behavior changes, bug fixes, or failing checks → fixing-code
  • test-only cleanup, coverage, or TDD → improving-tests
  • review findings without edits → reviewing-code
  • target architecture design or repo-wide structural audit → architecture skills
  • cosmetic churn with no maintenance value

Language references

Load the matching reference for the language being refactored:

  • C# /.NET: references/csharp.md
  • Go: references/go.md
  • Java/Kotlin: references/java-kotlin.md
  • Python: references/python.md
  • Rust: references/rust.md
  • TypeScript/JavaScript: references/typescript.md

Unsupported language: use the general workflow in this file only.

Evidence first

Before editing:

  1. Define goal, non-goals, preservation target, and safety gate.
  2. Map every affected site with text search and language-aware tools.
  3. For renames, moves, extracts, splits, or broad restructures, use graph tools when available:
  • GitNexus dry-run rename for renames; GitNexus context, impact, and query for callers, callees, execution flows, and string/dynamic refs.
  • codegraph status first; if fresh, use codegraph context or affected to size dependency/call blast radius.
  1. Treat stale graph indexes as no evidence. Refresh if allowed; otherwise fall back to search/LSP and report the gap.
  2. Check non-code references when names or paths change: config, routes, DI wiring, serialization keys, CLI entries, generated sources, scripts, and docs.
  3. Read representative implementation files and tests.
  4. Add characterization tests at the public boundary when behavior is under-specified and risk is not low.

No mapped site, no edit.

Batch rules

Good batches are small, reversible, and single-purpose:

  • rename one symbol/concept and all callers
  • move one module/function and its tests
  • extract one cohesive responsibility behind the same public behavior
  • remove one duplicate implementation after tests prove equivalence
  • update one repeated pattern across mapped sites

Rules:

  • Separate mechanical structure changes from logic changes.
  • Do not rename many concepts while changing APIs or control flow.
  • Prefer semantic refactoring tools; use precise text edits only for mapped sites.
  • For public APIs, keep compatibility shims or deprecations unless the user approved a breaking change.
  • Run narrow tests after each batch; run broader lint/type/test checks before the next batch or final report.
  • Delete dead code exposed by the refactor. Do not hand-edit generated or vendored files unless the project regenerates them from source.

Output

Engineer:

REFACTOR COMPLETE
=================
Preservation target: 
Safety gate: 
Files changed: N
Status: CLEAN | NEEDS ATTENTION

Mapping:
-  — 

Changes:
- path:line — change

Verification:
-  — pass/fail

Reviewer:

## Proposed Changes

Preservation target: 
Safety gate: 

Mapping:
-  — 

### Change 1: 

File: `path/to/file`
Action: CREATE | MODIFY | DELETE

Code:

Rationale: 

For multi-file renames, list every mapped occurrence or explicitly mark ambiguous/unmapped references.

Failure handling

  • Scope unclear: ask which files/concept and what behavior to preserve.
  • Tests/checks missing for risky code: ask to add characterization tests or shrink/defer the refactor.
  • Tests fail after a batch: inspect or revert that batch before continuing.
  • Required behavior change appears: stop and split into refactor first, then feature/fix.
  • Graph tool missing or stale: report the gap and use search/LSP evidence instead.
  • Generated or vendored occurrence: skip it unless regeneration is part of the verified workflow.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.