Create a skill for debugging issues in the omnirepo - reading logs, tracing errors, fixing problems.
---
name: debugging
description: Debug issues in Haskell and Python code. Use when something isn't working, you see an error, or need to trace a problem.
---
# Debugging
Systematic approach to finding and fixing issues.
## Process
1. **Reproduce** - Can you trigger the error consistently?
2. **Isolate** - What's the minimal case that fails?
3. **Trace** - Follow the error from symptom to cause
4. **Fix** - Make the smallest change that fixes it
5. **Verify** - Confirm the fix works and didn't break anything
## Reading Error Messages
### Haskell
\`\`\`
Foo.hs:42:15: error:
• Couldn't match type 'Text' with 'String'
\`\`\`
- File:line:column tells you exactly where
- The bullet points explain what's wrong
- Look for "Expected" vs "Actual" type
### Python
\`\`\`
Traceback (most recent call last):
File "foo.py", line 42, in bar
...
TypeError: unsupported operand type
\`\`\`
- Read bottom-up: last line is the error
- Traceback shows the call stack
## Checking Logs
### Systemd services
\`\`\`bash
journalctl -u <service-name> -f # Follow logs
journalctl -u <service-name> --since "1 hour ago"
\`\`\`
### Agent/subagent logs
\`\`\`bash
ls ~/logs/subagents/ # Subagent traces
cat ~/logs/orchestrator/*.log # Orchestrator logs
\`\`\`
### Build logs
\`\`\`bash
bild Omni/Thing.hs 2>&1 | less # Capture and page
\`\`\`
## Common Issues
### "Module not found"
- Check import statement matches file path
- Check the dep comment is present
- Run `bild` to regenerate
### "Connection refused"
- Is the service running? `systemctl status <service>`
- Is it the right port?
- Check firewall/network
### "Permission denied"
- Check file permissions: `ls -la <file>`
- Check if path is in a protected directory
- Check systemd hardening (ProtectSystem)
## When Stuck
1. Simplify - remove code until it works, then add back
2. Print debug - add trace/print statements
3. Check assumptions - verify inputs are what you expect
4. Search codebase - has this been solved before?
5. Ask for help - describe what you tried
Omni/Ide/Debug.md