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. Configure the autonomy plugin for this repository: discover the adopting org's state (role homes, substrate availability, budget posture, pipeline slots with live prices), interview where discovery cannot infer, and write the schema-versioned binding under .claude/autonomy/. Use when: 'set up autono

How to use this skill

Skill file

Purpose

Discovery phase of autonomy adoption. Maps the roles in

CODE0 to this org's real instances

and records the result as the schema-versioned binding the resolution ladder in

CODE0 reads at the repo-local layer. Never assumes

any org, repo, tracker, or fleet shape. Discovery reads what exists, the interview fills what

it cannot infer, and every landed change is reviewable per

CODE0.

Actions

resolution ladder. User-global (~/.claude/autonomy/) → project (.claude/autonomy/) →

personal override (.claude/autonomy/**/*.local.*), additive, plus the org rung when the merged

layers carry an org_policy_home pointer: fetch the org binding via the host CLI with the

consumer's own auth and fold it in at its ladder position. Report what is bound, what is

missing, and which layer or rung contributes each value; an unreachable org-policy home is

warned as not-considered, never silently omitted. Also report whether node resolves on PATH

(command -v node through the Bash tool, so the probe works without the hook launcher): every

hook row runs through node hooks/exec-bash.mjs, so without it the hooks do not launch and

are not enforced. Report each pipeline slot from the record that owns it. No writes.

reads the existing binding and proposes deltas; it never overwrites blind and never touches

unrelated user content. All project paths anchor at the project root. Resolve

${CLAUDE_PROJECT_DIR} (fall back to the repository toplevel) before writing; invoking the

skill from a subdirectory must never create a nested .claude/autonomy/.

Argument surface (enumerated)

| Argument | Values | Headless default |

|---|---|---|

| action | check \| apply | (required) |

| --org-policy-home | repository locator, optionally #<path> to the binding document \| none | none |

| --budget-posture | free \| paid-opt-in | free |

A locator without #<path> triggers document discovery at bind time (the binding instance

document is found by its schema-versioned shape per the org repo's own layout) and the

resolved path is persisted alongside the pointer so later fetches are deterministic.

Slices marked argument-selected below (guardrail, routine) run only when the free-text remainder

of the invocation names them, for example apply followed by "wire the guardrail slice"; none of

the enumerated flags selects a slice.

apply with every argument supplied runs non-interactively, no prompts, so automation and

headless use work. With arguments missing, discovery infers first and interviews only the

gaps (convention ladder: config present → use it; absent → infer and persist; cannot infer →

ask and offer to persist; otherwise → safe free-tier default).

Discovery (apply)

  1. Role homes: inspect the repository and, when a host CLI with the consumer's own auth is

available, the org, which repositories hold the CI-orchestration, settings-as-code, and

org-policy roles. A solo/no-org adopter terminates at the binding-seam contract's terminal

default: the repo-local binding is the whole binding, free-tier defaults throughout.

  1. Substrate availability: what execution surfaces exist (local machine, CI runners,

self-run infrastructure). Recorded as declared posture, not probed destructively.

  1. Budget posture: free unless the user explicitly opts into paid-opt-in; anything

paid is advisory + explicit opt-in with cost surfaced first (wiring-vs-advisor).

  1. Pipeline slots: runner, git host, ticket tracker, observability. Each slot reads what steps

1 and 2, the telemetry slice, and the work-items tracker binding already found, lays out the

option classes with no preference, looks up the price of any option that can bill at run time,

and hands wiring to the slot's owner. No price is ever written to the binding or this skill.

Read CODE0 when apply reaches this step or

check reports slots: it owns the slot-to-owner table, the option classes, and the live

price-research step.

Written binding

apply writes .claude/autonomy/binding.json with these serialized keys:

(capability-distribution-home, ci-orchestration-home, settings-as-code-home,

org-policy-home, runner-execution-home); a value may be null (unborn role, or no org

instance, never invented);

discovered;

self-run-infrastructure), boolean values.

The same file name is the shape at every layer: the user-global layer is

~/.claude/autonomy/binding.json, the project layer .claude/autonomy/binding.json, and

each layer's personal override binding.local.json beside it. The project file is tracked

(team-shared); recommend the recursive consumer .gitignore line: .claude/**/*.local.*.

Layers resolve per the binding-seam ladder, additively: user-global → org binding (when

pointed) → project → personal override. Capability slices (like telemetry below) add their

sections additively under their slice name: a binding without a slice's section is valid

(absent-section tolerance) and no schema major bump is needed for an additive section.

Telemetry slice

Wires the emitting state of

CODE0

for all three execution contexts, discovery-first. Everything lands as reviewable changes;

paid sinks are advisory + explicit opt-in with cost surfaced first.

  1. Detect an existing observability stack. Interview + repo/env inspection (OTEL_*

endpoints in settings/env blocks, collector configs, known backend config files). Found →

wire emission toward it: agent-session env block (settings env) and a CI emission snippet

pointing at the org's endpoint. Paid/hosted stack → advisory with cost surfaced before any

