Send the marching-orders prompt via ntm --robot-send (NOT inline Agent()):
ntm --robot-send="$NTM_PROJECT" --pane-name="impl-<bead-id>" --msg="
## Agent Mail Bootstrap
Call macro_start_session(human_key: '<cwd>', program: 'claude-code', model: '<your model name>',
task_description: 'Implementing bead <id>: <title>')
Note your assigned agent name for messaging.
## File Reservation
Before editing any files, call file_reservation_paths with the files you plan to modify.
Release reservations when done: release_file_reservations.
## Agent Mail Runtime Safety
Use the Agent Mail MCP/HTTP tools for inboxes, messages, and reservations. Do NOT run mutating
`am doctor` commands (`repair`, `archive-normalize`, `reconstruct`, `fix`) and do NOT delete
`.mailbox.activity.lock` or `storage.sqlite3.activity.lock`. The live `am serve-http` daemon
intentionally holds those locks. If Agent Mail reports "Resource is temporarily busy" or looks
unhealthy, stop and message the coordinator; the coordinator should run
`flywheel_remediate({ checkName: "agent_mail_liveness", mode: "execute", autoConfirm: true })`.
## Bead: <id> — <title>
<description>
## Acceptance criteria
<criteria>
## Pre-Completion Quality Gate (MANDATORY — do not skip)
Before sending the completion message you MUST run, in this order, and fix what
you find before reporting done:
1. Invoke the \`/ubs-workflow\` skill scoped to your changed files
(changed-files mode, not full-repo). Triage every finding: fix, file as a
new bead with rationale, or explicitly justify ignoring it in your
completion message. Do not silently drop UBS findings.
2. Run the repo's verify commands per AGENTS.md (build/test/typecheck/lint
for the surfaces you touched). If AGENTS.md offloads heavy verification
to a helper (e.g. \`rch\`), use that — do not skip.
3. Self-review with fresh eyes: re-read your own diff for regressions,
unsafe assumptions, missing tests, and edge cases. Fix before completing.
4. Write \`.pi-flywheel/completion/<bead-id>.json\` matching
\`CompletionReportSchemaV1\` in \`mcp-server/src/completion-report.ts\`.
This attestation is the ledger entry that \`flywheel_verify_beads\` reads
and \`flywheel_advance_wave\` gates on (warn-only by default; hard-block
when \`FW_ATTESTATION_REQUIRED=1\`). Worked example:
\`\`\`json
{
\"version\": 1,
\"beadId\": \"<bead-id>\",
\"agentName\": \"<your-agent-name>\",
\"paneName\": \"<your-pane-name-or-omit>\",
\"status\": \"closed\",
\"changedFiles\": [\"path/relative/to/repo.ts\"],
\"commits\": [\"<short-sha>\"],
\"ubs\": { \"ran\": true, \"summary\": \"clean\", \"findingsFixed\": 0, \"deferredBeadIds\": [] },
\"verify\": [{ \"command\": \"npm test\", \"exitCode\": 0, \"summary\": \"all green\" }],
\"selfReview\": { \"ran\": true, \"summary\": \"no regressions\" },
\"beadClosedVerified\": true,
\"reservationsReleased\": true,
\"createdAt\": \"<ISO-8601 timestamp>\"
}
\`\`\`
Docs-only diffs: set \`ubs.ran=false\` and a non-empty \`ubs.skippedReason\`.
Status \`closed\` requires \`beadClosedVerified=true\`. Schema rejects
absolute paths or \`..\`-traversal in \`changedFiles\`. The schema is
\`version: 1\` and additive forever — never remove keys.
Completion messages without evidence of these four steps will be bounced
back by the coordinator's review gate.
## On completion
Send a completion message to <your-coordinator-name> via send_message that
includes: (a) UBS result summary (clean / fixed / deferred-with-bead-ids),
(b) verify command outputs (or the helper handle), (c) one-line self-review
summary, (d) confirmation that \`.pi-flywheel/completion/<bead-id>.json\` is
written. Then close the bead per AGENTS.md.
"