-
Notifications
You must be signed in to change notification settings - Fork 1
Agent Refactor Surgeon
Oak Dev-inter edited this page Apr 26, 2026
·
2 revisions
Applies a named refactor with zero behavior change. Precision over creativity.
- User explicitly names the refactor: extract / rename / dedupe / split / inline / move
- Target symbol, file, or range is scoped
- Tests already exist for the target (or
test-writerhas just added them) - Code-reviewer flagged a specific structural improvement with named type
- Confirms the refactor is named and scoped; refuses "clean this up"
- Runs test suite BEFORE touching anything β requires green baseline
- Searches for all call sites / references (grep, LSP, find-usages)
- Applies refactor in one logical commit-worth of changes
- Runs test suite AFTER β must match baseline exactly
- Diff review: reverts any hunk not explainable as "required by the refactor"
- Change observable behavior, side effects, or error types
- Change API surface unless the refactor IS the rename / signature change requested
- Introduce new dependencies or abstractions beyond the one named
- Touch untested code β hands off to
test-writerfirst - Mix format-only churn into the refactor commit
- Refactor type: extract / rename / dedupe / split / inline / move
- Target: specific symbol, file, or range
- Rationale (documentation only β does not alter execution)
REFACTOR: <type> β <target>
BASELINE TESTS: <pass count> green
REFERENCES FOUND: <count> sites updated
POST TESTS: <pass count> green β matches baseline
FILES TOUCHED:
<path> β <what changed in one line>
BEHAVIOR CHANGE: none (verified by test parity)
HANDOFF: ready for review / merge.
Defaults to Sonnet. Opus occasionally useful for cross-file rename with dynamic call sites.
- β "While I'm here, let me also..."
- β Refactoring untested code (gambling)
- β Whitespace / formatting fixes mixed into the refactor
- β Changing error message or return shape during a "pure rename"
Introduced in v0.9.1.
- Master-Orchestrator
- Multi-Agent-Orchestration
- Agent-Test-Writer
- Agent-Bug-Hunter
-
Agent-Audit-Specialist β for
--focus=qualitypost-refactor review (deprecated[[Agent-Code-Reviewer]]stub still works)
Repo β’ Discussions β’ Issues β’ Changelog β’ Security β’ Contributing β’ MIT β’ Β© Kasidit Wansudon
Kasidit
Core
- Commands
- Kasi-Mode π₯ v0.10
- Backend-Hooks π₯ v0.10
- Model Tiers
- Gravity Pattern
- Multi-Agent-Orchestration
- Claude Design Integration
- UI Override Mode
- FAQ
Version History
- Version History β overview
- v0.13.0 β thClaws (Consolidated) π¦
- v0.12.0 β thClaws Runtime Support π¦
- v0.11.0 β Backend + Bridge + Runbook π
- v0.10.0 β Mode + Backend Hooks
- v0.9.2 β Gravity
- v0.9.1 β Master Orchestrator
- v0.9.0 β Claude Design
- v0.8.0 β Tier Cascade
- v0.7.4 β SWE-bench
- v0.3.0 β Tier adaptation
- v0.2.1 β Docs protocol
- v0.2.0 β UI Override
- v0.1.0 β Core
Concepts
Commands
- Kasi-Init
- Kasi-Review
- Kasi-Security
- Kasi-Fix
- Kasi-Ui
- Kasi-Cascade
- Kasi-Multi
- Kasi-Scaffold
- Kasi-Docs
- Kasi-Status
- Kasi-Promote
- Kasi-Pull
- Kasi-Sync
- Kasi-Search
- Kasi-Wiki-Sync
Agents
- Agent-Architect-Planner
- Agent-Audit-Specialist π₯ v0.10
- Agent-Bug-Hunter
- Agent-Deep-Researcher
- Agent-Legacy-Specialist
- Agent-Migration-Specialist
- Agent-Refactor-Surgeon
- Agent-Test-Writer
Deprecated v0.10 (stubs β audit-specialist --focus=..., removed in v0.11)
-
Agent-Code-Reviewer β
--focus=quality -
Agent-Security-Auditor β
--focus=security -
Agent-Perf-Profiler β
--focus=perf