Troubleshoots Linux incidents with a distro-aware, evidence-first workflow for mutable and immutable systems, desktop and server roles, and containerized workflows.
Scope
Use this skill for:
- Boot failures, degraded services, and login issues
- Network and DNS failures
- Package/update/rollback problems
- Desktop stack issues (Wayland/X11, audio, GPU, input)
- Server incidents (SSH, firewall, daemon failures, disk pressure)
- Immutable systems (rpm-ostree, transactional-update, NixOS)
- Container stack issues (Distrobox, Podman, Docker, cgroups, namespace boundaries)
- Virtualization stack issues (KVM/libvirt, QEMU, VirtualBox, VMware, nested virtualization)
- Kernel/driver faults and log-heavy debugging workflows
Safety rules
- Evidence before changes. Reproduce, gather logs, then fix.
- Prefer reversible actions first.
- Never run destructive commands unless explicitly requested.
- Ask before rebooting, reimaging, repartitioning, or data migration.
- For production servers, prioritize minimal-impact mitigation first.
- Before applying any fix command, confirm whether the user wants the AI to run it or wants to run it themselves.
- When unsure, stop and ask one focused question before risky changes.
- Never ask the user to paste passwords, PINs, recovery keys, tokens, or other secrets into chat. If a privileged command needs authentication and the execution harness supports an interactive terminal, run it with a TTY so sudo/polkit/SSH can read the secret locally from the prompt. If the user accidentally pastes a secret into chat, do not repeat it, store it, or use it; tell the user to enter secrets only in the local prompt.
Authentication for privileged commands
When the user chooses AI-runs-approved-fixes and a command requires privilege:
- Prefer the harness/tool option that allocates an interactive TTY, so
sudo, fingerprint, polkit, or SSH password prompts are handled outside chat.
- Do not use
sudo -S, askpass wrappers, environment variables, shell history, temporary files, or chat-provided secrets to pass passwords.
- If authentication times out or the user interrupts it, check for partially completed work before retrying.
- If TTY authentication is unavailable or repeatedly fails, switch to user-runs-fixes mode for that command and provide the exact command for the user to run manually.
- After an interrupted privileged operation, verify the system state before continuing, especially for operations that can leave services stopped or devices inactive.
Setup (always run first)
- Establish run context before diagnostics. If the user has not already answered, ask:
- Target device: main system/host, current sandbox/container, or another device over SSH?
- Execution mode: should the AI run approved fix commands, or should it provide commands for the user to run manually?
If the target is another device over SSH, ask for the SSH target string and do not run local diagnostics as if they describe the remote device. If the user chooses manual execution, gather read-only evidence when possible and present fix commands without running them.
- Run mode detection on the chosen target:
uname -a
cat /etc/os-release
systemd-detect-virt || true
ps -p 1 -o comm=
- Classify:
- Family: Debian/Ubuntu, Fedora/RHEL, Arch, openSUSE, Alpine, NixOS, other
- Model: mutable or immutable
- Role: desktop, server, mixed
- Init: systemd or alternative
- Container context: host, container, nested container
- Target: local host, current sandbox/container, or SSH remote
- Execution mode: AI-runs-approved-fixes or user-runs-fixes
- Load prior incident context from
${LINUX_TROUBLESHOOTER_DOCS_DIR:-$HOME/docs} when available.
Use prior docs as context, not as proof. Prefer recent and topic-relevant Markdown files, especially incident reports created by this skill. Keep this selective:
find "${LINUX_TROUBLESHOOTER_DOCS_DIR:-$HOME/docs}" -maxdepth 1 -type f -name '*.md' -printf '%T@ %p\n' 2>/dev/null | sort -nr | head -20
Then search/read only likely relevant files, using filenames, headings, and keywords from the current symptom, service names, device names, package names, and error text. For example:
rg -n -i 'keyword|service|device|error' "${LINUX_TROUBLESHOOTER_DOCS_DIR:-$HOME/docs}" 2>/dev/null
Summarize any relevant prior findings, fixes, rollback notes, and verification results before deciding on a new fix. Do not bulk-load unrelated notes or treat stale docs as current system state.
- Load these shared references before focused troubleshooting:
- reference/evidence-checklist.md
- reference/distro-matrix.md
- reference/rollback-patterns.md
- reference/verification-patterns.md
- If first token matches a command, load its reference file and follow it.
Command menu
If no argument is provided, first ask the run-context questions from Setup step 0, then show this table and ask what to run.
| Command |
Focus |
Typical checks |
triage [symptom] |
General incident intake |
scope, impact, timeline, recent changes |
boot [symptom] |
Boot/login/startup |
bootctl/grub, journal, targets, drivers |
network [symptom] |
Connectivity and DNS |
link, routes, resolver, firewall, MTU |
packages [symptom] |
Package/update errors |
repo health, locks, conflicts, signatures |
virtualization [symptom] |
Hypervisors and VMs |
kvm modules, libvirt units, nested virt, guest boot |
storage [symptom] |
Disk and filesystem |
usage, inode pressure, fs errors, mounts |
performance [symptom] |
CPU/memory/io bottlenecks |
pressure, hot processes, io wait |
desktop [symptom] |
GUI/session/media/input |
display manager, compositor, pipewire |
server [symptom] |
Services and remote access |
systemd units, ports, auth, limits |
immutable [symptom] |
ostree/snapshots/declarative |
deployment status, rollback/rebase |
security [symptom] |
auth/policy failures |
sudo/polkit, SELinux/AppArmor, SSH |
containers [symptom] |
Distrobox/Podman/Docker issues |
runtime, namespace, cgroup, bind mounts |
kernel [symptom] |
kernel modules/drivers/crashes |
dmesg, module state, taint, firmware |
logs [symptom] |
log-centric diagnostics |
journal slicing, service pivots, correlation |
If first word matches a command, focus the workflow on that area.
If not, treat the full input as a symptom and run triage.
References
Command references:
- reference/triage.md
- reference/boot.md
- reference/network.md
- reference/packages.md
- reference/virtualization.md
- reference/storage.md
- reference/performance.md
- reference/desktop.md
- reference/server.md
- reference/immutable.md
- reference/security.md
- reference/containers.md
- reference/kernel.md
- reference/logs.md
Shared references:
- reference/evidence-checklist.md
- reference/distro-matrix.md
- reference/rollback-patterns.md
- reference/verification-patterns.md
Output contract
For each troubleshooting run, provide:
- Diagnosis: most likely root cause, with confidence level
- Immediate fix: minimal-risk steps
- Durable fix: long-term correction
- Rollback: exact undo path
- Verification: commands and expected healthy signals
- Incident doc: create or update a concise Markdown report under
${LINUX_TROUBLESHOOTER_DOCS_DIR:-$HOME/docs} before the final response
Also state the selected target device and execution mode in the final response and incident doc. For fix commands, distinguish commands already run by the AI from commands the user still needs to run manually.
Use the bundled helper from the active skill checkout when available:
bash scripts/new-incident-doc.sh "<topic>" <<'EOF'
# Incident: <topic>
## Diagnosis
## Immediate fix
## Durable fix
## Rollback
```bash
```
## Verification
```bash
```
EOF
If the helper is not available in the active harness copy, write the same report directly to ${LINUX_TROUBLESHOOTER_DOCS_DIR:-$HOME/docs}/$(date +%F)-<slug>.md. Include the report path in the final answer. If the filesystem blocks writing the report, state that explicitly and provide the intended contents.
If information is missing, ask focused questions before applying risky changes.
1---2name: linux-troubleshooter-23description: Use when troubleshooting Linux issues across distro families and deployment models, including mutable and immutable systems, desktop and server environments.4version: 2.2.25user-invocable: true6argument-hint: "[triage|boot|network|packages|virtualization|storage|performance|desktop|server|immutable|security|containers|kernel|logs] [symptom]"7license: Apache-2.08---91011Troubleshoots Linux incidents with a distro-aware, evidence-first workflow for mutable and immutable systems, desktop and server roles, and containerized workflows.1213## Scope1415Use this skill for:1617- Boot failures, degraded services, and login issues18- Network and DNS failures19- Package/update/rollback problems20- Desktop stack issues (Wayland/X11, audio, GPU, input)21- Server incidents (SSH, firewall, daemon failures, disk pressure)22- Immutable systems (rpm-ostree, transactional-update, NixOS)23- Container stack issues (Distrobox, Podman, Docker, cgroups, namespace boundaries)24- Virtualization stack issues (KVM/libvirt, QEMU, VirtualBox, VMware, nested virtualization)25- Kernel/driver faults and log-heavy debugging workflows2627## Safety rules28291. Evidence before changes. Reproduce, gather logs, then fix.302. Prefer reversible actions first.313. Never run destructive commands unless explicitly requested.324. Ask before rebooting, reimaging, repartitioning, or data migration.335. For production servers, prioritize minimal-impact mitigation first.346. Before applying any fix command, confirm whether the user wants the AI to run it or wants to run it themselves.357. When unsure, stop and ask one focused question before risky changes.368. Never ask the user to paste passwords, PINs, recovery keys, tokens, or other secrets into chat. If a privileged command needs authentication and the execution harness supports an interactive terminal, run it with a TTY so sudo/polkit/SSH can read the secret locally from the prompt. If the user accidentally pastes a secret into chat, do not repeat it, store it, or use it; tell the user to enter secrets only in the local prompt.3738## Authentication for privileged commands3940When the user chooses AI-runs-approved-fixes and a command requires privilege:4142- Prefer the harness/tool option that allocates an interactive TTY, so `sudo`, fingerprint, polkit, or SSH password prompts are handled outside chat.43- Do not use `sudo -S`, askpass wrappers, environment variables, shell history, temporary files, or chat-provided secrets to pass passwords.44- If authentication times out or the user interrupts it, check for partially completed work before retrying.45- If TTY authentication is unavailable or repeatedly fails, switch to user-runs-fixes mode for that command and provide the exact command for the user to run manually.46- After an interrupted privileged operation, verify the system state before continuing, especially for operations that can leave services stopped or devices inactive.4748## Setup (always run first)49500. Establish run context before diagnostics. If the user has not already answered, ask:5152- **Target device**: main system/host, current sandbox/container, or another device over SSH?53- **Execution mode**: should the AI run approved fix commands, or should it provide commands for the user to run manually?5455If the target is another device over SSH, ask for the SSH target string and do not run local diagnostics as if they describe the remote device. If the user chooses manual execution, gather read-only evidence when possible and present fix commands without running them.56571. Run mode detection on the chosen target:5859```bash60uname -a61cat /etc/os-release62systemd-detect-virt || true63ps -p 1 -o comm=64```65662. Classify:6768- **Family**: Debian/Ubuntu, Fedora/RHEL, Arch, openSUSE, Alpine, NixOS, other69- **Model**: mutable or immutable70- **Role**: desktop, server, mixed71- **Init**: systemd or alternative72- **Container context**: host, container, nested container73- **Target**: local host, current sandbox/container, or SSH remote74- **Execution mode**: AI-runs-approved-fixes or user-runs-fixes75763. Load prior incident context from `${LINUX_TROUBLESHOOTER_DOCS_DIR:-$HOME/docs}` when available.7778Use prior docs as context, not as proof. Prefer recent and topic-relevant Markdown files, especially incident reports created by this skill. Keep this selective:7980```bash81find "${LINUX_TROUBLESHOOTER_DOCS_DIR:-$HOME/docs}" -maxdepth 1 -type f -name '*.md' -printf '%T@ %p\n' 2>/dev/null | sort -nr | head -2082```8384Then search/read only likely relevant files, using filenames, headings, and keywords from the current symptom, service names, device names, package names, and error text. For example:8586```bash87rg -n -i 'keyword|service|device|error' "${LINUX_TROUBLESHOOTER_DOCS_DIR:-$HOME/docs}" 2>/dev/null88```8990Summarize any relevant prior findings, fixes, rollback notes, and verification results before deciding on a new fix. Do not bulk-load unrelated notes or treat stale docs as current system state.91924. Load these shared references before focused troubleshooting:9394- [reference/evidence-checklist.md](reference/evidence-checklist.md)95- [reference/distro-matrix.md](reference/distro-matrix.md)96- [reference/rollback-patterns.md](reference/rollback-patterns.md)97- [reference/verification-patterns.md](reference/verification-patterns.md)98995. If first token matches a command, load its reference file and follow it.100101## Command menu102103If no argument is provided, first ask the run-context questions from Setup step 0, then show this table and ask what to run.104105| Command | Focus | Typical checks |106|---|---|---|107| `triage [symptom]` | General incident intake | scope, impact, timeline, recent changes |108| `boot [symptom]` | Boot/login/startup | bootctl/grub, journal, targets, drivers |109| `network [symptom]` | Connectivity and DNS | link, routes, resolver, firewall, MTU |110| `packages [symptom]` | Package/update errors | repo health, locks, conflicts, signatures |111| `virtualization [symptom]` | Hypervisors and VMs | kvm modules, libvirt units, nested virt, guest boot |112| `storage [symptom]` | Disk and filesystem | usage, inode pressure, fs errors, mounts |113| `performance [symptom]` | CPU/memory/io bottlenecks | pressure, hot processes, io wait |114| `desktop [symptom]` | GUI/session/media/input | display manager, compositor, pipewire |115| `server [symptom]` | Services and remote access | systemd units, ports, auth, limits |116| `immutable [symptom]` | ostree/snapshots/declarative | deployment status, rollback/rebase |117| `security [symptom]` | auth/policy failures | sudo/polkit, SELinux/AppArmor, SSH |118| `containers [symptom]` | Distrobox/Podman/Docker issues | runtime, namespace, cgroup, bind mounts |119| `kernel [symptom]` | kernel modules/drivers/crashes | dmesg, module state, taint, firmware |120| `logs [symptom]` | log-centric diagnostics | journal slicing, service pivots, correlation |121122If first word matches a command, focus the workflow on that area.123If not, treat the full input as a symptom and run `triage`.124125## References126127Command references:128129- [reference/triage.md](reference/triage.md)130- [reference/boot.md](reference/boot.md)131- [reference/network.md](reference/network.md)132- [reference/packages.md](reference/packages.md)133- [reference/virtualization.md](reference/virtualization.md)134- [reference/storage.md](reference/storage.md)135- [reference/performance.md](reference/performance.md)136- [reference/desktop.md](reference/desktop.md)137- [reference/server.md](reference/server.md)138- [reference/immutable.md](reference/immutable.md)139- [reference/security.md](reference/security.md)140- [reference/containers.md](reference/containers.md)141- [reference/kernel.md](reference/kernel.md)142- [reference/logs.md](reference/logs.md)143144Shared references:145146- [reference/evidence-checklist.md](reference/evidence-checklist.md)147- [reference/distro-matrix.md](reference/distro-matrix.md)148- [reference/rollback-patterns.md](reference/rollback-patterns.md)149- [reference/verification-patterns.md](reference/verification-patterns.md)150151## Output contract152153For each troubleshooting run, provide:1541551. **Diagnosis**: most likely root cause, with confidence level1562. **Immediate fix**: minimal-risk steps1573. **Durable fix**: long-term correction1584. **Rollback**: exact undo path1595. **Verification**: commands and expected healthy signals1606. **Incident doc**: create or update a concise Markdown report under `${LINUX_TROUBLESHOOTER_DOCS_DIR:-$HOME/docs}` before the final response161162Also state the selected **target device** and **execution mode** in the final response and incident doc. For fix commands, distinguish commands already run by the AI from commands the user still needs to run manually.163164Use the bundled helper from the active skill checkout when available:165166````bash167bash scripts/new-incident-doc.sh "<topic>" <<'EOF'168# Incident: <topic>169170## Diagnosis171172## Immediate fix173174## Durable fix175176## Rollback177```bash178```179180## Verification181```bash182```183EOF184````185186If the helper is not available in the active harness copy, write the same report directly to `${LINUX_TROUBLESHOOTER_DOCS_DIR:-$HOME/docs}/$(date +%F)-<slug>.md`. Include the report path in the final answer. If the filesystem blocks writing the report, state that explicitly and provide the intended contents.187188If information is missing, ask focused questions before applying risky changes.