codemap_routine_remove_script
Remove a script from a routine.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
routineName | string | ✅ Required | Routine name |
category | stringaudit | build | orient | close | utility | ✅ Required | Script category |
scriptName | string | ✅ Required | Script name (filename without .js extension) |
Usage Examples
MCP Usage (for AI Agents like Claude)
json
{
"name": "codemap_routine_remove_script",
"arguments": {
"routineName": "deploy",
"scriptName": "old-test"
}
}Example Output
JSON Response
json
{
"success": true,
"message": "Removed script \"audit/old-security-check\" from routine \"pre-release\"."
}When to Use This Tool
-
Use
- Remove deprecated or obsolete scripts from routines
- Clean up routines after script refactoring
- Fix routines that reference deleted scripts
- Reorganize workflow by removing and re-adding scripts
- Simplify workflows by removing unnecessary automation
codemap_routine_remove_script when you need to:
Common Patterns
Script Deprecation
Workflow Simplification
Category Migration
Remove outdated script from routine:
1. Verify script in routine: codemap_routine_list()
2. Remove: codemap_routine_remove_script({
routineName: "build",
category: "audit",
scriptName: "old-lint-check"
})
3. Optionally delete script: codemap_script_delete({ category: "audit", name: "old-lint-check" })Workflow Simplification
Remove redundant scripts:
codemap_routine_remove_script({
routineName: "deploy",
category: "build",
scriptName: "legacy-webpack"
})
codemap_routine_remove_script({
routineName: "deploy",
category: "build",
scriptName: "old-minify"
})Category Migration
Move script to different category:
1. Remove from routine: codemap_routine_remove_script({
routineName: "ci",
category: "build",
scriptName: "analyze-bundle"
})
2. Delete old script: codemap_script_delete({ category: "build", name: "analyze-bundle" })
3. Recreate in new category: codemap_script_create({ category: "audit", name: "analyze-bundle" })
4. Re-add to routine: codemap_routine_add_script({
routineName: "ci",
category: "audit",
scriptName: "analyze-bundle"
})Pro Tips
- Must specify category: Both category and scriptName required - scripts are organized by category
- Script itself unchanged: Removing from routine doesn't delete the script file
- No error if already removed: Tool is idempotent - safe to call multiple times
- Routine continues: Other steps in routine unaffected by script removal
- Order matters for execution: Removing and re-adding changes execution order
Best Practices
- Verify routine contents before removing scripts to avoid mistakes
- Test routine after removing scripts to ensure workflow still works
- Document removal reasons using routine messages
- Remove obsolete scripts promptly to keep workflows maintainable
- Consider if script should be deleted entirely or just removed from this routine
Common Mistakes
❌ Mistake: Wrong category specified
✅ Instead: Use correct category
---
❌ Mistake: Including .js extension
✅ Instead: Omit file extension
---
❌ Mistake: Assuming script is deleted
✅ Instead: Delete script if truly obsolete
---
❌ Mistake: Removing critical script without replacement
✅ Instead: Add replacement before removing
---
❌ Mistake: Not handling script dependencies
✅ Instead: Check dependencies before removal
codemap_routine_remove_script({
routineName: "build",
category: "audit", // Script is actually in "build" category
scriptName: "compile-ts"
})
// Error: Script "audit/compile-ts" not found in routine✅ Instead: Use correct category
codemap_routine_remove_script({
routineName: "build",
category: "build", // Correct category
scriptName: "compile-ts"
})---
❌ Mistake: Including .js extension
codemap_routine_remove_script({
routineName: "deploy",
category: "build",
scriptName: "bundle.js" // Extension included
})✅ Instead: Omit file extension
codemap_routine_remove_script({
routineName: "deploy",
category: "build",
scriptName: "bundle" // No extension
})---
❌ Mistake: Assuming script is deleted
// Remove from routine
codemap_routine_remove_script({
routineName: "build",
category: "audit",
scriptName: "old-check"
})
// Script still exists and can be used elsewhere
codemap_routine_add_script({
routineName: "ci",
category: "audit",
scriptName: "old-check" // This works!
})✅ Instead: Delete script if truly obsolete
// Remove from routine
codemap_routine_remove_script({
routineName: "build",
category: "audit",
scriptName: "old-check"
})
// Delete script entirely
codemap_script_delete({
category: "audit",
name: "old-check"
})---
❌ Mistake: Removing critical script without replacement
// Remove security audit from release
codemap_routine_remove_script({
routineName: "release",
category: "audit",
scriptName: "security-check"
})
// Releases now skip security checks!✅ Instead: Add replacement before removing
// Add new security check first
codemap_routine_add_script({
routineName: "release",
category: "audit",
scriptName: "security-scan-v2"
})
// Then remove old one
codemap_routine_remove_script({
routineName: "release",
category: "audit",
scriptName: "security-check"
})---
❌ Mistake: Not handling script dependencies
// Script B depends on output from Script A
codemap_routine_remove_script({
routineName: "build",
category: "build",
scriptName: "generate-types" // Script A
})
// Script B fails because types missing✅ Instead: Check dependencies before removal
// Review routine to identify dependencies
const routine = await codemap_routine_list();
const buildRoutine = routine.routines.find(r => r.name === "build");
// If dependent scripts exist, handle them
// Option 1: Remove both
codemap_routine_remove_script({ routineName: "build", category: "build", scriptName: "generate-types" })
codemap_routine_remove_script({ routineName: "build", category: "build", scriptName: "compile-with-types" })
// Option 2: Modify dependent script to not rely on removed script