Skip to content
Back to skills

Setup

ASecurity

Check discovery prerequisites, print gate allow rules, and apply docs/conventions/discovery.yaml after confirmation (actions: check, apply).

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

Works with

  • claude code

Security analysis

A100/100

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

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

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: "Check discovery prerequisites, print gate allow rules, and apply docs/conventions/discovery.yaml after confirmation (actions: check, apply)."
argument-hint: "[check|apply] [<key>=<value> ...]"
user-invocable: true
disable-model-invocation: true
---

# Setup

## Purpose

Report whether this session can run the discovery plugin's dispatch design, and print the permission
rules that stop the acceptance-gate scripts prompting on every run. Artifact placement needs no
configuration: the plugin's artifact protocol
([`${CLAUDE_PLUGIN_ROOT}/reference/artifact-protocol.md`](${CLAUDE_PLUGIN_ROOT}/reference/artifact-protocol.md))
fixes where `EXPLORE.md`, `RESEARCH.md` and `INTENT.md` land, in the memory slice
`<memory_dir>/<slug>/`, never committed.

The plugin owns one tracked consumer file, `docs/conventions/discovery.yaml`, the repository layer
of its settings (keys, values and layers:
[`${CLAUDE_PLUGIN_ROOT}/reference/config.md`](${CLAUDE_PLUGIN_ROOT}/reference/config.md); schema:
`${CLAUDE_PLUGIN_ROOT}/schemas/discovery.schema.json`). `check` reports it; `apply` writes it,
plus, on the operator's yes to the convention-home offer, the instruction-file region and the
`.gitignore` line (`apply` step 4). The harness rows and the operator's `~/.claude/settings.json` are reported only, never
written. Action routing: no argument or `check` runs the check; `apply` runs the check, then
writes. Re-running either reads the current state again.

## `check` (read-only)

Report a PASS/INFO/WARN table. Do not write anything. No row is ever a FAIL or a blocker.

