| name | debug |
| description | Debug PureScript code using Debug.taggedLog for logging and nix run
executed in background with monitoring.
Triggers: "debug", "why doesn't work", "investigate", "add logs"
|
| user-invocable | true |
| model | opus |
PureScript Debug Workflow
1. Add Debug Logging
import Debug (taggedLog)
-- Usage: taggedLog returns the value unchanged (pure)
result = taggedLog "label" someValue
2. Run in Background
Run with output capture:
nix run 2>&1 | tee /tmp/purs-debug.log
- Use
run_in_background: true
- Set timeout: 120s (2 min)
3. Monitor Every 30 Seconds
Check output:
tail -20 /tmp/purs-debug.log
If no new output for 30 seconds, kill process:
pkill -f "node.*microgpt"
4. Analyze and Fix
- Read
/tmp/purs-debug.log
- Identify the issue from taggedLog output
- Fix the code
- Remove or adjust debug logs
- Re-run
nix run to verify
5. Iterate
Repeat steps 2-4 until the issue is resolved.