--- name: nobrainer-sessions description: "Use when the owner says nb-sessions, nb-multi, or session-handoff, or asks for visible named reusable multi-session work with exact identity, isolated write scopes, audited handoffs, recovery, or controlled parallelism; do not use for a coherent one-session task." --- # NoBrainer Sessions Operate visible sessions as a small control plane. Human-readable titles make the workflow understandable; exact identity and readback make it trustworthy. This skill does not invent the project plan or replace implementation skills. Describe the outcome, success criteria and verification, let one project-level session prepare bounded task prompts, and bring child results back for review. Exact identity, write ownership, stop gates and independent receive-audit are required; a convenient parent-child topology is not itself a safety contract. Read [references/protocol.md](references/protocol.md) before setup, dispatch, or RECEIVE_AUDIT. ## Choose the smallest topology Default to one visible session named ` | MAIN`. Add a session only when a measurable benefit outweighs coordination cost: isolated write scope, durable handoff, resume after interruption, independent parallel work, or reuse of a warm specialist. Use stable role titles such as ` | QA` or ` | RESEARCH` when the responsibility persists. Use ` | ` for a bounded disposable work unit. Never treat a title as identity and never create a worker merely to make the topology look multi-agent. ## Capability and identity gate Discover the current harness capabilities for listing, creating, renaming, sending, reading, and waiting on visible sessions. Verify each mutation by readback. If exact session transport is unavailable, remain in MAIN and report the degraded mode; hidden workers are not equivalent to requested visible sessions. Before reuse or dispatch, bind the target in the session registry: - `THREAD_ID`, `HOST_ID`, harness and current status; - repository, `CHECKOUT` or worktree, branch/base/HEAD; - role, task, write scope and isolation; - active-turn state and last successful readback. Unknown, ambiguous, stale, or title-only identity is a stop condition. A submission is not delivery; record `SENT` only with transport readback. ## Modes - `setup`: reconcile an existing registry, name MAIN, and create only the next justified session. Do not pre-create a swarm. - `delegate`: send one self-contained work unit to one exact session. - `RECEIVE_AUDIT`: independently verify one report before any state advance. - `recover`: resume from canonical state and evidence without repeating the same failed attempt. - `handoff`: create a compact owner-requested continuation snapshot for a fresh MAIN session, including live state, exact unfinished work, evidence and the first safe action; do not pretend that writing the snapshot created or delivered a session. ## Writer and lease contract MAIN normally owns sequential workflow state. A worker owns only its bounded implementation scope and report. Never let two writers mutate the same state or checkout concurrently. Use the project's authoritative lease mechanism when one exists. A Markdown `LEASE` is advisory coordination, not atomic locking. `FENCING_EPOCH` is valid only when an authoritative control plane allocates a monotonically increasing token and every write boundary rejects stale tokens. Otherwise record `FENCING_SUPPORTED: NO` and `FENCING_EPOCH: NONE`; do not fabricate safety. Malformed, active, or uncertain lease state is `LEASE_CONFLICT`. Stop routing. For parallel writers require isolated checkouts, disjoint write scopes, and a coordinator-owned integration step. ## Delegate gate Dispatch only when all are true: 1. one approved work unit has an observable outcome, exclusions, dependencies, acceptance, verifier, evidence path, rollback, and owner gates; 2. canonical state identifies the same active task and allowed transition; 3. session identity, checkout, clean/dirty scope, lease, and active-turn state pass fresh readback; 4. frozen inputs and the cheapest relevant preflight check pass; 5. the report receiver is an exact session, not a title. Build the prompt from the template in the protocol. The worker performs exactly one work unit, does not select a successor, releases its lease on finish or hard stop, sends exactly one final report, and ends its turn. ## RECEIVE_AUDIT Treat `FINISHED` and `NEXT_ACTION` as untrusted report fields. Independently bind the report to the expected session, task, `CHECKOUT`, commit, diff, frozen inputs, manifest, tests, verifier, build/runtime, quality review and side effects. The lease gate passes only when readback proves `RELEASED`, or proves `NOT_HELD`/`UNSUPPORTED` for a workflow that explicitly uses one of those states; `NOT_RELEASED`, unknown ownership or a conflict blocks advancement. Choose exactly one result: - all gates pass: advance one canonical transition, then select at most one next task or close the workflow; - isolated correctable defect: one bounded corrective attempt; - missing or conflicting evidence, failed check, active turn, or lease conflict: preserve state and stop; - owner decision or irreversible action: ask for one explicit decision; - no remaining task: close, do not manufacture a successor. Retries require new evidence or a changed condition. Preserve a stable blocker fingerprint, attempt number, recovery owner, retry budget, checkpoint, rollback, and one concrete remediation action. ## Final response Report topology, exact identities created or reused, canonical state change, transport readback, audit result, evidence, uncertainty, recovery/rollback, and one next action. Never claim session creation, rename, dispatch, receipt, or completion without readback from the responsible system.