#!/bin/bash # omarchy:summary=Diagnose a crashed process with the default coding agent # omarchy:args= [comm] [exe] [signal] # omarchy:examples=omarchy agent crash 1516893 # Clicked from a "Process crashed:" notification, or run by hand against any PID # in `coredumpctl list`. The method lives in the diagnose-crash skill so it is # edited in one place and works with whichever agent is default; this only # gathers the facts and points at it. set -euo pipefail pid=${1:?usage: omarchy-agent-crash [comm] [exe] [signal]} if [[ ! $pid =~ ^[0-9]+$ ]]; then echo "Not a PID: $pid" >&2 echo "Usage: omarchy agent crash (see: coredumpctl list)" >&2 exit 1 fi comm=${2:-unknown} exe=${3:-unknown} signal=${4:-unknown} skill="$OMARCHY_PATH/default/agents/skills/diagnose-crash/SKILL.md" # Looked up live so a hand-run PID still gets a timestamp. A rotated-away core # only costs the timestamp, so failure is tolerated. when=$(coredumpctl list "$pid" --no-pager --no-legend 2>/dev/null | tail -1 | cut -d' ' -f1-4) || true when=${when:-unknown} prompt=$( cat <