fix_retain_cycles
Fix common retain cycles by adding weak to delegates, [weak self] to closures, and removeObserver in deinit. Previews changes by default before applying.
Instructions
Automatically fix common retain cycle patterns: add weak to delegates, add [weak self] + guard let self to closures, add removeObserver in deinit. Defaults to dry-run mode (preview only). Set dryRun to false to apply changes.
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": {
"projectPath": "<projectPath>"
},
"name": "fix_retain_cycles"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dryRun | No | Preview changes without modifying files (default: true) | |
| categories | No | Which fix categories to apply (default: all) | |
| projectPath | Yes | Path to the Xcode project root directory | |
| targetPaths | No | Specific files/directories to fix (default: entire project) | |
| excludePatterns | No | Glob patterns to exclude |