---
name: multi-agent-kill
language: en
description: "Stop the given task, then remove its worktree and branch. Asks for confirmation. Use when a running or stuck task should be stopped and its worktree removed."
user-invocable: true
argument-hint: "#id  -  task ID to delete (e.g. #2)"
---

# multi-agent kill  -  Stop and Delete Task

**Input**: $ARGUMENTS

Stop the task and remove its worktree + branch + logs. Destructive operation  -  always asks for confirmation.

## Steps

1. **Find the task**  -  parse `#N` or `PROJ-XXXXX` from the argument

2. **Show info**  -  display the task details:
   ```
   ⚠️ Task to be deleted:
   - ID: #3
   - Jira: PROJ-133408
   - Branch: feature/PROJ-133408-...
   - Worktree: .worktrees/PROJ-133408/
   ```

3. **Get confirmation**: "Are you sure?"
   - If not sure → cancel

4. **Delete**:
   ```bash
   git worktree remove .worktrees/PROJ-{id} --force
   git branch -D {branch-name}
   ```

5. **Remote branch**  -  also ask: "Do you want to delete the remote branch too?"
   - Yes → `git push origin --delete {branch-name}`
   - No → delete locally only

6. **Confirm**: `❌ Task #N (PROJ-{id}) killed`
