Skip to content
Back to skills

Setup

ASecurity

Verify python-format prerequisites and hooks (check [inspect]), or install ruff and git hooks (apply [install-ruff|install-git-hooks]).

  • 34 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 2, 2026
ai-agentspythongoshellbashnodegitperformancedocumentation

Works with

  • claude code
  • cli

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

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

Scanned December 4, 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-cca3f199/badge)](https://www.skillsdirectory.com/skills/melodic-software-setup-cca3f199)

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 python-format prerequisites and hooks (check [inspect]), or install ruff and git hooks (apply [install-ruff|install-git-hooks])."
argument-hint: "[check|apply] [inspect|install-ruff|install-git-hooks [scope=local|shared]]"
user-invocable: true
disable-model-invocation: true
allowed-tools:
  - "Bash(command -v jq*)"
  - "Bash(node \"${CLAUDE_PLUGIN_ROOT}/lib/git-hooks/install.mjs\" verify:*)"
  - "Bash(node ${CLAUDE_PLUGIN_ROOT}/lib/git-hooks/install.mjs verify:*)"
  - "Bash(node \"${CLAUDE_PLUGIN_ROOT}/lib/git-hooks/install.mjs\" inspect:*)"
  - "Bash(node ${CLAUDE_PLUGIN_ROOT}/lib/git-hooks/install.mjs inspect:*)"
  - "Bash(node \"${CLAUDE_PLUGIN_ROOT}/lib/git-hooks/install.mjs\" plan:*)"
  - "Bash(node ${CLAUDE_PLUGIN_ROOT}/lib/git-hooks/install.mjs plan:*)"
  - "Bash(sh \"${CLAUDE_PLUGIN_ROOT}/git-hooks/format.sh\" --resolve)"
  - "Bash(sh \"${CLAUDE_PLUGIN_ROOT}/git-hooks/format.sh\" --resolve:*)"
  - "Bash(sh ${CLAUDE_PLUGIN_ROOT}/git-hooks/format.sh --resolve)"
  - "Bash(sh ${CLAUDE_PLUGIN_ROOT}/git-hooks/format.sh --resolve:*)"
  - "Bash(sh \"${CLAUDE_PLUGIN_ROOT}/git-hooks/lint.sh\" --resolve)"
  - "Bash(sh \"${CLAUDE_PLUGIN_ROOT}/git-hooks/lint.sh\" --resolve:*)"
  - "Bash(sh ${CLAUDE_PLUGIN_ROOT}/git-hooks/lint.sh --resolve)"
  - "Bash(sh ${CLAUDE_PLUGIN_ROOT}/git-hooks/lint.sh --resolve:*)"
shell: bash
---

# Setup

## Pre-computed context

`check`'s `jq` probe ran at load time. Read this row instead of re-issuing it; it shows
the tool's path when present, or `absent` when missing:

- `jq`: !`command -v jq 2>/dev/null || echo absent`

A row reading `[shell command execution disabled by policy]` carries no result: run that tool's
`command -v` probe via Bash instead.

- **Pointer**: for the placeholder a skipped load-time command leaves, fetch
  [skills § Inject dynamic context](https://code.claude.com/docs/en/skills#inject-dynamic-context)
  live.
- **As of**: 2026-11-11
- **Recheck trigger**: the placeholder text changes.

## 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. Python formatting and linting are two concerns. The hooks run only the
plugin's shipped adapter, where that tool's own config governs the file, and otherwise nothing; they
never run a command from the repository's python record (`docs/conventions/ecosystems/python.yaml`), which
`/toolchain:lint` (if enabled) and `/toolchain:check` (if enabled) run on request. The only consumer-project files this plugin
writes are its git-hook entry copies (`apply install-git-hooks`); the record is written by
`/toolchain:setup apply python` (if enabled), never here. The tunables are the native `userConfig` options (the on/off toggle and the
gitignored-file switch). `apply install-ruff` is the one other write
path: the adapter's tool, installed into the repo's existing managed environment as described
below.

Action routing: no argument or `check` runs the check; `check inspect` runs only the
`check inspect` section; `apply` runs the check first, then
remediation; `apply install-ruff` additionally authorizes the install its section describes. All are non-interactive except where a section says to ask. Never prompt
when the action is given. `apply install-git-hooks` asks only where its section says to.

## `check` (read-only)

The hook script (`${CLAUDE_PLUGIN_ROOT}/hooks/python-format.sh`), the entries and the resolver
they share are the single source of truth for what the plugin requires and how it resolves
things; step 3 asks the resolver itself.

**Read it first.** Open `${CLAUDE_PLUGIN_ROOT}/hooks/python-format.sh` with the Read tool before
any probe. Probe what it actually does, don't recite this file. Then read the
pre-computed `jq` row, run the remaining probes via Bash, and report a PASS/FAIL/INFO
table with one remediation line per FAIL. Do not modify anything.
Run every numbered step below and give each one that applies its own row in that table, also when
the request adds questions of its own; answer those beside the table.
Read each option value from this text; never put a `${user_config.*}` string in a shell command.
Open plugin files by the `${CLAUDE_PLUGIN_ROOT}` paths this skill names; never Glob or Grep the plugin directory.
An installed plugin runs from a deeply nested cache path, and a search passed that path can fail
to start on some hosts because the path is too long, while reading a named file still works.

When the plugin's toggle is disabled, every prerequisite absence except Node.js downgrades
from FAIL to INFO. The hook script exits through its enabled-gate before probing anything, so
a deliberately disabled plugin is not broken. Node.js stays FAIL: `hooks.json` spawns `node`
before the script can read the toggle. Report the probes informationally and note that re-enabling
restores the FAIL semantics. A tool the git pre-commit entry needs keeps the grade it gets with the
toggle on while that entry is installed (step 8 reports it as a `tool` line beside an `ok`, `stale`
or `modified` entry): the entry runs at commit outside Claude Code and reads no toggle.

1. **Bash version.** Check against the hooks' floor, Bash 3.2 or newer (`${CLAUDE_PLUGIN_ROOT}/hooks/hook-file-path.sh`).
2. **`jq`.** The pre-computed `jq` row. FAIL if absent: the batch hook then does nothing,
   since it reads the file paths with `jq`.
3. **What each concern resolves to.** From the repository root run
   `sh "${CLAUDE_PLUGIN_ROOT}/git-hooks/format.sh" --resolve` and
   `sh "${CLAUDE_PLUGIN_ROOT}/git-hooks/lint.sh" --resolve`. Each prints one row: plugin, concern,
   source, tool, found, detail, tab-separated. It reads the adapter's config and runs nothing. Append repository paths (`--resolve src/a.py scripts/b.py`) for one
   row per file when the answer can differ per file, as an adapter's config walk does; the detail
   column then names the config that governs that file and the binary that would run, or why
   nothing resolved. An adapter's own rules (which config opts a file in, where its binary comes
   from) are in `${CLAUDE_PLUGIN_ROOT}/git-hooks/adapters.sh`: read them to explain why a row
   names that config. That explanation reads the candidate files on the walk and names each one
   passed over with why it did not count, and the table or section that opted the governing file in.
   Report one line per concern from the rows, never from this text:
   - `adapter:<name>` with found `yes`: PASS, naming the adapter's tool and that its config opted in.
   - found `no`: FAIL; the remediation is the adapter tool's
     `${CLAUDE_PLUGIN_ROOT}/prerequisites.json` install hints (Read that path).
   - `none`: INFO "unresolved": no shipped adapter's config governs the repository, so the hooks run
     nothing. This is the opt-out by design.
   A detail saying a python record exists is INFO beside the row: the hooks never run it, and
   `/toolchain:lint` (if enabled) or `/toolchain:check` (if enabled) runs it on request.
4. **Draft, never write, the record.** When a concern is unresolved, or the person names a tool the
   plugin ships no adapter for, say that the hooks will not run that tool: they run only the shipped
   adapter. Find the repository's own formatter and linter by the steps in
   [reference/ecosystem-resolution.md](../../reference/ecosystem-resolution.md), and draft the
   `fix-cmd` and `lint-cmd` values: each holds `<files>`, `fix-cmd` only formats (import ordering
   included) and `lint-cmd` only reports, with findings as `<path>:<line>` lines. Hand the draft to
   `/toolchain:setup apply python` (if enabled), the one writer of those keys, so `/toolchain:lint` (if enabled) and
   `/toolchain:check` (if enabled) can run them on request.
5. **Hook toggle.** Report the effective `python_format_enabled` value:
   `${user_config.python_format_enabled}` (unexpanded or empty means default `true`).
6. **Hook registration.** INFO: confirm the plugin is enabled for this project
   (`/plugin` → Installed) rather than parsing settings files.
7. **Node.js.** Run `command -v node` via Bash. FAIL when absent: every hook launch goes
   through `node hooks/exec-bash.mjs`, so a missing `node` is a hook launch error, not a skip
   notice. On Windows, `command -v node` is not the hook's environment: a version manager can
   return an ephemeral per-call shim (fnm's `fnm_multishells\<pid>_<timestamp>\node`) that the <!-- portability-ok: Windows path, not a shell regex -->
   hook process cannot resolve. FAIL when the only hit is such a shim, and report the persisted
   resolution from `[Environment]::GetEnvironmentVariable('Path','Machine')` and `'User'`. An
   in-process hit that is not ephemeral is INFO beside that result, not a PASS by itself.
8. **Git pre-commit entries.** Run `node "${CLAUDE_PLUGIN_ROOT}/lib/git-hooks/install.mjs" verify`
   from the repository. It lists `format` and `lint`. Each line is `<state>\t<entry>[\t<detail>]`: `ok` is PASS, `declined` is
   INFO (this clone said no; silent at session start), and `missing`, `stale`, `modified` or `superseded` is a
   FAIL whose remediation is `apply install-git-hooks`; a `superseded` detail lists what an install under an earlier plugin or entry name left (the single entry these two replaced), which that action removes on the user's yes. A `tool\t<tool>\tmissing` line means the
   installed entry cannot run here: list every such tool (the entry's resolved tool) with its install method from the
   `${CLAUDE_PLUGIN_ROOT}/prerequisites.json` (Read that path), so a lane or cloud setup script can provision it before an
   auto-mode session commits. Outside a git repository, report INFO and skip the step.

## `check inspect` (read-only)

Follow [reference/git-hook-decisions.md](reference/git-hook-decisions.md) "check inspect", with `<plugin>` = `python-format` and
`<install>` = `${CLAUDE_PLUGIN_ROOT}/lib/git-hooks/install.mjs`.

## `apply install-git-hooks [scope=local|shared]`

Follow [reference/git-hook-decisions.md](reference/git-hook-decisions.md) "apply install-git-hooks", with `<plugin>` =
`python-format`, `<install>` = `${CLAUDE_PLUGIN_ROOT}/lib/git-hooks/install.mjs`, `<verify-step>` = `check` step
8, and the entries `format` and `lint`.

The `format` entry rewrites: at commit it formats the staged Python files and stages the result,
so tell the user that a commit can change the files it contains, and that a partly staged Python
file is refused untouched. The `lint` entry only reports findings on the lines the commit adds.
A decline of the earlier single entry carries to both.

## `apply` (idempotent)

Run `check`, then for each FAIL offer the resolution. Never install anything without the
consumer's explicit go-ahead in the invocation. `apply install-ruff` installs the Ruff adapter's
tool **only into a managed Python environment the repo already uses**, never by creating one and
never globally, mirroring how the adapter resolves the binary. Resolve the target from what the
repo already declares:

Principles, in order. They decide every case, whatever the tool:

1. **Identify the repo's dependency manager from its own markers**: a lockfile or a
   `pyproject.toml` tool section. Recognize the manager from what the repo declares, and look up
   its commands in its own documentation at run time; don't assume from a list.
2. **Record through the manager, never around it.** A managed project gets the tool via that
   manager's own dev-dependency add command, so the manifest and lockfile record it. A bare
   `pip install` into its environment is state the manager's next sync or clean silently removes.
3. **Never create or mutate an environment.** When no environment exists yet, use the
   manager's record-only mode when it has one and hand the sync/install step to the
   consumer as their own command; when the manager's add command cannot avoid
   creating/instantiating an environment, don't run it. Give it as guidance instead.
4. **Only where the adapter resolves.** The adapter resolves repo-ancestor `.venv` interpreters
   or `PATH`, nothing else (`${CLAUDE_PLUGIN_ROOT}/git-hooks/adapters.sh`). A manager that defaults
   its environment to a cache directory must have an in-project environment confirmed first, from
   the manager's own config; otherwise guide (enable in-project mode and recreate, or put the tool
   on `PATH`) rather than installing somewhere the adapter never looks.
5. **Bare `pip install` only into a plain existing `.venv`** with no manager markers of
   any kind. State the change and target environment before running.
6. **Ambiguity stops.** No environment plus no recognized manager, or conflicting
   signals → guidance only, anchored on the install hints in
   `${CLAUDE_PLUGIN_ROOT}/prerequisites.json`, matching the entries' missing-tool text.

After any remediation, re-run the relevant `check` probe live via Bash (a pre-computed row
predates the remediation) and report its actual result.
Never claim resolved on the install command's exit code alone. For everything else `apply`
only points:

- missing `jq` / Bash: platform install instructions from the README Requirements section;
  this skill never installs system packages.
- toggle off: set `python_format_enabled` to `false` through Claude Code's native flow,
  interactively with `/plugin configure python-format@<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.
- a concern unresolved: `check` step 4's draft, for `/toolchain:setup apply python` (if enabled). The plugin
  imposes no rules and no tool of its own; it offers to create a minimal config for the Ruff
  adapter in the repository root only when the person explicitly asks for one.

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

## Next

- Repository wants a tool the plugin ships no adapter for (drafted commands ready): /toolchain:setup apply python.
- A hook stage over its time budget in `setup check inspect`: /performance:target.

## What this skill does not do

- Run the formatter or the linter. Editing any `.py`/`.pyi` file exercises the batch hook;
  `git commit` exercises the installed pre-commit entries.
- Write the python record: `/toolchain:setup apply python` (if enabled) does.
- Write the plugin cache, Claude Code user settings, or `pluginConfigs`.
- Create a virtual environment, install Ruff globally, or install outside a managed
  environment the repo already uses.
- Download or execute tools during `check`; network use happens only in an explicitly
  requested `apply install-ruff` inside the consumer repository.

Files in this skill

  • SKILL.md22 KB
  • evals/evals.json14.4 KB
  • reference/statusline-edit.md10.9 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.