Setup

From melodic-software/claude-code-plugins · View interactive version

Setup is an AI agent skill from the GitHub repository melodic-software/claude-code-plugins. Report (check, the default) or write (apply) this repository's tracked docs/conventions/ecosystems/ECOSYSTEM.yaml build, test and lint commands, which /toolchain:check and /toolchain:lint resolve first. Re-runnable.

How to use this skill

Skill file

Purpose

Inspect and configure the consuming repo's tracked ecosystem command surface per the uniform setup

contract (docs/plugin-philosophy.md "Setup is explicit and repeatable" in the marketplace

repository): check reports what is configured, apply writes it. The tracked files at

docs/conventions/ecosystems/<ecosystem>.yaml let /toolchain:check and /toolchain:lint

resolve commands deterministically from rung 1 of the ladder

(CODE0)

instead of inferring every run or reporting a key unresolved. This skill is the ladder's

writer for rungs 2 and 3 (infer-and-persist, ask-and-persist).

Idempotent: re-running reads the existing files and offers updates rather than overwriting blind. An

unconfigured ecosystem is INFO, never FAIL: an attended run infers or asks for its commands, and a

key nothing resolves reads skip (unresolved: ...).

Action routing: no argument or check runs the check; apply runs the check first, then writes.

apply <ecosystem> scopes the whole run to that one ecosystem; when a named ecosystem's inference is

unambiguous it is written non-interactively, otherwise (or with no ecosystem argument in an

interactive session) the interview below runs.

Resolve repo root

REPO_ROOT=$(git rev-parse --show-toplevel)

Write only inside $REPO_ROOT/docs/conventions/ecosystems/, plus moving legacy

$REPO_ROOT/.claude/ecosystems/ files there per apply step 1; never the plugin directory or the

plugin data directory; configuration lives in the consumer's tracked files. Also read the legacy

$REPO_ROOT/.claude/ecosystems/.

`check` (read-only)

The contract schema (ecosystem.schema.json) is the single source of truth for the file shape.

Read the ladder first, then report a PASS/FAIL/INFO table; modify nothing.

  1. Configured ecosystems. For each $REPO_ROOT/docs/conventions/ecosystems/<ecosystem>.yaml

present, report the ecosystem and its resolved command surface

(build-cmd/test-cmd/test-changed-cmd/check-cmd/lint-cmd/fix-cmd/code-fix-cmd). Validate each against the contract's

ecosystem.schema.json. FAIL a schema-invalid file (with the validation error in the

remediation line), an ecosystem file excluded by .gitignore (git check-ignore -v matches;

teammates would never receive it. Report the matching rule), or an un-ignored but untracked file

(git ls-files --error-unmatch exits non-zero; report "commit it to share with the team").

Otherwise PASS. If $ARGUMENTS names one ecosystem, scope

the report to just that file.

WARN each file still at the legacy $REPO_ROOT/.claude/ecosystems/: readers use it only

while no file of that name is under docs/conventions/ecosystems/, and the remediation is

apply, which moves it there. A legacy file shadowed by one of the same name there is not read

at all; say so and name both paths.

  1. Unconfigured ecosystems. INFO: detect which ecosystems the repo has that are not yet

configured (see the inference signals under apply), and note that /toolchain:check /

/toolchain:lint resolve those through inference, and report a key nothing resolves as

unresolved. The remediation is apply to persist a command surface.

`apply` (idempotent)

Run check first. Then write the accepted ecosystem files. After each write, re-run the check

probe pair for that path rather than trusting the write: git check-ignore -v reports no match,

and git ls-files --error-unmatch distinguishes tracked from written-but-untracked (the

guaranteed state right after a fresh write, so report "written but untracked: commit it", never

success).

1. Read existing config first

For each $REPO_ROOT/docs/conventions/ecosystems/<ecosystem>.yaml that already exists, load it

and present a short summary. Propose moving each legacy $REPO_ROOT/.claude/ecosystems/ file

there, content unchanged, .local.yaml files included: a tracked file with git mv, an untracked

one (a personal .local.yaml the old .claude/**/*.local.* ignore line kept out of git) with a

plain move, and only once git check-ignore shows the new path ignored (else recommend the

docs/conventions/**/*.local.* line of step 5 first). With a file of the same name at both, show

