52-execute-refactor-150

[52] EXECUTE. Three-stage refactoring workflow: (1) iterative research of refactor/modularization options, (2) plan + risk/edge-case analysis + Scope150 validation, then implement with tests after user confirmation, and (3) apply Scout105 cleanup protocol. Use when asked to refactor, modularize, or restructure code safely.

16 stars

Best use case

52-execute-refactor-150 is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

[52] EXECUTE. Three-stage refactoring workflow: (1) iterative research of refactor/modularization options, (2) plan + risk/edge-case analysis + Scope150 validation, then implement with tests after user confirmation, and (3) apply Scout105 cleanup protocol. Use when asked to refactor, modularize, or restructure code safely.

Teams using 52-execute-refactor-150 should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/52-execute-refactor-150/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/development/52-execute-refactor-150/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/52-execute-refactor-150/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How 52-execute-refactor-150 Compares

Feature / Agent52-execute-refactor-150Standard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

[52] EXECUTE. Three-stage refactoring workflow: (1) iterative research of refactor/modularization options, (2) plan + risk/edge-case analysis + Scope150 validation, then implement with tests after user confirmation, and (3) apply Scout105 cleanup protocol. Use when asked to refactor, modularize, or restructure code safely.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Execute-Refactor 150 Protocol

## Overview

Run in three stages:
1. Research refactor options (iterative, no code changes).
2. Plan + confirm + implement with tests and validation.
3. Apply Scout105 cleanup (objective, small, user-approved).

## Stage 1 — Research refactor options (iterative)

1. **Create or reuse the session log** at `.sessions/SESSION_[date]-[name].md`.
   - If the file does not exist, create it and add the investigation template below.
   - Keep all research notes inside the session log only (no scattered notes in chat).

2. **Define the core question** (the refactor goal).
   - Write a single sentence: “We need to refactor X to achieve Y.”
   - Example: “Refactor SermonCard to reduce duplication and isolate date logic.”

3. **Define scope (Scope150)**.
   - **Core (100%)**: list files and behaviors you will directly change.
   - **Boundary (50%)**: list callers, dependent modules, tests, configs, and data flow.
   - If unsure, add a “to verify” bullet and resolve it during observations.

4. **Perform observations (search/read) in ordered layers**.
   - **Interface layer**: find entry points (routes, public APIs, UI entry points).
   - **Domain layer**: identify entities, i18n keys, enums, types.
   - **Pattern layer**: locate hooks, services, clients, shared utilities.
   - **Usage layer**: trace imports and call sites.
   - For each layer, read the minimum number of files that explain the behavior.

5. **Record findings in the log with sources**.
   - Each fact must include a source (file path + line reference or command).
   - Separate facts from hypotheses. Do not mix them.

6. **Generate hypotheses and refactor options**.
   - For each option, note: goal, steps, benefits, risks, and test impact.
   - Prefer at least 2 options so tradeoffs are explicit.

7. **Decide if more research is needed**.
   - If user says “research more”, expand scope or inspect new files.
   - Update the log with new branches and continue Stage 1.

8. **Stop before implementation**.
   - End Stage 1 with: options summary, remaining unknowns, and a recommended path.

### Investigation log template

```
## Investigations

### Investigation: <short topic>

#### Core question
- ...

#### Scope
- Core (100%):
  - ...
- Boundary (50%):
  - ...

#### Findings
- <fact> (source: file path / command)
  - Subfinding

#### Hypotheses
- H1: ...
  - Prediction: ...
  - Test: ...
  - Status: pending/confirmed/rejected

#### Refactor options
- Option A: ... (pros/cons)
- Option B: ... (pros/cons)

#### Next branches
- ...
```

## Stage 2 — Plan, confirm, implement

1. **Write a refactor plan**.
   - Break into ordered steps with file-level granularity.
   - Include expected intermediate states (what should still pass after each step).

2. **List risks and edge cases**.
   - Identify behavior changes, API contract risks, and hidden coupling.
   - Explicitly note any breaking-change risk.

3. **Define a validation checklist**.
   - Tests to run (unit/integration).
   - Manual checks if needed (UI flows, API calls).
   - Expected outputs and what would indicate failure.

4. **Perform Scope150 validation planning**.
   - Core (100%): ensure each planned change has a test or validation step.
   - Boundary (50%): list all callers/integrations/tests to be checked.

5. **Ask for user confirmation before editing**.
   - Provide plan, risks, and validation checklist.
   - Do not edit until the user approves.

6. **Implement the refactor**.
   - Follow the plan in order.
   - Keep changes minimal and reversible.

7. **Add or update tests**.
   - Cover changed logic and any new boundaries.
   - Avoid brittle tests; prefer behavior-based assertions.

8. **Run validation**.
   - Execute all tests from the checklist.
   - Record results and fix failures before moving to Stage 3.

## Stage 3 — Scout105 cleanup protocol

Apply only **objective** cleanup after a Key Point (phase complete). Do not add features.

