Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Setup?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/melodic-software-setup-07cd92a9)
---
description: "Verify markdown-format prerequisites and hooks (check [inspect]), or install lint and git hooks (apply [install-lint|install-git-hooks])."
argument-hint: "[check|apply] [inspect|install-lint|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/markdown-lint.sh\" --resolve)"
- "Bash(sh \"${CLAUDE_PLUGIN_ROOT}/git-hooks/markdown-lint.sh\" --resolve:*)"
- "Bash(sh ${CLAUDE_PLUGIN_ROOT}/git-hooks/markdown-lint.sh --resolve)"
- "Bash(sh ${CLAUDE_PLUGIN_ROOT}/git-hooks/markdown-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 missing, reading as literal command text, or 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. Markdown formatting and linting are two concerns. The hooks run only
the plugin's shipped markdownlint-cli2 adapter, where a markdownlint config governs the file, and
otherwise nothing; they never run a command from the repository's markdown record
(`docs/conventions/ecosystems/markdown.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 markdown` (if enabled), never
here. Rules come from the repository's own markdownlint config, and the tunables are the native
`userConfig` options (the on/off toggle and the gitignored-file switch).
`apply` is otherwise guidance-and-verify, with one more write path: the explicitly invoked
`apply install-lint` dependency install 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-lint` additionally authorizes the consumer-repo dependency
install described below. All 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 hook script (`${CLAUDE_PLUGIN_ROOT}/hooks/markdown-format.sh`), the adapter
(`${CLAUDE_PLUGIN_ROOT}/git-hooks/adapters.sh`) and the gates it applies for the batch row and the
pre-commit entry (`${CLAUDE_PLUGIN_ROOT}/git-hooks/markdown-gates.sh`) are the single source of
truth for what the plugin requires and how it resolves things; step 6 asks the resolver itself.
**Read them first.** Probe what they actually do, 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.
Read each option value from this text; never put a `${user_config.*}` string in a shell command:
bash reads an unsubstituted one as a bad substitution and the whole call fails.
Open plugin files by the `${CLAUDE_PLUGIN_ROOT}` paths this skill names; never Glob or Grep the plugin
directory: the paths already name every file this skill opens.
When the plugin's toggle is disabled, every prerequisite absence except Node.js (item 1)
downgrades from FAIL to INFO. The hook and the `SessionStart` probe both exit through the
enabled gate before probing anything, so a deliberately disabled plugin is not broken.
Node.js stays FAIL: Claude Code must spawn `node` for the hook row before that gate can run.
A tool the git pre-commit entry needs keeps the grade it gets with the toggle on while that entry
is installed (item 11 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.
Report the probes informationally and note that re-enabling restores the FAIL semantics.
1. **Node.js.** Every hook row starts through `node hooks/exec-bash.mjs`, so without
`node` on `PATH` no hook launches and nothing is enforced. Probe it via Bash with
`node --version` (a hook cannot report its own missing launcher; a stale version-manager
shim resolves on `PATH` yet cannot run, so resolution alone is not a PASS). FAIL if it is
absent or exits non-zero, in every toggle state; the remediation is to install or repair
Node.js (README Requirements).
2. **Bash version.** Check against the hooks' floor, Bash 3.2 or newer (`${CLAUDE_PLUGIN_ROOT}/hooks/hook-file-path.sh`).
3. **`jq`.** The pre-computed `jq` row, or the Bash probe when that row carries no result. The
batch hook reads the file paths with `jq` and does nothing, silently, without it. FAIL if
absent *and* the repository opted in per item 5; INFO otherwise, because without a config
nothing would run anyway and the missing config, not jq, is why.
4. **`markdownlint-cli2`.** Resolve it exactly the way the gates' `md_local_bin` and the
hook's PATH lookup do: `PATH` first, then `node_modules/.bin/markdownlint-cli2` walking up
from a Markdown file's directory to the repository root, with the shim's symlinks followed
and its physical target required to stay inside the repository's `node_modules` tree. A
binary or shim the hook would reject must not PASS here. Then confirm the resolved tool
actually executes, loading no repository config or module: run it with `--help`, never `-h`, `--version` or a
bare glob. It executed when its first output line is the tool's version banner, whatever the
exit code (a repo shim can resolve yet still be broken: missing Node interpreter, dangling
target). Anything else is FAIL, with the execution error in the remediation line. FAIL when
nothing the hook would accept resolves.
- **Probe**: [`markdownlint-cli2` `--help` and `--version`](https://github.com/melodic-software/claude-code-plugins/issues/13201#issuecomment-6630609726).
**As of**: 2026-11-04. **Recheck trigger**: a `markdownlint-cli2` release changes what `--help`
prints first, or adds a `--version` flag.
5. **Consumer markdownlint config, the opt-in.** This is what activates the plugin, not a
style detail. Mirror the gates' `md_config_state` walk: from a Markdown file's directory
up to the repo root, so nested configs apply to nested files and the opt-in is per-path (a
root config covers the tree; a `docs/` config covers only `docs/`). Where that walk finds
nothing the hook exits silently: no `--fix`, no findings, and no notice, not even a missing
prerequisite. The `SessionStart` probe reports a missing `markdownlint-cli2` only where a
config sits in the project directory or above it or is tracked anywhere in the repository
(`when` in `${CLAUDE_PLUGIN_ROOT}/prerequisites.json`), so an untracked nested config alone
gets no probe line. Search the whole tree
(skip `node_modules`), report the root config the cascade discovers, list nested configs
with their directory scope, and report as INFO, gated, every config the gates'
`md_classify` flags (a `.cjs` or `.mjs` config, or one naming `customRules`,
`markdownItPlugins` or `outputFormatters`, or holding a backslash in a quoted string): the
plugin runs markdownlint-cli2 under it only after the user approves that config state
(README "Trust model"), so until then the files it governs are neither rewritten nor
checked. Never create the approval marker yourself: approval is the user's. For a path no config governs, report the plugin as **INFO,
inactive, not PASS**: nothing is broken, the repository simply never opted in, and that is
the whole reason formatting is not happening. Name the remediation in the same line rather
than leaving the reader to infer it: the user can add a markdownlint config to opt in. Do not
offer to create one. Never report markdownlint's own default rules as the
fallback. An unconfigured repo gets no rules, not the defaults.
6. **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/markdown-lint.sh" --resolve`. Each prints one row: plugin, concern,
source, tool, found, detail, tab-separated. It reads the configs and runs nothing. Append
repository paths (`--resolve docs/a.md tools/b.md`) for one row per file, since the opt-in is
per path: the detail column then names the config closest to that file and the binary that
would run, the trust verdict holding the file back, or why nothing resolved. Report one line
per concern from the rows, never from this text:
- `adapter:<name>` with found `yes`: PASS, naming the tool and the config that opted in.
- found `no`: FAIL; the remediation is item 4's.
- `none`: INFO "unresolved": item 5 says why.
A detail saying a markdown 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.
7. **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 markdown` (if enabled), the one writer of those keys, so `/toolchain:lint` (if enabled) and
`/toolchain:check` (if enabled) can run them on request.
8. **Path scope, the repository's `.gitignore`.** INFO: the batch hook leaves a gitignored
file alone, because a path the repository excludes is not part of the reviewable artifact.
(The pre-commit entries only see files git stages, so they need no such rule.) List the
ignored Markdown the repository carries as out of scope with
`git ls-files --others --ignored --exclude-standard -- '*.md' '*.mdc'`,
and note that a tracked file is never treated
as ignored even when a pattern matches it. Report the effective
`${user_config.markdown_format_lint_gitignored}` value (unexpanded or empty means
default `false`, i.e. gitignored files are skipped); `true` restores rewriting there.
9. **Hook toggle.** Report the effective `markdown_format_enabled` value:
`${user_config.markdown_format_enabled}` (unexpanded or empty means default `true`).
10. **Hook registration.** INFO: confirm the plugin is enabled for this project
(`/plugin` → Installed) rather than parsing settings files.
11. **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>` = `markdown-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>` =
`markdown-format`, `<install>` = `${CLAUDE_PLUGIN_ROOT}/lib/git-hooks/install.mjs`, `<verify-step>` = `check` step
11, and the entry `format`.
The `format` entry rewrites: at commit it formats the staged Markdown files and stages the result,
so tell the user that a commit can change the files it contains, and that a partly staged Markdown
file is refused untouched, and that it blocks only on a finding `--fix` leaves on a line the commit
adds. A decline of the earlier single entry carries to it.
## `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-lint` adds `markdownlint-cli2` as a
dev dependency in the consumer repository, by these principles, in order:
1. **Identify the repo's package manager from its own markers**: its lockfile, else the manifest's
declared manager, else the registry client the manifest implies. Look up that manager's
dev-dependency add command in its own documentation at run time; don't assume from a list.
2. **Record through the manager, never around it,** so the manifest and lockfile record the tool.
Never introduce a competing lockfile: two lockfiles record two dependency trees that drift
apart. State the change before running it.
3. **Only where the adapter resolves.** The adapter runs `markdownlint-cli2` from `PATH` or a
`node_modules/.bin` shim walking up from the file (`${CLAUDE_PLUGIN_ROOT}/git-hooks/markdown-gates.sh`
`md_local_bin`). When the manager's own config says it installs no such shim, ask the repo's own
manager for that setting rather than inferring it, skip the install and give guidance: put the
tool on `PATH` or change that setting.
4. **Ambiguity stops.** No manifest, several lockfiles, or a lockfile that contradicts the declared
manager: guidance only, anchored on the install hints in `${CLAUDE_PLUGIN_ROOT}/prerequisites.json`.
The verify-after-remediation rule below is the backstop when an install still yields no
usable shim. 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 / Node.js: platform install instructions from the README Requirements section;
this skill never installs system packages.
- toggle off: set `markdown_format_enabled` to `true` through Claude Code's native flow,
interactively with `/plugin configure markdown-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.
- no markdownlint config: this is why the plugin does nothing here, so lead with it rather
than leaving it as a footnote under the passing prerequisites. Then offer to create a
minimal `.markdownlint-cli2.jsonc` in the repository root only when explicitly asked.
The plugin imposes no rules of its own, and which rules a repository adopts is its own
decision, never this skill's.
- a concern the repository wants run by another tool: `check` step 7's draft, for
`/toolchain:setup apply markdown` (if enabled).
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 markdown.
- 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 `.md` file exercises the batch hook end-to-end, and
`git commit` exercises the installed pre-commit entries. The only
execution `check` performs is the `--help` liveness probe of the resolved linter; it never
lints, fixes, touches repository content, or loads a repository config or module.
- Write the markdown record: `/toolchain:setup apply markdown` (if enabled) does.
- Write the plugin cache, Claude Code user settings, or `pluginConfigs`.
- Download anything during `check`; network use happens only in an explicitly
requested `apply install-lint` inside the consumer repository.