the difference and keep the docs/conventions/ one unless the person says otherwise. The interview proposes changes against that baseline; nothing is dropped without the

user confirming. If $ARGUMENTS names one ecosystem, scope the whole run to just that file.

2. Infer candidates from the repo before asking

Detect which ecosystems apply from what actually exists, and draft each one's command surface from

inference only: the repo's records, instructions, build files, tool configs and CI. The plugin ships

no default file to seed a draft from; a key nothing implies goes to the interview, never to a

command the plugin picks.

A drafted command that runs a tool through a package runner (npx, pnpm dlx, yarn dlx, bunx,

uvx) names the package the project's manifest declares, never a shorter name the runner could

resolve to someone else's package (@biomejs/biome, not biome), and passes the runner's

no-download option where it has one (npx --no). A recorded command runs on later unattended runs

too, so a bare name here would fetch and run an undeclared package on every one of them.

When the repo has its own task runner or wrapper scripts (a task file, a manifest's scripts block,

a scripts directory its docs or CI call), draft each command key from the matching task or script

first, in any ecosystem. Draft test-changed-cmd from the repo's own test

runner's way of selecting tests for changed files, over <files>; when the repo has no such

selection, look it up with /discovery:research (if enabled) for the runner the repo uses, and leave the key

out when none exists.

nearest project). Note any repo-specific trap in notes (e.g. the xUnit v3 --nologo pin).

dependencies name, run through uv run … when uv.lock exists. Set project-discovery to the

pyproject.toml roots.

configured linter (biome.json → Biome format vs check --write; eslint config → ESLint).

documents or its linter and formatter configs imply, and ask for the rest.

/toolchain:check does not).

Repo-specific CI-parity gates beyond plain build/test/lint (lockfile drift, generated-artifact

freshness, schema regeneration) belong in the ecosystem file's gates array. Draft one when the

repo's CI runs such a check. For an ecosystem with project-discovery, a gate that is repo-wide

rather than per-project (protobuf generation, schema freshness. Checks something that exists once,

not once per discovered project root) needs run-from: repo-root on the drafted gate; omitting it

defaults to per-project execution, which redundantly re-runs the check in every root or fails in

roots lacking its config. Ask which shape applies when the CI check's own scope is ambiguous from its

command alone.

3. Interview or write non-interactively

When apply <ecosystem> names one ecosystem and its inference is unambiguous, write the drafted

command surface non-interactively. Otherwise interview, one decision at a time: present each inferred

ecosystem's drafted command surface with a recommendation; let the user accept, edit, or skip it. When

inference is ambiguous (multiple test runners, no configured linter), ask for the command rather than

guessing. Offer any ecosystem the repo has that inference missed.

4. Write the files

Materialize one $REPO_ROOT/docs/conventions/ecosystems/<ecosystem>.yaml per accepted ecosystem,

conforming to the contract's ecosystem.schema.json. Each file carries a one-line header comment citing the

contract, globs (required), the four command keys (null where a phase does not apply), and the

optional keys that apply (anchor, project-discovery, opt-in, install-hint, requires, gates, notes,

lint-cmd, test-changed-cmd).

Write requires for a command that needs more than its tool on PATH, such as a runtime package

it imports or the tool build CI pins, instead of an install step inside the command string.

Confirm each file is tracked, not ignored.

This skill is the one writer of fix-cmd and lint-cmd. A format or lint plugin's setup drafts the

values and sends the person here with them. Write lint-cmd only as a report-only command over

<files>. /toolchain:lint and /toolchain:check run these keys on request; no hook runs a

record's command.

Recommend the consumer validate these in their own gate, a check-jsonschema hook or CI lane against

the contract schema catches typos the tolerant reader would otherwise ignore.

5. Offer the personal override convention

Personal per-key overrides go in docs/conventions/ecosystems/<ecosystem>.local.yaml; a

user-global base at ~/.claude/ecosystems/<ecosystem>.yaml is also honored. Layers resolve

user-global → team → personal override, additively per key. Recommend the consumer add the recursive

docs/conventions/**/*.local.* line to .gitignore if not already covered.

Output

Tracked docs/conventions/ecosystems/*.yaml files in the consuming repo, and a one-paragraph

summary of what was written and how to re-run this setup to reconfigure. check alone reports the effective

configuration and changes nothing.

Next

What this skill does not do

directory or the plugin data directory.

person's answer.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.