{ "enabled": true, "name": "[TM] Import Cleanup on Delete", "description": "Clean up imports when files are deleted", "version": "1", "when": { "type": "fileDeleted", "patterns": [ "**/*.{js,ts,jsx,tsx,py,go,rs,java,cpp,c,h,hpp,cs,rb,php,swift,kt}", "!**/node_modules/**", "!**/vendor/**", "!**/.git/**" ] }, "then": { "type": "askAgent", "prompt": "A source file was just deleted. Please:\n\n1. Based on the file type, search for all references to this file across the codebase (imports, includes, requires, use statements, etc.)\n2. Comment out or remove these references using the appropriate syntax for each language\n3. Check if any tasks mention this file and add a note about its deletion\n4. If this deletion completes a 'remove' or 'refactor' task, ask if it should be marked as done\n\nNote: Reference patterns vary by language (import/from, #include, require, use, etc.)" } }