shell-integration
Procedure for building or auditing code that writes shell code for several shells or edits their startup files, such as a tool init command, a PATH or prompt…
от ocx-sh★ 20 звёзд на GitHub
Установить shell-integration в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
shell-integration
An emitter is code that writes text another shell will run, and an rc editor is code that
rewrites a file a user owns. Both fail where nobody tests: on the fifth quote character, on a
CRLF profile, on a user's existing hook, on the second run. This skill carries the procedure
only. The standards live in the shell-quality rule (emit.md, fish.md, nushell.md,
elvish.md, zsh.md) and the powershell-quality rule (encoding.md), and this skill cites
them by ID. It ships the harness kit that goes red on each defect, because linters read none of
these strings.
Every result here was measured on 2026-10-11 on bash 3.2 to 5.3, zsh 5.0.8 to 5.9, dash, busybox
ash 1.37, fish 3.6.0 to 4.9.3, nushell 0.105.1 to 0.116.0, elvish 0.21.0, PowerShell 7.4.7 to 7.6.2
and Windows PowerShell 5.1.26100.9444. macOS and BSD are unverified: read only. A command marked
"translated 2026-10-11, re-watch pending" was not run on that version.
Contents: Scope · Consent · Step 0: inventory · Step 1: quoters · Step 2: refuse · Step 3: round trip · Step 4: rc files · Step 5: hooks · Step 6: completions · Step 7: undo · Batch · The receipt · MUST rows · SHOULD rows · What agents get wrong
| Read | When |
|---|---|
| references/harnesses.md | Before running anything: usage, expected red and green, gaps |
| references/roundtrip.py | Step 3: reference quoters, or your emitter through --shim, over corpus.txt |
| references/rc/check-rc-edit.sh | Step 4: apply an rc editor twice on LF, CRLF, symlink and mode |
| references/hooks/hook-harness.py | Step 5: bash, zsh, fish, nu, elvish hooks beside a user hook |
| references/pwsh/hook-case.ps1 | Steps 2, 4, 5: the PowerShell probes in pwsh/ |
| references/completions/readback-bash.sh | Step 6: one read-back script per shell, samples/, help-payloads.txt |
| references/batch/batch-set.py | Batch: the cmd.exe matrix, with plant.log and twin.log |
Scope
Steps 0 to 3 and 7 bind a command that prints shell text (SH-EMIT-01 to 15). Step 4 binds an
installer or setup command that edits rc files (SH-EMIT-16 to 23, 51). Step 5 binds prompt,
directory and pre-exec hooks (SH-EMIT-24 to 29, 42 to 47), Step 6 completion generators and
registration (SH-EMIT-33 to 41), and the Batch step a cmd.exe emitter (SH-EMIT-48 to 50). Out of
scope: quoting inside a script for itself (SH-EXP), installer flow (installer-script), the sh
floor (SH-DIAL) and PowerShell source policy (PS-ENC, PS-COMPAT).
Consent and a throwaway HOME
Every harness runs in a temp directory it creates and removes, with HOME and the XDG variables
pointed at it. Run the emitter under test the same way and never aim an rc editor at the real
HOME. Changing a user's real startup file needs the user's consent: print the block, the target
file and the removal command first, write only on a yes, and offer --dry-run and an opt-out
(SH-EMIT-21). Hook and completion text is silent, because it runs in every session (SH-EMIT-22).
Step 0: inventory the targets
Order of work: this step, quoters and refusals (1 to 3), rc files (4), hooks (5), completions (6),
then undo (7). Run each harness on the oldest and the newest interpreter you can install, run each
plant once in your own environment to prove the harness goes red there, and treat a missing
interpreter as a gap, never a pass. A docker image gives an old version, with the fixtures directory
mounted at the same path, no :ro, and -t for fish, nu and elvish (references/harnesses.md).
Green lint is necessary and never sufficient, because ShellCheck 0.11.0 reads no Rust, Go or Python
string literal. Run shellcheck -s sh over the emitted text and PSScriptAnalyzer 1.25.0 with
PSUseCompatibleSyntax for 5.1 over emitted PowerShell (SH-EMIT-15).
List every file that writes shell text or startup files, then fill one row per target shell and quoting context. A missing row is a missing quoter.
for t in git xargs grep; do command -v "$t" >/dev/null 2>&1 || echo "PREFLIGHT: $t missing"; done; git rev-parse --is-inside-work-tree >/dev/null 2>&1 || echo "PREFLIGHT: no usable git work tree" # vd-ok: xargs here is a tool name, not an invocation
git ls-files -z --cached --others --exclude-standard -- '*.rs' '*.go' '*.py' '
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/batch/batch-set.py
- references/batch/plant.log
- references/batch/twin.log
- references/completions/ascii-check.sh
- references/completions/help-payloads.txt
- references/completions/lazy-dir.sh
- references/completions/native-fallback.ps1
- references/completions/ptydrive.py
- references/completions/readback-bash.sh
- references/completions/readback-elvish.sh
- references/completions/readback-fish.fish
- references/completions/readback-nu.sh
- references/completions/readback-pwsh.ps1
- references/completions/readback-zsh.zsh
- references/completions/samples/completer-plant.nu
- references/completions/samples/completer-twin.nu
- references/completions/samples/demo-trunc.bash
- references/completions/samples/demo.bash
- references/completions/samples/demo.elv
- references/completions/samples/demo.fish
- references/completions/samples/demo.nu
- references/completions/samples/demo.zsh
- references/corpus.txt
- references/harnesses.md
- references/hooks/hook-harness.py
- references/pwsh/dir-case.ps1
- references/pwsh/dir-guard.ps1
- references/pwsh/env-empty.ps1
- references/pwsh/hook-case.ps1
- references/pwsh/profile-edit.ps1
- references/rc/check-rc-edit.sh
- references/rc/plant-append.sh
- references/rc/plant-awk.sh
- references/rc/plant-rename.sh
- references/rc/rc-edit.sh
- references/roundtrip.py
FAQ
Что делает скилл shell-integration?
Procedure for building or auditing code that writes shell code for several shells or edits their startup files, such as a tool init command, a PATH or prompt hook, an rc or profile block, a generated completion script or a cmd.exe Batch line. Covers one quoter per target, refusing values a target cannot carry, the 36-case hostile round trip, rc file choice and byte-safe edits, append-safe hooks, completion registration proven by read-back, undo, and a harness kit run on the oldest and newest interpreter. Use when someone asks to "generate shell code from Rust, Go or Python", "write tool init for bash zsh fish nu elvish", "add a PROMPT_COMMAND or precmd hook", "edit .bashrc or a PowerShell profile", "install shell completions", "quote a value for fish, nu, elvish or pwsh", "audit an env emitter", "completions installed but nothing happens". Not for scripts that quote for themselves (shell-port), failing scripts (shell-diagnose) or curl-to-sh installers (installer-script).
Как установить скилл shell-integration?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл shell-integration запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
doc-coauthoring
AnthropicGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
academy-guide
AnthropicStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
internal-comms
AnthropicA set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
skill-development
AnthropicThis skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…