opt-in.

  1. No stack → the file-artifact free default (zero paid dependencies):

CODE0 when apply reaches this

step for the snippet, uploading the artifact directory per run;

static OSS collector binary + file-exporter config writing JSON-lines into the same

artifact directory. Per-job, no standing infrastructure);

one exists, else a local collector instance (same binary + config template) exporting

into a local query-on-read store directory.

draw from metered pools.

  1. Agent-session wiring (Claude Code specifics). Turn the session's telemetry export on with

the variables

monitoring: common configuration variables

names, read live, and for work-item-dispatched sessions set

OTEL_RESOURCE_ATTRIBUTES carrying autonomy.work_item.url=<canonical item URL>. The

slice treats spans as optional and never depends on beta span shapes. It joins on

autonomy.work_item.url, never on inbound trace context; relying on native inbound-context

joining is the telemetry contract's recorded migration trigger. Read

CODE0 when a binding

asks about trace context, spans or the join, needs evidence that a guardrail fired, or asks

what memory activity is observable: it holds the pointer records for these wiring decisions,

the permission-decision event, and the memory gap.

  1. Record the binding. Sink class, endpoint or artifact path, and the semconv pin land

as the telemetry section of the schema-versioned binding.

  1. Conformance. Run

CODE0 against

produced OTLP JSON-lines to verify the pinned schemaUrl and the join attribute before

declaring the emitting state reached.

Return-accounting capture slice

Wires the capture-enabled state of

CODE0,

discovery-first: detect the tracker class and close-flow surface, wire the close- and

reply-triggered attestation handlers via the close-triggered snippet in

CODE0 where machine-editable (the

marker-keyed comment floor, or provenance-verifiable native fields), advise where GUI-only or

entitlement-gated, and record the

capture section of the repo-local autonomy binding. Read

CODE0 when apply reaches the capture slice: it

owns the autonomous-class capture gate, the record-integrity rule, the attestation-routing rule,

and every serialized capture key. Agents prompt and aggregate; they never estimate the two

human-attested return fields.

Trigger/dispatch slice

Wires the signal-adapter and dispatch state of

CODE0,

discovery-first: discover the four signal-surface classes and their transports, wire the DIY floor

(event kick + scheduled drain) as reviewable changes through the one queue-drain entrypoint, advise

plan-gated integrations, and record the triggers section (the surfaces map + drain cadence) of

the repo-local autonomy binding. Vendor event names and invocation flags live in this slice's

CODE0 (adapter shapes) and

CODE0 (acknowledgment shape), never the contract.

Read CODE0 when apply

reaches the trigger/dispatch slice: it owns the per-surface adapter obligations, the

execution-surface attestation caveat, the admission fail-closed rule, every serialized triggers

key, and the CODE0 conformance

step.

Guardrail binding resolution

How guardrail policy resolves across the two governance surfaces the guardrail contract

splits policy into. This section owns resolution; the guardrail slice below

(detect → bind → live-validate → fail-closed) is the action that produces the security binding

this order resolves.

Two-surface split. Security-sensitive guardrail axes. Isolation bindings with their

runtime markers, merge policy, verification blocking knobs, per-class verification

topology, promotion state, escalation

routes, admission rules and caps. Bind only in the security binding document in the

settings-as-code home, outside the blast radius of the agents it governs. Its schema is

contract-owned and ships at

CODE0;

CODE0 validates a

document (schema shape + the semantic rules the schema cannot express) and, with

--evidence, resolves each promotion cell's effective state against a promotion-evidence

source, the bound state is a ceiling contrary evidence lowers without writing the

binding. Read the

admission-policy leaf directly

when binding admission rules and caps: it owns the decision table, the wildcard precedence rule,

and the override_justification floor those caps enforce. Non-security axes remap in the

additive guardrails section of the repo-local binding: class→label strings (which local label

means which work class; read the

work-classes leaf directly when

resolving what a label maps to; it owns the risk-property bundles and promotion discipline behind

each class) and cost-tier→model names. Vocabulary remaps only, never policy content.

A third home that is not a governance surface. Two axes of the

verification-topology leaf

bind in this plugin's userConfig rather than either governance surface: the verification lens

pool, and whether the advisory visual narration lane runs. Neither counts anything, the pool

contributes to no floor, and the narration lane has no security-binding cell at all, so neither can

weaken a floor, which is what lets them sit on an operator surface. The placement holds only while

no settings file a watched repository commits can set this plugin's options, so a repo cannot dial

its own verification. The slice proposes neither as a binding field.

<https://code.claude.com/docs/en/settings-reference#pluginconfigs> live.

Layered resolution order. Org-policy-home defaults → settings-as-code per-repo

security binding → repo-local non-security remaps. Later layers refine earlier ones for

non-security axes only; no repo-local (agent-writable) value ever supplies or overrides a

security axis.

Security-binding locator registry. When settings-as-code is a separate repository,

the org-policy home carries the repo→security-binding-document registry the dispatch seam

resolves each repository's security binding through. One registry, resolvable per repo,

on the org governance surface.

Agent-unwritable bootstrap for security resolution. The repo-local org_policy_home

