"Verify the bash-format hook's runtime prerequisites and configuration for this repository. Use when: 'set up bash-format', 'configure bash-format', 'is bash-format working', shell lint or formatting silently isn't happening, or the hook reported a missing prerequisite. Actions: check (read-only verification, default) | apply (resolve what check found). Re-runnable and safe."
Resources
1Install
npx skillscat add melodic-software/claude-code-plugins/plugins-bash-format-skills-setup Install via the SkillsCat registry.
Pre-computed context
check's tool probes ran at load time. Read these rows instead of re-issuing them; each shows the
tool's path when present, or absent when missing:
jq: !{ command -v jq 2>/dev/null || echo "absent"; }node: !{ command -v node 2>/dev/null || echo "absent"; }shellcheck: !{ command -v shellcheck 2>/dev/null || echo "absent"; }shfmt: !{ command -v shfmt 2>/dev/null || echo "absent"; }
A row reading [shell command execution disabled by policy] carries no result: run that tool'scommand -v probe via Bash instead.
Purpose
Thin check-centric setup per the uniform setup contract (docs/plugin-philosophy.md
"Setup is explicit and repeatable" in the marketplace repository): check inspects and
reports, apply resolves. This plugin owns no consumer-project configuration. Linting
rules come from the repository's own .shellcheckrc, formatting from its .editorconfig,
and the only tunables are the native userConfig options bash_format_enabled andbash_format_lint_gitignored. Every prerequisite is a PATH
binary the plugin never bundles, and the plugin never installs system packages, so apply
is guidance-only with no write path. It never modifies the repository, user settings, or
the plugin cache.
Action routing: no argument or check runs the check; apply runs the check first, then
offers remediation guidance. Both are non-interactive. Never prompt when the action is given.
check (read-only)
The hook script (${CLAUDE_PLUGIN_ROOT}/hooks/bash-format.sh) is the single source of truth
for what it requires and how it resolves things.
Read it first. Probe what it actually does, don't recite this file. Then read the
pre-computed tool rows, run the remaining probes via Bash, and report a PASS/FAIL/INFO
table with one remediation line per FAIL. Do not modify anything.
The lint pass and the format pass are independent; report each separately. A skip notice
appears once per session and agent, renewed every eighth skip (README Requirements).
When the plugin's toggle is disabled, every prerequisite absence downgrades from FAIL to
INFO. The hook exits through its enabled-gate before probing anything, so a deliberately
disabled plugin is not broken. Report the probes informationally and note that re-enabling
restores the FAIL semantics.
- Bash version. Check against the hook's documented floor (README Requirements),
noting any features the hook degrades without (for example telemetry'sEPOCHREALTIME,
a Bash 5.0+ builtin). node. The pre-computednoderow. FAIL if absent: every hook row launches throughnode hooks/exec-bash.mjs, so withoutnodethe hook does not launch and no shell edit is
linted or formatted (README Requirements).jq. The pre-computedjqrow. FAIL if absent: the hook then skips with a visible
notice instead of running either pass.shellcheck(lint pass). The pre-computedshellcheckrow. FAIL if absent: the lint pass
skips with a visible notice.shfmt(format pass). The pre-computedshfmtrow. Its FAIL/INFO status depends on the.editorconfigopt-in below, because the format pass runs only when the repo has opted
in:- opted in AND
shfmtabsent → FAIL: the format pass skips with a visible
notice. - not opted in → INFO regardless of
shfmt: the format pass stays quiet by design (the
repo chose not to format), so a missingshfmtis not a defect here.
- opted in AND
.editorconfigshell opt-in. Mirror the hook's opt-in logic
(shell_editorconfig_opt_in/section_applies_to_shell), not merely "does an.editorconfigexist". The opt-in is an EditorConfig section that names shell files:
a shell glob such as[*.sh],[*.bash], or[*.{sh,bash}](including path-prefixed
forms like[**/*.sh]), discovered by walking up from the file's directory to the repo
root and stopping at aroot = trueconfig. A bare[*]catch-all does NOT count (most
repos only set line-ending / charset properties there). Path-only sections like[scripts/**]do NOT count either. Report as INFO: whether a governing shell section
exists and therefore whether the format pass is active. If none exists, INFO-note the
consequence per the hook's logic: shell files are left unformatted rather than rewritten
to shfmt's built-in defaults..shellcheckrc. INFO: ShellCheck auto-discovers.shellcheckrcby walking up from
the file's directory. Report whether one exists; its absence is not a FAIL (ShellCheck
applies its own defaults).- Hook options. Report both effective values.
${user_config.bash_format_enabled}
(unexpanded or empty means the manifest defaulttrue; any value other thantrue
disables the hook).${user_config.bash_format_lint_gitignored}(unexpanded or empty means
the manifest defaultfalse): unless it istrue, an edit to a file the repository
gitignores is silently skipped, so a user asking why.work/scratch.shwas not formatted
gets this answer. - Hook registration. INFO: confirm the plugin is enabled for this project
(/plugin→ Installed) rather than parsing settings files. - Project scope. INFO: when
CLAUDE_PROJECT_DIRis set, the hook acts only
on shell files inside it (symlink-resolved membership guard in the shared hook
library, aware of Windows 8.3 short-name spellings of in-project paths, a
per-volume property; only volumes with 8.3 generation enabled produce them);
a.sh/.bashfile written outside the project (temp/scratchpad
dirs) is silently skipped. No lint, no format, no notice. The OS temp tree
counts as outside even when it sits underCLAUDE_PROJECT_DIR, unless the
project root itself lives under temp. When
CLAUDE_PROJECT_DIRis unset (e.g. some headless-psessions) the guard
is skipped and any existing edited file is processed. Report this so a green
checkis not read as "every shell edit anywhere is covered". - Gitignored files. INFO: unless
bash_format_lint_gitignoredistrue, a file the
repository gitignores (git check-ignore) is silently skipped: no lint, no format, no
notice. A tracked file that matches an ignore pattern stays in scope, and when git cannot
decide (git absent, no repository, an error) the hook acts as before
(hook::gitignored_out_of_scopeinhooks/rewrite-guard.sh). Report the item 8 value
beside this.
When every probe passes, report the result with the scope caveats (items 10 and 11).
Never an unqualified "fully operational", which would imply out-of-project shell
edits are covered when they are deliberately skipped.
apply (idempotent)
Run check, then for each FAIL point at the resolution. This skill installs nothing:
- missing
shellcheck: install guidance from the README Requirements section
(the ShellCheck install guide); this
skill never installs system packages. - missing
shfmtwhile the repo opts in: install guidance
(shfmt); this skill never installs system packages. - missing
node/jq/ Bash: platform install instructions from the README Requirements section. - no shell
.editorconfigopt-in (and formatting is wanted): explain that adding a governing
shell section ([*.sh],[*.bash], or[*.{sh,bash}]) to an.editorconfigopts the
repo in. A bare[*]is not enough, but this skill does not write it..editorconfigis
cross-cutting (it governs every editor and tool in the repo), so the choice and the edit
belong to the consumer. - toggle off, or gitignored files wanted: reconfigure through Claude Code's native flow, per the marketplace's
plugin-reconfiguration convention
(https://github.com/melodic-software/claude-code-plugins/blob/main/docs/conventions/plugin-reconfiguration/README.md,
which owns the verified-version record): interactive/plugin configure bash-format@<marketplace>any time, or headlessclaude plugin install bash-format@<marketplace> -s <scope> --config bash_format_enabled=true
(or--config bash_format_lint_gitignored=true; repeatable per key). Against an already-installed plugin it printsalready installed
and still writes the value. Do not uninstall to reconfigure: that drops this plugin's
entire storedpluginConfigsentry, resetting every option in the README's Options reference
to its manifest default.-sdefaults touser; pass the scopeclaude plugin listreports
for this plugin, and run from that project's directory for aproject/localscope, or the
rerun adds a second install record at the scope passed and enables the plugin there; the
value itself always lands in user settings. A rejected value prints a warning yet exits 0,
so read the output. This skill never writes user settings orpluginConfigs. Afterwards reruncheckin a fresh session. The rendered${user_config.*}is injected at skill load and each hook receives itsCLAUDE_PLUGIN_OPTION_*from an environment fixed at session start, so a same-sessioncheckstill reports the OLD value; report the observed effective value, never an
unobserved change.
After pointing at a remediation, re-run the relevant check probe live via Bash (a pre-computed row
predates the remediation, so never re-read it) and report its actual result. Never claim resolved on
the reader's report that they installed something.
Re-running apply after everything passes changes nothing and reports "already configured".
What this skill does NOT do
- Run the linter or formatter. Editing any
.shor.bashfile exercises the hook
end-to-end. - Write the plugin cache, Claude Code user settings, or
pluginConfigs. Nor the repository,
including.editorconfig/.shellcheckrc. Every prerequisite is aPATHbinary or the
native toggle, so remediation is guidance only. - Download or execute tools during
checkbeyond the read-onlycommand -vpresence probes.
Gotchas
ENAMETOOLONGwhen grepping the plugin cache. Installed plugins run from a
deeply nested, cache-isolated path. Piping agrep/rgover the long absolute
path tohooks/hook-utils.sh(or another bundled file) can spawn-fail withENAMETOOLONGon some hosts. Read the file directly (orcdinto the plugin
hooks dir first and grep a short relative path) rather than passing the full
cache path on the command line.checkPASS ≠ every shell edit is covered. WhenCLAUDE_PROJECT_DIRis set
the hook is project-scoped (probe 10): shell files written outside it are silently
skipped, so a fully greencheckstill does not cover out-of-project edits. (WhenCLAUDE_PROJECT_DIRis unset the scoping does not apply. See probe 10.)shfmtFAIL is opt-in-conditional. A missingshfmtis only a FAIL when an.editorconfigsection governs shell files; without that opt-in it is INFO, not
a defect. Resolve the.editorconfigopt-in state before callingshfmta failure.