Skip to content
Back to skills

Setup

ASecurity

Verify powershell-format prerequisites and hooks (check [inspect]), or resolve and register git pre-commit entries (apply [install-git-hooks]).

  • 34 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 2, 2026
ai-agentsrustgoshellbashnodegitperformance

Works with

  • claude code
  • cli

Security analysis

A100/100

Pro scans all 2 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-69036103/badge)](https://www.skillsdirectory.com/skills/melodic-software-setup-69036103)

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 powershell-format prerequisites and hooks (check [inspect]), or resolve and register git pre-commit entries (apply [install-git-hooks])."
argument-hint: "[check|apply] [inspect|install-git-hooks [scope=local|shared]]"
user-invocable: true
disable-model-invocation: true
allowed-tools:
  - "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

## 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. PowerShell formatting and linting are two concerns, each with its own
git-hook entry. The hooks run only the plugin's shipped PSScriptAnalyzer adapter, where a
`PSScriptAnalyzerSettings.psd1` governs the file, and otherwise nothing; they never run a command
from the repository's powershell record (`docs/conventions/ecosystems/powershell.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 powershell` (if enabled), never here. Rules come from the repository's own settings
file, and the tunables are the native `userConfig` options (the on/off toggle and the
end-of-turn check). The `pwsh` runtime and the PSScriptAnalyzer module are resolved from the
environment (never bundled, never downloaded), and the plugin installs nothing, so `apply` is
otherwise guidance-only. It never modifies user settings or the plugin cache.

A machine without PowerShell or the PSScriptAnalyzer module, or a repo without a settings file,
is INFO in `check` while no settings file opts the adapter in: the hooks then run nothing by
design. Where a settings file does opt in, `check` step 3's rows decide. A machine without
PowerShell gets the `SessionStart` probe's notice once per session while the plugin is enabled,
in a repository where a settings file sits at or above the project directory or is tracked
anywhere in it.

Action routing: no argument or `check` runs the check; `check inspect` runs only the
`check inspect` section; `apply` runs the check first, then
offers remediation guidance. Both are non-interactive. Never prompt when the action is given.
`apply install-git-hooks` asks only where its section says to.

## `check` (read-only)

The entry (`${CLAUDE_PLUGIN_ROOT}/git-hooks/format.sh`), the end-of-turn `lint.sh`, their adapter
(`adapters.sh` and `psscriptanalyzer.ps1` beside them) 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 them first.** Probe what they actually do, don't recite this file. Then run the
probes via Bash and report a PASS/FAIL/INFO table with one remediation line per FAIL. Do not modify anything.
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` downgrades from
FAIL to INFO. The hooks exit through their 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. A missing `node` stays FAIL in either state: every hook row launches
`node`, and the gate runs inside `hooks/exec-bash.mjs`.

1. **Bash version.** Check against the floor, Bash 3.2 or newer (`${CLAUDE_PLUGIN_ROOT}/lib/git-hooks/check-lib.sh`).
2. **`node`.** Probe via Bash: `command -v node`, then `node --version` when it resolves. FAIL if
   absent: every handler in `hooks/hooks.json` launches through `node hooks/exec-bash.mjs`, so
   without `node` the hook never starts and says nothing (README Requirements). The hook process
   resolves bare `node` from the persisted Machine/User PATH, not from this shell. On Windows a
   version manager can return a per-call path whose directory name contains a process id (fnm's
   `fnm_multishells\<pid>_<timestamp>\node`); that path is ephemeral, so FAIL when it is the only <!-- portability-ok: Windows path, not a shell regex -->
   hit, say so, and report the persisted resolution separately from
   `[Environment]::GetEnvironmentVariable('Path','Machine')` and `'User'`. A non-ephemeral in-shell
   hit is INFO beside that result, not a PASS by itself.
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.ps1 build/b.psm1`) for one row per file, since the
   closest settings file governs each file; the detail column then names it, or the row says
   nothing resolved. The adapter's own rules (which settings file opts a file in, where `pwsh`
   comes from) are in `${CLAUDE_PLUGIN_ROOT}/git-hooks/adapters.sh`: read them to explain a row.
   Report one line per concern from the rows, never from this text:
   - `adapter:<name>` with found `yes`: PASS, naming the adapter's tool and the settings file that
     opted in. Report the `pwsh` version too:
     `pwsh -NoProfile -NonInteractive -Command '$PSVersionTable.PSVersion.ToString()'`.
   - found `no`: FAIL; the remediation is the adapter tool's
     `${CLAUDE_PLUGIN_ROOT}/prerequisites.json` install hints (Read that path).
   - `none`: INFO "unresolved": no settings file governs the repository, so the hooks run
     nothing. This is the opt-out by design.
   A detail saying a powershell 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. **PSScriptAnalyzer module.** Probe **only when a row found `pwsh`** (so the probe never errors
   on a pwsh-less box):
   `pwsh -NoProfile -NonInteractive -Command 'if (Get-Module -ListAvailable -Name PSScriptAnalyzer) { "present" } else { "absent" }'`.
   Absent is FAIL while a row resolved to the adapter: an agent commit then fails with the
   install command and a person's commit gets a notice, as the check-placement contract says,
   and the Stop check stays silent. The probe is read-only: `Get-Module -ListAvailable`
   inspects, it does not format, lint, or mutate.
