Skip to content
Back to skills

Setup

ASecurity

Verify disk-hygiene prerequisites, platform posture, kill switch, and old policy files; check (read-only) or apply (remediation/migration).

  • 34 stars
  • 0 votes
  • 0 copies
  • 9 views
  • Added September 2, 2026
ai-agentspythonshellbashnodegit

Works with

  • claude code
  • cli

Security analysis

A100/100

Pro scans all 8 files and shows the line behind each finding

Scanned December 3, 2026

npx -y skills add melodic-software/claude-code-plugins --skill setup --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Setup?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Setup
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/melodic-software-setup-f9fa2677/badge)](https://www.skillsdirectory.com/skills/melodic-software-setup-f9fa2677)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
description: "Verify disk-hygiene prerequisites, platform posture, kill switch, and old policy files; check (read-only) or apply (remediation/migration)."
argument-hint: "[check|apply]"
user-invocable: true
disable-model-invocation: true
---

# Setup

## 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. Targets and modes arrive as `/disk-hygiene:clean` arguments. The
tunables are two `userConfig` options, the `disk_hygiene_enabled` toggle and `policy_file`,
plus the standing policy layers. `apply` writes nothing and installs nothing; it points at
the remediation for each FAIL.

Action routing: no argument or `check` runs the check; `apply` runs the check first, then
points at each remediation. Neither prompts.

## `check` (read-only)

The clean skill and its bundled scripts (`${CLAUDE_PLUGIN_ROOT}/skills/clean/`) are the
single source of truth for what the plugin requires per platform.

**Read it first.** Probe what it actually does, don't recite this file. Then run each probe via
Bash and report a PASS/FAIL/INFO table with one remediation line per FAIL. Do not modify anything.

Read engine files (`hygiene.py` and the other scripts under `skills/clean/scripts/`) with the
Read or Grep tool, or with the one plain reader command step 2 names, run alone with its
absolute path. Never name an engine file inside a compound shell line: no `cd`, variable
assignment, `$` expansion, `;` or `&&` chain around it. The plugin's own guard denies such a
line as "not one plain literal invocation"; it lets a line through only when every command in
it is a reader it lists (`destructive_guard.py` `_bash_reads_only`).

The toggle is an audit-only kill switch, not a short-circuit: the guard registers
unconditionally and still scans with the toggle off, so most prerequisite absences keep their
FAIL semantics regardless of the toggle. Only the execution-tier tools the audit lane never
invokes (step 4's `lsof`-class probes) downgrade from FAIL to INFO when the toggle is
disabled, report those informationally and note that re-enabling restores the FAIL semantics.
A missing `git` keeps its step-3 verdict either way: the audit lane itself calls it, and its absence degrades the VCS-tracked-content evidence the plugin's fail-closed posture depends on.

Every step-1 and step-2 failure likewise stays FAIL with the toggle disabled.
Audit-only mode is *enforced by* the guard, every guard surface
depends on a Python 3 interpreter resolving (every surface through
`hooks/run-python-hook.sh`, which tries `python3`, then `python`, then `py -3`), and a
guard that never runs can neither read nor enforce the configured `false`, so the fail-open
is most dangerous in exactly this
configuration. That covers an **exhausted** interpreter ladder, every rung absent, a stub, or
`indeterminate`, a rung whose version probe then fails to launch at all (a corrupt or
zero-length binary outside `WindowsApps`, a broken shim, a permission error), *and* an
interpreter that starts but reports a version below the parsed floor. It does **not** cover a
stubbed `python3` alongside a working `python` or `py -3`: the launcher skips the stub, every
guard launches, and that is a WARN (see step 2), not a failure to downgrade.
Launching the version probe proves only that something executes, not that it can run
the guard's own source: Python 3.6, for example, rejects the guard's
`from __future__ import annotations` and exits without a deny, which this plugin treats as the
same fail-open (what such an exit does to the call: [Other exit codes](https://code.claude.com/docs/en/hooks#other-exit-codes)). Unproven guard execution
fails closed like every other guard-relevant unknown in this plugin.

1. **Node exec-form launcher registration**. All three registrations (both wired hooks in
   `hooks/hooks.json` and the skill-scoped belt in `skills/clean/SKILL.md` frontmatter) must set
   `command` to `node` and put `hooks/exec-bash.mjs`, then `hooks/run-python-hook.sh` and that
   script's arguments, in `args`. `node` resolves to `node.exe`. FAIL if `command` is bare `bash`,
   `sh`, or `python3`, or if the script path is `command` with no `args`: on Windows bare `bash` is
   the WSL relay and a `.sh` path is not a spawnable executable, so the guard cannot start; this
   plugin treats a guard that cannot start as enforcing nothing (what a failed launch does to the
   call: the pointer below). Also FAIL if
   `exec-bash.mjs` or the launcher is missing.
   - **Pointer**: when checking how exec form spawns `command`, or what a hook that fails to start
     does to the call, fetch [Exec form and shell form](https://code.claude.com/docs/en/hooks#exec-form-and-shell-form)
     and [Block the action when a hook fails](https://code.claude.com/docs/en/hooks#block-the-action-when-a-hook-fails)
     live.

   **`node` and bash**, probed with the Bash tool, not through the launcher. FAIL if
   `command -v node` finds nothing: every guard and detector row runs `node`, so none launches and no guard
   is enforced. FAIL if no bash resolves in the launcher's own order, which `resolveBash` in
   `${CLAUDE_PLUGIN_ROOT}/hooks/exec-bash.mjs` sets per platform (read it; do not recite it). On
   Windows the remediation is either `CLAUDE_CODE_GIT_BASH_PATH`, a Git for Windows install, or a
   `bash.exe` on `PATH` outside `System32`, `Sysnative` and `WindowsApps`; elsewhere, a `bash` on
   `PATH`. Both FAILs stay FAIL with the toggle disabled, like the interpreter ladder. State the
   consequence in the remediation: the hook fails to launch, the guard is not enforced, and the call
   proceeds; what the user and the model see then is in the Other exit codes record below. A missing `node` cannot be
   reported by the launcher or the Stop detector, which both need `node` to start. `node` on
   `PATH` is a prerequisite separate from Claude Code itself.
   - **Pointer**: when checking whether Claude Code ships or needs Node, fetch
     [Install with npm](https://code.claude.com/docs/en/setup#install-with-npm) live; for the
     failed-launch notice, [Other exit codes](https://code.claude.com/docs/en/hooks#other-exit-codes).
2. **Python floor on `PATH`**. The interpreter used by scanning, validation, the
   guard, and cleanup. (The guard registers on two surfaces: a plugin-level engine gate
   that acts only on engine-referencing commands, and the skill-frontmatter belt `/disk-hygiene:clean`
   arms (the clean skill's safety model holds how long the plugin counts on it; for how long a skill
   hook stays registered, fetch [Hooks in skills and agents](https://code.claude.com/docs/en/hooks#hooks-in-skills-and-agents)
   live). Both register unconditionally and resolve the kill switch by
   reading `disk_hygiene_enabled` from managed settings first, then the user `settings.json`.) The required version has one origin: the `MIN_PYTHON`
   constant in `${CLAUDE_PLUGIN_ROOT}/skills/clean/scripts/hygiene.py`, parse it from
   there with the Grep tool or this one command, alone on its line:
   `grep -m1 '^MIN_PYTHON' ${CLAUDE_PLUGIN_ROOT}/skills/clean/scripts/hygiene.py`. Probe the
   interpreter against that value in a separate call; do not
   recite a version number from this file or the README. FAIL if absent or older, naming
   the parsed floor in the remediation; the plugin never downloads a runtime. Report the
   absolute interpreter path (guarded engine calls must use the same absolute interpreter
   the guard reports. Bash aliases and functions cannot substitute).

   On Windows, confirm the name the guard resolves is real before anything executes it,
   including this floor check's own version probe. `python3` is the first rung of the ladder
   `hooks/run-python-hook.sh` walks for every guard surface, and on Windows that name can resolve
   to an App Execution Alias stub rather than an interpreter, so setup never executes it
   unclassified. The stub does not stop any guard by itself: the launcher skips it
   and falls through to `python`, then `py -3`.
   - **Pointer**: when checking what the alias stub does or how to clear it, fetch
     [Using Python on Windows: Troubleshooting](https://docs.python.org/3/using/windows.html#troubleshooting)
     live.

   **The ladder, not the first
   rung, is the verdict.** A host with real Python installed without "Add to PATH" but with the
   `py` launcher has a stubbed `python3` and a perfectly working guard; failing it would report a
   healthy install as broken and send the operator to reinstall Python. So the alias probe is
   **diagnostic input**. It says what the first rung is, and keeps setup from executing it,
   while the verdict comes from resolving the ladder and checking the selected interpreter
   against the parsed floor.
   Order of operations: (a) locate the resolution without executing it (`Get-Command python3`
   / `command -v python3`, locating is inspection; running is not); (b) classify it with the
   bundled inspect-only probe, launched via an interpreter that is not the bare name
   `python3` (`py -3`, `python`, or an absolute interpreter path, any interpreter already
   proven real):
   `"<python>" "${CLAUDE_PLUGIN_ROOT}/skills/setup/scripts/python3_alias_probe.py"`; if no
   such interpreter exists **or the one you chose emits no JSON verdict**, apply the probe's own
   portable signal directly in PowerShell. Proven real is not the same as able to run the probe:
   a pre-3.7 interpreter rejects its `from __future__ import annotations` and a legacy `python`
   2.x fails earlier still, each before anything is classified, so a machine whose only
   alternate launcher is Python 3.6 reaches the verdict through PowerShell, not by having no
   launcher at all. The signal: a zero-length file under a `WindowsApps` path component is the stub
   (`(Get-Item -Force (Get-Command python3).Source)` → `Length` 0 plus a `ReparsePoint`
   attribute); (c) resolve the ladder in the launcher's own order, skipping any rung the probe
   classified as a stub: `python3` only when its verdict is `ok`, then `python`, then `py -3`.
   The version probe may execute a rung only once that rung is not a stub, that is the whole
   point of (b), and it is why the bare name `python3` is never executed on a
   `store-alias-stub` verdict. Report the absolute path of the first rung that runs and meets
   the floor.

   **FAIL when the ladder is exhausted or below the floor**. No rung resolves, or the one that
   does reports a version under the parsed `MIN_PYTHON`. That is the real fail-open: the guard
   cannot run, and it emits neither exit 2 nor a `deny`. Distinguish the two for the remediation
   wording, an interpreter that starts and reports a version below the floor is a floor miss
   (name the parsed floor), one that fails to launch at all is an absent-interpreter failure
   (the plugin never downloads a runtime). Both keep the FAIL under a disabled toggle: a
   below-floor interpreter is not proven able to execute the guard's source, so audit-only mode
   is unenforceable there too. `indeterminate` on **every** rung is the same case, identity the
   probe could not read anywhere on the ladder is uncertainty about whether the guard can launch
   at all, and fails closed like every other guard-relevant unknown in this plugin.

   **PASS with a WARN when the ladder resolves a supported interpreter but `python3` is the
   stub.** Every guard launches, so nothing is failing open. State the residual plainly: the
   operator's own bare `python3` still reaches the stub, and guarded engine calls must use the
   absolute interpreter path reported above rather than that name. Offer clearing the stub as an
   optional tidy-up, not as a fix for a broken install: clear the stub (the pointer above has the
   steps) or put real Python ahead of WindowsApps on `PATH`. A bare `command -v python3` success is not evidence on its own.
3. **Git**. `command -v git`. Conditional per the README: optional for ordinary trees,
   required when a target contains or sits inside a Git worktree. Report presence as INFO
   with that conditionality stated; absence is only a FAIL for worktree-containing targets.
4. **Platform posture**. Detect the current OS family and report its documented lane per
   the README, keeping the audit and execution lanes visibly separate: Windows (full
   **audit**: `lstat` reparse + Win32, never UAC; engine **execution unsupported**.
   `preview` reports `execution-platform-unsupported` as a per-candidate blocker, removal is
   a manual, per-path Recycle-Bin handoff only after an execution request and explicit
   approval), Linux (full audit; execution when
   `/proc/self/mountinfo` is readable, `lsof` needed only for that optional execution
   lane, absent `lsof` is INFO with the reduced-capability note), macOS (audit/report
   only by design; manual Trash handoff only after an execution request and explicit approval. INFO, not a defect).
5. **Execution kill switch**. Resolve the effective `disk_hygiene_enabled` value
   deterministically; never present an assumed value as the configured one. Run the bundled
   probe with the step-2 interpreter:
   `"<python>" "${CLAUDE_PLUGIN_ROOT}/skills/setup/scripts/kill_switch_probe.py"`
   and report its `effective` value together with its `source` (`configured` vs `default`).
   When the probe says `degraded: true`, report that the configured value could not be read
   and that default `true` is being assumed, an assumption, never the configured value. The
   body token `${user_config.disk_hygiene_enabled}` is at most a cross-check: if it expanded
   to a boolean that contradicts the probe, report the discrepancy instead of silently
   preferring either channel (the probe sees user settings only; managed settings or a
   `--settings` flag can carry a value the probe cannot see).
6. **Plugin registration**. INFO: confirm the plugin is enabled for this project
   with `claude plugin list` rather than parsing settings files; read its output fields in
   [plugin list](https://code.claude.com/docs/en/plugins/cli-reference#plugin-list).

## `apply` (idempotent)

Run `check`, then for each FAIL point at the resolution. Every prerequisite is a system
tool or an OS capability, so `apply` installs nothing and writes nothing, it only points:

- missing/old Python: the platform's own install channel for the floor `check` parsed from
  the engine's `MIN_PYTHON`; never a plugin download.
- missing git (worktree targets): platform install instructions.
- missing `node` or no bash the launcher accepts: the platform's own install channel for Node.js
  or Git for Windows, or on Windows `CLAUDE_CODE_GIT_BASH_PATH` naming an existing `bash.exe`.
- toggle off: set `disk_hygiene_enabled` to `true` through Claude Code's native flow,
  interactively with `/plugin configure disk-hygiene@<marketplace>` or by a headless route, as the
  marketplace's plugin-reconfiguration convention gives them in
  [§ The routes](../../reference/plugin-reconfiguration.md#the-routes)
  (it owns the verified-version record). Apply the scope and failure-signal caveats in its
  [§ Caveats every setup skill's short form carries](../../reference/plugin-reconfiguration.md#caveats-every-setup-skills-short-form-carries).
  Read both sections and print what they give, the fallback route, its behavior on an
  already-installed plugin and the scope to pass included, rather than only naming them, and
  leave out the verified-version record.
  Never uninstall to reconfigure; that section links what an uninstall deletes. This skill never
  writes user settings or `pluginConfigs`. Afterwards rerun `check` in a **fresh session**, since a
  same-session `check` can still show the old value, and report the observed effective value,
  never an unobserved change.

  - **Pointer**: for the headless command's flags, how it reports a saved or refused value, and
    when a saved value applies, fetch
    [plugin CLI reference § plugin configure](https://code.claude.com/docs/en/plugins/cli-reference#plugin-configure)
    live.

Re-running `apply` after everything passes changes nothing and reports "already configured".

## What this skill does not do

- Run an audit or cleanup, that is `/disk-hygiene:clean`.
- Write the plugin cache, Claude Code user settings, or `pluginConfigs` directly. `policy_file`
  is set only through Claude Code's own configure route.
- Install any tool or runtime, during either `check` or `apply`, guidance only.

Files in this skill

  • SKILL.md14.2 KB
  • evals/evals.json4.1 KB
  • scripts/kill_switch_probe.py2.3 KB
  • scripts/kill_switch_probe.test.sh973 B
  • scripts/python3_alias_probe.py6.2 KB
  • scripts/python3_alias_probe.test.sh1.8 KB
  • scripts/test_kill_switch_probe.py9.5 KB
  • scripts/test_python3_alias_probe.py6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.