Command Palette

Search for a command to run...

Назад к скиллам
скилл № 13611

shell-diagnose

Symptom-routed diagnosis of a shell script, CI step or PowerShell installer that is already failing, routing a failure on exit code, first stderr line and…

БесплатноБез исполняемых скриптов
ocx-shот ocx-sh★ 20 звёзд на GitHub

Установить shell-diagnose в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

shell-diagnose

A shell script, CI step or PowerShell installer is already failing. This skill routes the symptom to the measurement that names the cause. It carries the procedure only. The standards live in the shell-quality and powershell-quality rules, and this skill cites them by ID.

Every error text and status was captured on 2026-10-11 on dash 0.5.12, busybox 1.37, bash 3.2 to 5.3, zsh 5.0.8 to 5.9, nu 0.105.1 and 0.116.0, Windows PowerShell 5.1.26100, and PowerShell 7.4.7 and 7.6.6 (7.4 reaches end of support 2026-11-10). macOS and BSD behaviour is unverified: read only and the rows that touch it say so. Depth is in references/, read only when a step points to it. The cells mode, cr, pipefail-or and non-ascii were run on 2026-10-11 over twelve third-party trees (plant red, twin green, hits read).

Contents: Consent first · Stop condition · Never edit the check · Step 0: interpreter identity · Route by three facts · A. Exit 126, 127 or 2 on a file that exists · B. Dialect · C. Bash 3.2 · D. Statuses above 128 · E. zsh · F. PowerShell · G. Nushell · H. Hosts, CI and installers · The receipt · MUST rows · What agents get wrong

Read When
references/symptom-text.md A pasted message that differs from the table: every captured variant per launcher and version, the 126 wording on 23 interpreters, the bash 3.2 construct texts
references/signal-statuses.md Any exit above 128, or a fix that compares a signal status to a literal
references/nu-churn.md A nushell error id or warning, and what nu-check can and cannot see
references/windows-and-ci.md exit under irm | iex, a Git Bash hang, a Taskfile panic, a container-job step, BusyBox wget

Consent first

Touch only a process the operator has named as theirs to touch. Absent consent, print the command and its cost from this table and stop.

Action Cost to the target
kill -TERM or kill -KILL on a named process Ends it, and KILL destroys the evidence
Running the failing script or installer again It can write to HOME, rc files and /usr/local. Run it in a throwaway container, or under env -i with a throwaway HOME (SH-CORE-16)
docker run of a version image Pulls the image. The mount is read-only, so a script that writes to its directory must be copied first

Anything run on a fixture, a copy or a throwaway container needs no consent. Prefer those.

Stop condition

Stop when all four hold, and do not keep measuring after.

  1. The root cause is named as a mechanism. "The kernel looks for the interpreter /bin/sh followed by a CR byte" is a cause. "A bad shebang" is a category.
  2. The measurement that proved it is pasted: the command, the exit status and the verbatim first stderr line.
  3. Either the fix was watched to clear the symptom (the same measurement, before and after, both pasted), or the cause is a named gap with the interpreter version and the surface that would settle it.
  4. Nothing outside the cause was changed to reach step 3.

Never edit the check

Making the symptom disappear by changing the measurement is the failure this skill exists to prevent. Each of these is a violation, not a fix.

Edit Why it is a violation Rule
|| true after set -o pipefail Dash 0.5.12-2 and posh abort on the option error before || true runs SH-DIAL-07
set +e, 2>/dev/null on a probe, or || true on a command whose failure mattered The failure is still there. Only the report is gone SH-CORE-01
A # shellcheck disable= with no same-line reason The next reader cannot tell a verified exception from a silenced bug SH-GATE-05
Flipping #!/bin/sh to bash and leaving the Kind: header alone The header and the shebang now disagree, and the dialect error moves SH-DIAL-03
shell: bash added to a step to hide a dialect error The step passes on the runner and fails where bash is absent SH-CORE-01
A file-wide setopt nonomatch to clear a zsh no matches found It changes every glob in the file SH-ZSH-05
chcp 65001 or a console font change for garbled PowerShell 5.1 text The file was decoded as ANSI before the console saw a byte PS-ENC-01
A timeout around a hanging cmd /c The hang is now a failure. The cause is the path conversion SH-CORE-01

If the only fix available is one of these, record it as a g

Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • references/nu-churn.md
  • references/signal-statuses.md
  • references/symptom-text.md
  • references/windows-and-ci.md

FAQ

Что делает скилл shell-diagnose?

Symptom-routed diagnosis of a shell script, CI step or PowerShell installer that is already failing, routing a failure on exit code, first stderr line and interpreter identity to the one measurement that names its cause. Covers exit 126 or 127 on a file that exists, a CR byte in a shebang, a pipefail abort on dash, bash 3.2 constructs, exit 141, 143, 269 or 397, an empty array under set -u, zsh unmatched globs, PowerShell 5.1 parse errors, exit under irm piped to iex, nushell removed commands, a cmd /c hang in Git Bash, and busybox wget flags. Use when someone reports "Permission denied", "bad interpreter", "required file not found", "Illegal option -o pipefail", "[[: not found", "bad substitution", "unbound variable", "no matches found", "The token '&&' is not a valid statement separator", "works locally but fails in CI" or an exit status above 128. Not for writing portable shell (shell-quality), a bash 3.2 port (shell-port), shell integration (shell-integration) or an installer (installer-script).

Как установить скилл shell-diagnose?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл shell-diagnose запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить shell-diagnose с