[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78EEEWYRACQEPDPC039DEK0":3,"skill-same:01M78EEEWYRACQEPDPC039DEK0":88},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":32,"ownerDescription":33,"updatedAt":34,"install":35,"resources":47},"01M78EEEWYRACQEPDPC039DEK0","build-loop",null,"Build and independently verify one ready implementation ticket through a human-gated repair loop.","mikeyobrien\u002Fpi-tidy-tools","mikeyobrien","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F11792047?v=4","01M78EA4XJ7CY5SB8V7EPB1581","Mikey O'Brien","01M78EA4YD4ECB9199H176CNQY",63,"MIT","https:\u002F\u002Fgithub.com\u002Fmikeyobrien\u002Fpi-tidy-tools\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fbuild-loop\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: build-loop\ndescription: Build and independently verify one ready implementation ticket through a human-gated repair loop.\ndisable-model-invocation: true\ncompatibility: Requires the pi-tidy-tools repository, its development dependencies, the subagent tool, configured issue-tracker access, Git, and util-linux flock.\n---\n\n# Pi Tidy Build Loop\n\nBuild exactly one unblocked implementation ticket per manually invoked run. A fresh builder or repairer changes only authorized scope, the parent owns canonical state and mechanical verification, and a fresh read-only verifier accounts for the complete acceptance contract. The human controls acceptance, revision, retesting, and stopping.\n\nTicket acceptance is not product sign-off. After the parent specification's complete ticket chain closes, prepare a handoff to `qa-loop` for assembled real-user behavior.\n\n## Non-negotiable ownership\n\n- One run handles one ticket. Never continue into another ticket in the same run or context.\n- Existing staged, unstaged, and untracked changes are user-owned unless the confirmed charter explicitly attributes them to this ticket.\n- Builders and repairers modify only authorized product scope and their assigned fragment and artifact paths.\n- Acceptance verifiers remain read-only with respect to product source, tests, documentation, dependencies, Git metadata, user configuration, and tracker state.\n- Only the parent sequences and appends canonical events, runs canonical mechanical verification, classifies repair authorization, commits, changes tracker state, and closes attempts, tickets, and runs.\n- No subagent stages, unstages, commits, resets, restores, checks out, stashes, cleans, rebases, amends, or mutates the issue tracker.\n- Never close or modify the parent specification.\n- Never discard, overwrite, reformat, stage, or commit user-owned changes.\n- A subagent's checks are evidence about its work, not canonical verification.\n- Delegated Pi processes inherit `PI_TIDY_SUBAGENT_CHILD=1`. When builders, repairers, or verifiers run repository tests that instantiate the subagent extension, invoke that test command with only this sentinel unset (for example `env -u PI_TIDY_SUBAGENT_CHILD npm test`); never alter the parent environment. Parent canonical checks run normally.\n\n## 1. Resolve one ready ticket\n\nIf the human supplied a ticket, fetch its full body and comments. Otherwise inspect the configured tracker, present the ready frontier, and ask the human to choose exactly one ticket. Never choose silently.\n\nRead the issue-tracker configuration when present, the project ethos, the ticket, its complete parent specification, relevant package documentation, current source and tests, and declared blockers. For this repository, GitHub issue bodies use `## Parent` and `## Blocked by`; verify every blocker directly in the tracker.\n\nRefuse a ticket that is missing, closed, ambiguous, lacks one unambiguous parent, lacks acceptance criteria, is not marked ready, or has any open blocker.\n\nNormalize acceptance criteria in source order as `AC-001`, `AC-002`, and so on without changing their text. For every criterion select the highest practical seam:\n\n1. public package or tool interface\n2. CLI or integration interface with deterministic fake adapters\n3. a lower internal seam only when the public seam cannot expose the behavior\n4. the canonical QA TUI harness only for explicitly visual or interactive criteria\n\nCharter the run with:\n\n- exact ticket and parent identities, URLs, titles, states, and source text\n- user-visible outcome\n- stable acceptance criteria and selected seams\n- focused checks plus required repository checks\n- mutable product paths and isolated run-state paths\n- safety constraints, external inputs, and named out-of-scope work\n- exact staged, unstaged, and untracked starting state\n- ownership attribution for every pre-existing change\n\nThe normal repository checks are:\n\n```bash\nnpm test\nnpm run check\ngit diff --check\n```\n\nAdd focused ticket checks before them. Include a worktree scope audit as canonical parent evidence even though it is not a shell command.\n\nSummarize the charter and ask the human to confirm or amend it. After confirmation, choose a filename-safe run ID, create `.pi\u002Fbuild-runs\u002F\u003Crun-id>\u002Ffragments\u002F` and `artifacts\u002F`, and snapshot the index plus every declared user-owned staged, unstaged, and untracked path without overwriting prior evidence:\n\n```bash\n.pi\u002Fskills\u002Fbuild-loop\u002Fscripts\u002Fworktree-audit.mjs snapshot \u003Crun-dir>\u002Fartifacts\u002Fworktree-baseline.json \u003Cuser-owned-path ...>\n```\n\nRead `.pi\u002Fskills\u002Fbuild-loop\u002FEVENT_LEDGER.md` and `.pi\u002Fskills\u002Fbuild-loop\u002Fledger-types.d.ts`, write a parent-owned `run.started` fragment referencing that baseline, and initialize the ledger:\n\n```bash\n.pi\u002Fskills\u002Fbuild-loop\u002Fscripts\u002Fbuild-ledger.mjs init \u003Crun-dir> \u003Crun-started-fragment>\n```\n\nAppend parent-owned `ticket.started` evidence proving the ticket is on the dependency frontier. Validate and render after every accepted fragment:\n\n```bash\n.pi\u002Fskills\u002Fbuild-loop\u002Fscripts\u002Fbuild-ledger.mjs append \u003Crun-dir> \u003Cfragment>\n.pi\u002Fskills\u002Fbuild-loop\u002Fscripts\u002Fbuild-ledger.mjs validate \u003Crun-dir>\n.pi\u002Fskills\u002Fbuild-loop\u002Fscripts\u002Fbuild-ledger.mjs report \u003Crun-dir>\n```\n\nThis phase is complete only when canonical history contains `run.started` and `ticket.started`, every starting change has an owner, and the human-confirmed charter contains a seam and evidence plan for every criterion.\n\n## 2. Dispatch a fresh builder\n\nAppend parent-owned `attempt.started` with kind `initial` or `revision`, a fresh agent ID, and any exact human revision direction. Invoke exactly one subagent with the builder prompt below.\n\nAudit its response, worktree, and fragment before append. Reject missing criterion accounting, undeclared files, index mutation, user-owned changes, forbidden commands, or fragment events outside builder ownership. A builder may emit only `implementation.applied`. When its mode is `blocked`, append one parent-authored `failure.raised` with source kind `agent`, source ID equal to the assigned agent ID, and a non-repairable classification; close the attempt as blocked without inventing mechanical evidence, then append `run.blocked`.\n\n### Builder prompt\n\n```text\nYou are the builder for one ticket-scoped attempt in the pi-tidy-tools build loop.\n\nActive ticket contract:\n\u003Cverbatim ticket title, URL, body, comments, and AC mappings>\n\nParent specification:\n\u003Cverbatim parent title, URL, and body>\n\nConfirmed run charter:\n\u003Cverbatim charter, seams, mutable and prohibited scope, safety, external inputs, and required checks>\n\nHuman revision direction:\n\u003Cverbatim direction, or \"none\">\n\nCurrent repository state:\n\u003Cgit status --short>\n\u003Cgit diff --stat>\n\u003Cgit diff --cached --stat>\n\nUser-owned starting changes:\n\u003Cverbatim ownership inventory>\n\nPrior context:\n\u003Cprior attempt and failures, or \"first attempt\">\n\nLedger assignment:\n- Run directory: \u003Crun directory>\n- Attempt: \u003Cattempt number>\n- Agent ID: \u003Cfresh agent ID>\n- Builder fragment: \u003Crun directory>\u002Ffragments\u002Fattempt-\u003CNNN>-builder.jsonl\n- Artifact directory: \u003Crun directory>\u002Fartifacts\u002F\n\nRead .pi\u002Fskills\u002Fpi-tidy-tools-ethos\u002FSKILL.md, .pi\u002Fskills\u002Fbuild-loop\u002FEVENT_LEDGER.md, .pi\u002Fskills\u002Fbuild-loop\u002Fledger-types.d.ts, relevant package documentation, and the complete current diff before editing.\n\nImplement exactly this ticket and no follow-up ticket. Preserve every user-owned staged, unstaged, and untracked change. Modify only charter-authorized product paths plus your assigned fragment and artifact paths. Do not stage, unstage, commit, reset, restore, checkout, stash, clean, rebase, amend Git metadata, install or update dependencies without explicit charter authorization, publish, or mutate the issue tracker.\n\nWork test-first at each criterion's agreed seam. Establish focused failing evidence where behavior lacks coverage, make the smallest extension-owned correction, and run focused checks. Keep automated tests hermetic: temporary state, fake providers and RPC, controlled clocks where relevant, zero network or credentials, no user configuration, and order-independent execution. Use the canonical TUI harness only when the charter explicitly requires visual or interaction acceptance.\n\nInspect the complete final diff and worktree status. If preserving user work conflicts with the ticket, expected behavior is ambiguous, scope must expand, or external action is needed, stop rather than improvising. Emit `implementation.applied` with mode `blocked`, no files or tests, and concrete blocker evidence; the parent will classify the agent blocker and close the attempt without fabricated mechanical checks.\n\nOtherwise write exactly one `implementation.applied` event with mode `changed`, actor builder, your exact attempt and agent ID, changed files, tests, summary, residual risk, and evidence. Omit seq. Emit no parent, verifier, repair, human, commit, tracker, ticket-closure, or run-closure events.\n\nReturn the fragment path and a criterion-oriented ledger containing each AC ID, behavior implemented, files changed, tests added or updated, commands and observed outcomes, complete changed-file list, residual risks, and blockers. Never declare the ticket verified, accepted, committed, closed, or complete.\n```\n\n## 3. Perform parent-owned mechanical verification\n\nAfter accepting the implementation fragment, the parent directly:\n\n1. captures staged, unstaged, and untracked state\n2. compares it with the run baseline and prior accepted attempt\n3. proves user-owned bytes and the complete index remain preserved by running `.pi\u002Fskills\u002Fbuild-loop\u002Fscripts\u002Fworktree-audit.mjs compare \u003Crun-dir>\u002Fartifacts\u002Fworktree-baseline.json`\n4. rejects changes outside mutable scope, index mutation, undeclared generated state, and changes belonging to blocked tickets\n5. runs every focused and repository check from the charter\n6. inspects the complete ticket delta and worktree status\n7. writes `\u003Crun-dir>\u002Fartifacts\u002Faccepted-focused-plan.json` with `.pi\u002Fskills\u002Fbuild-loop\u002Fscripts\u002Ffocused-plan.mjs \u003Cplan-file> \u003Cexact-ticket-file ...>` after all checks pass; inspect and reference its parent\u002Ftree\u002Ffile set as mechanical evidence\n8. records each command's status, exit code, evidence, accepted focused plan, exact current ticket-owned file set, and scope audit in one `mechanical.verification.recorded` event\n\nDo not infer success from builder output. If any check or scope audit fails or blocks, skip acceptance verification and record one matching parent-authored `failure.raised` per non-pass source, using `sourceId: \"scope-audit\"` for scope and `verifierId: \"parent\"`. When a resumed mechanical BF source passes, record its matching parent-authored `failure.verification.recorded` before acceptance. Allocate or reuse stable `BF-001` IDs, then close the attempt with the reducer-derived outcome.\n\nA failure is automatically repairable only when its expected behavior is already unambiguously required by the active ticket or parent and the repair remains within mutable scope. Classify missing decisions, scope expansion, and external action distinctly; they require human or external resolution.\n\n## 4. Dispatch a fresh acceptance verifier\n\nOnly after all mechanical checks pass and scope is clean, append `acceptance.started` with a fresh verifier ID. Invoke exactly one read-only subagent with the verifier prompt below.\n\nAudit its criterion coverage, seams, evidence, stable failure identity, and fragment ownership. The verifier emits events in reducer order: every `criterion.checked` first; then all acceptance-sourced `failure.raised` events; then every required independent `failure.verification.recorded` for authorized repairs or resumed blockers; finally terminal `acceptance.closed` after complete accounting. It never edits product files or emits parent-owned events.\n\n### Acceptance verifier prompt\n\n```text\nYou are the fresh independent acceptance verifier for one ticket-scoped attempt in the pi-tidy-tools build loop. You did not implement this attempt. Treat builder and repairer claims as leads, not proof.\n\nActive ticket contract:\n\u003Cverbatim ticket and AC mappings>\n\nParent specification:\n\u003Cverbatim parent specification>\n\nConfirmed run charter:\n\u003Cverbatim charter, selected seam per AC, mutable scope, safety, and external-input contract>\n\nParent-owned mechanical evidence:\n\u003Cverbatim command results, scope audit, worktree comparison, and artifact references>\n\nImplementation context:\n\u003Cbuilder or repair summaries, changed files, prior BF IDs, and any resumed BF IDs awaiting fresh verification>\n\nCurrent repository state:\n\u003Cgit status --short>\n\u003Cgit diff --stat>\n\u003Cgit diff --cached --stat>\n\nFailure identity assignment:\n- Existing failures: \u003CBF definitions, or \"none\">\n- Authorized repaired failures requiring independent verification: \u003CIDs, or \"none\">\n- Next available failure ID: \u003CBF-NNN>\n\nLedger assignment:\n- Run directory: \u003Crun directory>\n- Attempt: \u003Cattempt number>\n- Verifier ID: \u003Cfresh verifier ID>\n- Verifier fragment: \u003Crun directory>\u002Ffragments\u002Fattempt-\u003CNNN>-acceptance.jsonl\n- Artifact directory: \u003Crun directory>\u002Fartifacts\u002F\n\nRead .pi\u002Fskills\u002Fpi-tidy-tools-ethos\u002FSKILL.md, .pi\u002Fskills\u002Fbuild-loop\u002FEVENT_LEDGER.md, .pi\u002Fskills\u002Fbuild-loop\u002Fledger-types.d.ts, relevant product documentation, the complete diff, and parent evidence before reviewing.\n\nRemain read-only with respect to product source, tests, documentation, dependencies, Git metadata, user configuration, and tracker state. Write only your assigned fragment and evidence artifacts. Do not install, format, update, publish, or run commands that write outside charter-approved temporary or run paths.\n\nIndependently classify every AC exactly once at its agreed highest seam:\n- pass: direct evidence demonstrates the criterion\n- fail: observed behavior contradicts the criterion\n- blocked: required evidence cannot be obtained inside the declared environment or safety contract\n\nMissing evidence is not a pass. Code inspection, builder assertions, passing lower-level tests, or parent command success alone are insufficient when a criterion requires public or user-visible behavior. Reassess the complete ticket after a repair, not only repaired examples. Preserve existing BF identity when the same failure recurs; allocate new IDs monotonically only for distinct failures. Classify each new failure as repairable, decision-required, scope-expansion, or external.\n\nWrite `criterion.checked` events for every AC, then `failure.raised` events for new fail or blocked observations, then one `failure.verification.recorded` event for every authorized repaired or resumed criterion\u002Fagent failure after its source is freshly proven, and only then `acceptance.closed`. This order is mandatory: the reducer requires all criteria before failures, failures before verifications, and complete accounting before terminal acceptance closure. Every failure and verification event carries your exact verifier ID. Use actor acceptance-verifier, your exact attempt and verifier ID, and omit seq. Emit no implementation, mechanical, human, commit, tracker, ticket-closure, or run-closure events.\n\nReturn the fragment path and a complete coverage ledger mapping every AC to PASS, BF ID, or BLOCKED, with evidence, actual versus expected behavior, repair classification, residual risk, and confirmation that product source remained unchanged. Never declare the ticket accepted, committed, closed, or complete.\n```\n\nAfter appending the verifier fragment, parent appends `attempt.closed` with the exact reducer-derived outcome and open failure IDs. Validate and regenerate the report.\n\n## 5. Repair authorized failures\n\nWhen an attempt fails and every open failure is repairable, automatically append a new `attempt.started` of kind `repair` with a fresh repairer ID and the exact complete open failure set. No additional human authorization is needed because the ticket already authorizes these behaviors.\n\nInvoke one fresh repairer with the prompt below. Audit its work and fragment. A successful repairer emits one `implementation.applied` for the attempt and exactly one `repair.applied` for every authorized BF ID. A blocked repairer emits only blocked implementation; parent records an agent blocker and closes the attempt without mechanical evidence.\n\n### Repairer prompt\n\n```text\nYou are a fresh repairer for one narrowly authorized attempt in the pi-tidy-tools build loop.\n\nActive ticket and parent contract:\n\u003Cverbatim ticket, AC mappings, and parent specification>\n\nConfirmed charter:\n\u003Cverbatim charter>\n\nAuthorized failures:\n\u003Cverbatim BF IDs, sources, actual and expected behavior, evidence, reproductions, and acceptance tests>\n\nExplicitly unauthorized observations:\n\u003Cverbatim list, or \"none\">\n\nCurrent repository and user-owned state:\n\u003Cgit status --short, diffs, and ownership inventory>\n\nLedger assignment:\n- Run directory: \u003Crun directory>\n- Attempt: \u003Cattempt number>\n- Agent ID: \u003Cfresh repairer ID>\n- Repair fragment: \u003Crun directory>\u002Ffragments\u002Fattempt-\u003CNNN>-repair.jsonl\n- Artifact directory: \u003Crun directory>\u002Fartifacts\u002F\n\nRead .pi\u002Fskills\u002Fpi-tidy-tools-ethos\u002FSKILL.md, .pi\u002Fskills\u002Fbuild-loop\u002FEVENT_LEDGER.md, .pi\u002Fskills\u002Fbuild-loop\u002Fledger-types.d.ts, relevant product docs, and the complete diff before editing.\n\nRepair every authorized BF ID and only those failures. Do not address unrelated defects, cleanup, speculative improvements, or follow-up tickets. Preserve all user-owned and previously accepted work. Modify only confirmed mutable scope and assigned run paths. Do not stage, unstage, commit, reset, restore, checkout, stash, clean, rebase, amend, install or update dependencies without authorization, publish, or mutate tracker state.\n\nWork test-first at each authorized acceptance seam. Reproduce each failure hermetically, implement the smallest correction, run focused checks, and inspect the complete diff. If repair requires a product decision, scope expansion, external action, or user-owned modification, stop rather than improvising. Emit `implementation.applied` with mode `blocked`, the exact authorized failure set, no files or tests, and concrete blocker evidence; emit no `repair.applied` events.\n\nOtherwise write one `implementation.applied` event with mode `changed`, actor repairer and the exact authorized failure set, then one `repair.applied` event per BF ID. Use your exact attempt and agent ID and omit seq. Emit no canonical verification, criteria, human, commit, tracker, ticket-closure, or run-closure events.\n\nReturn the fragment path, one resolution entry per BF ID with root cause, files, regression coverage, focused evidence and residual risk, complete changed-file list, blockers, and unauthorized observations. Never mark a failure canonically fixed or the ticket accepted, committed, closed, or complete.\n```\n\nAfter repair, repeat parent mechanical verification and dispatch a different fresh verifier over the entire acceptance contract only when the mechanical gate passes. The parent or verifier records independent verification for every authorized failure that reaches acceptance. If mechanical verification fails first, close the repair attempt as failed without fabricating acceptance or repair-verification evidence; the prior failure and new mechanical failures remain open for the next fresh repair. Continue with fresh agents while every open product failure remains repairable.\n\nIf an attempt blocks, append `run.blocked` naming exactly the open non-repairable blocker IDs and return to the human with the exact reason and required action. Resume in this exact reducer order:\n\n1. For any `decision-required` or `scope-expansion` blocker, obtain explicit human revision direction and append `human.decided` with action `revise` for the blocked attempt. External-only blockers do not receive this decision event.\n2. Append `run.resumed` for the same blocked stage and exactly the complete blocker ID set, with resolution evidence. This changes each blocker only to resolved-awaiting-verification, never fixed.\n3. Start a fresh revision, repair, or retest attempt as appropriate. Never start the attempt before `run.resumed`.\n\nThe fresh attempt must pass its normal gates and record matching independent `failure.verification.recorded` evidence for every resumed blocker before readiness. Prior blocked evidence remains canonical.\n\n## 6. Human completion gate\n\nAn attempt is ready only when every criterion passes, every mechanical check passes, scope is clean, user-owned changes are preserved, every historical failure is independently fixed, and a focused ticket commit can be formed safely.\n\nPresent a concise summary with criterion coverage, mechanical commands, complete ticket-owned file list, worktree ownership, residual risk, and proposed commit message. Wait for exactly one action:\n\n- `accept` - authorize a focused ticket commit and closure\n- `revise \u003Cdirection>` - record direction and start a fresh builder attempt\n- `retest` - run a fresh unchanged attempt with all mechanical checks and a fresh verifier\n- `stop` - close only the build run, preserve work, and leave the ticket open\n\nResolve ambiguous input with one short question.\n\nOn `accept`, append `human.decided`, then:\n\n1. prove every proposed commit path is ticket-owned and contains no inseparable user-owned edits\n2. write the proposed commit message into the run artifacts and inspect the exact proposed ticket file set and previously recorded accepted focused plan\n3. create the focused commit with `.pi\u002Fskills\u002Fbuild-loop\u002Fscripts\u002Ffocused-commit.mjs \u003Cmessage-file> --accepted-plan \u003Crun-dir>\u002Fartifacts\u002Faccepted-focused-plan.json --audit-baseline \u003Crun-dir>\u002Fartifacts\u002Fworktree-baseline.json \u003Cexact-ticket-file ...>`; this rejects any parent\u002Ftree\u002Ffile drift since mechanical acceptance, uses isolated index state, performs the preservation audit before installing the synchronized index, and restores the original index if final HEAD compare-and-swap fails\n4. require successful helper JSON with `audited: true`; on failure, prove the helper did not overwrite concurrent HEAD\u002Findex work and that any helper-owned HEAD update was rolled back before retrying\n5. rerun `.pi\u002Fskills\u002Fbuild-loop\u002Fscripts\u002Fworktree-audit.mjs compare \u003Cbaseline> \u003Cexact-ticket-file ...>` as independent parent evidence, inspect the successful commit, and record its exact status, hexadecimal SHA, file set, and audited helper output in `commit.recorded`\n6. if the helper fails or its output cannot establish that rollback-and-preservation invariant, record `commit.recorded` with `failed` or `blocked` status and its evidence, then append the matching `run.blocked`; do not close or retry blindly\n7. close only the active ticket in the configured tracker\n8. verify the exact charter ticket closed and the exact charter parent still open and unmodified in `tracker.recorded`, including both immutable tracker references\n9. append `ticket.closed` and `run.closed` only after both operations succeed\n\nIf a focused commit cannot be separated safely, record the unsuccessful `commit.recorded` outcome before the matching `run.blocked` and ask the human. A commit or tracker failure preserves accepted evidence and becomes a resumable closure blocker. While blocked at commit or tracker closure, the human may retry after `run.resumed` or reply `stop`; record the additional stop decision and close the run while leaving any unclosed ticket open.\n\nOn `revise`, append the human decision and begin a fresh revision attempt carrying the direction verbatim. On `retest`, append the decision and run a fresh unchanged attempt. On `stop`, append the decision and `run.closed` with reason `stopped`; never commit or close the ticket.\n\n## 7. Close and hand off\n\nGenerate the final report from canonical JSONL and present its path. It must account for charter, tracker frontier, every attempt, criterion, failure, repair, command, human decision, commit, tracker outcome, residual risk, and final worktree.\n\nAfter accepted closure, recompute and report the dependency frontier but do not start another ticket. End the run and require a fresh invocation and context.\n\nWhen every declared child ticket of the parent specification is closed, write the versioned artifact at `.pi\u002Fbuild-runs\u002F\u003Crun-id>\u002Fartifacts\u002Fqa-handoff.v1.json`. It has this exact schema (all strings are non-empty; arrays may be empty only for `residualRisks` and `deferredWork`):\n\n```json\n{\n  \"schema\": \"pi-tidy-build-qa-handoff\",\n  \"version\": 1,\n  \"parent\": { \"id\": \"\u003Cprovider>:\u003Crepository>#\u003Cnumber>\", \"url\": \"\u003Curl>\", \"title\": \"\u003Ctitle>\", \"promise\": \"\u003Cverbatim complete parent body>\" },\n  \"acceptedTickets\": [{ \"id\": \"\u003Cprovider>:\u003Crepository>#\u003Cnumber>\", \"url\": \"\u003Curl>\", \"commitSha\": \"\u003Cfull lowercase commit SHA>\", \"reportPath\": \".pi\u002Fbuild-runs\u002F\u003Crun-id>\u002Freport.md\" }],\n  \"entryPoints\": [\"\u003Cuser-visible entry point>\"],\n  \"environment\": [\"\u003Crelevant environment or configuration>\"],\n  \"residualRisks\": [\"\u003Crisk>\"],\n  \"deferredWork\": [\"\u003Cdeferred item>\"],\n  \"suggestedAcceptanceBoundaries\": [\"\u003Cproduct-level boundary>\"]\n}\n```\n\nWrite atomically, reject unknown\u002Fmissing keys, duplicate ticket IDs, commits, or report paths, and verify every ticket\u002Fcommit\u002Freport against canonical closed build ledgers before presenting it. Record and report its SHA-256. Present `\u002Fskill:qa-loop \u003Chandoff path>`. The handoff is draft charter input only; the QA human must still confirm the resulting charter. Do not claim QA started or passed. The QA loop owns its own charter, real-user harness, human finding gate, ledger, and closure.\n\n## Closure conditions\n\nThe build loop is complete only when one explicit terminal path is accepted by the reducer:\n\n- human accepts, focused commit succeeds, active ticket closes, parent remains open and unmodified, and the generated report records ticket-closed run closure; or\n- human stops, current work is preserved, the active ticket remains open, no commit or tracker closure occurs, and the report records stopped run closure.\n\nNever compress multiple tickets, skip independent acceptance, use a builder's own tests as canonical proof, or describe a blocked or merely implemented ticket as complete.\n","# Pi Tidy Build Loop\n\nBuild exactly one unblocked implementation ticket per manually invoked run. A fresh builder or repairer changes only authorized scope, the parent owns canonical state and mechanical verification, and a fresh read-only verifier accounts for the complete acceptance contract. The human controls acceptance, revision, retesting, and stopping.\n\nTicket acceptance is not product sign-off. After the parent specification's complete ticket chain closes, prepare a handoff to `qa-loop` for assembled real-user behavior.\n\n## Non-negotiable ownership\n\n- One run handles one ticket. Never continue into another ticket in the same run or context.\n- Existing staged, unstaged, and untracked changes are user-owned unless the confirmed charter explicitly attributes them to this ticket.\n- Builders and repairers modify only authorized product scope and their assigned fragment and artifact paths.\n- Acceptance verifiers remain read-only with respect to product source, tests, documentation, dependencies, Git metadata, user configuration, and tracker state.\n- Only the parent sequences and appends canonical events, runs canonical mechanical verification, classifies repair authorization, commits, changes tracker state, and closes attempts, tickets, and runs.\n- No subagent stages, unstages, commits, resets, restores, checks out, stashes, cleans, rebases, amends, or mutates the issue tracker.\n- Never close or modify the parent specification.\n- Never discard, overwrite, reformat, stage, or commit user-owned changes.\n- A subagent's checks are evidence about its work, not canonical verification.\n- Delegated Pi processes inherit `PI_TIDY_SUBAGENT_CHILD=1`. When builders, repairers, or verifiers run repository tests that instantiate the subagent extension, invoke that test command with only this sentinel unset (for example `env -u PI_TIDY_SUBAGENT_CHILD npm test`); never alter the parent environment. Parent canonical checks run normally.\n\n## 1. Resolve one ready ticket\n\nIf the human supplied a ticket, fetch its full body and comments. Otherwise inspect the configured tracker, present the ready frontier, and ask the human to choose exactly one ticket. Never choose silently.\n\nRead the issue-tracker configuration when present, the project ethos, the ticket, its complete parent specification, relevant package documentation, current source and tests, and declared blockers. For this repository, GitHub issue bodies use `## Parent` and `## Blocked by`; verify every blocker directly in the tracker.\n\nRefuse a ticket that is missing, closed, ambiguous, lacks one unambiguous parent, lacks acceptance criteria, is not marked ready, or has any open blocker.\n\nNormalize acceptance criteria in source order as `AC-001`, `AC-002`, and so on without changing their text. For every criterion select the highest practical seam:\n\n1. public package or tool interface\n2. CLI or integration interface with deterministic fake adapters\n3. a lower internal seam only when the public seam cannot expose the behavior\n4. the canonical QA TUI harness only for explicitly visual or interactive criteria\n\nCharter the run with:\n\n- exact ticket and parent identities, URLs, titles, states, and source text\n- user-visible outcome\n- stable acceptance criteria and selected seams\n- focused checks plus required repository checks\n- mutable product paths and isolated run-state paths\n- safety constraints, external inputs, and named out-of-scope work\n- exact staged, unstaged, and untracked starting state\n- ownership attribution for every pre-existing change\n\nThe normal repository checks are:\n\n```bash\nnpm test\nnpm run check\ngit diff --check\n```\n\nAdd focused ticket checks before them. Include a worktree scope audit as canonical parent evidence even though it is not a shell command.\n\nSummarize the charter and ask the human to confirm or amend it. After confirmation, choose a filename-safe run ID, create `.pi\u002Fbuild-runs\u002F\u003Crun-id>\u002Ffragments\u002F` and `artifacts\u002F`, and snapshot the index plus every declared user-owned staged, unstaged, and untracked path without overwriting prior evidence:\n\n```bash\n.pi\u002Fskills\u002Fbuild-loop\u002Fscripts\u002Fworktree-audit.mjs snapshot \u003Crun-dir>\u002Fartifacts\u002Fworktree-baseline.json \u003Cuser-owned-path ...>\n```\n\nRead `.pi\u002Fskills\u002Fbuild-loop\u002FEVENT_LEDGER.md` and `.pi\u002Fskills\u002Fbuild-loop\u002Fledger-types.d.ts`, write a parent-owned `run.started` fragment referencing that baseline, and initialize the ledger:\n\n```bash\n.pi\u002Fskills\u002Fbuild-loop\u002Fscripts\u002Fbuild-ledger.mjs init \u003Crun-dir> \u003Crun-started-fragment>\n```\n\nAppend parent-owned `ticket.started` evidence proving the ticket is on the dependency frontier. Validate and render after every accepted fragment:\n\n```bash\n.pi\u002Fskills\u002Fbuild-loop\u002Fscripts\u002Fbuild-ledger.mjs append \u003Crun-dir> \u003Cfragment>\n.pi\u002Fskills\u002Fbuild-loop\u002Fscripts\u002Fbuild-ledger.mjs validate \u003Crun-dir>\n.pi\u002Fskills\u002Fbuild-loop\u002Fscripts\u002Fbuild-ledger.mjs report \u003Crun-dir>\n```\n\nThis phase is complete only when canonical history contains `run.started` and `ticket.started`, every starting change has an owner, and the human-confirmed charter contains a seam and evidence plan for every criterion.\n\n## 2. Dispatch a fresh builder\n\nAppend parent-owned `attempt.started` with kind `initial` or `revision`, a fresh agent ID, and any exact human revision direction. Invoke exactly one subagent with the builder prompt below.\n\nAudit its response, worktree, and fragment before append. Reject missing criterion accounting, undeclared files, index mutation, user-owned changes, forbidden commands, or fragment events outside builder ownership. A builder may emit only `implementation.applied`. When its mode is `blocked`, append one parent-authored `failure.raised` with source kind `agent`, source ID equal to the assigned agent ID, and a non-repairable classification; close the attempt as blocked without inventing mechanical evidence, then append `run.blocked`.\n\n### Builder prompt\n\n```text\nYou are the builder for one ticket-scoped attempt in the pi-tidy-tools build loop.\n\nActive ticket contract:\n\u003Cverbatim ticket title, URL, body, comments, and AC mappings>\n\nParent specification:\n\u003Cverbatim parent title, URL, and body>\n\nConfirmed run charter:\n\u003Cverbatim charter, seams, mutable and prohibited scope, safety, external inputs, and required checks>\n\nHuman revision direction:\n\u003Cverbatim direction, or \"none\">\n\nCurrent repository state:\n\u003Cgit status --short>\n\u003Cgit diff --stat>\n\u003Cgit diff --cached --stat>\n\nUser-owned starting changes:\n\u003Cverbatim ownership inventory>\n\nPrior context:\n\u003Cprior attempt and failures, or \"first attempt\">\n\nLedger assignment:\n- Run directory: \u003Crun directory>\n- Attempt: \u003Cattempt number>\n- Agent ID: \u003Cfresh agent ID>\n- Builder fragment: \u003Crun directory>\u002Ffragments\u002Fattempt-\u003CNNN>-builder.jsonl\n- Artifact directory: \u003Crun directory>\u002Fartifacts\u002F\n\nRead .pi\u002Fskills\u002Fpi-tidy-tools-ethos\u002FSKILL.md, .pi\u002Fskills\u002Fbuild-loop\u002FEVENT_LEDGER.md, .pi\u002Fskills\u002Fbuild-loop\u002Fledger-types.d.ts, relevant package documentation, and the complete current diff before editing.\n\nImplement exactly this ticket and no follow-up ticket. Preserve every user-owned staged, unstaged, and untracked change. Modify only charter-authorized product paths plus your assigned fragment and artifact paths. Do not stage, unstage, commit, reset, restore, checkout, stash, clean, rebase, amend Git metadata, install or update dependencies without explicit charter authorization, publish, or mutate the issue tracker.\n\nWork test-first at each criterion's agreed seam. Establish focused failing evidence where behavior lacks coverage, make the smallest extension-owned correction, and run focused checks. Keep automated tests hermetic: temporary state, fake providers and RPC, controlled clocks where relevant, zero network or credentials, no user configuration, and order-independent execution. Use the canonical TUI harness only when the charter explicitly requires visual or interaction acceptance.\n\nInspect the complete final diff and worktree status. If preserving user work conflicts with the ticket, expected behavior is ambiguous, scope must expand, or external action is needed, stop rather than improvising. Emit `implementation.applied` with mode `blocked`, no files or tests, and concrete blocker evidence; the parent will classify the agent blocker and close the attempt without fabricated mechanical checks.\n\nOtherwise write exactly one `implementation.applied` event with mode `changed`, actor builder, your exact attempt and agent ID, changed files, tests, summary, residual risk, and evidence. Omit seq. Emit no parent, verifier, repair, human, commit, tracker, ticket-closure, or run-closure events.\n\nReturn the fragment path and a criterion-oriented ledger containing each AC ID, behavior implemented, files changed, tests added or updated, commands and observed outcomes, complete changed-file list, residual risks, and blockers. Never declare the ticket verified, accepted, committed, closed, or complete.\n```\n\n## 3. Perform parent-owned mechanical verification\n\nAfter accepting the implementation fragment, the parent directly:\n\n1. captures staged, unstaged, and untracked state\n2. compares it with the run baseline and prior accepted attempt\n3. proves user-owned bytes and the complete index remain preserved by running `.pi\u002Fskills\u002Fbuild-loop\u002Fscripts\u002Fworktree-audit.mjs compare \u003Crun-dir>\u002Fartifacts\u002Fworktree-baseline.json`\n4. rejects changes outside mutable scope, index mutation, undeclared generated state, and changes belonging to blocked tickets\n5. runs every focused and repository check from the charter\n6. inspects the complete ticket delta and worktree status\n7. writes `\u003Crun-dir>\u002Fartifacts\u002Faccepted-focused-plan.json` with `.pi\u002Fskills\u002Fbuild-loop\u002Fscripts\u002Ffocused-plan.mjs \u003Cplan-file> \u003Cexact-ticket-file ...>` after all checks pass; inspect and reference its parent\u002Ftree\u002Ffile set as mechanical evidence\n8. records each command's status, exit code, evidence, accepted focused plan, exact current ticket-owned file set, and scope audit in one `mechanical.verification.recorded` event\n\nDo not infer success from builder output. If any check or scope audit fails or blocks, skip acceptance verification and record one matching parent-authored `failure.raised` per non-pass source, using `sourceId: \"scope-audit\"` for scope and `verifierId: \"parent\"`. When a resumed mechanical BF source passes, record its matching parent-authored `failure.verification.recorded` before acceptance. Allocate or reuse stable `BF-001` IDs, then close the attempt with the reducer-derived outcome.\n\nA failure is automatically repairable only when its expected behavior is already unambiguously required by the active ticket or parent and the repair remains within mutable scope. Classify missing decisions, scope expansion, and external action distinctly; they require human or external resolution.\n\n## 4. Dispatch a fresh acceptance verifier\n\nOnly after all mechanical checks pass and scope is clean, append `acceptance.started` with a fresh verifier ID. Invoke exactly one read-only subagent with the verifier prompt below.\n\nAudit its criterion coverage, seams, evidence, stable failure identity, and fragment ownership. The verifier emits events in reducer order: every `criterion.checked` first; then all acceptance-sourced `failure.raised` events; then every required independent `failure.verification.recorded` for authorized repairs or resumed blockers; finally terminal `acceptance.closed` after complete accounting. It never edits product files or emits parent-owned events.\n\n### Acceptance verifier prompt\n\n```text\nYou are the fresh independent acceptance verifier for one ticket-scoped attempt in the pi-tidy-tools build loop. You did not implement this attempt. Treat builder and repairer claims as leads, not proof.\n\nActive ticket contract:\n\u003Cverbatim ticket and AC mappings>\n\nParent specification:\n\u003Cverbatim parent specification>\n\nConfirmed run charter:\n\u003Cverbatim charter, selected seam per AC, mutable scope, safety, and external-input contract>\n\nParent-owned mechanical evidence:\n\u003Cverbatim command results, scope audit, worktree comparison, and artifact references>\n\nImplementation context:\n\u003Cbuilder or repair summaries, changed files, prior BF IDs, and any resumed BF IDs awaiting fresh verification>\n\nCurrent repository state:\n\u003Cgit status --short>\n\u003Cgit diff --stat>\n\u003Cgit diff --cached --stat>\n\nFailure identity assignment:\n- Existing failures: \u003CBF definitions, or \"none\">\n- Authorized repaired failures requiring independent verification: \u003CIDs, or \"none\">\n- Next available failure ID: \u003CBF-NNN>\n\nLedger assignment:\n- Run directory: \u003Crun directory>\n- Attempt: \u003Cattempt number>\n- Verifier ID: \u003Cfresh verifier ID>\n- Verifier fragment: \u003Crun directory>\u002Ffragments\u002Fattempt-\u003CNNN>-acceptance.jsonl\n- Artifact directory: \u003Crun directory>\u002Fartifacts\u002F\n\nRead .pi\u002Fskills\u002Fpi-tidy-tools-ethos\u002FSKILL.md, .pi\u002Fskills\u002Fbuild-loop\u002FEVENT_LEDGER.md, .pi\u002Fskills\u002Fbuild-loop\u002Fledger-types.d.ts, relevant product documentation, the complete diff, and parent evidence before reviewing.\n\nRemain read-only with respect to product source, tests, documentation, dependencies, Git metadata, user configuration, and tracker state. Write only your assigned fragment and evidence artifacts. Do not install, format, update, publish, or run commands that write outside charter-approved temporary or run paths.\n\nIndependently classify every AC exactly once at its agreed highest seam:\n- pass: direct evidence demonstrates the criterion\n- fail: observed behavior contradicts the criterion\n- blocked: required evidence cannot be obtained inside the declared environment or safety contract\n\nMissing evidence is not a pass. Code inspection, builder assertions, passing lower-level tests, or parent command success alone are insufficient when a criterion requires public or user-visible behavior. Reassess the complete ticket after a repair, not only repaired examples. Preserve existing BF identity when the same failure recurs; allocate new IDs monotonically only for distinct failures. Classify each new failure as repairable, decision-required, scope-expansion, or external.\n\nWrite `criterion.checked` events for every AC, then `failure.raised` events for new fail or blocked observations, then one `failure.verification.recorded` event for every authorized repaired or resumed criterion\u002Fagent failure after its source is freshly proven, and only then `acceptance.closed`. This order is mandatory: the reducer requires all criteria before failures, failures before verifications, and complete accounting before terminal acceptance closure. Every failure and verification event carries your exact verifier ID. Use actor acceptance-verifier, your exact attempt and verifier ID, and omit seq. Emit no implementation, mechanical, human, commit, tracker, ticket-closure, or run-closure events.\n\nReturn the fragment path and a complete coverage ledger mapping every AC to PASS, BF ID, or BLOCKED, with evidence, actual versus expected behavior, repair classification, residual risk, and confirmation that product source remained unchanged. Never declare the ticket accepted, committed, closed, or complete.\n```\n\nAfter appending the verifier fragment, parent appends `attempt.closed` with the exact reducer-derived outcome and open failure IDs. Validate and regenerate the report.\n\n## 5. Repair authorized failures\n\nWhen an attempt fails and every open failure is repairable, automatically append a new `attempt.started` of kind `repair` with a fresh repairer ID and the exact complete open failure set. No additional human authorization is needed because the ticket already authorizes these behaviors.\n\nInvoke one fresh repairer with the prompt below. Audit its work and fragment. A successful repairer emits one `implementation.applied` for the attempt and exactly one `repair.applied` for every authorized BF ID. A blocked repairer emits only blocked implementation; parent records an agent blocker and closes the attempt without mechanical evidence.\n\n### Repairer prompt\n\n```text\nYou are a fresh repairer for one narrowly authorized attempt in the pi-tidy-tools build loop.\n\nActive ticket and parent contract:\n\u003Cverbatim ticket, AC mappings, and parent specification>\n\nConfirmed charter:\n\u003Cverbatim charter>\n\nAuthorized failures:\n\u003Cverbatim BF IDs, sources, actual and expected behavior, evidence, reproductions, and acceptance tests>\n\nExplicitly unauthorized observations:\n\u003Cverbatim list, or \"none\">\n\nCurrent repository and user-owned state:\n\u003Cgit status --short, diffs, and ownership inventory>\n\nLedger assignment:\n- Run directory: \u003Crun directory>\n- Attempt: \u003Cattempt number>\n- Agent ID: \u003Cfresh repairer ID>\n- Repair fragment: \u003Crun directory>\u002Ffragments\u002Fattempt-\u003CNNN>-repair.jsonl\n- Artifact directory: \u003Crun directory>\u002Fartifacts\u002F\n\nRead .pi\u002Fskills\u002Fpi-tidy-tools-ethos\u002FSKILL.md, .pi\u002Fskills\u002Fbuild-loop\u002FEVENT_LEDGER.md, .pi\u002Fskills\u002Fbuild-loop\u002Fledger-types.d.ts, relevant product docs, and the complete diff before editing.\n\nRepair every authorized BF ID and only those failures. Do not address unrelated defects, cleanup, speculative improvements, or follow-up tickets. Preserve all user-owned and previously accepted work. Modify only confirmed mutable scope and assigned run paths. Do not stage, unstage, commit, reset, restore, checkout, stash, clean, rebase, amend, install or update dependencies without authorization, publish, or mutate tracker state.\n\nWork test-first at each authorized acceptance seam. Reproduce each failure hermetically, implement the smallest correction, run focused checks, and inspect the complete diff. If repair requires a product decision, scope expansion, external action, or user-owned modification, stop rather than improvising. Emit `implementation.applied` with mode `blocked`, the exact authorized failure set, no files or tests, and concrete blocker evidence; emit no `repair.applied` events.\n\nOtherwise write one `implementation.applied` event with mode `changed`, actor repairer and the exact authorized failure set, then one `repair.applied` event per BF ID. Use your exact attempt and agent ID and omit seq. Emit no canonical verification, criteria, human, commit, tracker, ticket-closure, or run-closure events.\n\nReturn the fragment path, one resolution entry per BF ID with root cause, files, regression coverage, focused evidence and residual risk, complete changed-file list, blockers, and unauthorized observations. Never mark a failure canonically fixed or the ticket accepted, committed, closed, or complete.\n```\n\nAfter repair, repeat parent mechanical verification and dispatch a different fresh verifier over the entire acceptance contract only when the mechanical gate passes. The parent or verifier records independent verification for every authorized failure that reaches acceptance. If mechanical verification fails first, close the repair attempt as failed without fabricating acceptance or repair-verification evidence; the prior failure and new mechanical failures remain open for the next fresh repair. Continue with fresh agents while every open product failure remains repairable.\n\nIf an attempt blocks, append `run.blocked` naming exactly the open non-repairable blocker IDs and return to the human with the exact reason and required action. Resume in this exact reducer order:\n\n1. For any `decision-required` or `scope-expansion` blocker, obtain explicit human revision direction and append `human.decided` with action `revise` for the blocked attempt. External-only blockers do not receive this decision event.\n2. Append `run.resumed` for the same blocked stage and exactly the complete blocker ID set, with resolution evidence. This changes each blocker only to resolved-awaiting-verification, never fixed.\n3. Start a fresh revision, repair, or retest attempt as appropriate. Never start the attempt before `run.resumed`.\n\nThe fresh attempt must pass its normal gates and record matching independent `failure.verification.recorded` evidence for every resumed blocker before readiness. Prior blocked evidence remains canonical.\n\n## 6. Human completion gate\n\nAn attempt is ready only when every criterion passes, every mechanical check passes, scope is clean, user-owned changes are preserved, every historical failure is independently fixed, and a focused ticket commit can be formed safely.\n\nPresent a concise summary with criterion coverage, mechanical commands, complete ticket-owned file list, worktree ownership, residual risk, and proposed commit message. Wait for exactly one action:\n\n- `accept` - authorize a focused ticket commit and closure\n- `revise \u003Cdirection>` - record direction and start a fresh builder attempt\n- `retest` - run a fresh unchanged attempt with all mechanical checks and a fresh verifier\n- `stop` - close only the build run, preserve work, and leave the ticket open\n\nResolve ambiguous input with one short question.\n\nOn `accept`, append `human.decided`, then:\n\n1. prove every proposed commit path is ticket-owned and contains no inseparable user-owned edits\n2. write the proposed commit message into the run artifacts and inspect the exact proposed ticket file set and previously recorded accepted focused plan\n3. create the focused commit with `.pi\u002Fskills\u002Fbuild-loop\u002Fscripts\u002Ffocused-commit.mjs \u003Cmessage-file> --accepted-plan \u003Crun-dir>\u002Fartifacts\u002Faccepted-focused-plan.json --audit-baseline \u003Crun-dir>\u002Fartifacts\u002Fworktree-baseline.json \u003Cexact-ticket-file ...>`; this rejects any parent\u002Ftree\u002Ffile drift since mechanical acceptance, uses isolated index state, performs the preservation audit before installing the synchronized index, and restores the original index if final HEAD compare-and-swap fails\n4. require successful helper JSON with `audited: true`; on failure, prove the helper did not overwrite concurrent HEAD\u002Findex work and that any helper-owned HEAD update was rolled back before retrying\n5. rerun `.pi\u002Fskills\u002Fbuild-loop\u002Fscripts\u002Fworktree-audit.mjs compare \u003Cbaseline> \u003Cexact-ticket-file ...>` as independent parent evidence, inspect the successful commit, and record its exact status, hexadecimal SHA, file set, and audited helper output in `commit.recorded`\n6. if the helper fails or its output cannot establish that rollback-and-preservation invariant, record `commit.recorded` with `failed` or `blocked` status and its evidence, then append the matching `run.blocked`; do not close or retry blindly\n7. close only the active ticket in the configured tracker\n8. verify the exact charter ticket closed and the exact charter parent still open and unmodified in `tracker.recorded`, including both immutable tracker references\n9. append `ticket.closed` and `run.closed` only after both operations succeed\n\nIf a focused commit cannot be separated safely, record the unsuccessful `commit.recorded` outcome before the matching `run.blocked` and ask the human. A commit or tracker failure preserves accepted evidence and becomes a resumable closure blocker. While blocked at commit or tracker closure, the human may retry after `run.resumed` or reply `stop`; record the additional stop decision and close the run while leaving any unclosed ticket open.\n\nOn `revise`, append the human decision and begin a fresh revision attempt carrying the direction verbatim. On `retest`, append the decision and run a fresh unchanged attempt. On `stop`, append the decision and `run.closed` with reason `stopped`; never commit or close the ticket.\n\n## 7. Close and hand off\n\nGenerate the final report from canonical JSONL and present its path. It must account for charter, tracker frontier, every attempt, criterion, failure, repair, command, human decision, commit, tracker outcome, residual risk, and final worktree.\n\nAfter accepted closure, recompute and report the dependency frontier but do not start another ticket. End the run and require a fresh invocation and context.\n\nWhen every declared child ticket of the parent specification is closed, write the versioned artifact at `.pi\u002Fbuild-runs\u002F\u003Crun-id>\u002Fartifacts\u002Fqa-handoff.v1.json`. It has this exact schema (all strings are non-empty; arrays may be empty only for `residualRisks` and `deferredWork`):\n\n```json\n{\n  \"schema\": \"pi-tidy-build-qa-handoff\",\n  \"version\": 1,\n  \"parent\": { \"id\": \"\u003Cprovider>:\u003Crepository>#\u003Cnumber>\", \"url\": \"\u003Curl>\", \"title\": \"\u003Ctitle>\", \"promise\": \"\u003Cverbatim complete parent body>\" },\n  \"acceptedTickets\": [{ \"id\": \"\u003Cprovider>:\u003Crepository>#\u003Cnumber>\", \"url\": \"\u003Curl>\", \"commitSha\": \"\u003Cfull lowercase commit SHA>\", \"reportPath\": \".pi\u002Fbuild-runs\u002F\u003Crun-id>\u002Freport.md\" }],\n  \"entryPoints\": [\"\u003Cuser-visible entry point>\"],\n  \"environment\": [\"\u003Crelevant environment or configuration>\"],\n  \"residualRisks\": [\"\u003Crisk>\"],\n  \"deferredWork\": [\"\u003Cdeferred item>\"],\n  \"suggestedAcceptanceBoundaries\": [\"\u003Cproduct-level boundary>\"]\n}\n```\n\nWrite atomically, reject unknown\u002Fmissing keys, duplicate ticket IDs, commits, or report paths, and verify every ticket\u002Fcommit\u002Freport against canonical closed build ledgers before presenting it. Record and report its SHA-256. Present `\u002Fskill:qa-loop \u003Chandoff path>`. The handoff is draft charter input only; the QA human must still confirm the resulting charter. Do not claim QA started or passed. The QA loop owns its own charter, real-user harness, human finding gate, ledger, and closure.\n\n## Closure conditions\n\nThe build loop is complete only when one explicit terminal path is accepted by the reducer:\n\n- human accepts, focused commit succeeds, active ticket closes, parent remains open and unmodified, and the generated report records ticket-closed run closure; or\n- human stops, current work is preserved, the active ticket remains open, no commit or tracker closure occurs, and the report records stopped run closure.\n\nNever compress multiple tickets, skip independent acceptance, use a builder's own tests as canonical proof, or describe a blocked or merely implemented ticket as complete.\n",{"name":5,"description":7,"compatibility":24,"disable-model-invocation":25},"Requires the pi-tidy-tools repository, its development dependencies, the subagent tool, configured issue-tracker access, Git, and util-linux flock.",true,"main","b253d1504091e48e3d60ebab19535bf0d1cec363",".pi\u002Fskills\u002Fbuild-loop",3,"https:\u002F\u002Fgithub.com\u002Fmikeyobrien\u002Fpi-tidy-tools","https:\u002F\u002Fgithub.com\u002Fmikeyobrien","mobrienv.dev","Sr. SDE @ Amazon. Austin, TX. AI Enthusiast. \r\n","2026-10-13 08:29:57",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":25},[37,40,43],{"tool":38,"command":39},"npx","npx skills add mikeyobrien\u002Fpi-tidy-tools --skill build-loop",{"tool":41,"command":42},"bunx","bunx skills add mikeyobrien\u002Fpi-tidy-tools --skill build-loop",{"tool":44,"command":45},"pnpm","pnpm dlx skills add mikeyobrien\u002Fpi-tidy-tools --skill build-loop","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmikeyobrien\u002Fpi-tidy-tools\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fbuild-loop\u002FSKILL.md",[48,54,60,64,68,72,76,80,84],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"EVENT_LEDGER.md","REFERENCE","参考文档",9430,"https:\u002F\u002Fgithub.com\u002Fmikeyobrien\u002Fpi-tidy-tools\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fbuild-loop\u002FEVENT_LEDGER.md",{"path":55,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":58,"sourceHtmlUrl":59},"ledger-types.d.ts","SCRIPT","脚本",6370,"https:\u002F\u002Fgithub.com\u002Fmikeyobrien\u002Fpi-tidy-tools\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fbuild-loop\u002Fledger-types.d.ts",{"path":61,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":62,"sourceHtmlUrl":63},"scripts\u002Fbuild-ledger.mjs",51100,"https:\u002F\u002Fgithub.com\u002Fmikeyobrien\u002Fpi-tidy-tools\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fbuild-loop\u002Fscripts\u002Fbuild-ledger.mjs",{"path":65,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":66,"sourceHtmlUrl":67},"scripts\u002Fbuild-ledger.test.mjs",38307,"https:\u002F\u002Fgithub.com\u002Fmikeyobrien\u002Fpi-tidy-tools\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fbuild-loop\u002Fscripts\u002Fbuild-ledger.test.mjs",{"path":69,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":70,"sourceHtmlUrl":71},"scripts\u002Ffocused-commit.mjs",6649,"https:\u002F\u002Fgithub.com\u002Fmikeyobrien\u002Fpi-tidy-tools\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fbuild-loop\u002Fscripts\u002Ffocused-commit.mjs",{"path":73,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":74,"sourceHtmlUrl":75},"scripts\u002Ffocused-commit.test.mjs",9648,"https:\u002F\u002Fgithub.com\u002Fmikeyobrien\u002Fpi-tidy-tools\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fbuild-loop\u002Fscripts\u002Ffocused-commit.test.mjs",{"path":77,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":78,"sourceHtmlUrl":79},"scripts\u002Ffocused-plan.mjs",2631,"https:\u002F\u002Fgithub.com\u002Fmikeyobrien\u002Fpi-tidy-tools\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fbuild-loop\u002Fscripts\u002Ffocused-plan.mjs",{"path":81,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":82,"sourceHtmlUrl":83},"scripts\u002Fworktree-audit.mjs",10957,"https:\u002F\u002Fgithub.com\u002Fmikeyobrien\u002Fpi-tidy-tools\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fbuild-loop\u002Fscripts\u002Fworktree-audit.mjs",{"path":85,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":86,"sourceHtmlUrl":87},"scripts\u002Fworktree-audit.test.mjs",7984,"https:\u002F\u002Fgithub.com\u002Fmikeyobrien\u002Fpi-tidy-tools\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fbuild-loop\u002Fscripts\u002Fworktree-audit.test.mjs",[89,96,103,110,117,124],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M78EEXKEADXTNBVN3096T211","pi-tidy-bots-cli","Drive the pi-tidy-bots fleet runtime from an agent — init, daemonized start, status, stop, hot bot onboarding, and the HTTP+WS machine API (messages, transcripts, compaction, question cards) — all non-interactive with checked exit codes and --json shapes.","https:\u002F\u002Fgithub.com\u002Fmikeyobrien\u002Fpi-tidy-tools\u002Fblob\u002Fmain\u002Fskills\u002Fpi-tidy-bots-cli\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":19},"01M78EES9YE4WYNC6NJZNZD628","qa-loop","Run a human-gated QA and repair loop for pi-tidy-tools.","https:\u002F\u002Fgithub.com\u002Fmikeyobrien\u002Fpi-tidy-tools\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fqa-loop\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":19},"01M78EEP74RPPZYAZYEJRJ2DXK","pi-tidy-tools-ethos","Narrative guardrails for @mobrienv\u002Fpi-tidy-tools. Use when designing, implementing, reviewing, or documenting non-release changes to that package.","https:\u002F\u002Fgithub.com\u002Fmikeyobrien\u002Fpi-tidy-tools\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fpi-tidy-tools-ethos\u002FSKILL.md",[],[],{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":19},"01M78EEJAAK2GZ2FXR8PT6SPSY","npm-release","Releases one @mobrienv\u002Fpi-tidy-* workspace through GitHub and npm Trusted Publishing. Use when asked to prepare changelog entries, cut, publish, or monitor a patch, minor, major, or explicit-version release.","https:\u002F\u002Fgithub.com\u002Fmikeyobrien\u002Fpi-tidy-tools\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fnpm-release\u002FSKILL.md",[],[],{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":19},"01M78EEA9XNRCCR1SKEFSPXPTC","why","Use for 'why does X work this way', 'why we picked Y', design rationale, regressions, postmortems, or data-backed thresholds. Discovers available MCPs and queries each evidence category (source control, issue tracker, long-form docs, real-time chat, infrastructure observability, error tracking, product analytics warehouse) in parallel, then returns a cited read on decisions and tradeoffs. Use how for runtime behavior.","https:\u002F\u002Fgithub.com\u002Fmikeyobrien\u002Fpi-tidy-tools\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fwhy\u002FSKILL.md",[],[],{"skillNo":125,"name":126,"nameZh":6,"description":127,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":128,"categories":129,"keywords":130,"publishedAt":19},"01M78EE7FYS5EH3K5ETM10BBVZ","unslop","Cut AI tells from any writing. Must always apply.","https:\u002F\u002Fgithub.com\u002Fmikeyobrien\u002Fpi-tidy-tools\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Funslop\u002FSKILL.md",[],[]]