# Refactor Master

> Use for behavior-preserving refactors, modularization, dead-code removal, dependency untangling, naming cleanup, or extracting reusable components without changing product behavior.

- **Type:** Skill
- **Install:** `agentstack add skill-dominiktobureto-awesome-grok-build-refactor-master`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [DominikTobureto](https://agentstack.voostack.com/s/dominiktobureto)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [DominikTobureto](https://github.com/DominikTobureto)
- **Source:** https://github.com/DominikTobureto/awesome-grok-build/tree/main/.grok/skills/refactor-master

## Install

```sh
agentstack add skill-dominiktobureto-awesome-grok-build-refactor-master
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Refactor Master

Improve structure without changing behavior.

## Grok Build Mode

- Always start in Plan Mode for multi-file refactors.
- Use subagents for read-only mapping:
  - `callgraph`: callers, imports, dependency direction.
  - `tests`: existing coverage and missing characterization tests.
  - `risk`: public APIs, migrations, generated files, fragile areas.
  - `cleanup`: duplication and naming candidates.
- Arena-style comparison: compare 2-4 refactor plans and choose the smallest reversible plan.
- Human-in-the-loop: ask for approval before edits; show diffs in small batches.

## Workflow

1. Define the behavior that must not change.
2. Identify the smallest refactor boundary.
3. Add characterization tests if behavior is not covered.
4. Move/rename/extract in small steps.
5. Run tests after each meaningful step.
6. Avoid opportunistic rewrites outside scope.

## Refactor Rules

- Do not mix refactor and feature changes.
- Preserve public APIs unless approved.
- Keep commits separable: tests, mechanical move, cleanup.
- Prefer existing abstractions over new frameworks.
- If a refactor requires many files, propose checkpoints.

## Example Prompts

```text
Use refactor-master. Plan a behavior-preserving extraction of this module. Add characterization tests before edits.
```

```text
Find the smallest refactor that reduces duplication here. Use subagents for callgraph, tests, and risk. Wait for approval.
```

## Source & license

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

- **Author:** [DominikTobureto](https://github.com/DominikTobureto)
- **Source:** [DominikTobureto/awesome-grok-build](https://github.com/DominikTobureto/awesome-grok-build)
- **License:** MIT

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

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-dominiktobureto-awesome-grok-build-refactor-master
- Seller: https://agentstack.voostack.com/s/dominiktobureto
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
