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-3f78a23c)
---
description: "Check (read-only) or apply work-items tracker binding, recurring schedule (--seed-schedule opt-in), and role, provenance, and tier labels."
argument-hint: "[check|apply] [--seed-schedule] [--accept-recommended]"
user-invocable: true
disable-model-invocation: true
---
# Setup
## Purpose
Verify and configure the work-items plugin for the consuming repo. Setup owns three concerns: **bind
the tracker provider** (the `tracker` key of the tracked `<home>/work-items.yaml`, the once-per-repo
declaration the seam needs before any verb runs; see "Provider binding" below), the tracked
recurring-schedule config at `.github/recurring-schedule.json` so the `due`, `recheck`, and `work`
actions resolve a real schedule instead of degrading to "no recurring schedule configured", and the
optional canonical-role → label remap in the binding (see "Canonical role labels" below). The
recurring-schedule pass is the bulk path for seeding or reshaping the whole schedule at once; the
per-item `add --recurring` path (which appends a single row as a side effect of filing its work item)
stays as-is. That bulk pass is opt-in rather than part of initial config: a first-time bind writes the
empty skeleton and stops there, because that bind is usually reached as a detour from another verb
reporting "no binding", the operator came to do something else, and should not be walked through a
per-item interview to get there.
Check-centric per the uniform setup contract (`docs/plugin-philosophy.md`
"Setup is explicit and repeatable" in the marketplace repository): `check` inspects read-only and
reports a PASS/FAIL/INFO table; `apply` binds the provider, writes or reshapes the schedule, and
offers the role remap, then re-runs `check`. No argument or `check` runs the check; `apply` runs the
check first, then the bind-and-write flow; `apply --seed-schedule` additionally opts in to the
candidate-inference-and-interview pass. Idempotent: re-running reads the on-disk files and offers
updates rather than overwriting blind. The schedule file is a plain tracked
JSON file the skill reads and writes directly (Read / Write / `jq`). It is not a tracker record, so it
does not route through the work-item-tracker seam; only operations on the work items themselves (labels,
item lookups, edits) go through the bound provider.
## Resolving the paths
Root every path at the project root, never a bare relative path (which breaks when invoked from a
subdirectory). The binding lives in the convention home, which the repository binds in the pointer
region of `AGENTS.md` or `CLAUDE.md`:
```bash
ROOT="<project root>"
bash "${CLAUDE_PLUGIN_ROOT}/lib/resolve-convention-home.sh" --root "$ROOT"
```
`<project root>` is the literal path [`tracker-seam.md`](${CLAUDE_PLUGIN_ROOT}/reference/tracker-seam.md) "Project root" resolves, in its own Bash call before this snippet; the same holds wherever `<project root>` appears below.
Exit `0` prints the home; exit `1` (no pointer) means `docs/conventions`. Exit `4` (the repository
declined a home) or `5` (the root is `$HOME`, an ancestor of it, or not a git work tree) means no home
applies: nothing can bind the repository there, so setup writes no binding and reports that the
repository needs a convention home first. Exit `3` (a broken pointer) is a `check` FAIL naming the
resolver's message. With `<home>` resolved:
- `BINDING` is the `tracker` key of `$ROOT/<home>/work-items.yaml`. That file may hold other
work-items settings; setup edits only its `tracker` mapping.
- `OVERRIDE` is the gitignored personal override `$ROOT/<home>/work-items.local.yaml` (its `tracker` mapping).
- `LEGACY` is the retired binding file `$ROOT/.work-item-tracker.json` and its personal override
`$ROOT/.work-item-tracker.local.json`. The seam no longer reads them; step 1 of "Provider binding"
copies them, and setup never writes them.
- `SCHEDULE` is `$ROOT/.github/recurring-schedule.json`.
The binding and schedule are version-controlled and shared by the whole team. They belong in the
consumer's tree, never in the plugin directory or any machine-local state.
## Provider binding (the tracker seam)
`apply` runs this first, the recurring-schedule and role-label passes below resolve the binding; the
`check` binding probe validates it read-only. The tracker seam runs against exactly one provider per
repo, declared under the `tracker` key of the tracked `<home>/work-items.yaml` (resolved as `BINDING`
above); every seam verb resolves the bound provider from it, and with no binding the seam hard-errors
(exit 3) with a message naming `/work-items:setup apply`. The seam **ships with this plugin** and bundles two adapters, `github` and `local-markdown`;
for those, installing the plugin is enough and a repo only declares which one it uses. `jira`, `gitea`,
and `linear` ship as **seeds**, which step 4 copies into the consuming repo, where the repo owns them.
Binding shape, discovery, and
adapter resolution are the seam contract's
[`${CLAUDE_PLUGIN_ROOT}/tools/work-item-tracker/CONTRACT.md`](${CLAUDE_PLUGIN_ROOT}/tools/work-item-tracker/CONTRACT.md)
"Setup (binding file)" and "Adapter resolution".
Step 1's keep-or-re-bind recommendation and the steps 2–3 interview are all decisions. With no
interactive user, resolve them by `apply`'s "Autonomous invocation" rule below rather than asking,
it fixes what the RECOMMENDED answers resolve to (including that an existing binding is kept), and
when this pass must stop instead of guessing.
1. **Read the current binding first.** If `<home>/work-items.yaml` has a `tracker` key, load it and
report the bound `provider` and `config`. RECOMMENDED: keep it. Re-bind only to switch providers
or fix config. Keeping a binding to a seeded provider still runs step 4's seed copy, attended or
not. When only the legacy `.work-item-tracker.json` binds the repository, copy it: run step 5's
ignore pass for `OVERRIDE` first, then
`bash "${CLAUDE_PLUGIN_ROOT}/skills/setup/scripts/migrate-binding.sh" --root "$ROOT"`. It copies
the JSON binding and its personal override into the `tracker` mapping of `<home>/work-items.yaml` and
`<home>/work-items.local.yaml`, appending to a file that holds other settings. It checks both
layers and reads each copy back through the seam before it writes either, so a binding is never
copied without its personal override. Announce each line it prints (`copied`, `already-yaml`, `no-json`,
`empty`). Exit `1` names a value it cannot copy (a null, an empty object, a list of mappings);
`3` an `OVERRIDE` path that no `.gitignore` rule covers or that the index holds; `4` a repository
where no home applies or whose pointer is broken. Each writes nothing and is a finding to report. The JSON files
stay where they are, unchanged, and no longer bind: a vendored seam or the repository's own tooling
may still read only them. Say so, and say that a later binding edit lands only in the YAML file. Then treat the copy as the current binding. If neither
file binds the repository, say so and continue to the interview.
2. **Choose the provider**, recommendation first. One line each below; the selection detail,
how to verify a `github` bind, what each provider can and cannot do, and every config key,
is `reference/providers.md`. Read it before recommending, and cite it when explaining a
capability gap.
- **`github`** (RECOMMENDED). Full-parity coordination over GitHub Issues via the ambient `gh`
CLI. `gh repo view --json owner,name` is the operative bind-time test (`gh auth status` is
not, see the reference).
- **`local-markdown`**, the offline reference provider; branch- and worktree-confined, so
**never** a coordination surface. Needs `config.storage_dir`.
- **`jira`**. Read/resolve-only against a Jira Cloud project set. Consume-only, so it does not
enable `/work-items:work` or `track start`.
- **`linear`**. Verb parity with `github` except `release`, so it **is** a coordination surface. Personal
API key (the headless-appropriate credential); issue numbering lives outside the repo.
- **`gitea`**. Gitea / Forgejo, self-hostable and free. Issues and dependency edges, but **no
leases and no sub-items**, so `/work-items:work` cannot claim on it.
- **another provider**. Put its adapter consumer-local under
`<repo root>/tools/work-item-tracker/adapters/<provider>/`; the seam resolves those ahead of
the bundled pair, so no fork is needed. `/work-items:onboard-adapter` (if enabled) generates
one rather than starting from a blank file.
3. **Settle the config, all non-secret.** `lease_ttl_hours` (required for every provider;
RECOMMENDED `24`) plus that provider's own subtree, the per-provider key table is in
`reference/providers.md`. Interview for each value; for any token, ask for the env-var **name**
and probe that it resolves in-env at bind time.
- **Secrets never go in this file**. It is tracked in git. A provider that needs an API token
references it by env-var name / the repo's secret-store convention from inside its adapter, never
as a literal here. `github` needs none (ambient `gh`); `jira`, `gitea`, and `linear` reference theirs by
`auth_env` name.
4. **Write the binding.** Re-read `<home>/work-items.yaml` from disk immediately before writing
(create the home directory and the file when absent) and edit only its `tracker` mapping,
leaving every other top-level key and comment as it was: preserve any existing
`config.role_labels` (owned by the role-label pass below) and any other keys. Write
`schema_version: "1.0"` (quoted, so it stays a string), the chosen `provider`, the `config`, and,
unless one already exists, the self-describing `docs` pointer (CONTRACT.md "Setup (binding
file)"). Keep to the YAML subset the seam reads (CONTRACT.md "Setup (binding file)"): block
mappings and sequences, no flow mappings; quote any string holding a colon followed by a space. Confirm the file still
parses with `awk -f "${CLAUDE_PLUGIN_ROOT}/skills/triage/scripts/yaml-subset.awk" <file>` (exit
`0`), then confirm tracked-not-ignored via the pair: `git check-ignore -v` no match and `git ls-files --error-unmatch` exit 0 (non-zero after a fresh write = "written but untracked: commit it").
**For a seeded provider** (`jira`, `gitea`, `linear`), whether this step wrote the binding or
step 1 kept it, copy its seed by running
`bash "${CLAUDE_PLUGIN_ROOT}/tools/work-item-tracker/seed-copy.sh" <provider>` from the project
root; the seam exits 3 for that provider until the copy exists. Its first stdout line is the outcome
(the table is in `${CLAUDE_PLUGIN_ROOT}/tools/work-item-tracker/seeds/README.md`):
- `copied`, `up-to-date`, or `fast-forwarded` (exit 0): report it, and say the copy under
`tools/work-item-tracker/adapters/<provider>/` is the consumer's to commit and own.
- `edited` (exit 1): someone changed the copy, so nothing was written. Show the diff that follows
and stop this step; never delete or overwrite the copy to force an update. With no interactive
user, report it as a finding and continue with the existing copy.
5. **Ensure the personal-override gitignore line.** The gitignored personal override
(`<home>/work-items.local.yaml`, allowlisted keys only. CONTRACT.md "Setup (binding file)") sits
in the convention home, outside the `.claude/**/*.local.*` convention line, so `apply` must
confirm a repository `.gitignore` rule covers it even when the personal override file does not exist yet,
and append that path as a line when none does, **announcing the edit** (touch nothing else there).
While a legacy `.work-item-tracker.local.json` exists, it must stay ignored and untracked too:
run the same probes on it.
`$GIT_DIR/info/exclude` and `core.excludesFile` do not protect a teammate. A *tracked* personal override
in the index is a finding to stop and report, never ignore. Ignored and untracked are **two
independent probes**; a bare `git check-ignore` is silent for an already-tracked path. Run the
probes as [`reference/personal-override-ignore-probes.md`](reference/personal-override-ignore-probes.md) specifies,
including why the ignore verdict must not come from `check-ignore -v`'s exit code.
Example `<home>/work-items.yaml` (`github`; `local-markdown` adds `storage_dir: .work-items` under
`config`):
```yaml
tracker:
schema_version: "1.0"
provider: github
docs: Work-item tracker binding, see the work-items plugin's tools/work-item-tracker/CONTRACT.md (Setup)
config:
lease_ttl_hours: 24
```
## `check` (read-only)
`check` inspects and reports; it writes nothing. Read [reference/check.md](reference/check.md)
when invoked with `check` or with no action, and again at the start of `apply`, which runs the same
probes first: it owns the probe order, every PASS/FAIL/INFO row, and the remediation line each FAIL
prints. `apply` below consumes those probe results and never re-derives them. The `jq` and
tracker-binding entry gates that check.md's probe 1 tests are defined in
[`${CLAUDE_PLUGIN_ROOT}/reference/tracker-seam.md`](${CLAUDE_PLUGIN_ROOT}/reference/tracker-seam.md)
"Provider-neutral over the seam" (its three entry invariants); read it for what each gate enforces and its remediation.
## `apply` (idempotent)
Run `check`, then bind the provider (step 1) before the schedule and role-label passes. The schedule
branches on **how many rows the schedule already carries**, never on whether the file exists. A
skipped first-time `apply` leaves `{"items": []}` on disk, so a file-absence gate would make the
seeding path unreachable by re-running:
- **Schedule carries ≥1 item**. Summarize it, infer candidates, and interview against that baseline
(steps 7–9), offering updates. `--seed-schedule` is a no-op here; this branch already interviews.
- **Schedule absent, or present with an empty `items` array**. Write only the minimum viable config:
the provider binding, the role-label pass, and the empty `{"items": []}` skeleton so `due` /
`recheck` / `work` stop degrading to "no recurring schedule configured". Steps 4–5 do not run: no
candidate inference, no per-item interview. **This is the default.**
- **Schedule present but not parseable as the `{"items": [ ... ]}` root**, no `items` key, a null or
non-array `items`, a non-object root, or invalid JSON. This is a `check` FAIL, not a zero-row
schedule: stop and report it rather than treating it as either branch, because overwriting or
"leaving it untouched" both leave a malformed file the recurring actions cannot read.
Seeding rows on the empty/absent branch is **opt-in**, satisfied by any one of: the explicit
`--seed-schedule` argument; an accepted yes/no offer; or an invocation that in its own words asks for
the schedule to be seeded (e.g. "seed a sensible recurring schedule for this repo"), an explicit
request is the opt-in, so honor it without re-asking. Otherwise offer exactly once, before step 7, as a
single yes/no with **skip marked RECOMMENDED**: name that seeding walks them through one interview per
candidate item, that the skeleton alone already stops the degradation, and that re-running `apply` (or
`apply --seed-schedule`) bulk-seeds later at any time. On skip, say so plainly and go to step 10.
### Autonomous invocation (no interactive user)
When `apply` runs in an unattended or loop-driven context there is nobody to answer any of its
questions, and blocking on one strands the run. Read
[reference/autonomous-apply.md](reference/autonomous-apply.md) before the first decision point of
an unattended `apply`, and follow it for every decision in the flow, not only the seeding offer: it
owns the silent-resolve rule, the never-guess rule, the per-pass unattended resolutions, and what
the run must say in its summary about each decision it took without asking.
The first decision is the bind. With no binding in either file (`work-items.yaml` or the legacy
JSON), bind `github` only when `gh` is installed and
`gh repo view --json owner,name` resolves; otherwise no provider can be chosen safely, so write no
`tracker` key, stop, and report the named blocker "tracker binding needs a provider decision; run
`/work-items:setup apply` with a user present". Unlike the seeding offer, whose safe default (skip)
resolves silently, this decision has no safe default.
### The `apply` flow, step by step
Read [reference/apply.md](reference/apply.md) before step 1: the numbered flow and the role-label, won't-do and provenance passes it runs.
## Provenance label (migration)
The `apply` flow runs this pass: [reference/apply.md](reference/apply.md) "Provenance label (migration)".
## Canonical role labels (optional remap)
The `apply` flow runs this pass: [reference/apply.md](reference/apply.md) "Canonical role labels (optional remap)".
## Won't-do classification
The `apply` flow runs this pass: [reference/apply.md](reference/apply.md) "Won't-do classification".
## Output
A tracked `<home>/work-items.yaml` binding under its `tracker` key (provider + non-secret config) and
a tracked `.github/recurring-schedule.json`, both in the consuming repo, plus a one-paragraph summary:
the bound provider and config, whether a legacy JSON binding was copied and kept, the recurring items written (id, cadence, next_due), or, on the skipped path,
that only the empty skeleton was written and that `apply --seed-schedule` bulk-seeds rows whenever the
operator wants them, whether any labels were created, any role→label remap written to the
binding, and how to re-run this setup to reconfigure. On a `check`-only run, the
PASS/FAIL/INFO table and its remediation lines, mutating nothing.
## Spoke paths
The `reference/` files write the plugin's root directory as `<plugin-root>`, which is
`${CLAUDE_PLUGIN_ROOT}`. Put that path in place of the placeholder before running a command or
writing it into a brief. Those files use the placeholder because we do not rely on a `${…}`
token resolving in a supporting file or in the Bash tool.
- **Pointer**: when deciding whether a `${…}` reference resolves in a file or tool, fetch
[plugins manifest reference § Where each variable resolves](https://code.claude.com/docs/en/plugins/manifest-reference#where-each-variable-resolves)
live.
## Next
- Inspect backlog or add items: /work-items:track.
- Evaluate untriaged intake: /work-items:triage.
- Pick and execute the next ready item: /work-items:work.
## What this skill does not do
- Run tracker operations, no item is created, claimed, or closed here. Filing and coordination are
`/work-items:track` (`add`, `due`, `recheck`), `/work-items:work`, and `/work-items:triage`. `check`
only inspects config; `apply` seeds the binding, schedule, and optional role→label remap.
- Write the plugin cache, Claude Code user settings, or `pluginConfigs`.
- Duplicate the per-item `add --recurring` path, that path stays for filing a single recurring item;
setup is the bulk path that seeds or reshapes the whole schedule, opt-in on a first-time bind.
- Author a provider adapter. The seam bundles `github` and `local-markdown`, and setup only copies
the `jira`, `gitea`, or `linear` seed (step 4 of "Provider binding"); any other adapter lives in the
consuming repo at
`<project root>/tools/work-item-tracker/adapters/<provider>/`, not written by setup.
- Store secrets, the binding is tracked in git and carries non-secret config only (a provider token is
referenced by name from inside its adapter, never written here).
- Write machine-local state, the binding and schedule live in the consumer's tracked tree, never in
the plugin directory or plugin data directory.