agentleFS
markmhendricksonmarkmhendrickson/neotoma/.claude/skills/manage_error_debugging/SKILL.md

manage_error_debugging

Skill38 starsChanged 2 months agoMITView on GitHub

Manage Error Debugging Automation

The file

Show its rules and text

We split this skill into the rules it gives an agent

24 rules. About 0 are common, 20 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈20

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Check for PID file: .cursor/error_reports/watcher.pid

    line 38
  2. Distinctive:

    If PID file exists, verify process is still running

    line 39
  3. Distinctive:

    If running, exit with message: "Error debugging watcher is already running (PID: {pid})"

    line 40
  4. Distinctive:

    If disabled, exit with error

    line 45
  5. Distinctive:

    Ensure log directory exists (if configured)

    line 49
  6. Very specific:

    Write PID to .cursor/error_reports/watcher.pid

    line 54
  7. Distinctive:

    Check if process is still running

    line 59
  8. Distinctive:

    If not running, read log file and show error

    line 60
  9. Very specific:

    Read PID from .cursor/error_reports/watcher.pid

    line 65
  10. Distinctive:

    If PID file doesn't exist, exit: "Error debugging watcher is not running"

    line 66
  11. Distinctive:

    Check if process with PID is running

    line 69
  12. Distinctive:

    If not running, remove stale PID file and exit: "Watcher process not found (stale PID file removed)"

    line 70
  13. Distinctive:

    Wait up to 5 seconds for graceful shutdown

    line 74
  14. Distinctive:

    If still running, send KILL signal

    line 75
  15. Distinctive:

    If not found: "Status: Not running"

    line 83
  16. Distinctive:

    Verify process with PID exists

    line 86
  17. Distinctive:

    If not: "Status: Not running (stale PID file)"

    line 87
  18. Distinctive:

    Remove stale PID file

    line 88
  19. Distinctive:

    If not found: "No log file found.

    line 100
  20. Distinctive:

    Remove PID file on stop or if process not found

    line 116
  21. Very specific:

    Use ps command (available on macOS, Linux)

    line 131
  22. Distinctive:

    If watcher fails to start, show error from log file

    line 175
  23. Distinctive:

    If PID file exists but process not found, clean up stale PID file

    line 176
  24. Distinctive:

    If configuration disabled, prevent start and show message

    line 177

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md
<!-- Source: .cursor/skills/manage-error-debugging/SKILL.md -->

Manage Error Debugging Automation

Manage the error debugging automation monitoring script (start, stop, status, logs).

Command Usage

/manage_error_debugging [action]

Actions:

  • start - Start the error debugging watcher in background
  • stop - Stop the running watcher
  • status - Check if watcher is running and show status
  • logs - Show recent logs from the watcher
  • restart - Stop and start the watcher
  • (no action) - Show status (default)

Prerequisites

  • Error debugging automation enabled in foundation-config.yaml
  • scripts/trigger_error_debug_cli.js exists and is executable
  • Node.js installed

Workflow

Action: start

  1. Check if already running:
    • Check for PID file: .cursor/error_reports/watcher.pid
    • If PID file exists, verify process is still running
    • If running, exit with message: "Error debugging watcher is already running (PID: {pid})"
  2. Verify configuration:
    • Load foundation-config.yaml
    • Check development.error_debugging.enabled === true
    • If disabled, exit with error
  3. Create necessary directories:
    • Ensure .cursor/error_reports/ exists
    • Ensure log directory exists (if configured)
  4. Start watcher in background:
    • Run: node scripts/trigger_error_debug_cli.js --watch > .cursor/error_reports/watcher.log 2>&1 &
    • Capture PID of background process
    • Write PID to .cursor/error_reports/watcher.pid
    • Output: "Started error debugging watcher (PID: {pid})"
  5. Verify start:
    • Wait 1 second
    • Check if process is still running
    • If not running, read log file and show error

Action: stop

  1. Check if running:
    • Read PID from .cursor/error_reports/watcher.pid
    • If PID file doesn't exist, exit: "Error debugging watcher is not running"
  2. Verify process exists:
    • Check if process with PID is running
    • If not running, remove stale PID file and exit: "Watcher process not found (stale PID file removed)"
  3. Stop process:
    • Send TERM signal to process
    • Wait up to 5 seconds for graceful shutdown
    • If still running, send KILL signal
    • Remove PID file
    • Output: "Stopped error debugging watcher (PID: {pid})"

Action: status

  1. Check PID file:
    • Read .cursor/error_reports/watcher.pid
    • If not found: "Status: Not running"
  2. Check if process is running:
    • Verify process with PID exists
    • If not: "Status: Not running (stale PID file)"
    • Remove stale PID file
  3. If running, show:
    • PID
    • Uptime (how long it's been running)
    • Configuration status (enabled/disabled)
    • Last log entry (if log file exists)

Action: logs

  1. Check log file:
    • Read .cursor/error_reports/watcher.log
    • If not found: "No log file found. Watcher may not have started yet."
  2. Display logs:
    • Show last 50 lines (configurable)
    • Or tail logs if --follow flag provided

Action: restart

  1. Run stop action (if running)
  2. Wait 1 second
  3. Run start action

Implementation Notes

PID File Management:

  • Store PID in: .cursor/error_reports/watcher.pid
  • Remove PID file on stop or if process not found

Log File:

  • Logs written to: .cursor/error_reports/watcher.log
  • Rotate or truncate on restart (optional)

Process Verification:

# Check if process exists (cross-platform)
if ps -p $PID > /dev/null 2>&1; then
  # Process is running
fi

Platform-Specific:

  • Use ps command (available on macOS, Linux)
  • On Windows, may need tasklist or PowerShell Get-Process

Configuration

Configure in foundation-config.yaml:

development:
  error_debugging:
    enabled: true
    automation:
      watch_mode: true  # Enable continuous monitoring
      cursor_cli:
        # ... cursor_cli configuration ...

Examples

# Check status
/manage_error_debugging
/manage_error_debugging status

# Start watcher
/manage_error_debugging start

# Stop watcher
/manage_error_debugging stop

# View logs
/manage_error_debugging logs

# Restart watcher
/manage_error_debugging restart

Related Commands

  • /report - Report an error (triggers debugging if automation enabled)
  • /debug - Manually debug pending errors (deprecated: use /debug instead)

Error Handling

  • If watcher fails to start, show error from log file
  • If PID file exists but process not found, clean up stale PID file
  • If configuration disabled, prevent start and show message
  • On stop, handle graceful shutdown with timeout fallback to KILL

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.