[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M72TK5HFSZPDCACEEPHG1WK5":3,"skill-same:01M72TK5HFSZPDCACEEPHG1WK5":97},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M72TK5HFSZPDCACEEPHG1WK5","ywc-merge-dependabot",null,"(ywc) Use when the user wants to merge Dependabot PRs, batch-process dependency updates, or clean up accumulated Dependabot PRs. Triggers: \"merge dependabot\", \"dependabot PR\", \"dependency updates\", \"security updates merge\", \"디펜다봇 머지\", \"依存関係更新マージ\". Do not use for non-Dependabot PRs, manual dependency upgrades, or for merging feature PRs (use ywc-create-pr or platform tools).","yongwoon\u002Fywc-agent-toolkit","yongwoon","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F9317029?v=4","01M72SZSF6VKANKG5QTMV4V95S","01M72SZSG8HHC3W2CV5P7EJ5AH",8,"MIT","https:\u002F\u002Fgithub.com\u002Fyongwoon\u002Fywc-agent-toolkit\u002Fblob\u002Fmain\u002Fplugins\u002Fywc-agent-toolkit\u002Fskills\u002Fywc-merge-dependabot\u002FSKILL.md",[],[],"2026-11-10 22:39:42",false,"---\nname: ywc-merge-dependabot\ndescription: >-\n  (ywc) Use when the user wants to merge Dependabot PRs, batch-process dependency updates, or clean up accumulated Dependabot PRs. Triggers: \"merge dependabot\", \"dependabot PR\", \"dependency updates\", \"security updates merge\", \"디펜다봇 머지\", \"依存関係更新マージ\". Do not use for non-Dependabot PRs, manual dependency upgrades, or for merging feature PRs (use ywc-create-pr or platform tools).\n---\n\n# Merge Dependabot Pull Requests\n\n**Announce at start:** \"I'm using the ywc-merge-dependabot skill to merge Dependabot PRs with CI verification — sequential by default, or parallel-auto (ecosystem-lane scheduling) when requested.\"\n\nSafely merge Dependabot PRs with CI verification, head-pinned merges, Dependabot rebase for conflicts, and clear reporting. Metadata prefers explicit invocation (`allow_implicit_invocation: false`); it is not a runtime enforcement guarantee.\n\n## Rationalization Defense\n\nWhen tempted to skip a step, check this table first:\n\n| Excuse | Reality |\n|---|---|\n| \"All ecosystems can run in parallel — fire all merges at once without grouping\" | No. Within an ecosystem (e.g., multiple npm PRs all touching `package-lock.json`) the client must keep one active PR at a time. `parallel-auto` only fans out across non-overlapping ecosystems, not within one. |\n| \"Mixed-ecosystem PR (touches both `package.json` and `pom.xml`) is fine to auto-merge\" | No. Mixed PRs go to a final sequential pass; `--auto` cannot guarantee ordering when a single PR crosses two parallel groups. |\n| \"Just enable `--auto` on every PR and walk away\" | The polling loop and final summary are non-optional. Without them users have no audit trail of which PRs failed, why, or whether an ecosystem lane stalled. |\n| \"Repo doesn't have auto-merge enabled, fall through silently\" | If `parallel-auto` is requested but `gh repo view --json autoMergeAllowed` returns `false`, fall back to sequential mode and tell the user — never pretend parallel scheduling is running. |\n| \"CI is green but lockfile shows different hash, merge anyway\" | Lockfile mismatch indicates dirty working state. Stop and rebase the PR first. |\n| \"Major version bump looks safe, just merge\" | Major bumps need explicit user confirmation. Default action: skip and report for human review. |\n| \"Conflicts with main, force-push my own resolution\" | Use Dependabot's `@dependabot rebase` comment instead. Hand-resolved conflicts in dep PRs hide breaking changes. |\n| \"Security mode, and the PR body mentions a CVE or GHSA\" | The body embeds upstream release notes, so a CVE in it proves nothing. A PR is in `security` scope only when `select-security-prs.py` matches it to an open Dependabot alert; otherwise skip it and report it. |\n| \"All passed, no need for a final summary\" | Always emit a per-PR result table (merged \u002F skipped \u002F failed) at the end. |\n\n**Violating the letter of these rules is violating the spirit.** Dependabot velocity is worthless if a bad merge silently breaks main.\n\n## Context\n\n- Repository: !`gh repo view --json nameWithOwner --jq .nameWithOwner`\n- Default branch: !`gh repo view --json defaultBranchRef --jq .defaultBranchRef.name`\n\n## Mode Selection\n\nThis skill supports two orthogonal flags inside `$ARGUMENTS`. Parse the argument string as a set of space-separated tokens.\n\n**Scope flag** — controls which PRs are eligible:\n\n| Token | Scope |\n| --- | --- |\n| `security` | Security-related Dependabot PRs only |\n| _(token absent)_ | All Dependabot PRs |\n\n**Execution flag** — controls how eligible PRs are processed:\n\n| Token | Execution | When to use |\n| --- | --- | --- |\n| `parallel-auto` | Group eligible PRs by lockfile ecosystem; keep one active `gh pr merge --auto` PR per ecosystem lane; enqueue the next PR in that lane only after the previous PR reaches a terminal state; one final sequential pass clears the `mixed` bucket | Many PRs (≥ 5) across multiple ecosystems (npm + github-actions + python ...) where wall-clock CI wait is the bottleneck |\n| _(token absent)_ | Sequential — one PR at a time, ascending PR number | Small batches, repos with strict branch protection, or environments where auto-merge is disabled |\n\nExamples:\n\n- `(empty)` → all PRs, sequential (default)\n- `security` → security PRs only, sequential\n- `parallel-auto` → all PRs, ecosystem-lane auto-merge\n- `security parallel-auto` → security PRs only, ecosystem-lane auto-merge\n\nSecurity-related PRs are identified by the repository's open Dependabot alerts, never by labels or PR text (see Step 1).\n\n**Parallel-auto prerequisite:** before entering parallel-auto mode, verify the repository allows auto-merge:\n\n```bash\ngh repo view --json autoMergeAllowed --jq .autoMergeAllowed\n```\n\nIf the value is `false`, announce the fallback (\"Auto-merge is not enabled on this repository — falling back to sequential mode\") and proceed as if `parallel-auto` were absent. Never silently skip scheduling and pretend the work is in progress.\n\n## Task\n\n### 1. List Dependabot PRs\n\nRetrieve all open PRs created by Dependabot:\n\n```bash\ngh pr list --author \"app\u002Fdependabot\" --state open --json number,title,labels,body --limit 100\n```\n\nIf in **security-only mode**, keep only the PRs that match an open Dependabot alert. Add `files` to the `--json` fields above and pipe the list through:\n\n```bash\ngh pr list --author \"app\u002Fdependabot\" --state open --json number,title,body,files --limit 100 \\\n  | python3 \u002Fpath\u002Fto\u002Fywc-merge-dependabot\u002Fscripts\u002Fselect-security-prs.py {owner\u002Frepo}\n```\n\nA PR matches when it changes the alert's manifest file and names the alert's package in its title (a grouped PR, whose title says \"group\", may name it in its body instead). Labels and words such as \"CVE-\", \"GHSA-\" or \"vulnerability\" do not count: the body embeds upstream release notes. Exit 0 prints `{\"security\": [...], \"other\": [...], \"advisories\": {...}}`; process only `security` and report every `other` PR as `Skipped (no matching Dependabot alert)`. Exit 2 means the alerts could not be read (Dependabot alerts disabled, or the token cannot read them): report every PR as `Skipped (security status unresolved)` with the printed `error`, and merge nothing. Any other exit stops the run. Known limit: the script does not check that the PR's target version reaches the advisory's first patched version, so a bump that stays vulnerable is still kept as `security`; the other pre-merge checks still apply.\n\nSort the resulting list by PR number ascending — processing order matters because earlier merges can affect later PRs.\n\n### 2. Pre-Merge Checks\n\nFor each PR, run these checks **before** attempting to merge. If any check fails, skip the PR.\n\n| Check | Skip condition | Skip label |\n| --- | --- | --- |\n| **Dockerfile FROM change** | PR modifies a `FROM` image version in any Dockerfile | `Skipped (Dockerfile)` |\n| **Major version upgrade** | PR bumps a major version (e.g. 2.x → 3.x), which risks breaking changes | `Skipped (Major version upgrade)` |\n| **CI failed** | A required CI check has failed | `Failed (CI not passing)` |\n| **CI pending** | A required CI check is still pending | `Skipped (CI pending)`; in parallel-auto the PR instead stays in its lane for the Stage 1 lane start (`--auto`) |\n\n### Dockerfile FROM detection\n\nFetch the diff successfully, then match changed `FROM` lines only inside Dockerfile hunks. A README or shell-file `FROM` line alone does not trigger the skip. Recognize `Dockerfile*` and `*.dockerfile` basenames in nested directories, added\u002Fdeleted files and multi-stage builds; match the instruction case-insensitively. A failed diff query is unresolved, never a clean result. Unsupported quoted paths\u002Fparser failure also remain unresolved and block that PR's merge.\n\nThe following runnable recipe takes the already selected numeric PR as `$pr`. Exit 0 means skip for Dockerfile FROM change; 1 means a successful scan found none; any other exit is unresolved. Capture the exit explicitly rather than treating every nonzero as no match.\n\n\u003C!-- operational-safety:dockerfile-detector:start -->\n```bash\npatch=$(gh pr diff \"$pr\") || { printf '%s\\n' 'UNRESOLVED: diff query failed' >&2; exit 2; }\nprintf '%s\\n' \"$patch\" | awk '\n  \u002F^diff --git \u002F { sawfile=1; docker=0; hunk=0; next }\n  !hunk && (\u002F^--- \u002F || \u002F^\\+\\+\\+ \u002F) {\n    path=substr($0,5)\n    if (path == \"\u002Fdev\u002Fnull\") next\n    if (path ~ \u002F^\"\u002F) { bad=1; exit }\n    sub(\u002F^[ab]\\\u002F\u002F,\"\",path); sub(\u002F\\t.*$\u002F,\"\",path)\n    n=split(path,parts,\"\u002F\")\n    if (parts[n] ~ \u002F^(Dockerfile.*|.*\\.dockerfile)$\u002F) docker=1\n    next\n  }\n  \u002F^@@ \u002F { hunk=1; next }\n  docker && hunk && \u002F^[+-][[:space:]]*[Ff][Rr][Oo][Mm][[:space:]]\u002F { found=1 }\n  NF { nonempty=1 }\n  END { if (bad || (nonempty && !sawfile)) exit 2; exit !found }\n'\n```\n\u003C!-- operational-safety:dockerfile-detector:end -->\n\nTo detect major version bumps, compare the version numbers in the PR title (Dependabot titles typically follow the pattern \"Bump X from A to B\"). A major bump means the leftmost non-zero version segment changed.\n\n### 2.5. Ecosystem Grouping (parallel-auto mode only)\n\nSkip this step in sequential mode. In parallel-auto mode, classify the eligible PR list by lockfile ecosystem using the bundled script. Resolve the script path relative to this skill folder (the directory containing this `SKILL.md`), not relative to the target repository.\n\n```bash\npython3 \u002Fpath\u002Fto\u002Fywc-merge-dependabot\u002Fscripts\u002Fgroup-by-ecosystem.py {pr_numbers...}\n```\n\nReplace `\u002Fpath\u002Fto\u002Fywc-merge-dependabot` with the actual skill directory path.\n\nThe script returns single-line JSON of the shape `{\"groups\": {ecosystem: [pr...]}, \"errors\": [...]}`. Recognised ecosystems: `npm`, `github-actions`, `python`, `go`, `cargo`, `maven`, `gradle`, `docker`. PRs touching no recognised marker, or markers from two or more ecosystems, land in the `mixed` group.\n\nThe grouping serves two purposes:\n\n1. **Audit trail** — the final summary records which ecosystem each PR belonged to and which ecosystem lanes ran concurrently.\n2. **Mixed-bucket isolation** — `mixed` PRs are deliberately held back to a final sequential pass (Step 3b stage 3) so a single PR that crosses two parallel groups cannot race with itself.\n\nSurface the grouping breakdown to the user before merging:\n\n```\nEcosystem grouping (8 PRs eligible):\n  - npm:            #201, #205, #207\n  - github-actions: #203, #209\n  - python:         #204, #208\n  - mixed:          #211\n```\n\n### 3. Merge Process\n\nChoose the flow based on the execution flag from Mode Selection. Both flows preserve the same safety contract — only the merge invocation and waiting strategy differ.\n\n### One polling deadline across chunks\n\nSet one run-wide deadline once at the start of Step 3 (`started_at + 1800` seconds). Every 3a rebase\u002FCI wait, the parallel lane polling session and Stage 3 below share it; it is never reset per PR. Each polling chunk is bounded by the lesser of that deadline and its tool time budget. Never recompute the original 1800-second deadline on chunk resume; sleeps and API timeouts must fit the remaining total budget. A completion response received at or after the deadline cannot turn that wait into success.\n\nPersist `deadline`, `active`, `lanes`, `status`, and `rebase_commented` (plus `rebase_intent`, below) together with the bound repository\u002Finvocation identity and pending PR head\u002FCI run identity. For a sequential wait, `active` contains its one PR and `lanes` its pending queue. Acquire an exclusive per-repository\u002Fqueue lock; a competing owner must stop before mutation. Save a complete snapshot by atomic replacement of a private state file under that serialized invocation owner after every chunk and before handoff; never evaluate state as shell source. Persistence failure is `BLOCKED`: retain the previous snapshot and stop subsequent merge\u002Fcomment requests. Validate identity and state on resume; missing or malformed state returns `NEEDS_CONTEXT` without further merge\u002Fcomment requests. An in-memory original deadline can reconstruct lost state only after reconciliation, never extend the budget.\n\nAlso persist `ci_wait[pr] = {head, restarts}` (the rebased head a 3a CI wait is on, and its restart count) and `stage3` (the list of PR numbers queued for Stage 3, kept beside `active` and `lanes`) in the same snapshot. An absent `ci_wait` or `stage3` key is empty, not malformed. The base-check result is never persisted: the check runs in the same block as its `--auto` call, every time. Persisted or remote values are compared in-process on parsed JSON, never interpolated into `--jq` or a shell string. On resume, first read `gh pr view {number} --json state,autoMergeRequest,headRefOid` and the Stage 1 step 1b `isInMergeQueue` value for every PR in `active`, `stage3` and `ci_wait`: a PR whose `state` is `MERGED` or `CLOSED` is recorded as terminal (`merged`, reported as `Merged`, or `closed`) and removed from those entries instead of being restarted. After those reads, advance each lane whose active PR was removed through the Stage 1 lane start block before polling: its pre-start read adopts a PR whose auto-merge is already enabled, or that is in the merge queue, as active (a start GitHub accepted before the crash), so that PR is polled and reported and the lane never stalls.\n\nOnly a successful rebase comment sets `rebase_commented[pr]`; persist that marker before another chunk. Because the process can end after GitHub accepts the comment but before the marker is saved, atomically persist a `rebase_intent[pr]` entry (with the pending PR head and a baseline of the PR's existing comment IDs) **before** sending the comment. On resume, an intent without a marker means the comment may already exist: list the PR's comments first and set the marker only if a matching `@dependabot rebase` comment whose ID is not in the baseline is found (an earlier run's comment never completes a new intent), and send only if none is. Reconcile an uncertain transport result against existing PR comments the same way before retrying, so an accepted comment is not duplicated. Reuse successful markers across retries. Rebase completion must be tied to the resulting head and its fresh CI run: stale green CI on the old head is not success.\n\nAt `now \u003C deadline`, a nonempty queue may save state and resume; a chunk boundary is not terminal success or failure. At `now >= deadline`, incomplete work is failed, never successful. Mark started PRs that are still incomplete failed\u002Fstalled (never-started PRs are `Skipped (deadline reached)`), disable their pending auto-merge, and report a disable failure as auto-merge possibly still enabled. Stop subsequent merge or mixed-queue advancement after timeout. A PR whose state is read as `MERGED` or `CLOSED` at or after the deadline is recorded with its actual outcome (`merged`, reported as `Merged`, or `closed`) rather than left `active` as `lane-stalled`; the wait itself still counts as timed out, so the next PR in its lane is never started. Empty queues succeed only after verified completion before the deadline. These polling instructions and the lane illustration are source\u002Fexpected-trace contracts; no live polling helper is provided.\n\n#### 3a. Sequential Flow (default)\n\nProcess PRs one at a time in ascending PR number order. This is important because merging one PR can create conflicts in subsequent PRs.\n\nFor each PR that passes pre-merge checks, first read `gh pr view {number} --json mergeable --jq .mergeable`. `CONFLICTING` enters the conflict path below; any other value, `UNKNOWN` included, goes through the gate:\n\n```bash\n# Record the head CI will verify; anything but a 40-char hex SHA stops here\nHEAD_SHA=$(gh pr view {number} --json headRefOid --jq .headRefOid) || HEAD_SHA=\"\"\n[[ \"$HEAD_SHA\" =~ ^[0-9a-f]{40}$ ]] || { echo \"Skipped (head unreadable)\"; exit 1; }\n\n# Gate on the required checks: 0 = pass, 8 = pending, other non-zero = failed,\n# except \"no required checks reported\" (resolved against the base branch below)\nOUT=$(gh pr checks {number} --required 2>&1) && RC=0 || RC=$?\nTAG=\"\"\nif [ \"$RC\" -ne 0 ] && [[ \"$OUT\" == *\"no required checks reported\"* ]]; then\n  RESOLVER_LAUNCHER=\"$(bash \"${CODEX_HOME:-$HOME\u002F.codex}\u002Fskills\u002Fscripts\u002Fselect-resolver-launcher.sh\" 2>&1)\" || { echo \"BLOCKED: ${RESOLVER_LAUNCHER#BLOCKED: }\" >&2; exit 3; }\n  BASE_CHECK_SCRIPT=\"$(bash \"$RESOLVER_LAUNCHER\" \"ywc-merge-dependabot\u002Fscripts\u002Fcheck-base-required-checks.sh\" bash)\" || { echo \"BLOCKED: resolver failed ($?)\" >&2; exit 3; }\n  BASE_OUT=$(bash \"$BASE_CHECK_SCRIPT\" {number}) && BASE_RC=0 || BASE_RC=$?\n  # Branch on the exit code before reading the last line CONFIRMED=\u003C0|1> BASE=\u003C…>\n  case \"$BASE_RC:${BASE_OUT##*$'\\n'}\" in\n    0:*) echo \"Skipped (CI pending)\"; exit 1 ;;  # base requires checks; none registered yet\n    1:\"CONFIRMED=0 BASE=\"?*)                    # validated base, no required check: gate on every check\n      TAG=\" (no required checks)\"\n      OUT=$(gh pr checks {number} 2>&1) && RC=0 || RC=$? ;;\n    3:*) echo \"Skipped (required checks unconfirmed)\"; exit 1 ;;  # lookup failed: never the fallback\n    *) echo \"Skipped (no required check confirmed)\"; exit 1 ;;  # base unreadable or invalid, usage error\n  esac\nfi\ncase \"$RC\" in\n  0) ;;\n  8) echo \"Skipped (CI pending)$TAG\"; exit 1 ;;\n  *) [[ \"$OUT\" == *\"no checks reported\"* ]] && { echo \"Skipped (no CI checks)\"; exit 1; }\n     echo \"Failed (CI not passing)$TAG\"; exit 1 ;;\nesac\n\n# Attempt merge, pinned to the head CI verified\ngh pr merge {number} --merge --match-head-commit \"$HEAD_SHA\" && echo \"Merged$TAG\"\n```\n\nGate the merge on the exit status of `gh pr checks --required`, as the block does: exit 8 is `Skipped (CI pending)`, any other non-zero exit is `Failed (CI not passing)`, and a non-zero exit is never a merge. The exception is output containing `no required checks reported`, which gh prints both when the base has no required check and when required checks have not registered on the head yet; the block resolves it with `check-base-required-checks.sh`. Its exit 0 means `Skipped (CI pending)`. Exit 1 with a non-empty `BASE=` gates on every check and tags the result `(no required checks)`, where `no checks reported` is `Skipped (no CI checks)`. Exit 3 is `Skipped (required checks unconfirmed)`, never the all-checks fallback. Any other result, an empty `BASE=` or exit 2 included, is `Skipped (no required check confirmed)`. Shell state does not persist between tool calls, so substitute the literal recorded SHA when the merge runs in a separate call.\n\n**Run blocked.** The two resolver lines resolve the bundled script through the shared Codex resolver; the resolver's stderr carries the `BLOCKED:` marker, which, not the exit code, tells it apart from the base check's exit 3. A resolver failure is `BLOCKED` for the whole run, never a per-PR result: make no further merge or `--auto` call and save the state snapshot. A PR that already has a terminal label (`Merged`, any `Failed (…)` or `Skipped (…)`, or `auto-merge-uncertain`) keeps its recorded terminal label; every other remaining PR is `Skipped (run blocked)`. In 3b, PRs already in `active` keep the auto-merge GitHub accepted, which is still gated by their confirmed required checks, and are reported as `Skipped (run blocked) — auto-merge still enabled` so the user can disable it.\n\n**Refused merge.** Re-read `gh pr view {number} --json headRefOid,mergeable` and apply the same `^[0-9a-f]{40}$` check; an unreadable re-read is `Skipped (head unreadable)`. A moved head re-runs the Step 2 Dockerfile and major-version checks and the gate on it, at most 2 restarts per PR, then `Failed (head kept moving)`. An unchanged head reading `CONFLICTING` enters the conflict path; any other unchanged head is `Failed (merge refused)` with the error. Never retry unpinned.\n\n**Conflict path.** The conflict path is entered only when `gh pr view {number} --json mergeable` reads `CONFLICTING`, in the read before the gate or in the re-read after a refused pinned merge. Never hand-resolve a Dependabot PR: a hand-merged lockfile can mask a breaking transitive bump. Use the `rebase_intent` → `@dependabot rebase` → chunked polling contract of One polling deadline across chunks above. The rebase is done when the polled `headRefOid` is 40-hex and differs from the recorded head, and `mergeable` is `MERGEABLE`; empty output, a failed query, `UNKNOWN` or any other value keeps polling. Then re-run the Step 2 checks on that `NEW_HEAD` and wait for its fresh CI inside the same run-wide deadline and chunks; this is not a second wait. Record `ci_wait[pr] = {head, restarts}` so the 2-restart cap holds across chunks. Each chunk runs the gate's check step on `NEW_HEAD`, with its sleep clamped to the remaining chunk and deadline budget:\n\n- Exit 8, or `no required checks reported` with base-check exit 0, keeps waiting while `now \u003C deadline`.\n- Base-check exit 1 with a non-empty `BASE=` waits on every check by the same rule and tags the result `(no required checks)`.\n- Exit 0 merges with `gh pr merge {number} --merge --match-head-commit \"\u003CNEW_HEAD>\"` (the literal SHA), with the refused-merge rule above.\n- Any other non-zero exit is `Failed (CI not passing)`.\n- Base-check exit 1 with an empty `BASE=`, exit 2 or exit 3 maps as in the gate: `Skipped (no required check confirmed)` or `Skipped (required checks unconfirmed)`.\n- `no checks reported` on the all-checks run keeps waiting, because a freshly rebased head may not have registered CI yet; still reported at the deadline, it is `Skipped (no CI checks)`, which takes precedence over `Failed (CI timeout)`.\n- Otherwise, at `now >= deadline` the result is `Failed (CI timeout)`.\n\nA moved head during the wait restarts it within the 2-restart cap. Polling exhaustion at the deadline, a still-conflicting head, or red CI skips the PR and surfaces it for human review.\n\nAfter each successful merge, note it — the next PR in the queue may now have conflicts caused by this merge.\n\n#### 3b. Parallel-Auto Flow\n\nIn parallel-auto mode the client uses GitHub auto-merge as a per-PR scheduler while preserving one active PR per ecosystem lane. GitHub auto-merge merges a PR when its requirements are met; it is not, by itself, an ecosystem-aware queue. If the repository's branch protection requires GitHub merge queue, `gh pr merge` may add eligible PRs to that queue, but the skill must still maintain ecosystem lanes and poll outcomes.\n\n**Stage 1 — Start one non-mixed PR per ecosystem lane:**\n\nFor each non-empty ecosystem group, start only the first PR in that group with auto-merge, through this lane start block. The base check runs before every `--auto` call, including on resume:\n\n```bash\n# 1. Pre-start read; parse the JSON in-process. state MERGED\u002FCLOSED → record it terminal.\n#    A non-empty autoMergeRequest → already started (an earlier chunk or run): treat it as active.\n#    headRefOid must match ^[0-9a-f]{40}$ (record it as \u003CHEAD_SHA>); otherwise → stage3.\ngh pr view {number} --json state,autoMergeRequest,headRefOid\n# 1b. gh pr view has no isInMergeQueue field, so read it through GraphQL ({owner}\u002F{repo} are\n#     gh's own placeholders). true → GitHub already queued the PR (its autoMergeRequest may be\n#     empty then): treat it as active. A failed read is treated like a failed step 1 read.\ngh api graphql -F owner='{owner}' -F repo='{repo}' -F pr={number} -f query='query($owner:String!,$repo:String!,$pr:Int!){repository(owner:$owner,name:$repo){pullRequest(number:$pr){isInMergeQueue}}}' --jq .data.repository.pullRequest.isInMergeQueue\n# 2. Confirm the base: only exit 0 may start the PR; any other exit → stage3, never --auto.\nRESOLVER_LAUNCHER=\"$(bash \"${CODEX_HOME:-$HOME\u002F.codex}\u002Fskills\u002Fscripts\u002Fselect-resolver-launcher.sh\" 2>&1)\" || { echo \"BLOCKED: ${RESOLVER_LAUNCHER#BLOCKED: }\" >&2; exit 3; }\nBASE_CHECK_SCRIPT=\"$(bash \"$RESOLVER_LAUNCHER\" \"ywc-merge-dependabot\u002Fscripts\u002Fcheck-base-required-checks.sh\" bash)\" || { echo \"BLOCKED: resolver failed ($?)\" >&2; exit 3; }\nBASE_OUT=$(bash \"$BASE_CHECK_SCRIPT\" {number}) && BASE_RC=0 || BASE_RC=$?\n[ \"$BASE_RC\" -eq 0 ] || { echo \"stage3 (base not confirmed, exit $BASE_RC)\"; exit 1; }\n# 3. Compare in-process with the BASE= value of ${BASE_OUT##*$'\\n'}; a difference re-runs step 2.\ngh pr view {number} --json baseRefName\n# 4. Start, pinned to the recorded head (the literal SHA).\ngh pr merge {number} --auto --merge --match-head-commit \"\u003CHEAD_SHA>\"\n```\n\nA run-wide `BLOCKED` from the resolver lines follows the Run blocked rule of 3a. Re-read `baseRefName` immediately before `--auto` (step 3). A base-check failure before any `--auto` call removes the PR from its lane and adds it to `stage3` directly, and the lane advances to its next PR. After any non-zero `--auto` result, re-read `state` and `autoMergeRequest` together (`gh pr view {number} --json state,autoMergeRequest`), plus `isInMergeQueue` with the step 1b read, before the PR leaves its lane; this does not try to tell a definite refusal from a transport failure. `--auto` can merge at once when no required check is pending, so a `MERGED` re-read persists `status[pr] = \"merged\"` (reported `Merged`) and a `CLOSED` re-read persists `status[pr] = \"closed\"`; either removes the PR from its lane, the lane advances, and the PR never enters `stage3`. An `OPEN` PR with `isInMergeQueue` true stays active in its lane: GitHub has queued it, and leaving the lane would let the next same-lockfile PR start while it can still merge. For an `OPEN` PR not in the merge queue, an empty `autoMergeRequest` removes the PR from its lane and adds it to `stage3`, and the lane advances. The PR \"may already have auto-merge enabled\" only when that re-read shows auto-merge enabled or fails (either read); the same holds when a resume read finds auto-merge enabled on a PR that is leaving its lane, or when the pre-start read fails. Such a PR moves to `stage3` only after `gh pr merge {number} --disable-auto` succeeds and a re-read shows `autoMergeRequest` empty and `isInMergeQueue` false. Otherwise persist `status[pr] = \"auto-merge-uncertain\"` and report it as `Failed (auto-merge possibly still enabled)`; it is never in `stage3`. An `auto-merge-uncertain` PR closes its lane: the lane's remaining PRs move to `stage3` with `held_by[pr]` set to the uncertain PR, and Stage 3 does not start a held PR until a fresh read of the blocker shows it `MERGED` or `CLOSED`, or `OPEN` with `autoMergeRequest` empty and `isInMergeQueue` false (persist `held_by` beside `stage3`; an absent key is empty). A blocker that stays in the merge queue, or whose state cannot be read, keeps its held PRs unstarted, so two same-lockfile PRs never auto-merge concurrently. A resume retries `--disable-auto` once for each such PR; a retry that succeeds moves the PR to `stage3` only when the re-read shows `autoMergeRequest` empty and `isInMergeQueue` false, otherwise it stays `auto-merge-uncertain`.\n\nIf no PR's base is confirmed at Stage 1, announce \"No required status checks confirmed on the base branch — falling back to sequential mode\" and process every PR with 3a.\n\nThis sets the active PR to merge automatically as soon as its CI is green and the branch is up to date. Do not enable auto-merge for the remaining PRs in the same ecosystem yet; enabling all same-lockfile PRs at once can race because auto-merge is not ecosystem-aware. Different ecosystem lanes may have one active PR each. The pin only guards the start; heads Dependabot pushes later are guarded by the confirmed required checks, which GitHub evaluates on the head it merges.\n\n**Stage 2 — Poll active lanes and advance them:**\n\nTrack each active PR's state until it reaches a terminal state. When an active PR merges, start the next PR from the same ecosystem lane with the Stage 1 lane start block (pre-start read, base check, `baseRefName` re-read, pinned `--auto`); a lane start never skips the base check, and a PR it moves to `stage3` lets the lane advance to its following PR in the same chunk. Use a single bounded loop (do not spin in tight retries). The following lane illustration omits state serialization and lane advancement; apply the complete chunk\u002Fstate contract above, rather than executing it as a complete polling helper:\n\n```bash\n# Bounded by the run-wide deadline set once at the start of Step 3; poll every 60 seconds.\ndeadline=$RUN_DEADLINE  # the persisted run-wide value; never recomputed here\nchunk_deadline=$(( $(date +%s) + 50 ))  # clamp to deadline; yield within tool budget\ndeclare -A lanes\nlanes[npm]=\"101 105 107\"\nlanes[github-actions]=\"203 209\"\nactive=(101 203)   # first PR from each non-empty lane\ndeclare -A status rebase_intent rebase_commented\nwhile [ ${#active[@]} -gt 0 ] && [ \"$(date +%s)\" -lt \"$deadline\" ] && [ \"$(date +%s)\" -lt \"$chunk_deadline\" ]; do\n  next=()\n  for pr in \"${active[@]}\"; do\n    pr_state=$(gh pr view \"$pr\" --json state --jq '.state' 2>\u002Fdev\u002Fnull || echo UNKNOWN)\n    merge_status=$(gh pr view \"$pr\" --json mergeStateStatus --jq '.mergeStateStatus' 2>\u002Fdev\u002Fnull || echo UNKNOWN)\n    if [ \"$(date +%s)\" -ge \"$deadline\" ]; then\n      # Past the deadline: record the real terminal state, never start the next lane PR.\n      case \"$pr_state\" in\n        MERGED) status[$pr]=\"merged\" ;;\n        CLOSED) status[$pr]=\"closed\" ;;\n        *) next+=(\"$pr\") ;;\n      esac\n      continue\n    fi\n    if [ \"$pr_state\" = \"MERGED\" ]; then\n      status[$pr]=\"merged\"\n      # Remove this PR from active. Then run the Stage 1 lane start block for the\n      # next unprocessed PR of the same ecosystem lane, if any, and append it to `next`.\n    elif [ \"$pr_state\" = \"CLOSED\" ]; then\n      status[$pr]=\"closed\"\n    elif [ \"$merge_status\" = \"CONFLICTING\" ] || [ \"$merge_status\" = \"DIRTY\" ]; then\n      # Keep the active lane item — Dependabot or a maintainer may rebase before the deadline.\n      next+=(\"$pr\")\n    else\n      next+=(\"$pr\")\n    fi\n  done\n  active=(\"${next[@]}\")\n  # Bound each API call and clamp sleep to both remaining budgets.\n  left=$(( deadline - $(date +%s) ))\n  chunk_left=$(( chunk_deadline - $(date +%s) ))\n  [ \"$chunk_left\" -lt \"$left\" ] && left=$chunk_left\n  [ ${#active[@]} -gt 0 ] && [ \"$left\" -gt 0 ] && sleep $(( left \u003C 60 ? left : 60 ))\ndone\n\n# A chunk boundary saves all state, never marks failure by itself.\nif [ \"$(date +%s)\" -ge \"$deadline\" ]; then\n  for pr in \"${active[@]}\"; do\n    status[$pr]=\"lane-stalled\"\n  done\nfi\n# Persist a complete snapshot per One polling deadline across chunks above.\n```\n\nPRs that reach `MERGED` are recorded as `Merged`. PRs whose status is `closed` (closed without merging, whether seen while polling, in a re-read, on resume or at the deadline) are recorded as `Skipped (closed without merge)`. PRs still in the `active` list after the deadline are recorded as `Failed (lane stalled)` so the user can investigate. `--disable-auto` does not remove a merge-queue entry. A PR can enter the merge queue after its Stage 1 read, so immediately before this final classification re-run the step 1b read for every remaining PR (a failed read is reported as queue state unknown, never as not queued). A stalled PR whose latest step 1b read shows `isInMergeQueue` true is reported as `Failed (lane stalled) — still in merge queue` for the user to dequeue. Do not extend the deadline silently — if the lane genuinely needs more time, the user can rerun the skill.\n\n**Stage 3 — Final sequential pass for the mixed bucket and unconfirmed-base PRs:**\n\nAfter all active lanes have drained successfully before the deadline (not merely because a chunk returned; drained means `active` is empty and every lane's queue is empty), process the `mixed` group and the persisted `stage3` list (PRs whose base was not confirmed, whose `--auto` start failed with an empty `autoMergeRequest` re-read, or whose lane an `auto-merge-uncertain` PR closed) using the same logic as Sequential Flow (3a), under the run-wide deadline. Mixed PRs run last because earlier merges may have changed the conflict surface they would land in. PRs that 3a or Stage 3 has not reached before the deadline are `Skipped (deadline reached)`; a held PR whose blocker was never confirmed gone is `Skipped (blocked by \u003Cpr>)`.\n\n### 4. Final Summary\n\nAfter processing all PRs, report results in this format:\n\n```\n## Dependabot Merge Results\n\nMode: parallel-auto (security)\nEcosystem groups processed: npm (3), github-actions (2), python (2), mixed (1)\n\n- ✅ Merged    (npm)            : #123 Bump axios from 1.6.0 to 1.7.2\n- ✅ Merged    (npm)            : #125 Bump lodash from 4.17.20 to 4.17.21\n- ✅ Merged    (github-actions) : #129 Bump actions\u002Fcheckout from 4.1.1 to 4.2.0\n- ⏭️ Skipped   (Dockerfile)     : #127 Bump node from 18 to 20\n- ⏭️ Skipped   (Major version upgrade) : #130 Bump webpack from 4.46.0 to 5.90.0\n- ❌ Failed    (lane stalled)   : #132 Bump express from 4.18.0 to 4.19.2 — CONFLICTING after 30 min\n- ❌ Failed    (CI timeout)     : #135 Bump aws-sdk + boto3 (mixed) — rebased head CI still pending at the deadline\n\nTotal: 3 merged \u002F 2 skipped \u002F 2 failed\n```\n\nInclude:\n- Mode line — scope flag + execution flag, so the reader can reproduce the run\n- Ecosystem group summary — only when parallel-auto was used; the count tells the reader how many ecosystem lanes ran concurrently\n- Per-PR result — for parallel-auto, annotate each line with the ecosystem; for sequential, omit the annotation\n- If a previous merge affected a subsequent PR, note which PR caused the issue\n- Total counts: merged \u002F skipped \u002F failed\n- Result labels beyond the example: `Skipped (closed without merge)`, `Failed (lane stalled) — still in merge queue`, `Skipped (CI pending)`, `Skipped (head unreadable)`, `Skipped (no required check confirmed)`, `Skipped (required checks unconfirmed)`, `Skipped (no CI checks)`, `Skipped (deadline reached)`, `Skipped (run blocked)`, `Skipped (run blocked) — auto-merge still enabled`, `Failed (CI not passing)`, `Failed (head kept moving)`, `Failed (merge refused)`, `Failed (CI timeout)`, `Failed (auto-merge possibly still enabled)`; a result gated on every check because the base has no required check carries the `(no required checks)` suffix\n\n## Error Handling\n\n| Error | Action |\n| --- | --- |\n| `gh` CLI not authenticated | Stop and ask user to run `gh auth login` |\n| No Dependabot PRs found | Report \"No Dependabot PRs found\" and stop |\n| Rate limit hit | Wait and retry, or stop and report progress so far |\n| Branch protection prevents merge | Skip PR and note the protection rule in the report |\n\n## Notes\n\n- Follow any additional instructions in `$ARGUMENTS`\n- Never force-merge or bypass branch protection rules\n- If the number of PRs is large (>20), ask the user for confirmation before proceeding. For batches of that size, also recommend `parallel-auto` mode if the eligible PRs span more than one ecosystem\n- `parallel-auto` reduces wall-clock time by letting GitHub run the CI cycle for non-conflicting ecosystem lanes concurrently. It does not reduce the *per-PR* CI cost, the safety surface, or the conflict-resolution requirements — it only changes how active PRs are scheduled\n\n## Integration\n\n- **upstream**: None — this skill is triggered directly by the user or a scheduled workflow when Dependabot PRs accumulate\n- **downstream**: `ywc-gen-testcase` (optional — run after merging dependency updates to verify the updated packages do not break existing test coverage)\n\n## Output Format\n\nReturn the Dependabot merge report with:\n\n```text\nStatus: \u003CDONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT>\nMode: \u003Cscope and execution mode>\nMerged: \u003CPR numbers>\nSkipped: \u003CPR numbers and reasons, using the Skipped (…) labels of Final Summary>\nFailed: \u003CPR numbers and reasons, using the Failed (…) labels of Final Summary>\nValidation: \u003CCI and branch-protection checks>\nNext action: \u003Cmanual follow-up or \"none\">\n```\n\n## Validation\n\nBefore finalizing, verify that branch protection was not bypassed, each PR result is categorized, CI status was checked after each merge lane, major or unsupported updates were skipped with reason, and failures include actionable blocker details.\n","# Merge Dependabot Pull Requests\n\n**Announce at start:** \"I'm using the ywc-merge-dependabot skill to merge Dependabot PRs with CI verification — sequential by default, or parallel-auto (ecosystem-lane scheduling) when requested.\"\n\nSafely merge Dependabot PRs with CI verification, head-pinned merges, Dependabot rebase for conflicts, and clear reporting. Metadata prefers explicit invocation (`allow_implicit_invocation: false`); it is not a runtime enforcement guarantee.\n\n## Rationalization Defense\n\nWhen tempted to skip a step, check this table first:\n\n| Excuse | Reality |\n|---|---|\n| \"All ecosystems can run in parallel — fire all merges at once without grouping\" | No. Within an ecosystem (e.g., multiple npm PRs all touching `package-lock.json`) the client must keep one active PR at a time. `parallel-auto` only fans out across non-overlapping ecosystems, not within one. |\n| \"Mixed-ecosystem PR (touches both `package.json` and `pom.xml`) is fine to auto-merge\" | No. Mixed PRs go to a final sequential pass; `--auto` cannot guarantee ordering when a single PR crosses two parallel groups. |\n| \"Just enable `--auto` on every PR and walk away\" | The polling loop and final summary are non-optional. Without them users have no audit trail of which PRs failed, why, or whether an ecosystem lane stalled. |\n| \"Repo doesn't have auto-merge enabled, fall through silently\" | If `parallel-auto` is requested but `gh repo view --json autoMergeAllowed` returns `false`, fall back to sequential mode and tell the user — never pretend parallel scheduling is running. |\n| \"CI is green but lockfile shows different hash, merge anyway\" | Lockfile mismatch indicates dirty working state. Stop and rebase the PR first. |\n| \"Major version bump looks safe, just merge\" | Major bumps need explicit user confirmation. Default action: skip and report for human review. |\n| \"Conflicts with main, force-push my own resolution\" | Use Dependabot's `@dependabot rebase` comment instead. Hand-resolved conflicts in dep PRs hide breaking changes. |\n| \"Security mode, and the PR body mentions a CVE or GHSA\" | The body embeds upstream release notes, so a CVE in it proves nothing. A PR is in `security` scope only when `select-security-prs.py` matches it to an open Dependabot alert; otherwise skip it and report it. |\n| \"All passed, no need for a final summary\" | Always emit a per-PR result table (merged \u002F skipped \u002F failed) at the end. |\n\n**Violating the letter of these rules is violating the spirit.** Dependabot velocity is worthless if a bad merge silently breaks main.\n\n## Context\n\n- Repository: !`gh repo view --json nameWithOwner --jq .nameWithOwner`\n- Default branch: !`gh repo view --json defaultBranchRef --jq .defaultBranchRef.name`\n\n## Mode Selection\n\nThis skill supports two orthogonal flags inside `$ARGUMENTS`. Parse the argument string as a set of space-separated tokens.\n\n**Scope flag** — controls which PRs are eligible:\n\n| Token | Scope |\n| --- | --- |\n| `security` | Security-related Dependabot PRs only |\n| _(token absent)_ | All Dependabot PRs |\n\n**Execution flag** — controls how eligible PRs are processed:\n\n| Token | Execution | When to use |\n| --- | --- | --- |\n| `parallel-auto` | Group eligible PRs by lockfile ecosystem; keep one active `gh pr merge --auto` PR per ecosystem lane; enqueue the next PR in that lane only after the previous PR reaches a terminal state; one final sequential pass clears the `mixed` bucket | Many PRs (≥ 5) across multiple ecosystems (npm + github-actions + python ...) where wall-clock CI wait is the bottleneck |\n| _(token absent)_ | Sequential — one PR at a time, ascending PR number | Small batches, repos with strict branch protection, or environments where auto-merge is disabled |\n\nExamples:\n\n- `(empty)` → all PRs, sequential (default)\n- `security` → security PRs only, sequential\n- `parallel-auto` → all PRs, ecosystem-lane auto-merge\n- `security parallel-auto` → security PRs only, ecosystem-lane auto-merge\n\nSecurity-related PRs are identified by the repository's open Dependabot alerts, never by labels or PR text (see Step 1).\n\n**Parallel-auto prerequisite:** before entering parallel-auto mode, verify the repository allows auto-merge:\n\n```bash\ngh repo view --json autoMergeAllowed --jq .autoMergeAllowed\n```\n\nIf the value is `false`, announce the fallback (\"Auto-merge is not enabled on this repository — falling back to sequential mode\") and proceed as if `parallel-auto` were absent. Never silently skip scheduling and pretend the work is in progress.\n\n## Task\n\n### 1. List Dependabot PRs\n\nRetrieve all open PRs created by Dependabot:\n\n```bash\ngh pr list --author \"app\u002Fdependabot\" --state open --json number,title,labels,body --limit 100\n```\n\nIf in **security-only mode**, keep only the PRs that match an open Dependabot alert. Add `files` to the `--json` fields above and pipe the list through:\n\n```bash\ngh pr list --author \"app\u002Fdependabot\" --state open --json number,title,body,files --limit 100 \\\n  | python3 \u002Fpath\u002Fto\u002Fywc-merge-dependabot\u002Fscripts\u002Fselect-security-prs.py {owner\u002Frepo}\n```\n\nA PR matches when it changes the alert's manifest file and names the alert's package in its title (a grouped PR, whose title says \"group\", may name it in its body instead). Labels and words such as \"CVE-\", \"GHSA-\" or \"vulnerability\" do not count: the body embeds upstream release notes. Exit 0 prints `{\"security\": [...], \"other\": [...], \"advisories\": {...}}`; process only `security` and report every `other` PR as `Skipped (no matching Dependabot alert)`. Exit 2 means the alerts could not be read (Dependabot alerts disabled, or the token cannot read them): report every PR as `Skipped (security status unresolved)` with the printed `error`, and merge nothing. Any other exit stops the run. Known limit: the script does not check that the PR's target version reaches the advisory's first patched version, so a bump that stays vulnerable is still kept as `security`; the other pre-merge checks still apply.\n\nSort the resulting list by PR number ascending — processing order matters because earlier merges can affect later PRs.\n\n### 2. Pre-Merge Checks\n\nFor each PR, run these checks **before** attempting to merge. If any check fails, skip the PR.\n\n| Check | Skip condition | Skip label |\n| --- | --- | --- |\n| **Dockerfile FROM change** | PR modifies a `FROM` image version in any Dockerfile | `Skipped (Dockerfile)` |\n| **Major version upgrade** | PR bumps a major version (e.g. 2.x → 3.x), which risks breaking changes | `Skipped (Major version upgrade)` |\n| **CI failed** | A required CI check has failed | `Failed (CI not passing)` |\n| **CI pending** | A required CI check is still pending | `Skipped (CI pending)`; in parallel-auto the PR instead stays in its lane for the Stage 1 lane start (`--auto`) |\n\n### Dockerfile FROM detection\n\nFetch the diff successfully, then match changed `FROM` lines only inside Dockerfile hunks. A README or shell-file `FROM` line alone does not trigger the skip. Recognize `Dockerfile*` and `*.dockerfile` basenames in nested directories, added\u002Fdeleted files and multi-stage builds; match the instruction case-insensitively. A failed diff query is unresolved, never a clean result. Unsupported quoted paths\u002Fparser failure also remain unresolved and block that PR's merge.\n\nThe following runnable recipe takes the already selected numeric PR as `$pr`. Exit 0 means skip for Dockerfile FROM change; 1 means a successful scan found none; any other exit is unresolved. Capture the exit explicitly rather than treating every nonzero as no match.\n\n\u003C!-- operational-safety:dockerfile-detector:start -->\n```bash\npatch=$(gh pr diff \"$pr\") || { printf '%s\\n' 'UNRESOLVED: diff query failed' >&2; exit 2; }\nprintf '%s\\n' \"$patch\" | awk '\n  \u002F^diff --git \u002F { sawfile=1; docker=0; hunk=0; next }\n  !hunk && (\u002F^--- \u002F || \u002F^\\+\\+\\+ \u002F) {\n    path=substr($0,5)\n    if (path == \"\u002Fdev\u002Fnull\") next\n    if (path ~ \u002F^\"\u002F) { bad=1; exit }\n    sub(\u002F^[ab]\\\u002F\u002F,\"\",path); sub(\u002F\\t.*$\u002F,\"\",path)\n    n=split(path,parts,\"\u002F\")\n    if (parts[n] ~ \u002F^(Dockerfile.*|.*\\.dockerfile)$\u002F) docker=1\n    next\n  }\n  \u002F^@@ \u002F { hunk=1; next }\n  docker && hunk && \u002F^[+-][[:space:]]*[Ff][Rr][Oo][Mm][[:space:]]\u002F { found=1 }\n  NF { nonempty=1 }\n  END { if (bad || (nonempty && !sawfile)) exit 2; exit !found }\n'\n```\n\u003C!-- operational-safety:dockerfile-detector:end -->\n\nTo detect major version bumps, compare the version numbers in the PR title (Dependabot titles typically follow the pattern \"Bump X from A to B\"). A major bump means the leftmost non-zero version segment changed.\n\n### 2.5. Ecosystem Grouping (parallel-auto mode only)\n\nSkip this step in sequential mode. In parallel-auto mode, classify the eligible PR list by lockfile ecosystem using the bundled script. Resolve the script path relative to this skill folder (the directory containing this `SKILL.md`), not relative to the target repository.\n\n```bash\npython3 \u002Fpath\u002Fto\u002Fywc-merge-dependabot\u002Fscripts\u002Fgroup-by-ecosystem.py {pr_numbers...}\n```\n\nReplace `\u002Fpath\u002Fto\u002Fywc-merge-dependabot` with the actual skill directory path.\n\nThe script returns single-line JSON of the shape `{\"groups\": {ecosystem: [pr...]}, \"errors\": [...]}`. Recognised ecosystems: `npm`, `github-actions`, `python`, `go`, `cargo`, `maven`, `gradle`, `docker`. PRs touching no recognised marker, or markers from two or more ecosystems, land in the `mixed` group.\n\nThe grouping serves two purposes:\n\n1. **Audit trail** — the final summary records which ecosystem each PR belonged to and which ecosystem lanes ran concurrently.\n2. **Mixed-bucket isolation** — `mixed` PRs are deliberately held back to a final sequential pass (Step 3b stage 3) so a single PR that crosses two parallel groups cannot race with itself.\n\nSurface the grouping breakdown to the user before merging:\n\n```\nEcosystem grouping (8 PRs eligible):\n  - npm:            #201, #205, #207\n  - github-actions: #203, #209\n  - python:         #204, #208\n  - mixed:          #211\n```\n\n### 3. Merge Process\n\nChoose the flow based on the execution flag from Mode Selection. Both flows preserve the same safety contract — only the merge invocation and waiting strategy differ.\n\n### One polling deadline across chunks\n\nSet one run-wide deadline once at the start of Step 3 (`started_at + 1800` seconds). Every 3a rebase\u002FCI wait, the parallel lane polling session and Stage 3 below share it; it is never reset per PR. Each polling chunk is bounded by the lesser of that deadline and its tool time budget. Never recompute the original 1800-second deadline on chunk resume; sleeps and API timeouts must fit the remaining total budget. A completion response received at or after the deadline cannot turn that wait into success.\n\nPersist `deadline`, `active`, `lanes`, `status`, and `rebase_commented` (plus `rebase_intent`, below) together with the bound repository\u002Finvocation identity and pending PR head\u002FCI run identity. For a sequential wait, `active` contains its one PR and `lanes` its pending queue. Acquire an exclusive per-repository\u002Fqueue lock; a competing owner must stop before mutation. Save a complete snapshot by atomic replacement of a private state file under that serialized invocation owner after every chunk and before handoff; never evaluate state as shell source. Persistence failure is `BLOCKED`: retain the previous snapshot and stop subsequent merge\u002Fcomment requests. Validate identity and state on resume; missing or malformed state returns `NEEDS_CONTEXT` without further merge\u002Fcomment requests. An in-memory original deadline can reconstruct lost state only after reconciliation, never extend the budget.\n\nAlso persist `ci_wait[pr] = {head, restarts}` (the rebased head a 3a CI wait is on, and its restart count) and `stage3` (the list of PR numbers queued for Stage 3, kept beside `active` and `lanes`) in the same snapshot. An absent `ci_wait` or `stage3` key is empty, not malformed. The base-check result is never persisted: the check runs in the same block as its `--auto` call, every time. Persisted or remote values are compared in-process on parsed JSON, never interpolated into `--jq` or a shell string. On resume, first read `gh pr view {number} --json state,autoMergeRequest,headRefOid` and the Stage 1 step 1b `isInMergeQueue` value for every PR in `active`, `stage3` and `ci_wait`: a PR whose `state` is `MERGED` or `CLOSED` is recorded as terminal (`merged`, reported as `Merged`, or `closed`) and removed from those entries instead of being restarted. After those reads, advance each lane whose active PR was removed through the Stage 1 lane start block before polling: its pre-start read adopts a PR whose auto-merge is already enabled, or that is in the merge queue, as active (a start GitHub accepted before the crash), so that PR is polled and reported and the lane never stalls.\n\nOnly a successful rebase comment sets `rebase_commented[pr]`; persist that marker before another chunk. Because the process can end after GitHub accepts the comment but before the marker is saved, atomically persist a `rebase_intent[pr]` entry (with the pending PR head and a baseline of the PR's existing comment IDs) **before** sending the comment. On resume, an intent without a marker means the comment may already exist: list the PR's comments first and set the marker only if a matching `@dependabot rebase` comment whose ID is not in the baseline is found (an earlier run's comment never completes a new intent), and send only if none is. Reconcile an uncertain transport result against existing PR comments the same way before retrying, so an accepted comment is not duplicated. Reuse successful markers across retries. Rebase completion must be tied to the resulting head and its fresh CI run: stale green CI on the old head is not success.\n\nAt `now \u003C deadline`, a nonempty queue may save state and resume; a chunk boundary is not terminal success or failure. At `now >= deadline`, incomplete work is failed, never successful. Mark started PRs that are still incomplete failed\u002Fstalled (never-started PRs are `Skipped (deadline reached)`), disable their pending auto-merge, and report a disable failure as auto-merge possibly still enabled. Stop subsequent merge or mixed-queue advancement after timeout. A PR whose state is read as `MERGED` or `CLOSED` at or after the deadline is recorded with its actual outcome (`merged`, reported as `Merged`, or `closed`) rather than left `active` as `lane-stalled`; the wait itself still counts as timed out, so the next PR in its lane is never started. Empty queues succeed only after verified completion before the deadline. These polling instructions and the lane illustration are source\u002Fexpected-trace contracts; no live polling helper is provided.\n\n#### 3a. Sequential Flow (default)\n\nProcess PRs one at a time in ascending PR number order. This is important because merging one PR can create conflicts in subsequent PRs.\n\nFor each PR that passes pre-merge checks, first read `gh pr view {number} --json mergeable --jq .mergeable`. `CONFLICTING` enters the conflict path below; any other value, `UNKNOWN` included, goes through the gate:\n\n```bash\n# Record the head CI will verify; anything but a 40-char hex SHA stops here\nHEAD_SHA=$(gh pr view {number} --json headRefOid --jq .headRefOid) || HEAD_SHA=\"\"\n[[ \"$HEAD_SHA\" =~ ^[0-9a-f]{40}$ ]] || { echo \"Skipped (head unreadable)\"; exit 1; }\n\n# Gate on the required checks: 0 = pass, 8 = pending, other non-zero = failed,\n# except \"no required checks reported\" (resolved against the base branch below)\nOUT=$(gh pr checks {number} --required 2>&1) && RC=0 || RC=$?\nTAG=\"\"\nif [ \"$RC\" -ne 0 ] && [[ \"$OUT\" == *\"no required checks reported\"* ]]; then\n  RESOLVER_LAUNCHER=\"$(bash \"${CODEX_HOME:-$HOME\u002F.codex}\u002Fskills\u002Fscripts\u002Fselect-resolver-launcher.sh\" 2>&1)\" || { echo \"BLOCKED: ${RESOLVER_LAUNCHER#BLOCKED: }\" >&2; exit 3; }\n  BASE_CHECK_SCRIPT=\"$(bash \"$RESOLVER_LAUNCHER\" \"ywc-merge-dependabot\u002Fscripts\u002Fcheck-base-required-checks.sh\" bash)\" || { echo \"BLOCKED: resolver failed ($?)\" >&2; exit 3; }\n  BASE_OUT=$(bash \"$BASE_CHECK_SCRIPT\" {number}) && BASE_RC=0 || BASE_RC=$?\n  # Branch on the exit code before reading the last line CONFIRMED=\u003C0|1> BASE=\u003C…>\n  case \"$BASE_RC:${BASE_OUT##*$'\\n'}\" in\n    0:*) echo \"Skipped (CI pending)\"; exit 1 ;;  # base requires checks; none registered yet\n    1:\"CONFIRMED=0 BASE=\"?*)                    # validated base, no required check: gate on every check\n      TAG=\" (no required checks)\"\n      OUT=$(gh pr checks {number} 2>&1) && RC=0 || RC=$? ;;\n    3:*) echo \"Skipped (required checks unconfirmed)\"; exit 1 ;;  # lookup failed: never the fallback\n    *) echo \"Skipped (no required check confirmed)\"; exit 1 ;;  # base unreadable or invalid, usage error\n  esac\nfi\ncase \"$RC\" in\n  0) ;;\n  8) echo \"Skipped (CI pending)$TAG\"; exit 1 ;;\n  *) [[ \"$OUT\" == *\"no checks reported\"* ]] && { echo \"Skipped (no CI checks)\"; exit 1; }\n     echo \"Failed (CI not passing)$TAG\"; exit 1 ;;\nesac\n\n# Attempt merge, pinned to the head CI verified\ngh pr merge {number} --merge --match-head-commit \"$HEAD_SHA\" && echo \"Merged$TAG\"\n```\n\nGate the merge on the exit status of `gh pr checks --required`, as the block does: exit 8 is `Skipped (CI pending)`, any other non-zero exit is `Failed (CI not passing)`, and a non-zero exit is never a merge. The exception is output containing `no required checks reported`, which gh prints both when the base has no required check and when required checks have not registered on the head yet; the block resolves it with `check-base-required-checks.sh`. Its exit 0 means `Skipped (CI pending)`. Exit 1 with a non-empty `BASE=` gates on every check and tags the result `(no required checks)`, where `no checks reported` is `Skipped (no CI checks)`. Exit 3 is `Skipped (required checks unconfirmed)`, never the all-checks fallback. Any other result, an empty `BASE=` or exit 2 included, is `Skipped (no required check confirmed)`. Shell state does not persist between tool calls, so substitute the literal recorded SHA when the merge runs in a separate call.\n\n**Run blocked.** The two resolver lines resolve the bundled script through the shared Codex resolver; the resolver's stderr carries the `BLOCKED:` marker, which, not the exit code, tells it apart from the base check's exit 3. A resolver failure is `BLOCKED` for the whole run, never a per-PR result: make no further merge or `--auto` call and save the state snapshot. A PR that already has a terminal label (`Merged`, any `Failed (…)` or `Skipped (…)`, or `auto-merge-uncertain`) keeps its recorded terminal label; every other remaining PR is `Skipped (run blocked)`. In 3b, PRs already in `active` keep the auto-merge GitHub accepted, which is still gated by their confirmed required checks, and are reported as `Skipped (run blocked) — auto-merge still enabled` so the user can disable it.\n\n**Refused merge.** Re-read `gh pr view {number} --json headRefOid,mergeable` and apply the same `^[0-9a-f]{40}$` check; an unreadable re-read is `Skipped (head unreadable)`. A moved head re-runs the Step 2 Dockerfile and major-version checks and the gate on it, at most 2 restarts per PR, then `Failed (head kept moving)`. An unchanged head reading `CONFLICTING` enters the conflict path; any other unchanged head is `Failed (merge refused)` with the error. Never retry unpinned.\n\n**Conflict path.** The conflict path is entered only when `gh pr view {number} --json mergeable` reads `CONFLICTING`, in the read before the gate or in the re-read after a refused pinned merge. Never hand-resolve a Dependabot PR: a hand-merged lockfile can mask a breaking transitive bump. Use the `rebase_intent` → `@dependabot rebase` → chunked polling contract of One polling deadline across chunks above. The rebase is done when the polled `headRefOid` is 40-hex and differs from the recorded head, and `mergeable` is `MERGEABLE`; empty output, a failed query, `UNKNOWN` or any other value keeps polling. Then re-run the Step 2 checks on that `NEW_HEAD` and wait for its fresh CI inside the same run-wide deadline and chunks; this is not a second wait. Record `ci_wait[pr] = {head, restarts}` so the 2-restart cap holds across chunks. Each chunk runs the gate's check step on `NEW_HEAD`, with its sleep clamped to the remaining chunk and deadline budget:\n\n- Exit 8, or `no required checks reported` with base-check exit 0, keeps waiting while `now \u003C deadline`.\n- Base-check exit 1 with a non-empty `BASE=` waits on every check by the same rule and tags the result `(no required checks)`.\n- Exit 0 merges with `gh pr merge {number} --merge --match-head-commit \"\u003CNEW_HEAD>\"` (the literal SHA), with the refused-merge rule above.\n- Any other non-zero exit is `Failed (CI not passing)`.\n- Base-check exit 1 with an empty `BASE=`, exit 2 or exit 3 maps as in the gate: `Skipped (no required check confirmed)` or `Skipped (required checks unconfirmed)`.\n- `no checks reported` on the all-checks run keeps waiting, because a freshly rebased head may not have registered CI yet; still reported at the deadline, it is `Skipped (no CI checks)`, which takes precedence over `Failed (CI timeout)`.\n- Otherwise, at `now >= deadline` the result is `Failed (CI timeout)`.\n\nA moved head during the wait restarts it within the 2-restart cap. Polling exhaustion at the deadline, a still-conflicting head, or red CI skips the PR and surfaces it for human review.\n\nAfter each successful merge, note it — the next PR in the queue may now have conflicts caused by this merge.\n\n#### 3b. Parallel-Auto Flow\n\nIn parallel-auto mode the client uses GitHub auto-merge as a per-PR scheduler while preserving one active PR per ecosystem lane. GitHub auto-merge merges a PR when its requirements are met; it is not, by itself, an ecosystem-aware queue. If the repository's branch protection requires GitHub merge queue, `gh pr merge` may add eligible PRs to that queue, but the skill must still maintain ecosystem lanes and poll outcomes.\n\n**Stage 1 — Start one non-mixed PR per ecosystem lane:**\n\nFor each non-empty ecosystem group, start only the first PR in that group with auto-merge, through this lane start block. The base check runs before every `--auto` call, including on resume:\n\n```bash\n# 1. Pre-start read; parse the JSON in-process. state MERGED\u002FCLOSED → record it terminal.\n#    A non-empty autoMergeRequest → already started (an earlier chunk or run): treat it as active.\n#    headRefOid must match ^[0-9a-f]{40}$ (record it as \u003CHEAD_SHA>); otherwise → stage3.\ngh pr view {number} --json state,autoMergeRequest,headRefOid\n# 1b. gh pr view has no isInMergeQueue field, so read it through GraphQL ({owner}\u002F{repo} are\n#     gh's own placeholders). true → GitHub already queued the PR (its autoMergeRequest may be\n#     empty then): treat it as active. A failed read is treated like a failed step 1 read.\ngh api graphql -F owner='{owner}' -F repo='{repo}' -F pr={number} -f query='query($owner:String!,$repo:String!,$pr:Int!){repository(owner:$owner,name:$repo){pullRequest(number:$pr){isInMergeQueue}}}' --jq .data.repository.pullRequest.isInMergeQueue\n# 2. Confirm the base: only exit 0 may start the PR; any other exit → stage3, never --auto.\nRESOLVER_LAUNCHER=\"$(bash \"${CODEX_HOME:-$HOME\u002F.codex}\u002Fskills\u002Fscripts\u002Fselect-resolver-launcher.sh\" 2>&1)\" || { echo \"BLOCKED: ${RESOLVER_LAUNCHER#BLOCKED: }\" >&2; exit 3; }\nBASE_CHECK_SCRIPT=\"$(bash \"$RESOLVER_LAUNCHER\" \"ywc-merge-dependabot\u002Fscripts\u002Fcheck-base-required-checks.sh\" bash)\" || { echo \"BLOCKED: resolver failed ($?)\" >&2; exit 3; }\nBASE_OUT=$(bash \"$BASE_CHECK_SCRIPT\" {number}) && BASE_RC=0 || BASE_RC=$?\n[ \"$BASE_RC\" -eq 0 ] || { echo \"stage3 (base not confirmed, exit $BASE_RC)\"; exit 1; }\n# 3. Compare in-process with the BASE= value of ${BASE_OUT##*$'\\n'}; a difference re-runs step 2.\ngh pr view {number} --json baseRefName\n# 4. Start, pinned to the recorded head (the literal SHA).\ngh pr merge {number} --auto --merge --match-head-commit \"\u003CHEAD_SHA>\"\n```\n\nA run-wide `BLOCKED` from the resolver lines follows the Run blocked rule of 3a. Re-read `baseRefName` immediately before `--auto` (step 3). A base-check failure before any `--auto` call removes the PR from its lane and adds it to `stage3` directly, and the lane advances to its next PR. After any non-zero `--auto` result, re-read `state` and `autoMergeRequest` together (`gh pr view {number} --json state,autoMergeRequest`), plus `isInMergeQueue` with the step 1b read, before the PR leaves its lane; this does not try to tell a definite refusal from a transport failure. `--auto` can merge at once when no required check is pending, so a `MERGED` re-read persists `status[pr] = \"merged\"` (reported `Merged`) and a `CLOSED` re-read persists `status[pr] = \"closed\"`; either removes the PR from its lane, the lane advances, and the PR never enters `stage3`. An `OPEN` PR with `isInMergeQueue` true stays active in its lane: GitHub has queued it, and leaving the lane would let the next same-lockfile PR start while it can still merge. For an `OPEN` PR not in the merge queue, an empty `autoMergeRequest` removes the PR from its lane and adds it to `stage3`, and the lane advances. The PR \"may already have auto-merge enabled\" only when that re-read shows auto-merge enabled or fails (either read); the same holds when a resume read finds auto-merge enabled on a PR that is leaving its lane, or when the pre-start read fails. Such a PR moves to `stage3` only after `gh pr merge {number} --disable-auto` succeeds and a re-read shows `autoMergeRequest` empty and `isInMergeQueue` false. Otherwise persist `status[pr] = \"auto-merge-uncertain\"` and report it as `Failed (auto-merge possibly still enabled)`; it is never in `stage3`. An `auto-merge-uncertain` PR closes its lane: the lane's remaining PRs move to `stage3` with `held_by[pr]` set to the uncertain PR, and Stage 3 does not start a held PR until a fresh read of the blocker shows it `MERGED` or `CLOSED`, or `OPEN` with `autoMergeRequest` empty and `isInMergeQueue` false (persist `held_by` beside `stage3`; an absent key is empty). A blocker that stays in the merge queue, or whose state cannot be read, keeps its held PRs unstarted, so two same-lockfile PRs never auto-merge concurrently. A resume retries `--disable-auto` once for each such PR; a retry that succeeds moves the PR to `stage3` only when the re-read shows `autoMergeRequest` empty and `isInMergeQueue` false, otherwise it stays `auto-merge-uncertain`.\n\nIf no PR's base is confirmed at Stage 1, announce \"No required status checks confirmed on the base branch — falling back to sequential mode\" and process every PR with 3a.\n\nThis sets the active PR to merge automatically as soon as its CI is green and the branch is up to date. Do not enable auto-merge for the remaining PRs in the same ecosystem yet; enabling all same-lockfile PRs at once can race because auto-merge is not ecosystem-aware. Different ecosystem lanes may have one active PR each. The pin only guards the start; heads Dependabot pushes later are guarded by the confirmed required checks, which GitHub evaluates on the head it merges.\n\n**Stage 2 — Poll active lanes and advance them:**\n\nTrack each active PR's state until it reaches a terminal state. When an active PR merges, start the next PR from the same ecosystem lane with the Stage 1 lane start block (pre-start read, base check, `baseRefName` re-read, pinned `--auto`); a lane start never skips the base check, and a PR it moves to `stage3` lets the lane advance to its following PR in the same chunk. Use a single bounded loop (do not spin in tight retries). The following lane illustration omits state serialization and lane advancement; apply the complete chunk\u002Fstate contract above, rather than executing it as a complete polling helper:\n\n```bash\n# Bounded by the run-wide deadline set once at the start of Step 3; poll every 60 seconds.\ndeadline=$RUN_DEADLINE  # the persisted run-wide value; never recomputed here\nchunk_deadline=$(( $(date +%s) + 50 ))  # clamp to deadline; yield within tool budget\ndeclare -A lanes\nlanes[npm]=\"101 105 107\"\nlanes[github-actions]=\"203 209\"\nactive=(101 203)   # first PR from each non-empty lane\ndeclare -A status rebase_intent rebase_commented\nwhile [ ${#active[@]} -gt 0 ] && [ \"$(date +%s)\" -lt \"$deadline\" ] && [ \"$(date +%s)\" -lt \"$chunk_deadline\" ]; do\n  next=()\n  for pr in \"${active[@]}\"; do\n    pr_state=$(gh pr view \"$pr\" --json state --jq '.state' 2>\u002Fdev\u002Fnull || echo UNKNOWN)\n    merge_status=$(gh pr view \"$pr\" --json mergeStateStatus --jq '.mergeStateStatus' 2>\u002Fdev\u002Fnull || echo UNKNOWN)\n    if [ \"$(date +%s)\" -ge \"$deadline\" ]; then\n      # Past the deadline: record the real terminal state, never start the next lane PR.\n      case \"$pr_state\" in\n        MERGED) status[$pr]=\"merged\" ;;\n        CLOSED) status[$pr]=\"closed\" ;;\n        *) next+=(\"$pr\") ;;\n      esac\n      continue\n    fi\n    if [ \"$pr_state\" = \"MERGED\" ]; then\n      status[$pr]=\"merged\"\n      # Remove this PR from active. Then run the Stage 1 lane start block for the\n      # next unprocessed PR of the same ecosystem lane, if any, and append it to `next`.\n    elif [ \"$pr_state\" = \"CLOSED\" ]; then\n      status[$pr]=\"closed\"\n    elif [ \"$merge_status\" = \"CONFLICTING\" ] || [ \"$merge_status\" = \"DIRTY\" ]; then\n      # Keep the active lane item — Dependabot or a maintainer may rebase before the deadline.\n      next+=(\"$pr\")\n    else\n      next+=(\"$pr\")\n    fi\n  done\n  active=(\"${next[@]}\")\n  # Bound each API call and clamp sleep to both remaining budgets.\n  left=$(( deadline - $(date +%s) ))\n  chunk_left=$(( chunk_deadline - $(date +%s) ))\n  [ \"$chunk_left\" -lt \"$left\" ] && left=$chunk_left\n  [ ${#active[@]} -gt 0 ] && [ \"$left\" -gt 0 ] && sleep $(( left \u003C 60 ? left : 60 ))\ndone\n\n# A chunk boundary saves all state, never marks failure by itself.\nif [ \"$(date +%s)\" -ge \"$deadline\" ]; then\n  for pr in \"${active[@]}\"; do\n    status[$pr]=\"lane-stalled\"\n  done\nfi\n# Persist a complete snapshot per One polling deadline across chunks above.\n```\n\nPRs that reach `MERGED` are recorded as `Merged`. PRs whose status is `closed` (closed without merging, whether seen while polling, in a re-read, on resume or at the deadline) are recorded as `Skipped (closed without merge)`. PRs still in the `active` list after the deadline are recorded as `Failed (lane stalled)` so the user can investigate. `--disable-auto` does not remove a merge-queue entry. A PR can enter the merge queue after its Stage 1 read, so immediately before this final classification re-run the step 1b read for every remaining PR (a failed read is reported as queue state unknown, never as not queued). A stalled PR whose latest step 1b read shows `isInMergeQueue` true is reported as `Failed (lane stalled) — still in merge queue` for the user to dequeue. Do not extend the deadline silently — if the lane genuinely needs more time, the user can rerun the skill.\n\n**Stage 3 — Final sequential pass for the mixed bucket and unconfirmed-base PRs:**\n\nAfter all active lanes have drained successfully before the deadline (not merely because a chunk returned; drained means `active` is empty and every lane's queue is empty), process the `mixed` group and the persisted `stage3` list (PRs whose base was not confirmed, whose `--auto` start failed with an empty `autoMergeRequest` re-read, or whose lane an `auto-merge-uncertain` PR closed) using the same logic as Sequential Flow (3a), under the run-wide deadline. Mixed PRs run last because earlier merges may have changed the conflict surface they would land in. PRs that 3a or Stage 3 has not reached before the deadline are `Skipped (deadline reached)`; a held PR whose blocker was never confirmed gone is `Skipped (blocked by \u003Cpr>)`.\n\n### 4. Final Summary\n\nAfter processing all PRs, report results in this format:\n\n```\n## Dependabot Merge Results\n\nMode: parallel-auto (security)\nEcosystem groups processed: npm (3), github-actions (2), python (2), mixed (1)\n\n- ✅ Merged    (npm)            : #123 Bump axios from 1.6.0 to 1.7.2\n- ✅ Merged    (npm)            : #125 Bump lodash from 4.17.20 to 4.17.21\n- ✅ Merged    (github-actions) : #129 Bump actions\u002Fcheckout from 4.1.1 to 4.2.0\n- ⏭️ Skipped   (Dockerfile)     : #127 Bump node from 18 to 20\n- ⏭️ Skipped   (Major version upgrade) : #130 Bump webpack from 4.46.0 to 5.90.0\n- ❌ Failed    (lane stalled)   : #132 Bump express from 4.18.0 to 4.19.2 — CONFLICTING after 30 min\n- ❌ Failed    (CI timeout)     : #135 Bump aws-sdk + boto3 (mixed) — rebased head CI still pending at the deadline\n\nTotal: 3 merged \u002F 2 skipped \u002F 2 failed\n```\n\nInclude:\n- Mode line — scope flag + execution flag, so the reader can reproduce the run\n- Ecosystem group summary — only when parallel-auto was used; the count tells the reader how many ecosystem lanes ran concurrently\n- Per-PR result — for parallel-auto, annotate each line with the ecosystem; for sequential, omit the annotation\n- If a previous merge affected a subsequent PR, note which PR caused the issue\n- Total counts: merged \u002F skipped \u002F failed\n- Result labels beyond the example: `Skipped (closed without merge)`, `Failed (lane stalled) — still in merge queue`, `Skipped (CI pending)`, `Skipped (head unreadable)`, `Skipped (no required check confirmed)`, `Skipped (required checks unconfirmed)`, `Skipped (no CI checks)`, `Skipped (deadline reached)`, `Skipped (run blocked)`, `Skipped (run blocked) — auto-merge still enabled`, `Failed (CI not passing)`, `Failed (head kept moving)`, `Failed (merge refused)`, `Failed (CI timeout)`, `Failed (auto-merge possibly still enabled)`; a result gated on every check because the base has no required check carries the `(no required checks)` suffix\n\n## Error Handling\n\n| Error | Action |\n| --- | --- |\n| `gh` CLI not authenticated | Stop and ask user to run `gh auth login` |\n| No Dependabot PRs found | Report \"No Dependabot PRs found\" and stop |\n| Rate limit hit | Wait and retry, or stop and report progress so far |\n| Branch protection prevents merge | Skip PR and note the protection rule in the report |\n\n## Notes\n\n- Follow any additional instructions in `$ARGUMENTS`\n- Never force-merge or bypass branch protection rules\n- If the number of PRs is large (>20), ask the user for confirmation before proceeding. For batches of that size, also recommend `parallel-auto` mode if the eligible PRs span more than one ecosystem\n- `parallel-auto` reduces wall-clock time by letting GitHub run the CI cycle for non-conflicting ecosystem lanes concurrently. It does not reduce the *per-PR* CI cost, the safety surface, or the conflict-resolution requirements — it only changes how active PRs are scheduled\n\n## Integration\n\n- **upstream**: None — this skill is triggered directly by the user or a scheduled workflow when Dependabot PRs accumulate\n- **downstream**: `ywc-gen-testcase` (optional — run after merging dependency updates to verify the updated packages do not break existing test coverage)\n\n## Output Format\n\nReturn the Dependabot merge report with:\n\n```text\nStatus: \u003CDONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT>\nMode: \u003Cscope and execution mode>\nMerged: \u003CPR numbers>\nSkipped: \u003CPR numbers and reasons, using the Skipped (…) labels of Final Summary>\nFailed: \u003CPR numbers and reasons, using the Failed (…) labels of Final Summary>\nValidation: \u003CCI and branch-protection checks>\nNext action: \u003Cmanual follow-up or \"none\">\n```\n\n## Validation\n\nBefore finalizing, verify that branch protection was not bypassed, each PR result is categorized, CI status was checked after each merge lane, major or unsupported updates were skipped with reason, and failures include actionable blocker details.\n",{"name":5,"description":7},"main","7e8ac872e53df8c89d75663e031626281a2a2f5c","plugins\u002Fywc-agent-toolkit\u002Fskills\u002Fywc-merge-dependabot",1,"https:\u002F\u002Fgithub.com\u002Fyongwoon\u002Fywc-agent-toolkit","https:\u002F\u002Fgithub.com\u002Fyongwoon","https:\u002F\u002Fwww.webhani.com","2026-11-08 17:14:59",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add yongwoon\u002Fywc-agent-toolkit --skill ywc-merge-dependabot",{"tool":37,"command":38},"bunx","bunx skills add yongwoon\u002Fywc-agent-toolkit --skill ywc-merge-dependabot",{"tool":40,"command":41},"pnpm","pnpm dlx skills add yongwoon\u002Fywc-agent-toolkit --skill ywc-merge-dependabot","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fyongwoon\u002Fywc-agent-toolkit\u002Fblob\u002Fmain\u002Fplugins\u002Fywc-agent-toolkit\u002Fskills\u002Fywc-merge-dependabot\u002FSKILL.md",true,[45,51,55,59,63,67,71,75,79,85,89,93],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"agents\u002Fopenai.yaml","REFERENCE","参考文档",292,"https:\u002F\u002Fgithub.com\u002Fyongwoon\u002Fywc-agent-toolkit\u002Fblob\u002Fmain\u002Fplugins\u002Fywc-agent-toolkit\u002Fskills\u002Fywc-merge-dependabot\u002Fagents\u002Fopenai.yaml",{"path":52,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":53,"sourceHtmlUrl":54},"evals\u002Fevals.json",1454,"https:\u002F\u002Fgithub.com\u002Fyongwoon\u002Fywc-agent-toolkit\u002Fblob\u002Fmain\u002Fplugins\u002Fywc-agent-toolkit\u002Fskills\u002Fywc-merge-dependabot\u002Fevals\u002Fevals.json",{"path":56,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":57,"sourceHtmlUrl":58},"README.en.md",4137,"https:\u002F\u002Fgithub.com\u002Fyongwoon\u002Fywc-agent-toolkit\u002Fblob\u002Fmain\u002Fplugins\u002Fywc-agent-toolkit\u002Fskills\u002Fywc-merge-dependabot\u002FREADME.en.md",{"path":60,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":61,"sourceHtmlUrl":62},"README.es.md",5613,"https:\u002F\u002Fgithub.com\u002Fyongwoon\u002Fywc-agent-toolkit\u002Fblob\u002Fmain\u002Fplugins\u002Fywc-agent-toolkit\u002Fskills\u002Fywc-merge-dependabot\u002FREADME.es.md",{"path":64,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":65,"sourceHtmlUrl":66},"README.ja.md",4457,"https:\u002F\u002Fgithub.com\u002Fyongwoon\u002Fywc-agent-toolkit\u002Fblob\u002Fmain\u002Fplugins\u002Fywc-agent-toolkit\u002Fskills\u002Fywc-merge-dependabot\u002FREADME.ja.md",{"path":68,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":69,"sourceHtmlUrl":70},"README.ko.md",4340,"https:\u002F\u002Fgithub.com\u002Fyongwoon\u002Fywc-agent-toolkit\u002Fblob\u002Fmain\u002Fplugins\u002Fywc-agent-toolkit\u002Fskills\u002Fywc-merge-dependabot\u002FREADME.ko.md",{"path":72,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":73,"sourceHtmlUrl":74},"README.md",4792,"https:\u002F\u002Fgithub.com\u002Fyongwoon\u002Fywc-agent-toolkit\u002Fblob\u002Fmain\u002Fplugins\u002Fywc-agent-toolkit\u002Fskills\u002Fywc-merge-dependabot\u002FREADME.md",{"path":76,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":77,"sourceHtmlUrl":78},"README.zh.md",4188,"https:\u002F\u002Fgithub.com\u002Fyongwoon\u002Fywc-agent-toolkit\u002Fblob\u002Fmain\u002Fplugins\u002Fywc-agent-toolkit\u002Fskills\u002Fywc-merge-dependabot\u002FREADME.zh.md",{"path":80,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":83,"sourceHtmlUrl":84},"scripts\u002Fcheck-base-required-checks.sh","SCRIPT","脚本",3675,"https:\u002F\u002Fgithub.com\u002Fyongwoon\u002Fywc-agent-toolkit\u002Fblob\u002Fmain\u002Fplugins\u002Fywc-agent-toolkit\u002Fskills\u002Fywc-merge-dependabot\u002Fscripts\u002Fcheck-base-required-checks.sh",{"path":86,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":87,"sourceHtmlUrl":88},"scripts\u002Fgroup-by-ecosystem.py",4841,"https:\u002F\u002Fgithub.com\u002Fyongwoon\u002Fywc-agent-toolkit\u002Fblob\u002Fmain\u002Fplugins\u002Fywc-agent-toolkit\u002Fskills\u002Fywc-merge-dependabot\u002Fscripts\u002Fgroup-by-ecosystem.py",{"path":90,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":91,"sourceHtmlUrl":92},"scripts\u002Fselect-security-prs.py",4206,"https:\u002F\u002Fgithub.com\u002Fyongwoon\u002Fywc-agent-toolkit\u002Fblob\u002Fmain\u002Fplugins\u002Fywc-agent-toolkit\u002Fskills\u002Fywc-merge-dependabot\u002Fscripts\u002Fselect-security-prs.py",{"path":94,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":95,"sourceHtmlUrl":96},"scripts\u002Ftest_merge_dependabot_scripts.py",34107,"https:\u002F\u002Fgithub.com\u002Fyongwoon\u002Fywc-agent-toolkit\u002Fblob\u002Fmain\u002Fplugins\u002Fywc-agent-toolkit\u002Fskills\u002Fywc-merge-dependabot\u002Fscripts\u002Ftest_merge_dependabot_scripts.py",[98,104,110,117,124,131],{"skillNo":99,"name":100,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":18},"01M72TQ84GTCPCV2VJ778V17TW","missing-frontmatter","https:\u002F\u002Fgithub.com\u002Fyongwoon\u002Fywc-agent-toolkit\u002Fblob\u002Fmain\u002Fscripts\u002Ffixtures\u002Fcodex-description-limit\u002Fmissing-frontmatter\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":18},"01M72TQ6M4BFWE7P9EPW0GZDCM","malformed-frontmatter","https:\u002F\u002Fgithub.com\u002Fyongwoon\u002Fywc-agent-toolkit\u002Fblob\u002Fmain\u002Fscripts\u002Ffixtures\u002Fcodex-description-limit\u002Fmalformed-frontmatter\u002FSKILL.md",[],[],{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":18},"01M72TQ3ESGKXZ4QRWGTX92BKJ","fixture-501-fail","(ywc) Use when aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa Do not use for x.","https:\u002F\u002Fgithub.com\u002Fyongwoon\u002Fywc-agent-toolkit\u002Fblob\u002Fmain\u002Fscripts\u002Ffixtures\u002Fcodex-description-limit\u002F501-fail\u002FSKILL.md",[],[],{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":18},"01M72TQ0HJ8H3R37J9WPWGKJZR","fixture-500-pass","(ywc) Use when aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa Do not use for x.","https:\u002F\u002Fgithub.com\u002Fyongwoon\u002Fywc-agent-toolkit\u002Fblob\u002Fmain\u002Fscripts\u002Ffixtures\u002Fcodex-description-limit\u002F500-pass\u002FSKILL.md",[],[],{"skillNo":125,"name":126,"nameZh":6,"description":127,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":128,"categories":129,"keywords":130,"publishedAt":18},"01M72TPWNCC7NEYD0D9N12KSQS","ywc-worktrees","(ywc) Use when creating, auditing, pruning, or resolving git worktrees for isolated task workspaces, whether delegated from an executor or used standalone. Triggers: \"worktree 생성\", \"worktree audit\", \"worktree 정리\", \"worktree prune\", \"ywc-worktrees\", \"create worktree\". Do not use for branch creation\u002Fdeletion alone, PR creation (use ywc-create-pr), CI or merge delivery (use ywc-finish-branch), task orchestration (use ywc-sequential-executor or ywc-parallel-executor), or non-git isolation.","https:\u002F\u002Fgithub.com\u002Fyongwoon\u002Fywc-agent-toolkit\u002Fblob\u002Fmain\u002Fplugins\u002Fywc-agent-toolkit\u002Fskills\u002Fywc-worktrees\u002FSKILL.md",[],[],{"skillNo":132,"name":133,"nameZh":6,"description":134,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":135,"categories":136,"keywords":137,"publishedAt":18},"01M72TPRNR3E6QWB91GM98ABBV","ywc-wayfinder","(ywc) Use when a large or uncertain change needs multi-session discovery with a deterministic local map and exactly one active ticket before planning or implementation. Triggers: \"wayfinder\", \"길찾기\", \"discovery map\", \"multi-session discovery\", \"탐색 ticket\", \"経路整理\", \"探索マップ\", \"ywc-wayfinder\". Do not use for ordinary planning (use ywc-plan), idea clarification (use ywc-brainstorm), direct implementation, or tracker\u002Fdatabase writes outside the local Markdown map.","https:\u002F\u002Fgithub.com\u002Fyongwoon\u002Fywc-agent-toolkit\u002Fblob\u002Fmain\u002Fplugins\u002Fywc-agent-toolkit\u002Fskills\u002Fywc-wayfinder\u002FSKILL.md",[],[]]