[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M699D1NXHJ7RQ09DAC1Y1W6F":3,"skill-same:01M699D1NXHJ7RQ09DAC1Y1W6F":153},{"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":23,"publishedAt":46,"linkOnly":47,"markdownContent":48,"markdownBody":49,"frontMatter":50,"refName":52,"commitSha":53,"skillDirectory":54,"forksCount":55,"repositoryHtmlUrl":56,"repositoryHomepageUrl":57,"ownerHtmlUrl":58,"ownerBlogUrl":59,"ownerDescription":60,"updatedAt":61,"install":62,"resources":74},"01M699D1NXHJ7RQ09DAC1Y1W6F","autopilot-pr-merge-worker",null,"Drive ONE already selected open pull request in microsoft\u002Fapm to mergeable. Classifies copilot-pull-request-reviewer[bot] inline review, runs autopilot-pr-review-worker, folds (by default) every recommendation inside the PR's stated scope, pushes to the head branch or a superseding PR that preserves authorship via commit trailers,   watches CI to green (`agent-merge` when that skill or `\u003Cagent_merge_state>` is present; otherwise `gh pr checks --watch`), and iterates under fixed caps until ready-to-merge, advisory-with-deferred, superseded, or blocked. Plan before any fold, push, or reviewer request. Never spawned by autopilot-pr-review-scheduler. That scheduler is advisory only. Invoke this skill by name when the caller asked to drive a PR to merge.","microsoft\u002Fapm","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M699CC41JR5QW38C9PDX6101",4369,"MIT","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fapm\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fautopilot-pr-merge-worker\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,9,45],"autopilot pr merge worker","merge","pr","pr merge","autopilot","worker","branch","commit trailers","invoke","scope","green","default","ready","only","never","bot","gh pr","open","open pull request","ci","copilot","review","2026-11-10 10:12:30",false,"---\nname: autopilot-pr-merge-worker\nactivation_card: on\ndescription: >-\n  Drive ONE already selected open pull request in microsoft\u002Fapm\n  to mergeable. Classifies copilot-pull-request-reviewer[bot]\n  inline review, runs autopilot-pr-review-worker, folds (by default)\n  every recommendation inside the PR's stated scope, pushes to the\n  head branch or a superseding PR that preserves authorship via\n  commit trailers,   watches CI to green (`agent-merge` when that skill or\n  `\u003Cagent_merge_state>` is present; otherwise `gh pr checks --watch`),\n  and iterates under fixed caps until ready-to-merge,\n  advisory-with-deferred, superseded, or blocked. Plan before any\n  fold, push, or reviewer request. Never spawned by\n  autopilot-pr-review-scheduler. That scheduler is advisory only.\n  Invoke this skill by name when the caller asked to drive a PR\n  to merge.\n---\n\n# autopilot-pr-merge-worker - per-PR drive-to-merge convergence loop\n\nWrites are optional via the activation card (`write: on` default).\n`autopilot-pr-review-scheduler` never spawns this skill.\nThe PR review scheduler never comments, labels, assigns, or\nrequests reviewers.\n\n`panel-review` requests a review. `status\u002Faccepted` is the human\naction flag. No accepted, no review. If `status\u002Faccepted` is\nmissing on this PR and every linked issue: remove `panel-review`\nif present, do not comment, stop. Never assign. The scheduler\nand panel stop the same way and leave no comment.\n\n## Activation card\n\n`activation_card: on`. Before any PR read or GitHub write, emit\nthis Enter card with every field filled. Missing field -> stop.\n\n```text\nskill: autopilot-pr-merge-worker\nskill_path: \u003Cresolved directory of this SKILL.md>\nmode: run\nsubject: microsoft\u002Fapm#\u003Cpr-number>\npath: merge\nintent: drive one already-selected PR\norigin: unattended | actor-session\nwrite: on | off\nrepo: microsoft\u002Fapm\npr: \u003Cpositive integer>\ninvocation: agentic-workflow | actor-session\ninvocation_mode: composed-implementation-review\n```\n\nRules:\n\n- `write` defaults to `on` when the caller omitted it.\n- `write: off` returns the filled template only. Do not comment,\n  add labels, remove labels, push, or request reviewers.\n- If `write: on`, post the one advisory comment via\n  `autopilot-comment` (`source_skill:\n  autopilot-pr-merge-worker`) and fold\u002Fpush inside the PR's\n  stated scope. Never assign. Never request the implementer as\n  a reviewer. Do not call `gh pr comment` yourself.\n- `origin` fail-closed unknown -> `unattended`.\n- Unattended never assigns and never requests reviewers.\n- One PR. Do not nest a scheduler path.\n- `plan_first` defaults to `yes`. Do not fold, push, or request\n  reviewers until Step 0.P exists. Copilot App spawn uses\n  `kickoff_mode: plan`. If the session started interactive, still\n  write that plan in-session and do not skip it. Wait for operator\n  approval when a plan-mode gate is present.\n\nAfter the loop, emit this Exit receipt:\n\n```text\nskill: autopilot-pr-merge-worker\nsubject: microsoft\u002Fapm#\u003Cpr-number>\npath: merge\nwrite: on | off\nposted: yes | no\npushed: yes | no\nreviewer_requested: no\napproved: n\u002Fa\n```\n\nThis SKILL.md is the natural-language module derived from a genesis\ndesign packet; refactors re-run the genesis skill from that packet.\n\nThis skill is a BUILDING BLOCK, not the PR-review queue.\n`autopilot-pr-review-scheduler` never composes it. Invoke it by\nname when the caller asked to drive a PR to merge. It COMPOSES\nthe [autopilot-pr-review-worker](..\u002Fautopilot-pr-review-worker\u002FSKILL.md)\nskill for the advisory pass -- it does NOT re-implement panel\nreview.\n\n## Boundary (what this skill does and does NOT do)\n\nDOES: take ONE PR that already exists and drive it to a terminal\nlanding-ready state; resolve cross-PR merge conflicts; emit the\nPR-facing advisory and supersede comments; return a schema-valid\n`completion_return`.\n\nDoes NOT: triage issues, decide which issues are worth fixing, open\nthe first PR for an issue, choose the batch, or maintain the\norchestrator's ground-truth table. Those are the parent\norchestrator's responsibility. If you find yourself triaging or\nopening greenfield PRs, you are in the wrong skill.\n\n## How an orchestrator composes this skill\n\nThe parent scheduler, for each PR in its batch, spawns ONE\nautopilot-pr-merge-worker subagent with the spawn body in\n[assets\u002Fworker-prompt.md](assets\u002Fworker-prompt.md).\nThe orchestrator passes the inputs that prompt declares (PR_NUMBER,\nISSUE_NUMBER, AUTHOR, HEAD_REPO, HEAD_BRANCH, MAINTAINER_CAN_MODIFY,\nREPO_ROOT, ORIGIN, optional PANEL_PRIOR). The subagent owns the whole\nconvergence loop end-to-end and returns a `completion_return`.\n\nAfter every driven PR returns `ready-to-merge`, the orchestrator\nruns the conflict-resolution phase: probe mergeability and, on\nDIRTY \u002F BEHIND \u002F CONFLICTING, spawn one conflict-resolution subagent\nper [assets\u002Fconflict-resolution-prompt.md](assets\u002Fconflict-resolution-prompt.md).\nThe step-by-step gate procedure is in\n[references\u002Fmergeability-gate.md](references\u002Fmergeability-gate.md)\n(load it when entering that phase).\n\n## Dependency declaration (read before composing)\n\nThis skill is a same-repo LOCAL SIBLING. A consuming orchestrator\nMUST declare the dependency at its own distribution surface and PROBE\nfor this skill before spawning. The probe is a tool call, not an\nassertion from recall (A9 SUPERVISED EXECUTION; truth #2 CONTEXT\nEXPLICIT):\n\n```\ntest -f ..\u002Fautopilot-pr-merge-worker\u002Fassets\u002Fworker-prompt.md \\\n  && test -f ..\u002Fautopilot-pr-merge-worker\u002Fassets\u002Fcompletion-schema.json \\\n  && test -f ..\u002Fautopilot-pr-merge-worker\u002Fscripts\u002Fowner_touch_gate.py \\\n  && echo \"autopilot-pr-merge-worker present\" \\\n  || echo \"MISSING autopilot-pr-merge-worker - stop and ask the operator\"\n```\n\nOn a probe MISS the orchestrator stops and asks the operator rather\nthan re-implementing the loop inline (avoids HAND-ROLLED\nHALLUCINATION and PHANTOM DEPENDENCY).\n\nThis skill itself COMPOSES [autopilot-pr-review-worker](..\u002Fautopilot-pr-review-worker\u002FSKILL.md).\nA consuming orchestrator inherits that transitive dependency; the\nspawned autopilot-pr-merge-worker subagent PROBES for it at preflight (all\nload-bearing panel assets under\n`$REPO_ROOT\u002F.agents\u002Fskills\u002Fautopilot-pr-review-worker\u002F`) and returns\n`status: blocked` ONLY on a genuine asset MISS, before any checkout\n(see the spawn body Step 0.0). Note: a missing `skill` TOOL is NOT a\nmiss -- in the normal subagent context the panel is executed INLINE\nfrom its on-disk SKILL.md + schemas (Step X.1.1), which is a\nfirst-class path, not a fallback.\n\n## Convergence loop contract (per PR)\n\nThe autopilot-pr-merge-worker subagent runs this loop (full detail in the spawn\nbody):\n\n0. Phase 0.P -- plan before implement (hard gate). Compare work to\n   date with the original task\u002Fscope (PR body + linked issue). Then\n   plan: fresh panel, fold in-scope findings and requirement gaps,\n   CI green via `agent-merge` when available else\n   `assets\u002Fci-recovery-checklist.md`. Do not checkout, fold, or\n   push until that plan exists (and is approved when plan-mode).\n1. Phase X.0 -- fetch + classify `copilot-pull-request-reviewer[bot]`\n   inline review per\n   [assets\u002Fcopilot-classification-prompt.md](assets\u002Fcopilot-classification-prompt.md).\n2. Phase X.1 -- run the `autopilot-pr-review-worker` against the PR: via the\n   `skill` tool if present, otherwise (the normal subagent case)\n   execute it INLINE from its on-disk SKILL.md + schemas. Both paths\n   produce the same single recommendation comment.\n3. Phase X.2 -- merge follow-ups (LEGIT Copilot + panel\n   `recommended_followups`) and apply the fold-vs-defer rubric per\n   [assets\u002Ffold-vs-defer-rubric.md](assets\u002Ffold-vs-defer-rubric.md).\n4. Phase X.2.5 -- canonical-owner + functional-evidence gate (FAIL\n   CLOSED). Run\n   [scripts\u002Fowner_touch_gate.py](scripts\u002Fowner_touch_gate.py) against\n   the exact base\u002Fhead. It parses the single canonical owner table in\n   `.apm\u002Finstructions\u002Farchitecture.instructions.md`; no LLM\n   self-classification may override a detected touch. Every touched\n   owner requires executed exact-head functional test IDs\u002Fevidence in\n   addition to the boundary lint and any required dual guardrail.\n   Schema-validate and semantically verify the version 2 completion\n   evidence. Missing evidence stays in the loop or returns `blocked`;\n   it is never deferred.\n5. Phase X.3 -- edit code; fold every FOLD item. Run the mutation-\n   break gate on any new regression-trap test.\n6. Phase X.4 -- run the lint contract until silent.\n7. Phase X.5 -- push (head branch; fall back to a superseding PR that\n   preserves authorship via commit trailers).\n8. Phase X.6 -- CI to green. Prefer the `agent-merge` skill when it\n   is loaded or the prompt contains `\u003Cagent_merge_state>` (do not\n   sleep\u002Fwatch inside that tick; never merge). Otherwise watch +\n   recover per\n   [assets\u002Fci-recovery-checklist.md](assets\u002Fci-recovery-checklist.md).\n9. Phase X.7 -- decide terminal vs next iteration.\n10. Phase X.8 -- at terminal, capture `head_sha`, `mergeable`,\n    `mergeStateStatus`, and CI status for the completion return.\n\n## Caps (hard limits)\n\n- Outer convergence iterations: 4.\n- Copilot classification rounds: 2.\n- CI recovery iterations: 3.\n\nWhen a cap is hit with foldable items still open, return\n`advisory-with-deferred` with a scope-boundary note per deferred\nitem. Caps exist to bound non-determinism; they are not targets.\n\n## Terminal returns\n\nThe subagent returns exactly one schema-valid `completion_return`\nmatching [assets\u002Fcompletion-schema.json](assets\u002Fcompletion-schema.json):\n\n- `ready-to-merge` -- clean convergence; CI observed green; lint\n  silent; canonical-owner gate passed with schema-valid and\n  semantically verified `architecture_evidence` version 2.\n- `advisory-with-deferred` -- iteration cap hit with foldable items\n  remaining (rare); each deferred item carries a scope-boundary note.\n- `superseded` -- push fell back to a superseding PR (records\n  `superseded_by`).\n- `blocked` -- CI cap hit, panel assets genuinely absent (Step 0.0\n  probe miss -- NOT merely the `skill` tool being unavailable), or\n  unresolvable scope conflict (records a one-paragraph `blocker`).\n\nThe orchestrator schema-validates every return. On malformed, re-spawn\nONCE; on a second malformed return, mark the row blocked and continue.\n\n## Disciplines enforced (inherited by every consumer)\n\n- Fold-by-default: every follow-up inside the PR's stated scope is\n  folded into THIS PR; only scope-crossing items are deferred, each\n  with a one-line boundary note.\n- Mutation-break gate: every regression-trap test added is proven by\n  deleting the guard it protects and confirming the test fails\n  without it, then restoring the guard.\n- Canonical-owner gate: deterministic detection parses the executable\n  selectors in the single canonical architecture owner table. Every\n  detected owner touch must map to at least one executed functional\n  test ID with exact command, passing evidence, and exact head SHA.\n  The version 2 completion contract intentionally replaces version 1\n  self-classified `decisions[]`; terminal v1 returns are malformed and\n  re-spawn once. A new owner, centralization, or split-authority repair\n  also requires the full dual guardrail (behavioral regression test,\n  static boundary guard, matching `test_architecture_*.py` assertion,\n  and mutation-break evidence) plus a clean\n  `scripts\u002Flint-architecture-boundaries.sh`. Missing evidence stays in\n  the loop or returns `blocked`; it is never deferred.\n- Lint contract: the canonical ruff pair\n  (`uv run --extra dev ruff check src\u002F tests\u002F` and\n  `ruff format --check src\u002F tests\u002F`) must be silent before any push.\n- CI-observed-green: terminal `ready-to-merge` requires real CI\n  evidence, not an assumption.\n- One advisory comment per PR per terminal pass, rendered from\n  [assets\u002Fpr-comment-templates.md](assets\u002Fpr-comment-templates.md)\n  and posted by `autopilot-comment`.\n- Authorship preservation: superseding PRs credit the original author\n  via commit trailers and link back.\n\n## Consequential writes cross a deterministic tool bridge\n\nEvery side effect (push, comment, PR open\u002Fclose, label, CI read,\nmergeability probe) goes through a deterministic CLI (`gh`, `git`,\n`uv run ruff`) wrapped in plan + execute + verify (A9 SUPERVISED\nEXECUTION). Present-state facts (CI status, mergeable, head sha) are\nREAD from `gh`\u002F`git` at terminal, never asserted from recall.\n\n## Bundled assets\n\n- [assets\u002Fworker-prompt.md](assets\u002Fworker-prompt.md)\n  -- the per-PR convergence-loop spawn body. ONE PR per subagent.\n- [assets\u002Ffold-vs-defer-rubric.md](assets\u002Ffold-vs-defer-rubric.md) --\n  the fold-by-default decision authority (Phase X.2).\n- [assets\u002Fcopilot-classification-prompt.md](assets\u002Fcopilot-classification-prompt.md)\n  -- LEGIT\u002FNOT-LEGIT classification of Copilot review (Phase X.0).\n- [assets\u002Fci-recovery-checklist.md](assets\u002Fci-recovery-checklist.md)\n  -- post-push CI watch + recovery loop (Phase X.6; cap 3).\n- [assets\u002Fconflict-resolution-prompt.md](assets\u002Fconflict-resolution-prompt.md)\n  -- cross-PR rebase + faithful conflict resolution spawn body.\n- [assets\u002Fcompletion-schema.json](assets\u002Fcompletion-schema.json) --\n  JSON schema for the `completion` and `conflict-resolution` return\n  shapes. Schema-validate every subagent return.\n- [scripts\u002Fowner_touch_gate.py](scripts\u002Fowner_touch_gate.py) --\n  non-interactive deterministic owner-touch detection and terminal\n  functional-evidence verification. Run `--help` for its CLI.\n- [assets\u002Fpr-comment-templates.md](assets\u002Fpr-comment-templates.md) --\n  PR ADVISORY + SUPERSEDE comment shapes (rendered at terminal).\n- [references\u002Fmergeability-gate.md](references\u002Fmergeability-gate.md) --\n  load-on-demand step-by-step for the conflict-resolution phase.\n","# autopilot-pr-merge-worker - per-PR drive-to-merge convergence loop\n\nWrites are optional via the activation card (`write: on` default).\n`autopilot-pr-review-scheduler` never spawns this skill.\nThe PR review scheduler never comments, labels, assigns, or\nrequests reviewers.\n\n`panel-review` requests a review. `status\u002Faccepted` is the human\naction flag. No accepted, no review. If `status\u002Faccepted` is\nmissing on this PR and every linked issue: remove `panel-review`\nif present, do not comment, stop. Never assign. The scheduler\nand panel stop the same way and leave no comment.\n\n## Activation card\n\n`activation_card: on`. Before any PR read or GitHub write, emit\nthis Enter card with every field filled. Missing field -> stop.\n\n```text\nskill: autopilot-pr-merge-worker\nskill_path: \u003Cresolved directory of this SKILL.md>\nmode: run\nsubject: microsoft\u002Fapm#\u003Cpr-number>\npath: merge\nintent: drive one already-selected PR\norigin: unattended | actor-session\nwrite: on | off\nrepo: microsoft\u002Fapm\npr: \u003Cpositive integer>\ninvocation: agentic-workflow | actor-session\ninvocation_mode: composed-implementation-review\n```\n\nRules:\n\n- `write` defaults to `on` when the caller omitted it.\n- `write: off` returns the filled template only. Do not comment,\n  add labels, remove labels, push, or request reviewers.\n- If `write: on`, post the one advisory comment via\n  `autopilot-comment` (`source_skill:\n  autopilot-pr-merge-worker`) and fold\u002Fpush inside the PR's\n  stated scope. Never assign. Never request the implementer as\n  a reviewer. Do not call `gh pr comment` yourself.\n- `origin` fail-closed unknown -> `unattended`.\n- Unattended never assigns and never requests reviewers.\n- One PR. Do not nest a scheduler path.\n- `plan_first` defaults to `yes`. Do not fold, push, or request\n  reviewers until Step 0.P exists. Copilot App spawn uses\n  `kickoff_mode: plan`. If the session started interactive, still\n  write that plan in-session and do not skip it. Wait for operator\n  approval when a plan-mode gate is present.\n\nAfter the loop, emit this Exit receipt:\n\n```text\nskill: autopilot-pr-merge-worker\nsubject: microsoft\u002Fapm#\u003Cpr-number>\npath: merge\nwrite: on | off\nposted: yes | no\npushed: yes | no\nreviewer_requested: no\napproved: n\u002Fa\n```\n\nThis SKILL.md is the natural-language module derived from a genesis\ndesign packet; refactors re-run the genesis skill from that packet.\n\nThis skill is a BUILDING BLOCK, not the PR-review queue.\n`autopilot-pr-review-scheduler` never composes it. Invoke it by\nname when the caller asked to drive a PR to merge. It COMPOSES\nthe [autopilot-pr-review-worker](..\u002Fautopilot-pr-review-worker\u002FSKILL.md)\nskill for the advisory pass -- it does NOT re-implement panel\nreview.\n\n## Boundary (what this skill does and does NOT do)\n\nDOES: take ONE PR that already exists and drive it to a terminal\nlanding-ready state; resolve cross-PR merge conflicts; emit the\nPR-facing advisory and supersede comments; return a schema-valid\n`completion_return`.\n\nDoes NOT: triage issues, decide which issues are worth fixing, open\nthe first PR for an issue, choose the batch, or maintain the\norchestrator's ground-truth table. Those are the parent\norchestrator's responsibility. If you find yourself triaging or\nopening greenfield PRs, you are in the wrong skill.\n\n## How an orchestrator composes this skill\n\nThe parent scheduler, for each PR in its batch, spawns ONE\nautopilot-pr-merge-worker subagent with the spawn body in\n[assets\u002Fworker-prompt.md](assets\u002Fworker-prompt.md).\nThe orchestrator passes the inputs that prompt declares (PR_NUMBER,\nISSUE_NUMBER, AUTHOR, HEAD_REPO, HEAD_BRANCH, MAINTAINER_CAN_MODIFY,\nREPO_ROOT, ORIGIN, optional PANEL_PRIOR). The subagent owns the whole\nconvergence loop end-to-end and returns a `completion_return`.\n\nAfter every driven PR returns `ready-to-merge`, the orchestrator\nruns the conflict-resolution phase: probe mergeability and, on\nDIRTY \u002F BEHIND \u002F CONFLICTING, spawn one conflict-resolution subagent\nper [assets\u002Fconflict-resolution-prompt.md](assets\u002Fconflict-resolution-prompt.md).\nThe step-by-step gate procedure is in\n[references\u002Fmergeability-gate.md](references\u002Fmergeability-gate.md)\n(load it when entering that phase).\n\n## Dependency declaration (read before composing)\n\nThis skill is a same-repo LOCAL SIBLING. A consuming orchestrator\nMUST declare the dependency at its own distribution surface and PROBE\nfor this skill before spawning. The probe is a tool call, not an\nassertion from recall (A9 SUPERVISED EXECUTION; truth #2 CONTEXT\nEXPLICIT):\n\n```\ntest -f ..\u002Fautopilot-pr-merge-worker\u002Fassets\u002Fworker-prompt.md \\\n  && test -f ..\u002Fautopilot-pr-merge-worker\u002Fassets\u002Fcompletion-schema.json \\\n  && test -f ..\u002Fautopilot-pr-merge-worker\u002Fscripts\u002Fowner_touch_gate.py \\\n  && echo \"autopilot-pr-merge-worker present\" \\\n  || echo \"MISSING autopilot-pr-merge-worker - stop and ask the operator\"\n```\n\nOn a probe MISS the orchestrator stops and asks the operator rather\nthan re-implementing the loop inline (avoids HAND-ROLLED\nHALLUCINATION and PHANTOM DEPENDENCY).\n\nThis skill itself COMPOSES [autopilot-pr-review-worker](..\u002Fautopilot-pr-review-worker\u002FSKILL.md).\nA consuming orchestrator inherits that transitive dependency; the\nspawned autopilot-pr-merge-worker subagent PROBES for it at preflight (all\nload-bearing panel assets under\n`$REPO_ROOT\u002F.agents\u002Fskills\u002Fautopilot-pr-review-worker\u002F`) and returns\n`status: blocked` ONLY on a genuine asset MISS, before any checkout\n(see the spawn body Step 0.0). Note: a missing `skill` TOOL is NOT a\nmiss -- in the normal subagent context the panel is executed INLINE\nfrom its on-disk SKILL.md + schemas (Step X.1.1), which is a\nfirst-class path, not a fallback.\n\n## Convergence loop contract (per PR)\n\nThe autopilot-pr-merge-worker subagent runs this loop (full detail in the spawn\nbody):\n\n0. Phase 0.P -- plan before implement (hard gate). Compare work to\n   date with the original task\u002Fscope (PR body + linked issue). Then\n   plan: fresh panel, fold in-scope findings and requirement gaps,\n   CI green via `agent-merge` when available else\n   `assets\u002Fci-recovery-checklist.md`. Do not checkout, fold, or\n   push until that plan exists (and is approved when plan-mode).\n1. Phase X.0 -- fetch + classify `copilot-pull-request-reviewer[bot]`\n   inline review per\n   [assets\u002Fcopilot-classification-prompt.md](assets\u002Fcopilot-classification-prompt.md).\n2. Phase X.1 -- run the `autopilot-pr-review-worker` against the PR: via the\n   `skill` tool if present, otherwise (the normal subagent case)\n   execute it INLINE from its on-disk SKILL.md + schemas. Both paths\n   produce the same single recommendation comment.\n3. Phase X.2 -- merge follow-ups (LEGIT Copilot + panel\n   `recommended_followups`) and apply the fold-vs-defer rubric per\n   [assets\u002Ffold-vs-defer-rubric.md](assets\u002Ffold-vs-defer-rubric.md).\n4. Phase X.2.5 -- canonical-owner + functional-evidence gate (FAIL\n   CLOSED). Run\n   [scripts\u002Fowner_touch_gate.py](scripts\u002Fowner_touch_gate.py) against\n   the exact base\u002Fhead. It parses the single canonical owner table in\n   `.apm\u002Finstructions\u002Farchitecture.instructions.md`; no LLM\n   self-classification may override a detected touch. Every touched\n   owner requires executed exact-head functional test IDs\u002Fevidence in\n   addition to the boundary lint and any required dual guardrail.\n   Schema-validate and semantically verify the version 2 completion\n   evidence. Missing evidence stays in the loop or returns `blocked`;\n   it is never deferred.\n5. Phase X.3 -- edit code; fold every FOLD item. Run the mutation-\n   break gate on any new regression-trap test.\n6. Phase X.4 -- run the lint contract until silent.\n7. Phase X.5 -- push (head branch; fall back to a superseding PR that\n   preserves authorship via commit trailers).\n8. Phase X.6 -- CI to green. Prefer the `agent-merge` skill when it\n   is loaded or the prompt contains `\u003Cagent_merge_state>` (do not\n   sleep\u002Fwatch inside that tick; never merge). Otherwise watch +\n   recover per\n   [assets\u002Fci-recovery-checklist.md](assets\u002Fci-recovery-checklist.md).\n9. Phase X.7 -- decide terminal vs next iteration.\n10. Phase X.8 -- at terminal, capture `head_sha`, `mergeable`,\n    `mergeStateStatus`, and CI status for the completion return.\n\n## Caps (hard limits)\n\n- Outer convergence iterations: 4.\n- Copilot classification rounds: 2.\n- CI recovery iterations: 3.\n\nWhen a cap is hit with foldable items still open, return\n`advisory-with-deferred` with a scope-boundary note per deferred\nitem. Caps exist to bound non-determinism; they are not targets.\n\n## Terminal returns\n\nThe subagent returns exactly one schema-valid `completion_return`\nmatching [assets\u002Fcompletion-schema.json](assets\u002Fcompletion-schema.json):\n\n- `ready-to-merge` -- clean convergence; CI observed green; lint\n  silent; canonical-owner gate passed with schema-valid and\n  semantically verified `architecture_evidence` version 2.\n- `advisory-with-deferred` -- iteration cap hit with foldable items\n  remaining (rare); each deferred item carries a scope-boundary note.\n- `superseded` -- push fell back to a superseding PR (records\n  `superseded_by`).\n- `blocked` -- CI cap hit, panel assets genuinely absent (Step 0.0\n  probe miss -- NOT merely the `skill` tool being unavailable), or\n  unresolvable scope conflict (records a one-paragraph `blocker`).\n\nThe orchestrator schema-validates every return. On malformed, re-spawn\nONCE; on a second malformed return, mark the row blocked and continue.\n\n## Disciplines enforced (inherited by every consumer)\n\n- Fold-by-default: every follow-up inside the PR's stated scope is\n  folded into THIS PR; only scope-crossing items are deferred, each\n  with a one-line boundary note.\n- Mutation-break gate: every regression-trap test added is proven by\n  deleting the guard it protects and confirming the test fails\n  without it, then restoring the guard.\n- Canonical-owner gate: deterministic detection parses the executable\n  selectors in the single canonical architecture owner table. Every\n  detected owner touch must map to at least one executed functional\n  test ID with exact command, passing evidence, and exact head SHA.\n  The version 2 completion contract intentionally replaces version 1\n  self-classified `decisions[]`; terminal v1 returns are malformed and\n  re-spawn once. A new owner, centralization, or split-authority repair\n  also requires the full dual guardrail (behavioral regression test,\n  static boundary guard, matching `test_architecture_*.py` assertion,\n  and mutation-break evidence) plus a clean\n  `scripts\u002Flint-architecture-boundaries.sh`. Missing evidence stays in\n  the loop or returns `blocked`; it is never deferred.\n- Lint contract: the canonical ruff pair\n  (`uv run --extra dev ruff check src\u002F tests\u002F` and\n  `ruff format --check src\u002F tests\u002F`) must be silent before any push.\n- CI-observed-green: terminal `ready-to-merge` requires real CI\n  evidence, not an assumption.\n- One advisory comment per PR per terminal pass, rendered from\n  [assets\u002Fpr-comment-templates.md](assets\u002Fpr-comment-templates.md)\n  and posted by `autopilot-comment`.\n- Authorship preservation: superseding PRs credit the original author\n  via commit trailers and link back.\n\n## Consequential writes cross a deterministic tool bridge\n\nEvery side effect (push, comment, PR open\u002Fclose, label, CI read,\nmergeability probe) goes through a deterministic CLI (`gh`, `git`,\n`uv run ruff`) wrapped in plan + execute + verify (A9 SUPERVISED\nEXECUTION). Present-state facts (CI status, mergeable, head sha) are\nREAD from `gh`\u002F`git` at terminal, never asserted from recall.\n\n## Bundled assets\n\n- [assets\u002Fworker-prompt.md](assets\u002Fworker-prompt.md)\n  -- the per-PR convergence-loop spawn body. ONE PR per subagent.\n- [assets\u002Ffold-vs-defer-rubric.md](assets\u002Ffold-vs-defer-rubric.md) --\n  the fold-by-default decision authority (Phase X.2).\n- [assets\u002Fcopilot-classification-prompt.md](assets\u002Fcopilot-classification-prompt.md)\n  -- LEGIT\u002FNOT-LEGIT classification of Copilot review (Phase X.0).\n- [assets\u002Fci-recovery-checklist.md](assets\u002Fci-recovery-checklist.md)\n  -- post-push CI watch + recovery loop (Phase X.6; cap 3).\n- [assets\u002Fconflict-resolution-prompt.md](assets\u002Fconflict-resolution-prompt.md)\n  -- cross-PR rebase + faithful conflict resolution spawn body.\n- [assets\u002Fcompletion-schema.json](assets\u002Fcompletion-schema.json) --\n  JSON schema for the `completion` and `conflict-resolution` return\n  shapes. Schema-validate every subagent return.\n- [scripts\u002Fowner_touch_gate.py](scripts\u002Fowner_touch_gate.py) --\n  non-interactive deterministic owner-touch detection and terminal\n  functional-evidence verification. Run `--help` for its CLI.\n- [assets\u002Fpr-comment-templates.md](assets\u002Fpr-comment-templates.md) --\n  PR ADVISORY + SUPERSEDE comment shapes (rendered at terminal).\n- [references\u002Fmergeability-gate.md](references\u002Fmergeability-gate.md) --\n  load-on-demand step-by-step for the conflict-resolution phase.\n",{"name":5,"description":7,"activation_card":51},true,"main","2920043258932f0f67e6f01df7b9047eb42f358c",".agents\u002Fskills\u002Fautopilot-pr-merge-worker",426,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fapm","https:\u002F\u002Fmicrosoft.github.io\u002Fapm\u002F","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-11-14 10:21:38",{"source":8,"skillName":5,"commands":63,"prompt":73,"zipAvailable":51},[64,67,70],{"tool":65,"command":66},"npx","npx skills add microsoft\u002Fapm --skill autopilot-pr-merge-worker",{"tool":68,"command":69},"bunx","bunx skills add microsoft\u002Fapm --skill autopilot-pr-merge-worker",{"tool":71,"command":72},"pnpm","pnpm dlx skills add microsoft\u002Fapm --skill autopilot-pr-merge-worker","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fapm\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fautopilot-pr-merge-worker\u002FSKILL.md",[75,81,87,91,95,99,103,107,111,115,121,125,129,133,137,141,145,149],{"path":76,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":79,"sourceHtmlUrl":80},"apm.yml","REFERENCE","参考文档",1216,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fapm\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fautopilot-pr-merge-worker\u002Fapm.yml",{"path":82,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":85,"sourceHtmlUrl":86},"assets\u002Fci-recovery-checklist.md","ASSET","资产文件",4521,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fapm\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fautopilot-pr-merge-worker\u002Fassets\u002Fci-recovery-checklist.md",{"path":88,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":89,"sourceHtmlUrl":90},"assets\u002Fcompletion-schema.json",22974,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fapm\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fautopilot-pr-merge-worker\u002Fassets\u002Fcompletion-schema.json",{"path":92,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":93,"sourceHtmlUrl":94},"assets\u002Fconflict-resolution-prompt.md",8981,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fapm\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fautopilot-pr-merge-worker\u002Fassets\u002Fconflict-resolution-prompt.md",{"path":96,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":97,"sourceHtmlUrl":98},"assets\u002Fcopilot-classification-prompt.md",3786,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fapm\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fautopilot-pr-merge-worker\u002Fassets\u002Fcopilot-classification-prompt.md",{"path":100,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":101,"sourceHtmlUrl":102},"assets\u002Ffold-vs-defer-rubric.md",4898,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fapm\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fautopilot-pr-merge-worker\u002Fassets\u002Ffold-vs-defer-rubric.md",{"path":104,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":105,"sourceHtmlUrl":106},"assets\u002Fpr-comment-templates.md",5780,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fapm\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fautopilot-pr-merge-worker\u002Fassets\u002Fpr-comment-templates.md",{"path":108,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":109,"sourceHtmlUrl":110},"assets\u002Fworker-prompt.md",35480,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fapm\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fautopilot-pr-merge-worker\u002Fassets\u002Fworker-prompt.md",{"path":112,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":113,"sourceHtmlUrl":114},"references\u002Fmergeability-gate.md",7070,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fapm\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fautopilot-pr-merge-worker\u002Freferences\u002Fmergeability-gate.md",{"path":116,"resourceType":117,"resourceTypeDesc":118,"sizeBytes":119,"sourceHtmlUrl":120},"scripts\u002Fowner_touch_gate.py","SCRIPT","脚本",31142,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fapm\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fautopilot-pr-merge-worker\u002Fscripts\u002Fowner_touch_gate.py",{"path":122,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":123,"sourceHtmlUrl":124},"spec-template.md",3289,"https:\u002F\u002Fgithub.com\u002Fsherryswift1019-gif\u002FAI-DZHT\u002Fblob\u002Fmain\u002F_bmad\u002Fbmm\u002F4-implementation\u002Fbmad-quick-dev\u002Fspec-template.md",{"path":126,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":127,"sourceHtmlUrl":128},"step-01-clarify-and-route.md",5027,"https:\u002F\u002Fgithub.com\u002Fsherryswift1019-gif\u002FAI-DZHT\u002Fblob\u002Fmain\u002F_bmad\u002Fbmm\u002F4-implementation\u002Fbmad-quick-dev\u002Fstep-01-clarify-and-route.md",{"path":130,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":131,"sourceHtmlUrl":132},"step-02-plan.md",1906,"https:\u002F\u002Fgithub.com\u002Fsherryswift1019-gif\u002FAI-DZHT\u002Fblob\u002Fmain\u002F_bmad\u002Fbmm\u002F4-implementation\u002Fbmad-quick-dev\u002Fstep-02-plan.md",{"path":134,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":135,"sourceHtmlUrl":136},"step-03-implement.md",1511,"https:\u002F\u002Fgithub.com\u002Fsherryswift1019-gif\u002FAI-DZHT\u002Fblob\u002Fmain\u002F_bmad\u002Fbmm\u002F4-implementation\u002Fbmad-quick-dev\u002Fstep-03-implement.md",{"path":138,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":139,"sourceHtmlUrl":140},"step-04-review.md",4025,"https:\u002F\u002Fgithub.com\u002Fsherryswift1019-gif\u002FAI-DZHT\u002Fblob\u002Fmain\u002F_bmad\u002Fbmm\u002F4-implementation\u002Fbmad-quick-dev\u002Fstep-04-review.md",{"path":142,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":143,"sourceHtmlUrl":144},"step-05-present.md",4020,"https:\u002F\u002Fgithub.com\u002Fsherryswift1019-gif\u002FAI-DZHT\u002Fblob\u002Fmain\u002F_bmad\u002Fbmm\u002F4-implementation\u002Fbmad-quick-dev\u002Fstep-05-present.md",{"path":146,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":147,"sourceHtmlUrl":148},"step-oneshot.md",2444,"https:\u002F\u002Fgithub.com\u002Fsherryswift1019-gif\u002FAI-DZHT\u002Fblob\u002Fmain\u002F_bmad\u002Fbmm\u002F4-implementation\u002Fbmad-quick-dev\u002Fstep-oneshot.md",{"path":150,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":151,"sourceHtmlUrl":152},"workflow.md",3171,"https:\u002F\u002Fgithub.com\u002Fsherryswift1019-gif\u002FAI-DZHT\u002Fblob\u002Fmain\u002F_bmad\u002Fbmm\u002F4-implementation\u002Fbmad-quick-dev\u002Fworkflow.md",[154,163,168,174,180,185],{"skillNo":155,"name":156,"nameZh":6,"description":157,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":158,"licenseFileUrl":6,"sourceHtmlUrl":159,"categories":160,"keywords":161,"publishedAt":162},"01M78JKQKRC85N30WT8HPN3EHM","autopilot-issue-accept","Use this skill to accept ONE microsoft\u002Fapm issue with a declared scope. The canvas Accept button, or a maintainer asking to accept an issue, starts it. Draft only from the latest triage proposed scope, get exact-text approval in this chat from a GOVERNANCE roster human, post that comment as that human, then add status\u002Faccepted. Do not invent scope, do not accept pull requests, and do not implement the issue.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fapm\u002Fblob\u002Fmain\u002Fpackages\u002Fautopilot\u002Fautopilot-issue-accept\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":164,"name":156,"nameZh":6,"description":157,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":158,"licenseFileUrl":6,"sourceHtmlUrl":165,"categories":166,"keywords":167,"publishedAt":162},"01M78JK63ZWG0XX043NVHZHNH9","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fapm\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fautopilot-issue-accept\u002FSKILL.md",[],[],{"skillNo":169,"name":170,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":171,"categories":172,"keywords":173,"publishedAt":46},"01M699JMZBYWPBT7JYWBSB95Z6","hello","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fapm\u002Fblob\u002Fmain\u002Ftests\u002Fintegration\u002Ffixtures\u002Ftarget_resolution\u002Fshared\u002Fminimal_skill\u002F.apm\u002Fskills\u002Fhello\u002FSKILL.md",[],[170],{"skillNo":175,"name":176,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":177,"categories":178,"keywords":179,"publishedAt":46},"01M699JKAMZ4DH1PYJMXHE4FG4","placeholder","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fapm\u002Fblob\u002Fmain\u002Ftests\u002Fintegration\u002Ffixtures\u002Ftarget_resolution\u002Fs25_copilot_alias\u002F.apm\u002Fskills\u002Fplaceholder\u002FSKILL.md",[],[176],{"skillNo":181,"name":176,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":182,"categories":183,"keywords":184,"publishedAt":46},"01M699JHR9DKJ7BZHAPF6DZX2Z","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fapm\u002Fblob\u002Fmain\u002Ftests\u002Fintegration\u002Ffixtures\u002Ftarget_resolution\u002Fs24_priority_override\u002F.apm\u002Fskills\u002Fplaceholder\u002FSKILL.md",[],[176],{"skillNo":186,"name":176,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":187,"categories":188,"keywords":189,"publishedAt":46},"01M699JG5BJBZSWM25F1VMJ2H6","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fapm\u002Fblob\u002Fmain\u002Ftests\u002Fintegration\u002Ffixtures\u002Ftarget_resolution\u002Fs23_error_renderer\u002F.apm\u002Fskills\u002Fplaceholder\u002FSKILL.md",[],[176]]