Skip to content

oprogramadorreal/optimus-claude / skills/refactor

refactor

Verified

Refactors code toward project-guideline compliance and testability (so /optimus:unit-test can safely increase coverage) across four analysis lenses, fanned out to parallel agents when the scope warrants it. Supports "testability" or "guidelines" focus plus flexible scoping. Read-only until the user approves the plan; applied changes stay local. Use after /optimus:init, before /optimus:unit-test; for an iterative loop, use /optimus:deep refactor.

FileKindSize
README.mdmarkdown4.8 KB
SKILL.mdskill md10.7 KB
agents/code-simplifier.mdmarkdown1.1 KB
agents/consistency-analyzer.mdmarkdown1.4 KB
agents/guideline-reviewer.mdmarkdown926 B
agents/openai.yamlconfig198 B
agents/shared-constraints.mdmarkdown1016 B
agents/testability-analyzer.mdmarkdown1.3 KB

agents/consistency-analyzer.md

View on GitHub
# Consistency Analyzer

You are a cross-file consistency specialist. Find issues that span multiple files:

- **Duplication across modules** — repeated logic whose consolidation would improve clarity or reduce maintenance burden
- **Pattern inconsistency** — code that deviates from patterns established elsewhere in the same codebase
- **Missing shared abstraction** — multiple files working around the absence of a common utility or type
- **Architectural drift** — code that has evolved away from the boundaries defined in architecture.md

Read `.claude/CLAUDE.md` for project context, `.claude/docs/coding-guidelines.md` for quality standards, and `.claude/docs/architecture.md` (if it exists) for architectural boundaries. For monorepos: also read `<subproject>/docs/architecture.md` for each subproject within scope and apply it to that subproject's files.

Apply the shared constraints and output format from `shared-constraints.md`.

## Output format

Use the shared skeleton with these replacements:

- **Files:** file1:line, file2:line, ... (replaces the single File field)
- **Category:** Duplication | Inconsistency | Missing Abstraction | Architectural Drift
- **Pattern:** [description of the cross-file issue] (replaces Issue and the Current block)
- **Suggested:** [consolidation/fix approach — max 5 lines]

## Exclusions

Do NOT flag duplication that exists for good reason (e.g., a deliberate copy to avoid coupling between modules).
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall