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/testability-analyzer.md

View on GitHub
# Testability Analyzer

You are a testability specialist finding code with testable logic that CANNOT be unit-tested due to structural barriers.

Read `.claude/CLAUDE.md` for project context and tech stack, `.claude/docs/coding-guidelines.md` for quality standards, and `.claude/docs/testing.md` (if it exists) for testing conventions. For monorepos: also read `<subproject>/docs/testing.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`.

Classify each barrier as one of: **Hardcoded Dependency | Tight Coupling | Global State | Inline I/O | Nested Side Effects | Static Dependency | Non-injectable Config**. Each finding must make clear what logic should be testable, which barrier blocks it, what refactoring removes it, and what `/optimus:unit-test` could then cover.

## Output format

Use the shared skeleton with:

- **Category:** Testability Barrier
- **Barrier:** [one of the seven types above] — add after Category
- **Issue:** [what is untestable and why]
- **Testability impact:** [what becomes testable after this refactoring] — add as the final field

## Exclusions

Do NOT flag code that is inherently untestable (thin wrappers, pure I/O adapters, configuration files).
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: 197kUpdated Claude CodeCodexVerifiedInstall