Self-diagnose and auto-repair workspace issues — missing scripts, broken configs, stale data, and environment problems. Activate when a tool fails, a script is not found, or the user reports something not working.
When something goes wrong — a command fails, a file is missing, or the user says "X isn't working" — follow this skill to diagnose the root cause and fix it automatically.
The sandbox writes application logs to /tmp/kicker-logs/sandbox.log (human-readable format, one line per entry). Use this to investigate runtime errors, failed LLM calls, model fallbacks, and tool execution issues:
# Recent errors
grep -i 'ERROR' /tmp/kicker-logs/sandbox.log | tail -20
# Recent warnings
grep -i 'WARN' /tmp/kicker-logs/sandbox.log | tail -20
# Last 50 lines
tail -50 /tmp/kicker-logs/sandbox.log
# Search for a specific runId
grep '<runId>' /tmp/kicker-logs/sandbox.log
Read the error message or user description and classify:
| Category | Signals |
|---|---|
| Missing script/file | No such file or directory, ENOENT, user asks to run something that doesn't exist |
| Missing dependency | MODULE_NOT_FOUND, command not found, pip: not found |
| Permission error | EACCES, Permission denied |
| Config/env issue | undefined, null, connection refused, auth failures |
| Stale data | Outdated cache, wrong timezone, old session data |
| Disk/resource issue | ENOSPC, ENOMEM, disk full |
Run targeted checks based on category:
Missing script/file:
# Check if the file exists anywhere in workspace
find ~/ -name "<filename>" -type f 2>/dev/null | head -5
# Check recent bash history for clues about what the script should do
cat ~/.bash_history 2>/dev/null | grep "<keyword>" | tail -10
Missing dependency:
# Check what's available
which <command> 2>/dev/null || echo "not installed"
pip3 list 2>/dev/null | grep <package>
npm list -g 2>/dev/null | grep <package>
Permission error:
ls -la <path>
whoami
id
Config/env issue:
# Check environment (only safe vars)
env | grep -i "<keyword>"
# Check connectivity
curl -s --max-time 5 <url> -o /dev/null -w "%{http_code}"
Disk/resource:
df -h /
du -sh ~/ 2>/dev/null
free -h 2>/dev/null || vm_stat 2>/dev/null
If the user asks to run a script that doesn't exist, don't just report the error. Instead:
code/scripts/chmod +x code/scripts/<name>Example: User says "run the cleanup script" but cleanup.sh doesn't exist → infer from context what needs cleaning (temp files? old logs? cache?), create the script, run it.
# Python packages
pip3 install --user <package>
# Node packages (global tools)
npm install -g <package>
# System packages (if available)
apt-get install -y <package> 2>/dev/null
Always try installing before telling the user it's unavailable.
chmod +x <script> # Make script executable
chmod 644 <config-file> # Fix config permissions
rm -rf data/cache/*After any repair, always verify:
When creating scripts that didn't exist before, follow these conventions:
code/scripts/#!/bin/bash or #!/usr/bin/env python3chmod +xset -e for bash, try/except for Python)