---
name: cleanup-sandbox
description: Uninstalls tools that /setup-sandbox installed on this machine. Reads ~/.humand/sandbox-installed.json to know exactly what to remove. Never touches software that was already installed before setup. Use when the user wants to clean up the sandbox environment.
metadata:
  category: Setup & Environment
---

# Skill: Cleanup Sandbox

Safely removes tools installed by `/setup-sandbox`. Reads `~/.humand/sandbox-installed.json` to know exactly what this skill installed vs. what was already on the machine — it will never remove pre-existing software.

## When to use

- User wants to uninstall the sandbox environment
- User says "limpiar entorno", "desinstalar", "cleanup", "borrar lo que se instaló"

## Steps

### 1. Read the install registry

```bash
cat ~/.humand/sandbox-installed.json
```

If the file doesn't exist:
> No encontré un registro de instalación en `~/.humand/sandbox-installed.json`. Es posible que el entorno no haya sido configurado con `/setup-sandbox`, o que el registro haya sido borrado manualmente.
> ¿Querés continuar de todas formas? Te voy a preguntar qué desinstalar manualmente.

### 2. Show what would be removed

Present a clear list before doing anything:

> Esto es lo que `/setup-sandbox` instaló y que se puede desinstalar:
>
> ✅ **nvm** — instalado por setup
> ✅ **Node 24.11.1** — instalado por setup
> ⏭️ **git** — ya existía antes del setup, no se tocará
> ⏭️ **Homebrew** — ya existía antes del setup, no se tocará
>
> ¿Querés continuar con la desinstalación?

Items marked `preexisting: true` in the registry are always skipped.

For Homebrew specifically, even if it was installed by setup, show an extra warning:
> ⚠️ **Homebrew** fue instalado por el setup. Tené en cuenta que otros programas de tu Mac pueden depender de él. ¿Estás seguro de que querés desinstalarlo?

### 3. Confirm

Ask for confirmation before proceeding. Accept `--yes` flag to skip confirmation (for automated flows).

If the user declines, abort cleanly:
> Ok, no se desinstalará nada.

### 4. Uninstall (Mac)

Only uninstall items where `preexisting: false`.

**Node 24.11.1**
```bash
nvm uninstall 24.11.1
```

**nvm**
```bash
brew uninstall nvm
# Remove nvm lines from shell profile
```

**Homebrew** (only if user confirmed the extra warning)
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
```

**git**
```bash
brew uninstall git
```

### 5. Uninstall (Windows)

**Node 24.11.1**
```powershell
nvm uninstall 24.11.1
```

**nvm-windows**: Instruct the user to uninstall via Windows Settings → Apps.

**git**: Instruct the user to uninstall via Windows Settings → Apps.

### 6. Clean up the registry

```bash
rm ~/.humand/sandbox-installed.json
rmdir ~/.humand 2>/dev/null || true   # only removes if empty
```

### 7. Summary

Tell the user what was removed:
> ✅ Limpieza completa. Esto es lo que se desinstalló:
> - nvm
> - Node 24.11.1
>
> Esto no se tocó porque ya existía antes del setup:
> - git
> - Homebrew
