Refactor Claw
refactor-claw
v0.2.0May 22, 2026Code refactoring — technical debt assessment, incremental modernization, and pre/post validation that nothing breaks
Refactoring without characterization tests is just moving furniture around a room you can't see. I refactor by first pinning behavior with tests, then applying structured transformations — extract method, invert dependency, replace conditional with polymorphism — and verifying that the test suite still passes at every intermediate commit.
PRIMARY ACTION
Unlock with ProWhen to Use
- Implement production-grade code and architecture
- Audit design decisions and tradeoffs
- Catch reliability issues before release
- Raise quality consistency across teams
Compatible Frameworks
8 TOOLS
Quality Gates
- Incremental, verifiable steps
- Behavior preserved at each step
- Cyclomatic complexity measurably reduced
- Plan documented with expected outcomes
- Rollback possible at every step
3 GATES DEFINED
Expected Outputs
Native exports per tool
openclaw/AGENTS.mdopenclaw/SOUL.mdopenclaw/TOOLS.md+7 morehermes/skills/flickclaw/refactor-claw/SKILL.mdhermes/skills/flickclaw/refactor-claw/references/workflow.mdhermes/skills/flickclaw/refactor-claw/references/quality-gates.md+2 moreclaude-code/CLAUDE.mdclaude-code/.claude/skills/refactor-claw/SKILL.mdclaude-code/.claude/skills/refactor-claw/references/workflow.md+3 morecodex/AGENTS.mdcodex/.flickclaw/agents/refactor-claw/codex.mdcodex/.flickclaw/agents/refactor-claw/workflow.md+2 morecursor/.cursor/rules/flickclaw-refactor-claw.mdccursor/.cursor/rules/flickclaw-refactor-claw-workflow.mdccursor/.cursor/rules/flickclaw-refactor-claw-quality-gates.mdcwindsurf/.windsurf/rules/flickclaw-refactor-claw.mdwindsurf/.windsurf/rules/flickclaw-refactor-claw-workflow.mdwindsurf/.windsurf/rules/flickclaw-refactor-claw-quality-gates.mdaider/CONVENTIONS.mdaider/aider.mdaider/.aider.conf.ymlollama/Modelfileollama/system-prompt.mdollama/template.md+1 moreInstall Commands
Install the FlickClaw CLI, then select your AI agent framework below to get the correct install command.
Step 1: Install CLI (one-time)
npm install -g @flickclaw/cli@latestStep 2: Select Framework
npm exec --yes @flickclaw/cli@latest -- install refactor-claw --target openclawDownload as ZIP
Example Prompt
Try this prompt with Refactor Claw to see what it can do:
Review the codebase architecture and identify 3 areas for improvement. Focus on maintainability, test coverage, and performance. Produce Refactored Module with Characterization Test Harness, Step-by-Step Refactoring Commit Series (Each Green), Interface/Call-Graph Diff Report (Before vs After).Example Output
IllustrativeWhat a typical Refactor Claw report looks like:
# Refactor Claw — Assessment Report **Project**: data-pipeline **Context**: an ETL pipeline processing 2M events/hour with PostgreSQL and Redis **Generated**: 2026-07-10 ## Executive Summary The Refactor Claw completed its review of data-pipeline (an ETL pipeline processing 2M events/hour with PostgreSQL and Redis). 3 findings were identified with concrete remediation steps. All quality gates were verified before delivery. ## Findings | # | Severity | Area | Finding | Recommended Action | |---|----------|------|---------|-------------------| | 1 | **P0** | Performance | N+1 queries in batch processing loop | Use eager loading with batch size 500 | | 2 | **P1** | Architecture | Tight coupling between extract and transform | Introduce event queue with dead letter handling | | 3 | **P2** | Testing | No integration tests for Redis failover | Add chaos test with Redis connection drop | ## Quality Gates - [✓] characterization_tests_cover_every_code_path_before_refactoring_begins - [✓] refactor_is_broken_into_commits_that_each_pass_all_tests - [✓] before_and_after_interface_or_call_graph_comparison_is_provided ## Outputs Generated - **Refactored Module with Characterization Test Harness**: Included in the report above. - **Step-by-Step Refactoring Commit Series (Each Green)**: Included in the report above. - **Interface/Call-Graph Diff Report (Before vs After)**: Included in the report above. ## Validation - [x] All quality gates passed (3/3) - [x] 3 findings documented with severity and remediation - [x] 3 output sections generated - [x] Evidence collected and referenced --- *This is an illustrative example output from FlickClaw. Results vary based on project context.*