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

Refactoring

skill-kreek-consult-refactoring · by kreek

Use for refactoring, behavior-preserving change, tests, and safe rewrites.

No reviews yet
0 installs
31 views
0.0% view→install

Install

$ agentstack add skill-kreek-consult-refactoring

✓ 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-kreek-consult-refactoring)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
3mo 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? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Refactoring

Iron Law

GREEN BEFORE THE REFACTOR. GREEN AFTER EACH STEP. NEVER MIX STRUCTURE AND BEHAVIOR IN ONE COMMIT.

When to Use

  • Changing structure while preserving behavior: legacy refactors, large

renames, extractions, migrations, branch by abstraction, strangler fig, Mikado planning, characterization tests, or big-bang rewrite avoidance.

When NOT to Use

  • Behavior-first feature work; use proof.
  • Commit grouping or git history surgery after changes already exist;

use git-workflow.

Core Ideas

  1. Preserve behavior first; add characterization tests where coverage

is missing. Separate structural from behavior changes: every commit is one or the other, never both.

  1. Name the coupling before changing structure: data shape, side effect,

module boundary, ownership, time, transport, persistence, or compatibility.

  1. Make every step small, reversible, and shippable.
  2. Validate the target shape before moving large amounts of code.
  3. For public interfaces, use parallel change: expand, migrate callers, then

contract. Ask which callers, data, and releases must keep working before adding shims, dual paths, or migration complexity.

  1. Delete old paths only when traffic/callers have moved and

verification proves it.

  1. Simplification is refactoring: remove accidental complexity only after

naming the behavior preserved and the coupling reduced.

Workflow

  1. Define the current behavior that must not change. Add or identify

tests that catch regressions at the public boundary.

  1. Name the concern being separated and its current coupling point.
  2. Pick the smallest safe pattern: rename, extract, move, parallel

change, branch by abstraction, or strangler. For broad renames, write a rename map first: separate private symbols, file paths, runtime/public keys, persisted names, docs, and compatibility cleanup.

  1. Record a preservation Proof Contract: unchanged behavior claim,

relevant invariant, public boundary, before/after check, evidence.

  1. For simplification, remove only complexity that has a named cost:

hidden mutable state, unnecessary layer, broad helper, scattered behavior, compatibility shim, dead flag, or duplicated rule with divergent meaning.

  1. Make one structural step, run focused tests, commit. Track any old

path left behind with owner and removal condition.

Verification

  • [ ] Tests were green before the refactor; characterization coverage

exists for legacy behavior touched.

  • [ ] The coupling being separated was named before code moved.
  • [ ] Each commit is structural or behavioral, not both; the system is

shippable at every commit.

  • [ ] Public interface changes use expand-contract or compatibility

shims; old and new paths both work during migration.

  • [ ] Backward compatibility expectations were confirmed or inherited

from an explicit public contract before compatibility machinery was added.

  • [ ] Simplification claims name the removed complexity and the preserved

behavior; behavior preservation has before/after evidence.

  • [ ] Deleted tests were replaced by equal or stronger behavior

coverage.

  • [ ] Leftover migration/deletion work has owner and deadline.
  • [ ] Every behavior-preservation claim has before/after proof

evidence, or the refactor is reported as unproven.

Tripwires

Use these when the shortcut thought appears:

  • Name behavior-preservation proof and add characterization where coverage is

missing.

  • Split structural and behavioral changes before committing.
  • Extract a helper/layer only after naming the behavior, state, effect, or

boundary being separated.

  • Treat shorter code as simpler only when it does not hide state, effects,

compatibility, ownership, or independent behavior.

  • Commit renames separately from extractions when possible.
  • Put opportunistic tweaks in separate behavior commits or leave them out.
  • Prove no callers remain before deleting old paths, or use expand-contract

migration.

  • Replace big-bang rewrites with the next safe slice or branch-by-abstraction

path.

Handoffs

  • proof: preservation evidence, characterization, boundary tests.
  • git-workflow: clean change grouping.
  • domain-modeling: effects or domain shape.
  • architecture: module boundaries, locality, layering, DDD patterns.
  • Workflow references/simple-not-easy.md: real coupling vs local ease.

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.