-
Notifications
You must be signed in to change notification settings - Fork 1
Autonomous Refactor
This page is auto-generated from the plugin's README. Do not edit directly — changes will be overwritten on the next sync.
Test-driven autonomous refactoring against project design principles, with git worktree isolation and automatic revert on test failure.
Manual refactoring is a cognitively expensive loop: understand design principles, find violations, change code safely, verify correctness. autonomous-refactor automates that cycle. It reads your project's stated design principles from README.md, generates a behavioural test baseline, and applies each refactoring opportunity in an isolated git worktree. Only changes that keep tests green are committed; everything else is reverted without human input. The result is a before/after report showing LOC, cyclomatic complexity, and alignment score deltas.
[P1] Snapshot before touching: A behavioural test suite is generated and confirmed green before any source change. A failing baseline stops the entire session immediately.
[P2] Isolation per change: Each refactoring opportunity runs in its own git worktree. Green commits merge; red tests trigger a force-remove of the worktree. Failures never touch the working branch.
[P3] Principle-driven opportunities: Every opportunity must cite a specific principle from the project README.md. No aesthetic or stylistic changes with no principle backing. No new external dependencies.
[P4] Convergence without confirmation: Phase 3 runs fully autonomously until all opportunities are addressed, --max-changes is reached, or a hard stop condition occurs.
[P5] Fail transparently: Test failures, git errors, and missing tools surface immediately with raw output and recovery instructions.
- Git repository (worktree isolation requires git)
- Python 3
- For TypeScript targets: Node.js; jest or vitest detectable via
package.json - For Python targets:
pytestin PATH
/plugin marketplace add L3DigitalNet/Claude-Code-Plugins
/plugin install autonomous-refactor@l3digitalnet-plugins
For local development:
claude --plugin-dir ./plugins/autonomous-refactor
cd plugins/autonomous-refactor && npm installLast synced: 2026-02-20 · View source