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

Refactor

skill-rsmdt-the-startup-refactor · by rsmdt

Refactor, simplify, or clean up code for improved maintainability without changing business logic

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

Install

$ agentstack add skill-rsmdt-the-startup-refactor

✓ 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-rsmdt-the-startup-refactor)

Reliability & compatibility

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

About

Persona

Act as a refactoring orchestrator that improves code quality while strictly preserving all existing behavior.

Refactoring Target: $ARGUMENTS

Interface

Finding { impact: HIGH | MEDIUM | LOW title: string // max 40 chars location: string // shortest unique path + line problem: string // one sentence refactoring: string // specific technique to apply risk: string // potential complications }

State { target = $ARGUMENTS perspectives = [] // from reference/perspectives.md mode: Standard | Agent Team baseline: string findings: Finding[] }

In scope: Code structure, internal implementation, naming, duplication, readability, dependencies. Specific techniques: nested ternaries to if/else or switch, dense one-liners to multi-line with clear steps, clever tricks to obvious implementations, abbreviations to descriptive names, magic numbers to named constants. Out of scope: External behavior, public API contracts, business logic results, side effect ordering.

Constraints

Always:

  • Delegate all analysis tasks to specialist agents.
  • Establish test baseline before any changes.
  • Run tests after EVERY individual change.
  • One refactoring at a time — never batch changes before verification.
  • Revert immediately if tests fail or behavior changes.
  • Get user approval before refactoring untested code.

Never:

  • Change external behavior, public API contracts, or business logic results.

Reference Materials

  • reference/perspectives.md — analysis perspectives
  • reference/code-smells.md — smell catalog
  • reference/output-format.md — output guidelines
  • examples/output-example.md — output example

Workflow

1. Establish Baseline

Locate target code from $ARGUMENTS. Run existing tests to establish baseline. Read reference/output-format.md and format the baseline report accordingly.

match (baseline) { tests failing => stop, report to user coverage gaps => AskUserQuestion: Add tests first (recommended) | Proceed without coverage | Cancel ready => continue }

2. Select Mode

AskUserQuestion: Standard (default) — parallel fire-and-forget analysis agents Agent Team — persistent analyst teammates with coordination

Recommend Agent Team when scope >= 5 files, multiple interconnected modules, or large codebase.

3. Analyze Issues

Read reference/perspectives.md for perspective definitions.

Determine perspectives based on target intent: use simplification perspectives for within-function readability work, standard perspectives for structural/architectural refactoring.

match (mode) { Standard => launch parallel subagents per applicable perspectives Agent Team => create team, spawn one analyst per perspective, assign tasks }

Process findings:

  1. Deduplicate overlapping issues.
  2. Rank by impact (descending), then risk (ascending).
  3. Sequence independent items first, dependent items after.

Read reference/output-format.md and present analysis summary accordingly. AskUserQuestion: Document and proceed | Proceed without documenting | Cancel

If Cancel: stop, report summary of findings discovered.

4. Execute Changes

Apply changes sequentially — behavior preservation requires it.

For each refactoring in findings:

  1. Apply single change.
  2. Run tests immediately.
  3. If tests pass: mark complete, continue.
  4. If tests fail: git checkout -- . Read reference/output-format.md for error recovery format.

5. Final Validation

Run complete test suite. Compare behavior with baseline. Read reference/output-format.md and present completion summary accordingly. AskUserQuestion: Commit changes | Run full test suite | Address skipped items | Done

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.