Claude skill
Refactor Safely
Refactor Safely is a Claude skill in the Lattice plugin. Restructure existing code safely without changing externally observable behavior.
What it does
The description in the skill's SKILL.md, which Claude reads to decide when to use it:
Restructure existing code safely without changing externally observable behavior. Composes context, design, architecture, code quality, and testing guardrails into a characterization-first refactoring workflow. Use when the user says 'refactor this', 'clean this up', 'untangle this module', 'move this to the right layer', 'simplify this code', or 'improve this structure'.
The skill's instructions (about 1,884 words) cover:
- Required Skills
- Additional Instructions
- Workflow
- Step 1: Establish Refactor Context
- Step 2: Define Preservation Boundaries
- Step 3: Propose High-Level Structural Plan
- Step 4: Add Characterization Protection First
- Step 5: Choose Refactor Strategy and Pacing
- Step 6: Refactor in Small Green Steps
- Step 7: Verify Preservation and Structural Improvement
- Step 8: Capture Decisions and Remaining Debt
How to use it
- Refactor Safely comes inside the Lattice plugin, so you get it by installing that plugin, along with its 26 other skills. A plugin installs as one unit, with all its skills. The plugin's page has the install steps, and plugins are saved to your Claude account.
- Ask Claude for the task. When your request matches the skill's description, Claude loads it.
- To pick it yourself in Claude chat, type
/or click + and choose refactor-safely. In Claude Code and Cowork, type:/lattice:refactor-safely
Source
- Plugin
- Lattice
- SKILL.md
- View on GitHub
- Repo stars
- 214
- Repo last pushed
- Nov 14, 2026
- Checked
- Nov 16, 2026
More skills in Lattice
- Refiners UpdateUpdate existing Lattice standards after a significant change — the update-mode counterpart to lattice-init.
- Requirement ForgeGenerate structured feature specifications through a collaborative product interview.
- Requirement Forge RefinerFacilitate a structured conversation to define requirement standards for a project — epic and feature definitions, scenario structure, AC format, priority notation, status workflow, and naming…
- Requirement QualityApply requirement quality principles when generating or validating feature specifications.
- ReviewPerform a structured code review by composing validation checklists from relevant atoms based on what code changed.
- Review RefinerFacilitate a structured conversation to customize how the review molecule works -- atom loading rules, severity classification, report format, scope rules, insight capture, and health logging.
- Secure CodingApply security-conscious thinking when generating or modifying code.
- Test QualityApply test quality principles when generating or reviewing test code.
- ArchitectureEnforce architectural rules when generating or modifying code, and validate proposed designs before approval (design mode).
- Architecture CompassArchitectural thinking partner for an existing repository — scans the codebase, conducts a structured interview, agrees on current architectural state and recommended direction, and produces a…
- Architecture RefinerFacilitate a structured conversation to define architecture principles for a repository.
- Bug FixInvestigate, reproduce, and safely fix a bug with regression protection.
- Clean CodeApply clean code principles when generating or modifying implementation code.
- Clean Code RefinerFacilitate a structured conversation to define clean code principles for a repository.
- Code ForgeGenerate implementation code from an approved design blueprint or verbal requirements.
- Collaborative JudgmentProtocol for handling ambiguous decisions and missing/conflicting knowledge during code generation, design, and review.
- Context AnchoringManage per-feature living documents that capture decisions, constraints, and reasoning across AI sessions during active development.
- Ddd RefinerFacilitate a structured conversation to define DDD guardrails for domain design within a repository.
- Design BlueprintRun a complete design workflow -- from establishing context through four progressive design levels (Capabilities, Components, Interactions, Contracts) to an approved blueprint.
- Design FirstGuide structured design thinking through 5 progressive levels before any code is written.
- Domain Driven DesignApply DDD tactical patterns when working with domain code, and validate proposed domain models before approval (design mode).
- Knowledge PrimingLoad project-specific context -- tech stack, architecture overview, directory layout, trusted sources, and conventions -- so that all skills operate with awareness of what this project actually is.
- Knowledge Priming RefinerFacilitate a structured conversation to create a project-specific knowledge base document.
- Language Idioms RefinerFacilitate a structured conversation to define language-specific idioms and patterns for a repository.