5. **Trust model.** When a row resolved to the adapter, surface the README **Trust model**: the
   settings file is executed-adjacent configuration. A `CustomRulePath` it declares would load
   and run repository-supplied rule modules, so the entry and the lint script skip such a settings state until
   the user approves its exact content (a marker under the repository's git common directory in
   `powershell-format/trust-approvals`, one store for every session and commit; any settings or
   rule-module change revokes it). It carries the same trust as build/CI configuration.
6. **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 and `lint-cmd`
   only reports, with findings as `<path>:<line>` lines. Hand the draft to
   `/toolchain:setup apply powershell` (if enabled), the one writer of those keys, so `/toolchain:lint` (if enabled) and
   `/toolchain:check` (if enabled) can run them on request.
7. **Hook toggle.** Report the effective `powershell_format_enabled` value:
   `${user_config.powershell_format_enabled}` (unexpanded or empty means default `true`; any
   value other than `true` disables the hooks). Also report `powershell_format_end_of_turn`:
   `${user_config.powershell_format_end_of_turn}` (unexpanded or empty means the shipped default
   `false`), as INFO: on, the Stop row lints the uncommitted changes in the background at each
   turn end and wakes Claude on a finding; off, only the
   git pre-commit entries run.
8. **Hook registration.** INFO: confirm the plugin is enabled for this project
   (`/plugin` → Installed) rather than parsing settings files.
9. **Git pre-commit entries.** Run `node "${CLAUDE_PLUGIN_ROOT}/lib/git-hooks/install.mjs" verify`
   from the repository. It lists `format`, and a retired `lint` entry while one is still installed. 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>` = `powershell-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>` =
`powershell-format`, `<install>` = `${CLAUDE_PLUGIN_ROOT}/lib/git-hooks/install.mjs`, `<verify-step>` = `check` step
9, and the entry `format`. Its adapter files are copied beside its script.

The `format` entry rewrites: at commit it formats the staged PowerShell files and stages the
result, so tell the user that a commit can change the files it contains, and that a partly
staged PowerShell file is refused untouched. It formats only the lines the commit adds and
reports no lint finding: linting runs in CI and in the opt-in end-of-turn check. A decline of the
earlier single entry carries to it. When a
`PSScriptAnalyzerSettings.psd1` declares `CustomRulePath`, the entry skips that state until
the user approves it; tell the user the approval command only in the user's own channel, never
in text an agent commit would print.

## `apply` (idempotent)

Run `check`, then for each finding point at the resolution. This skill installs nothing:

- missing `node` / Bash: platform install instructions from the README Requirements section;
  this skill never installs system packages.
- `pwsh` absent (and PowerShell support is wanted): point at the install hints in
  `${CLAUDE_PLUGIN_ROOT}/prerequisites.json` (Read that path), matching the entries'
  missing-tool text; this skill never installs it. If PowerShell is genuinely not applicable on this machine,
  leaving it absent is a valid end state. The hooks stay quiet; the once-per-session probe
  notice is the only signal, and `powershell_format_enabled` false or disabling the plugin stops it.
- PSScriptAnalyzer module absent: `Install-Module PSScriptAnalyzer` is **user-scope guidance
  only**. State the command for the reader to run; this skill never runs it.
- no `PSScriptAnalyzerSettings.psd1` (and linting/formatting is wanted): explain that adding a
  settings file at or below the project root opts the repo in, but this skill does not write
  it. The settings file is the executed-adjacent trust boundary above; the choice and the edit
  belong to the consumer.
- a concern unresolved, or a tool the plugin ships no adapter for: `check` step 6's draft, for
  `/toolchain:setup apply powershell` (if enabled).
- toggle off: set `powershell_format_enabled` to `true` through Claude Code's native flow,
  interactively with `/plugin configure powershell-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.

After pointing at a remediation, re-run the relevant `check` probe live via Bash 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".

## Next

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

## What this skill does not do

- Run the formatter or linter. `git commit` of a `.ps1`, `.psm1`, or `.psd1` file exercises the
  installed pre-commit entries end-to-end. The `check` pwsh probes and `--resolve` rows are read-only; they never format,
  lint, or mutate any file.
- Write the powershell record: `/toolchain:setup apply powershell` (if enabled) does.
- Write the plugin cache, Claude Code user settings, or `pluginConfigs`. Nor the repository,
  including `PSScriptAnalyzerSettings.psd1`. The `pwsh` runtime and the PSScriptAnalyzer module
  are resolved from the environment, never installed, so remediation is guidance only.
- Download tools during `check` beyond the read-only presence and version probes.

Files in this skill

  • SKILL.md8.3 KB
  • evals/evals.json6.7 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.