pointer is tolerable for non-security defaults only, a repo-writable pointer would let

an agent redirect the whole chain to a forged policy repository carrying a forged

registry, binding, and matching runtime markers. For security resolution the seam pins

the org-policy-home identity from an agent-unwritable bootstrap: org-level platform

configuration outside repo blast radius (an org-level setting or variable repo agents

cannot write) or the executor's trusted deployment config. Any security resolution that

would depend on a repo-writable pointer, or an unresolvable locator, fail-closes

autonomous dispatch, naming the compliant path (pin the home in org-level configuration

or the executor's deployment config).

Fail-closed. An absent or invalid security binding blocks autonomous dispatch.

Every signal enqueues human-gated. Documented defaults exist only for non-security axes;

no security axis ever resolves from a documented default or a repo-local surface.

Guardrail slice

Wires the enforced state of the guardrail contract

(open it, then the guardrails/<leaf>.md it routes to, for whatever axis is in question): detect,

bind, live-validate, fail-closed, always detect-diff-reconciling against the org's existing

guardrail surfaces. The resolution section above owns how bound

policy resolves; this slice is the action that produces the security binding it resolves. Read

CODE0 when apply reaches the guardrail

slice: it owns the per-layer wiring, the isolation-ladder probe (recipe in

CODE0), the security-binding schema and

its validator, and the paid-SKU opt-in surface. It reads

CODE0 when a surface's host is Windows. The

slice is argument-selected, so a run that does not select it never needs the file.

Routine slice

Wires the standing-routine state of the

routine catalog (read it to pick a routine; each

recipe is a leaf under routines/): a routine is a scheduled

temporal-class signal adapter behind the governed queue, never a private execution or merge path.

Like the guardrail slice it prepares the security surface and never writes it.

Read CODE0 when apply reaches the routine slice:

it owns the discovery-first reconciliation against the org's existing schedulers and bots, the

CODE0 template, the CI-cron

handler shape, and the signal-envelope verification. The slice is argument-selected, so a run

that does not select it never needs the file.

Prerequisite-resolution slice

Extends this skill per its own extension model for

routine prerequisite resolution.

Read

CODE0 when

apply reaches the prerequisite-resolution slice: it owns the binding-section JSON shape and

the wrapper scripts' non-interactive flags.

Liveness. The slice check is an engine health-check surface: it invokes

CODE0 end-to-end and

fails loud on internal failure, never a verdict-shaped fallback.

  1. check. For each scheduling surface already recorded under triggers / routines

(this slice declares no surfaces map of its own), report per-identity verdicts with

provenance via

CODE0.

A bare repo yields unsupported / unknown for every identity, never an error.

  1. apply. Detect-diff-reconcile against existing prerequisite_resolution

declarations; a declaration contradicting a ran-negative probe is a finding (identity

stays negative while the finding is open). The prose-context pass

reads CLAUDE.md / AGENTS.md (whether a session loads AGENTS.md is a Claude Code

rule, recorded in the slice context's "Instruction-file loading" section) / README to

propose declarations into non-security keys only; the human ratifies; the slice

writes the additive section (surface_refs + declarations, no surfaces map).

Narrowing-only enablement: enable in routines.enabled only when the verdict clears;

negative/unknown routes to the advisory path. Org-rung entitlements are interviewed,

never auto-written. Non-interactive contexts skip ask-and-persist and report assumptions.

Security-binding changes are prepared, never written.

Wrapper:

CODE0.

Runner note

The runner design pack is bindable-when-born:

until a build trigger fires and the runner-execution home is born, setup records nothing

runner-specific. No probe, no wiring, no binding section for the unborn home. The runner

pipeline slot is a different thing, the surface agent jobs run on today, and records only into

substrate. The single

exception is escalation notification routes, which already home on the security surface: the

severity axis (notice/attention/urgent) and the personal-push tier are prepared as route

options through the security binding's escalation_severity, escalation_severity_routes, and

escalation_ack keys, a reviewable change on the settings-as-code home like every other

security axis, never repo-local. The route set, its two-step severity resolution, and the

per-class default severities are specified by the

runner escalation leaf; this note points

there rather than restating them. The full lifecycle state model and each transition's telemetry

are specified by the

runner lifecycle leaf; read it directly

when tracing how a leased item moves through its states, since this note does not restate the

state machine. The ownership-seam map assigning each part of the runner to its owning home is

specified by the runner topology leaf; read

it directly when placing a runner obligation on its home, since this note does not re-derive the

split.

Next

Gotchas

Run-time failure modes, the two-binding split (repo-local autonomy binding vs the separate

security binding), detector-fired temporal signals that carry no routine identity, and a

scheduling surface recorded in two surfaces maps resolving as ambiguous, are catalogued in

CODE0.

What this skill does not do

extends this skill.

contract forbids it, and an eval in this repository showing a model's estimates match

human-attested effort bands is only its recheck trigger.

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

repository). Nor platform settings.

defaults; it never guesses silently.

Classes only; the deployment picks instances.

the run's reply only.

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.