codex/skills/select/SKILL.md
Swarm-ready work selector: choose one source (invocation list, `SLICES.md`, or `plan-N.md`), refine it into dependency-aware atomic tasks, and emit an OrchPlan (waves + delegation) plus optional pipelines. Use for prompts like `$select`, `use $select`, `pick the next safe wave`, `pick the next ready slice`, `orchestrate workers from SLICES`, or `what should run in parallel next`. Plan-only; no writeback; orchestration-agnostic.
npx skillsauth add tkersey/dotfiles selectInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Pick a task source, refine it into dependency-aware atomic tasks, schedule parallel waves when safe, and emit an orchestration plan.
This skill is plan-only:
SLICES.md writes, no plan-N.md writes); instead it emits explicit manual writeback steps when needed (e.g., "mark <id> as in_progress").It may also emit a small pipeline for driving planning artifacts into execution (manual steps; optionally loopable).
$select is optimized for parallel multi-agent execution, so it prefers plans that are explicit, decomposed, and lock-safe.
scope locks.contract, implementation, integration, checkpoint) to improve sequencing and review quality.scope.scope (required for safe parallelism), plus location and validation whenever possible.waves[0], include the full safe first wave only after dependency and scope checks pass.When the selected source is coarse or linear, refine task structure before scheduling waves:
contract tasks for API/schema/interface/config decisions that unblock multiple downstream tasks.checkpoint/integration tasks as join points after parallel branches.Use two dependency channels with distinct meaning:
depends_on: hard prerequisite; contributes to DAG readiness and wave scheduling.related_to: soft ordering/context edge; never gates readiness or wave eligibility.If ordering is uncertain or advisory ("nice first", "reduces rework"), prefer related_to over depends_on.
If present, interpret these directives from the invocation text:
mode: both|triage|new
both (default): triage in_progress first; then select new work.triage: only triage in_progress and recommend close/reopen/continue.new: skip triage and select new work (still warn about in_progress).max_tasks: auto|<int>
auto.slices, auto means: keep any carried-forward in_progress task and add every additional dependency-independent task that safely fits in waves[0]; it may still resolve to 1 when scope or dependencies only permit one task.review: required|auto|off
required (default): run a reviewer pass and iterate until it passes (or stop+ask if blocked).auto: run one reviewer pass; fix what you can; proceed with remaining warnings.off: skip the reviewer pass.When multiple sources exist, pick exactly one using this precedence:
SLICES.md (if present and parseable).plan-N.md (highest N, repo root).If the highest-precedence source exists but has no viable tasks, do not default to an empty plan.
Detect sources without mutating them:
SLICES.md:
SLICES.md).plan-N.md:
plan-(\d+).md in the repo root and pick the highest N.Preflight (best-effort):
Before emitting warnings, attempt safe, deterministic fixes that do not mutate sources.
Order (stop when resolved):
#).depends_on is unknown, try to map it to a unique known id via a numeric suffix alias (e.g., 1 -> t-1, sl-1) or an exact canonical match.scope entry: trim whitespace; drop a leading ./ (normalize ./ to .); collapse repeated /; remove a trailing / (except /).auto_fix: scope_normalize if any scope entry changed.scope is missing, scan location, verification, id, title, description, and subtasks for explicit path or glob tokens (contain /, **, or a file extension).scope and suppress the missing-scope warning.agent: orchestrator lacks subtasks, downgrade to worker.Record auto-fixes in the Decision Trace (auto_fix) and keep warnings for unresolved issues.
After you choose the source kind, read and apply exactly one adapter spec:
codex/skills/select/ADAPTER_LIST.mdcodex/skills/select/ADAPTER_SLICES.mdcodex/skills/select/ADAPTER_PLAN.mdRegression fixtures live in codex/skills/select/FIXTURES.md.
Parallelism is only scheduled when tasks provide enough metadata to make it defensible.
codex/skills/select/references/lock-roots.md.scope list.scope sets do not overlap.
scope entries as exclusive locks.scope entry: normalize it (drop leading ./; collapse /), drop a trailing /** or /**/*, then take the prefix up to the first glob metachar (*, ?, [).scope are treated as overlapping everything and therefore scheduled alone.
missing_scope only when it affects this plan's wave packing.scope list (paths/globs) to unlock parallel waves.scope are treated as overlapping everything and therefore scheduled alone.
"", ., ./, /, *, **, **/*.broad_scope only when it affects this plan's wave packing.depends_on edge to make the order intentional.
implicit_order only when lock roots are nested (strict prefix), the tasks are otherwise dependency-independent (no DAG path), and the order was chosen by tie-breaks/stable order.Parallel waves are only useful if each task is independently executable by a worker.
location: where to work (paths/globs; navigation only; does not affect scheduling)validation: how to prove done (commands/checks; does not affect scheduling)validation, warn missing_validation for tasks in that wave that lack validation.When $select selects work to start now (i.e., the tasks in the first scheduled wave waves[0]), it must also emit a claim so other planners/executors do not pick the same work concurrently.
in_progressin progress, in-progress, in_progressin_progress.list or plan, emit claim: none.st import-orchplan once, then st claim --wave <wN> --executor teams|mesh before any spawn_agent or $mesh run.$st handoff; if a helper still exists, it must auto-route into the same durable path internally.This is still plan-only: $select does not perform the writeback; it spells out what to change.
Tasks may be delegated to an agent: orchestrator only when the user provided subtasks.
If agent: orchestrator is set but subtasks is empty/missing, downgrade to agent: worker, record an auto-fix, and warn.
Emit one YAML block with the canonical plan.
Schema (YAML; best-effort, omit unknown keys):
schema_version: 1
kind: OrchPlan
created_at: "<rfc3339>"
source:
kind: list|slices|plan
locator: "<freeform; e.g. 'invocation', 'SLICES.md', 'plan-3.md'>"
# Optional. If omitted, treat as "auto" (unbounded by cap; waves are dependency/lock driven).
cap: auto
# Optional. Human/worker context only (does not affect scheduling).
prereqs: []
risks: []
tasks:
- id: t-1
title: "..."
description: "..." # optional
workstream: "..." # optional
role: contract|implementation|integration|checkpoint # optional
parallelism_impact: "unlocks <n> tasks" # optional best-effort
agent: worker|orchestrator
scope: ["path/**"]
location: ["path/file"] # optional
validation: ["..."] # optional
depends_on: []
related_to: [] # optional non-gating links
subtasks: []
waves:
- id: w1
tasks: [t-1, t-2]
- id: w2
tasks: [t-3]
integration:
boundary: patch-first
order: [t-1, t-2, t-3]
conflict_policy: rebase-author
warnings:
- "..."
After the OrchPlan YAML, emit a short plaintext trace (tight and structured):
source: chosen source kind + locatormode: resolved mode + resolved max_taskstriage: if any in_progress was seen, state: continue <id> OR recommend close <id> OR recommend reopen <id> OR noneclaim: mark <in_progress token> <id,...> OR already <in_progress token> <id> OR nonecounts: totals for the chosen source (at minimum: leaf, ready, blocked, in_progress)fanout_possible: number of dependency-independent tasks that could safely fit in waves[0] after scope checksfanout_selected: number of tasks actually placed into waves[0]fanout_left_on_table: fanout_possible - fanout_selectedpick: selected task id + 3-10 word reasonnext2: next two candidates (or none) + 3-10 word reason eachwaves: (recommended when tasks were scheduled) N + a compact wave listing (e.g. w1[t-1,t-2]; w2[t-3])review: pass|warn|skipped|blocked + 0-6 word notewarnings: list count + top 1-3 keys (e.g. unknown_deps, status_drift, cycle, broad_scope, implicit_order, underfilled_wave, missing_validation, linear_graph, missing_role, missing_checkpoint)auto_fix: list count + top 1-3 keys (e.g. dep_alias, scope_normalize, scope_infer)depends_on.workstream where useful.contract tasks when they can unlock parallel implementation branches.checkpoint/integration tasks as explicit join points across branches.related_to instead of depends_on.scope locks (tight paths/globs), plus location and validation where possible.id; apply orchestrator rule; treat unknown deps as blocked (pending auto-remediation).depends_on + scope locks.
7.5. If selecting new work, compute claim from waves[0]; for source-backed flows emit manual status writeback, and for durable execution handoffs keep the first-wave wave_id plus executor decision ready for st import-orchplan + st claim --wave <wN> --executor teams|mesh.review): check deps/order/locks/validation/delegation gaps; revise as needed.
depends_on to related_to when safe.waves[0] leaves safe ready work unclaimed and max_tasks was not explicitly capped, treat it as a planning defect and revise until fanout_left_on_table=0 or emit a blocking explanation.review=required: iterate until review: pass OR stop+ask if blocked.Build waves using dependency readiness and scope locks:
depends_on edges only (related_to is non-gating and excluded from DAG readiness).ready = unscheduled tasks whose deps are all scheduled.scope as overlapping everything (i.e. it can only be scheduled alone).scope locks ("", ., ./, /, *, **, **/*) as overlapping everything.ready whose scope lock roots do not overlap (greedy is fine).cap and max_tasks are auto, keep the full maximal subset; do not trim to one task merely because the source is slices.cap is a number, limit the wave to cap tasks.When you must choose between conflicting tasks (overlapping scope or cap pressure), use scoring beyond priority:
role=contract|checkpoint, then integration, then implementation.related_to another ready task, prefer the related-first ordering when it likely reduces rework.scope and explicit validation.Emit warnings when unresolved (noise-controlled; warn only when it affects this OrchPlan):
missing_scope: a task missing scope prevented adding at least one other ready task to the same wave.broad_scope: a task with overly-broad scope prevented adding at least one other ready task to the same wave.implicit_order: two dependency-independent tasks had nested lock roots and were concurrently ready; order chosen by tie-breaks/stable order.missing_validation: a parallel wave mixed tasks with and without validation.unknown_deps: a depends_on points at an unknown ID.orchestrator_without_subtasks: a task declared agent=orchestrator without subtasks.underfilled_wave: waves[0] left safe ready tasks unclaimed without an explicit max_tasks cap.linear_graph: the dependency graph is mostly chain-like and a safe split into workstreams/contracts/checkpoints appears possible.missing_role: multi-wave plan lacks role annotations where they are needed for reasoning/review.missing_checkpoint: multiple parallel implementation branches have no explicit integration/checkpoint join.
If a warning is auto-remediated, omit it from warnings and list it under auto_fix (except orchestrator downgrade, which must still warn).schema_version: 1
kind: OrchPlan
created_at: "2026-02-02T00:00:00Z"
source:
kind: list
locator: "invocation"
cap: auto
tasks:
- id: cfg
title: "Add config loader"
agent: worker
scope: ["src/config/**"]
location: ["src/config/loader.ts", "src/config/index.ts"]
validation: ["npm test -w config"]
depends_on: []
subtasks: []
- id: ui
title: "Update settings UI"
agent: worker
scope: ["src/ui/**"]
location: ["src/ui/Settings.tsx"]
validation: ["npm test -w ui"]
depends_on: []
subtasks: []
- id: wire
title: "Wire config into UI"
agent: worker
scope: ["src/app/**"]
location: ["src/app/bootstrap.ts"]
validation: ["npm test"]
depends_on: [cfg, ui]
subtasks: []
waves:
- id: w1
tasks: [cfg, ui]
- id: w2
tasks: [wire]
integration:
boundary: patch-first
order: [cfg, ui, wire]
conflict_policy: rebase-author
warnings: []
Decision Trace:
schema_version: 1
kind: OrchPlan
created_at: "2026-02-02T00:00:00Z"
source:
kind: list
locator: "invocation"
cap: auto
tasks:
- id: api
title: "Add /health endpoint"
agent: worker
scope: ["src/api/**"]
location: ["src/api/health.ts", "src/api/router.ts"]
validation: ["npm test -w api"]
depends_on: []
subtasks: []
- id: docs
title: "Document /health endpoint"
agent: worker
scope: ["docs/**"]
location: ["docs/api.md"]
depends_on: []
subtasks: []
- id: big
title: "Repo-wide rename OldName -> NewName"
agent: worker
scope: ["**"]
location: ["."]
validation: ["rg -n \"OldName\" . || true"]
depends_on: []
subtasks: []
waves:
- id: w1
tasks: [api, docs]
- id: w2
tasks: [big]
integration:
boundary: patch-first
order: [api, docs, big]
conflict_policy: rebase-author
warnings:
- "missing_validation: [docs]"
- "broad_scope: [big]"
Decision Trace:
Adapter specs live in:
codex/skills/select/ADAPTER_LIST.mdcodex/skills/select/ADAPTER_SLICES.mdcodex/skills/select/ADAPTER_PLAN.mdPipelines live in codex/skills/select/PIPELINES.md.
testing
Use before local patching when bugs, regressions, malformed state, crashes, parser failures, migrations, cache drift, protocol problems, compatibility requests, tolerant readers, fallbacks, coercions, retries, catch-and-continue logic, or local workarounds may broaden accepted invalid state.
testing
Use for bug reports, PR/issue prose, reviewer comments, user diagnoses, generated summaries, memories, retrieved context, public tracker context, claimed root causes, proposed fixes, fake-minimal repro risk, or any investigation where natural-language context could anchor the implementation scope.
development
Use when non-trivial work needs Challenge Escalation, latent-intelligence activation, frame-market selection, doctrine operators, dominant-move selection, ablation/surface-tax judgment, reification, review comment law, negative capability, route receipts, or proof-bearing refusal to mutate.
development
Apply Algebra-Driven Design. Use for ADD, denotational design, combinator models, law-driven architecture, domain algebra, property tests, codebase modeling, event sourcing, workflow design, or agentic skill design. If the canonical bundle is unavailable, use this wrapper as the minimal ADD kernel and report the missing bundle path.