1. **Dispatch capability.** `/discovery:explore` and `/discovery:research` dispatch a subagent by
   default, and that posture degrades rather than breaks on a session that cannot support all of it.
   Report these as PASS/INFO rows:
   - **Harness version against the 2.1.219 floor** (`claude --version`). Below it, several behaviors
     the dispatch design relies on are false rather than merely absent: background became the default
     subagent execution mode in **2.1.198**, and below **2.1.218** a `context: fork` skill always
     blocked the invoking turn and the narrow background tool set did not apply to it. As of
     2026-07-25; recheck when the section below changes when background became the default or how a
     fork skill runs. For current behavior, see
     [subagents: run subagents in foreground or background](https://code.claude.com/docs/en/sub-agents#run-subagents-in-foreground-or-background);
     the record for background as the default is
     [`${CLAUDE_PLUGIN_ROOT}/reference/parent-contract.md`](${CLAUDE_PLUGIN_ROOT}/reference/parent-contract.md),
     "Harness facts the dispatch design rests on". Report the
     observed version and, when it is under the floor, name which of those the session does not have.
     The skills still run, inline is always available, so this is INFO, not FAIL.
   - **`CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH`**. Report the value, present or absent, and say what
     the running harness does with it rather than assuming. Read absent against the observed
     version, in four windows: below **2.1.172** nesting does not exist and the variable buys
     nothing; **2.1.172** to **2.1.216** absent means available at a fixed five; **2.1.217** to
     **2.1.218** absent means *off*, and setting the variable is the only way to turn nesting on;
     **2.1.219** and later absent means available at a configurable default of three, and the
     variable lowers the ceiling (`"1"` disables nesting) as readily as it raises one. For the
     current default and the variable's version history, see
     [Let subagents spawn their own subagents](https://code.claude.com/docs/en/sub-agents#let-subagents-spawn-their-own-subagents)
     and the variable's row in [env vars](https://code.claude.com/docs/en/env-vars). As of
     2026-10-02; recheck when the default or the version history changes.
     Report absent as INFO in every window: nesting buys
     **throughput**, not coverage, without it a dispatched agent fans out sequentially, slower for
     the same result. The variable is still only one of **two** conditions: it cannot add a tool an
     agent definition left out. The shipped `discovery:explorer` / `discovery:researcher` definitions
     list `Agent` for exactly this reason; a third-party agent that does not is unaffected by setting
     it. It is not a correctness prerequisite here, because the one control that needs a context
     which has not seen the work is the outcome-gate verifier, and the parent dispatches that as a
     **sibling** rather than the agent as a child. Note that a shell env var is read at session start,
     so a value exported now takes effect next session. Whether a settings-file `env` value reaches
     a running session is
     [env vars: set variables in settings files](https://code.claude.com/docs/en/env-vars#set-variables-in-settings-files)'s
     to state.
   - **Fork availability.** Report it as a control, not a gate. Report `CLAUDE_CODE_FORK_SUBAGENT`
     when set; when unset, read the default for the observed version and session kind (interactive,
     `claude -p`, the SDK) from the pointer below and report that, never one remembered here. A
     default is not a runtime guarantee, so the only authoritative probe is still a live
     inheritance check (see `discipline:sweep-all`'s preflight); never claim forks are
     unconditionally available on every build. Name the command that starts a fork by hand as the
     pointer's fork section gives it.
     - **Pointer**: [Turn fork mode off](https://code.claude.com/docs/en/sub-agents#turn-fork-mode-on-or-off)
       for the default and the versions it changed in;
       [Fork the current conversation](https://code.claude.com/docs/en/sub-agents#fork-the-current-conversation)
       for the command that starts a fork by hand; the variable's row in
       [env vars](https://code.claude.com/docs/en/env-vars) for what each value does.
2. **Gate allow rules.** The acceptance-gate scripts prompt on every run unless the operator's
   `~/.claude/settings.json` allows them. Read its `permissions.allow` (a missing file or key reads
   as no rules; read only, never write) and compare it with these twelve rules for this install root:

   ```text
   Bash("${CLAUDE_PLUGIN_ROOT}/scripts/check-dispatch-artifact.sh" *)
   Bash("${CLAUDE_PLUGIN_ROOT}/scripts/check-coverage-complete.sh" *)
   Bash("${CLAUDE_PLUGIN_ROOT}/scripts/check-source-applicability.py" *)
   Bash("${CLAUDE_PLUGIN_ROOT}/scripts/check-restatement-labels.py" *)
   Bash("${CLAUDE_PLUGIN_ROOT}/scripts/check-author-kind.py" *)
   Bash(python3 "${CLAUDE_PLUGIN_ROOT}/scripts/check-claim-eligibility.py" *)
   Bash(${CLAUDE_PLUGIN_ROOT}/scripts/check-dispatch-artifact.sh *)
   Bash(${CLAUDE_PLUGIN_ROOT}/scripts/check-coverage-complete.sh *)
   Bash(${CLAUDE_PLUGIN_ROOT}/scripts/check-source-applicability.py *)
   Bash(${CLAUDE_PLUGIN_ROOT}/scripts/check-restatement-labels.py *)
   Bash(${CLAUDE_PLUGIN_ROOT}/scripts/check-author-kind.py *)
   Bash(python3 ${CLAUDE_PLUGIN_ROOT}/scripts/check-claim-eligibility.py *)
   ```

   Report one row, **never FAIL**: PASS when all twelve are present for this install root; INFO "stale"
   when gate rules name a different `…/scripts/check-*` root (an earlier version's cache directory,
   which stops matching after an update), naming that root; INFO "absent" otherwise. On stale or
   absent, print the twelve rules resolved to this install root and ready to paste, each as a JSON
   string for `permissions.allow` (the quoted forms escape their inner `"`). Applying them is the
   operator's job: this skill never writes user settings. The rules pin this version's cache
   directory on purpose, so a plugin update invalidates them and `check` reports them "stale" again;
   why a version wildcard is unsafe is in
   [`${CLAUDE_PLUGIN_ROOT}/reference/parent-contract.md`](${CLAUDE_PLUGIN_ROOT}/reference/parent-contract.md)
   ("Operator setup").
3. **Repository settings.** Run
   `"${CLAUDE_SKILL_DIR}/scripts/setup-apply.mjs" --check` from the project root and report each
   line it prints with its own INFO, PASS or WARN prefix. INFO when
   `docs/conventions/discovery.yaml` is absent (every key comes from `userConfig` or its default);
   PASS with each key's value when the file validates; WARN when it does not (a value outside the
   key's list, a key set twice, an empty value or empty string, or a map or list where one string
   belongs), quoting the file, key and value. An invalid value never stops a discovery skill: the
   skill names it and drops that layer, so the row is a WARN. `apply` fixes a value outside the list
   or an empty value; the other shapes are fixed by hand, and `apply` refuses the file until then.

## `apply` (writes `docs/conventions/discovery.yaml`, and the step 4 region and ignore line on a yes)

1. Run `check` and show its table.
2. **Resolve the values.** With complete `<key>=<value>` arguments, use them. Otherwise ask one key
   at a time, recommendation first, from the Keys table in `${CLAUDE_PLUGIN_ROOT}/reference/config.md`
   (`explore_output`: `auto`, the default, unless the team wants every run pinned to `change-prep`
   or `explain`). Never invent a key the schema does not list.
3. **Write.** One call with every value:

   ```bash
   "${CLAUDE_SKILL_DIR}/scripts/setup-apply.mjs" explore_output=explain
   ```

   Pass `--default <key>` as `${CLAUDE_PLUGIN_ROOT}/reference/setup-apply.md` "Defaults" says.

   The script checks each value against the schema and validates the whole resulting document
   before it writes; an invalid value or key, or an existing file with a key set twice, an empty
   string, a map or a list, exits 1 with one line and writes nothing. It writes the file only at
   `<git toplevel>/docs/conventions/discovery.yaml`. It resolves a symlinked root first, then
   refuses a root that is `$HOME` or an ancestor of it, a symlinked `docs`, `docs/conventions` or
   target, a hard-linked target, or a `docs/conventions` that resolves outside the repository,
   checked again right before the
   write, so the file never lands outside `docs/conventions/`. A missing file is created. A value already in place prints
   `already configured` and writes nothing.
4. **Diff, convention-home offer and verify.** Follow `${CLAUDE_PLUGIN_ROOT}/reference/setup-apply.md` from "A file that would
   change" through "Verify", with `<file>` = `docs/conventions/discovery.yaml` and `<apply-script>` =
   `"${CLAUDE_SKILL_DIR}/scripts/setup-apply.mjs"`.

## Output

`check`: the table and, when the gate allow rules are stale or absent, the twelve resolved rules as
JSON strings ready to paste. `apply`: the table before and after, the diff when one was shown, the
written path, and whether the file is tracked.

## Next

`/discovery:explore`

## Gotchas

- **Shell env vars are read at session start.** A capability the check reports as missing stays
  missing for the rest of this session even after it is exported in the shell; the recommendation
  takes effect next session. Whether a variable set in a settings file's `env` applies now is
  [env vars: set variables in settings files](https://code.claude.com/docs/en/env-vars#set-variables-in-settings-files)'s
  to state.
- **The gate allow rules stop matching after a plugin update.** They name this version's cache
  directory, so the gates prompt again until the operator pastes the rules `check` prints; `check`
  reports them "stale".
- **The repository file reaches the team only once committed.** `apply` leaves it uncommitted on
  purpose, and the tracked-file pair says so.

## What this skill does NOT do

- Run an exploration, research, or intent-tracing pass. Those are the plugin's discovery skills
  (`/discovery:explore`, `/discovery:research`, `/discovery:trace-intent`).
- Write machine-local state. The plugin directory and the plugin data directory
  (`${CLAUDE_PLUGIN_DATA}`, for caches and generated state only) stay untouched.
- Write Claude Code user settings or `pluginConfigs`. `check` reads `~/.claude/settings.json` and
  prints the gate allow rules; the operator applies them.
- Write any file other than `docs/conventions/discovery.yaml`, except the `apply` step 4 region and
  ignore line on the operator's explicit yes.

Files in this skill

  • SKILL.md10.7 KB
  • evals/evals.json2.6 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.