class-refactoringlisted
Install: claude install-skill pekral/cursor-rules
# Class Refactoring
## Purpose
Improve code structure and quality without changing behavior.
Focus on:
- clarity
- separation of concerns
- testability
- maintainability
---
## Modes
This skill runs in one of two modes, selected by the caller via `MODE` (default `apply`):
- **`apply` (default)** — full refactoring: modify code, author the pre-refactor coverage commit, run fixers / checkers, and chain the After Completion review. Every step below behaves as written unless it is explicitly flagged for `MODE=cr`.
- **`cr` (read-only lens — invoked by `@skills/code-review/SKILL.md`, `code-review-github`, `code-review-jira`, `code-review-bugsnag`)** — **never modify code, never author tests, never stage / commit / push, never run fixers or checkers, and never chain any After Completion review.** Scope the analysis to the lines added or modified by the PR diff and return the refactoring opportunities as markdown only, for the CR to fold into its Refactoring (DRY / tech debt) and Refactoring proposals sections. Every "apply / extract / split / consolidate" instruction below is emitted as a written proposal, not applied to code; the Test Coverage Gate becomes a read-only audit (report coverage gaps as findings, do not author tests).
**Completeness contract (`MODE=cr`).** The lens walks the **complete guideline set of this skill** against the diff — every bullet of **Refactoring Guidelines**, every bullet of **Laravel Context**, and the behavior-preservation clauses of the **