### Trigger (Key Point)
- Apply only after a milestone where the user would see complete value.
- Do not run per-file; run once per phase.

### Allowed cleanup categories (objective only)
- **Unused code**: unused imports/vars/fields (provable by grep/IDE).
- **Typos**: spelling errors in comments/strings (spellcheckable).
- **Formatting inconsistencies**: breaks the file’s own pattern.
- **Dead code**: commented debug lines or unreachable code.
- **Obviously wrong logic**: provably incorrect (duplicate checks, impossible types).

### Constraints
- Only in files already touched by the primary task.
- Remove garbage only; no new features or refactors.
- Each cleanup must take ≤ 30 seconds to verify + fix.
- Total cleanup time ≤ 5% of primary task time.
- Must be objectively measurable; if not measurable, skip.
- Require user approval before executing cleanup.

### Scout105 report (present to user)

```
✅ Key Point complete: <brief summary>

Scout105 opportunities:
- <file>: <item> (category, evidence)
- <file>: <item> (category, evidence)

Run Scout105 cleanup? [Yes / Skip / Selective]
```

### Execution
- If approved, apply all selected cleanups in batch.
- Run tests/build to validate no regression.
- If failures occur, revert or investigate causality before proceeding.

## Output expectations

- Stage 1: Provide refactor options + log path + remaining branches + recommended path.
- Stage 2: Provide plan, risks, validation checklist, and request confirmation.
- Stage 3: Provide Scout105 report, decision, and validation result.

Related Skills

refactoring-ui

16
from diegosouzapw/awesome-omni-skill

Practical UI design system based on Adam Wathan & Steve Schoger's "Refactoring UI". Use when you need to: (1) fix visual hierarchy problems, (2) choose consistent spacing and typography scales, (3) build color palettes with proper contrast, (4) add depth with shadows and layering, (5) design in grayscale first and add color last, (6) style components in Tailwind CSS, (7) make UI look professional without a designer.

kata-execute-quick-task

16
from diegosouzapw/awesome-omni-skill

Execute small ad-hoc tasks with Kata guarantees, running quick tasks without full planning, or handling one-off work outside the roadmap. Triggers include "quick task", "quick mode", "quick fix", "ad-hoc task", "small task", and "one-off task".

codebase-cleanup-refactor-clean

16
from diegosouzapw/awesome-omni-skill

You are a code refactoring expert specializing in clean code principles, SOLID design patterns, and modern software engineering best practices. Analyze and refactor the provided code to improve its...

code-refactoring-refactor-clean

16
from diegosouzapw/awesome-omni-skill

You are a code refactoring expert specializing in clean code principles, SOLID design patterns, and modern software engineering best practices. Analyze and refactor the provided code to improve its...

refactoring-patterns

16
from diegosouzapw/awesome-omni-skill

Safe refactoring workflow and common patterns. Invoke when extracting methods, renaming, moving code, or addressing code smells.

agent-md-refactor

16
from diegosouzapw/awesome-omni-skill

Refactor bloated AGENTS.md, CLAUDE.md, or similar agent instruction files to follow progressive disclosure principles. Splits monolithic files into organized, linked documentation. Use when (1) agent context files are too large or unwieldy, (2) need to separate project context from executable skills, (3) want to create modular documentation structure, (4) refactoring existing documentation for better organization, or (5) creating new agent context documentation from scratch.

51-execute-quality-150

16
from diegosouzapw/awesome-omni-skill

[51] EXECUTE. Commitment to maximum quality work with 150% coverage. Use when you need the highest quality output for critical tasks, complex problems, important decisions, or when standard work isn't enough. Triggers on "maximum quality", "150% mode", "full quality", "critical task", or when you explicitly want AI to work at its best.

bgo

10
from diegosouzapw/awesome-omni-skill

Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.

Coding & Development

angular-best-practices

16
from diegosouzapw/awesome-omni-skill

Angular performance optimization and best practices guide. Use when writing, reviewing, or refactoring Angular code for optimal performance, bundle size, and rendering efficiency.

angular-app-setup

16
from diegosouzapw/awesome-omni-skill

Creates an Angular 20 app directly in the current folder with strict defaults, deterministic non-interactive flags, and preflight safety checks. Use when the user asks to create, scaffold, or initialize Angular 20 in place and wants build/test verification.

angreal-patterns

16
from diegosouzapw/awesome-omni-skill

This skill should be used when the user asks to "test angreal tasks", "mock angreal", "document tasks", "angreal best practices", "error handling in tasks", "subprocess patterns", "dry run mode", "verbose mode", or needs guidance on testing patterns, development workflows, documentation strategies, or common implementation patterns for angreal tasks.

android

16
from diegosouzapw/awesome-omni-skill

Build, review, and refactor Android mobile apps (Kotlin) using modern Android patterns. Use for tasks like setting up Gradle modules, Jetpack Compose UI, navigation, ViewModel/state management, networking (Retrofit/OkHttp), persistence (Room/DataStore), DI (Hilt/Koin), testing, performance, release builds, and Play Store readiness.