triage
Triage autoloop fleet health. Reports GREEN/YELLOW/RED per loop with remediation hints. Renamed from 'doctor' to avoid clashing.
What this skill does
<!-- # SSoT-OK -->
# autoloop: Triage
> **Self-Evolving Skill**: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.
Self-diagnostic for the autoloop fleet. Cross-references registry.json, heartbeat.json files, launchctl list output, plist files, and (lightly) `~/.claude/projects` JSONL transcripts to surface zombies, orphans, label collisions, multi-cwd contamination, stale bindings, and missing heartbeats.
## Arguments
- `--json` — emit structured JSON output instead of human-readable terminal report
- `--fix` — apply SAFE auto-remediations only (see "What gets fixed" below)
## Severity model
- 🔴 **RED** — known-broken state requiring action (zombie launchctl entry, multi-cwd contamination, label collision, contract file missing, cwd_drift_detected)
- 🟡 **YELLOW** — probably-OK but worth attention (pending-bind >1h, dead pid + recent heartbeat)
- 🟢 **GREEN** — healthy
## Run
```bash
PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$HOME/.claude/plugins/marketplaces/cc-skills/plugins/autoloop}"
# shellcheck source=/dev/null
source "$PLUGIN_ROOT/scripts/triage-lib.sh"
JSON=false
FIX=false
for arg in "$@"; do
case "$arg" in
--json) JSON=true ;;
--fix) FIX=true ;;
esac
done
if [ "$FIX" = true ]; then
loop_triage_fix
else
if [ "$JSON" = true ]; then
loop_triage_report --json
else
loop_triage_report
fi
fi
```
## What gets fixed automatically (`--fix`)
Only operations that are reversible OR have no live side effects:
1. **Unload zombie launchctl entries** — labels matching `com.user.claude.loop.*` with no registry record. Calls `launchctl bootout gui/$(id -u)/<label>` and removes the orphan plist file.
2. **Prune `/var/folders/*` test entries** — registry entries whose `contract_path` starts with `/var/folders/` (mktemp leftovers from tests).
What `--fix` will **NEVER** do (intentionally — operator decision required):
- Spawn `claude --resume` for any reason.
- Auto-reclaim a loop with a live owner (use `/autoloop:reclaim <loop_id>` instead).
- Modify a loop's `bound_cwd` or clear `cwd_drift_detected` (these mean the session went somewhere it shouldn't — only the operator can authorize recovery).
- Delete heartbeat files or state directories.
## Companion: automatic self-healing
`heal-self.sh` runs automatically on every fresh SessionStart hook fire (gated by content-hash so it does no work when the registry is unchanged). It archives entries with `owner_session_id ∈ {unknown, unknown-session, '', pending-bind}` older than 1 hour to `~/.claude/loops/registry.archive.jsonl`. The archive is append-only and forensics-friendly.
## Refs
- Library: `plugins/autoloop/scripts/triage-lib.sh`
- Companion script: `plugins/autoloop/scripts/heal-self.sh`
## Post-Execution Reflection
0. **Locate yourself.** — Confirm this SKILL.md is the canonical file before any edit.
1. **What failed?** — Fix the instruction that caused it (e.g., a detection that produced false positives, a `--fix` op that wasn't actually safe).
2. **What drifted?** — Update if the registry schema, heartbeat fields, or launchctl output format changed.
3. **Log it.** — Evolution-log entry with trigger, fix, evidence.
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.