execute_refactor_workflow
Run an end-to-end refactoring pipeline: plan context, audit dependencies, apply AST transformations, run tests, and roll back on failure.
Instructions
End-to-End Orchestrated Refactoring Engine: Executes the complete Task -> Context Plan -> Reflection Audit -> Dependency Preflight -> Deterministic AST Transformation -> Test Execution & Rollback pipeline. Changes are test-gated and rolled back on failure; correctness is only as strong as the supplied test command.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"task": "<task>"
},
"name": "execute_refactor_workflow"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | Task description (e.g. 'Decouple SleepInhibitor from cli.py into system.py') | |
| dry_run | No | If true, simulates transformations without modifying disk | |
| symbols | No | Optional list of exact symbol names to refactor | |
| to_file | No | Target file (optional; deduced from task/plan if omitted) | |
| from_file | No | Source file (optional; deduced from task/plan if omitted) | |
| share_state | No | If true, automatically binds shared mutable globals and host module symbols across modules | |
| project_root | No | Path to the repository root directory (default: '.') | . |
| test_command | No | Test command to run for verification gate (e.g. 'pytest tests/test_system.py') | |
| token_budget | No | Max token budget for context planning (default: 3000) |