[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6C1Z1CSYB420HK07BDDJMSX":3,"skill-same:01M6C1Z1CSYB420HK07BDDJMSX":101},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":17,"categories":18,"keywords":29,"publishedAt":50,"linkOnly":51,"markdownContent":52,"markdownBody":53,"frontMatter":54,"refName":70,"commitSha":71,"skillDirectory":72,"forksCount":73,"repositoryHtmlUrl":74,"repositoryHomepageUrl":13,"ownerHtmlUrl":75,"ownerBlogUrl":13,"ownerDescription":13,"updatedAt":76,"install":77,"resources":90},"01M6C1Z1CSYB420HK07BDDJMSX","ci-queue-trim","CI 队列任务清理","Audit and trim queued GitHub Actions CI workflow runs whose head SHA is proven obsolete. PR association comes from `actions\u002Fruns\u002F{id}.pull_requests` (the only authoritative pointer); branch names that collide between forks MUST NOT cross-bind runs to a PR. Event semantics split pull_request from pull_request_target (the latter uses base-side SHA, so a tip advance is NOT a supersede signal) and merge_group \u002F unknown events skip the generic stale-head comparison. Per-item re-validation right before each `gh run cancel` catches concurrent state advances. Workflow importance is decided by an explicit configured allowlist (empty by default), never by fuzzy substring heuristics.","审计并清理队列中 head SHA 已被证实过时的 GitHub Actions CI 工作流运行。PR 关联来自 `actions\u002Fruns\u002F{id}.pull_requests`（唯一权威指针）；在 fork 之间重名的分支不得将运行交叉绑定到某个 PR。事件语义区分 pull_request 与 pull_request_target（后者使用 base 侧 SHA，因此 tip 前进不是被取代的信号），而 merge_group \u002F 未知事件跳过通用的 stale-head 比较。在每次 `gh run cancel` 前逐项重新验证，以捕捉并发状态变更。工作流的重要性由显式配置的允许列表决定（默认为空），绝不采用模糊的子串启发式判断。","jleechanorg\u002Fjleechan-skills","jleechanorg","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F221404966?v=4","01M6C1VJ99XG950X1DWPEBCBGX",null,"01M6C1VJDK5YVDNT3362RT5WSB",6,"MIT","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fci-queue-trim\u002FSKILL.md",[19,24],{"categoryNo":20,"categoryName":21,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BQGD4WETX0HM3SM9QKQ15B","SRE 工程师","PROFESSION","适用职业",{"categoryNo":25,"categoryName":26,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BQNXPY1AV6BSR5VKHDMWRH","部署与发布管理","SCENARIO","使用场景",[30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49],"ci","queue","trim","ci queue trim","unknown","TIP","only","clean","up","default","re","never","bind","branch","Bash","workflow","cleanup","github actions","actions","heuristics","2026-11-10 10:12:30",false,"---\nname: ci-queue-trim\ndescription: >\n  Audit and trim queued GitHub Actions CI workflow runs whose head SHA is\n  proven obsolete. PR association comes from\n  `actions\u002Fruns\u002F{id}.pull_requests` (the only authoritative pointer);\n  branch names that collide between forks MUST NOT cross-bind runs to a\n  PR. Event semantics split pull_request from pull_request_target (the\n  latter uses base-side SHA, so a tip advance is NOT a supersede signal)\n  and merge_group \u002F unknown events skip the generic stale-head comparison.\n  Per-item re-validation right before each `gh run cancel` catches\n  concurrent state advances. Workflow importance is decided by an explicit\n  configured allowlist (empty by default), never by fuzzy\n  substring heuristics.\ntype: skill\nscope: global\nowner: $USER\nversion: 1.2.0\ntriggers:\n  - \"ci queue trim\"\n  - \"trim ci queue\"\n  - \"cancel dormant ci runs\"\n  - \"clean up ci queue\"\n  - \"trim queued jobs\"\n  - \"ci backlog cleanup\"\n  - \"pr inactivity trim\"\nallowed-tools:\n  - Bash\n  - Read\n  - Write\n---\n\n# \u002Fci-queue-trim — CI Queue Inactivity Triage & Trimming\n\nUse this skill when GitHub Actions self-hosted or cloud runner queues become backlogged with queued runs whose head SHA is no longer current. PR closure and commit age alone never authorize cancellation.\n\n## The Pitfalls Resolved at Audit Time\n\n### 1. Deceptive `PR.updatedAt` (bots touch it constantly)\nWhen filtering PRs by activity, `PR.updatedAt` is **fundamentally deceptive**:\n- Automated bots (merge queues, label synchronizers, automated status\n  comments, rebase checks) constantly touch `updatedAt`.\n- A PR whose code has not been touched in 10–30 days frequently shows\n  `updatedAt` of \"2 minutes ago\".\n- The script uses the **immutable head-commit committer timestamp** as\n  the reporting source — fetched from\n  `GET repos\u002F{head.repo.full_name}\u002Fcommits\u002F{head.sha}` via\n  `commit.committer.date`. NEVER substituted with `pushed_at`,\n  `updated_at`, or run age.\n- `PR.updated_at` is reported separately for operator visibility only\n  (the `pr_updated_age` field); it is NOT used for cancellation decisions.\n- `--max-age-hours` labels matching-head commit age in the report only.\n  Exceeding it never authorizes cancellation. If commit age is unknown,\n  matching-head runs are KEEP incomplete; proven obsolete heads do not\n  require a timestamp.\n\n### 2. Superseded runs (`run.head_sha` ≠ PR\u002Fbranch current head)\nA run can be queued against an older SHA even though the PR has since\nadvanced. The script compares `run.head_sha` against the current head SHA\nto detect this without false-positive dormancy cancellations.\n\n- `PR.head.sha` is the **head branch tip SHA** — NOT the merge ref.\n  `merge_commit_sha` is a separate field and must NOT be used for\n  supersede comparison.\n- For `pull_request` events: comparison ref is `PR.head.sha`.\n- For `pull_request_target`: base-side semantics. The run's `head_sha`\n  is the BASE branch SHA, not the PR head SHA. Tip advances on the PR\n  are NOT proven supersede — always keep, including MERGED\u002FCLOSED PRs.\n- For `push` events: always KEEP with `audit_incomplete=True`. The run\n  record does not prove the original branch\u002Ftag namespace. Current tag\n  absence cannot exclude a deleted tag; same-name branch\u002Ftag collisions\n  are ambiguous. No branch or tag lookup authorizes cancellation.\n- For `merge_group` and any unsupported event: never apply the generic\n  stale-head comparison.\n\n### 3. Lookup failure (PR \u002F commit \u002F run detail unknown)\nIf the audit cannot verify the PR or run detail, the run is\nkept with `audit_incomplete=True`. A missing head-commit date marks\nmatching-head age reporting incomplete; it does not block proven\nsupersession. Run age never substitutes for head-commit age.\n\nA failed `gh run list` (queue fetch) is propagated as\n`stats[\"queue_fetch_failed\"]=True`, NOT silently turned into a healthy\nempty success. The CLI exits nonzero on queue fetch failure.\n\n### 4. PR association — branch names that collide between forks\nBranch-name lookup is **never** used to bind a run to a PR. The script\nreads `actions\u002Fruns\u002F{id}.pull_requests` (the only authoritative pointer).\nTwo forks pushing a branch named `feature\u002Fx` will not cross-bind the run\nto the wrong PR.\n\n- The audit requires **exactly one** PR association (0 or >1 ⇒ UNKNOWN,\n  `audit_incomplete=True`). There is no \"pick the first\" fallback.\n- Identity between the run's PR pointer and the fetched `pulls\u002F{n}`\n  record is verified by the stable **numeric `repo.id`**. The live\n  shape of `actions\u002Fruns\u002F{id}.pull_requests[].head.repo` is\n  `{id, name, url}` (no `full_name`); requiring `full_name` would mark\n  every real run unknown. The `pulls\u002F{n}.head.repo` record carries\n  `{id, full_name, name, ...}` — match by `id`.\n- Absent or mismatched `repo.id` ⇒ UNKNOWN. The association base repo ID,\n  run repository ID, and fetched PR base repo ID must all be present and equal.\n  PR number plus base repository identifies the PR; head ref is not used as\n  an alternative identity. Historical association head SHA may differ from\n  the current tip and is not required to equal it.\n\n### 5. Per-item refresh before cancellation\nBefore every individual `gh run cancel`, the script re-fetches the run\nrecord and the exact PR for PR events, re-runs the\n**same pure classifier** the audit used, and only cancels if the verdict\nis still CANCEL. If state moved on between audit time and mutation\ntime, the candidate is dropped.\n\nBoth audit and refresh use the same run-response validation:\n- Run IDs, PR numbers, and repository IDs must be positive JSON integers;\n  strings, booleans, floats, zero, and negative values are rejected.\n- `data.id` MUST equal the requested `run_id` (mismatched id ⇒ drop,\n  even if the rest looks valid).\n- `head_sha`, `head_branch`, `event`, `path`, and `status` must be nonempty\n  strings; `status` must be\n  `queued` before mutation.\n- `repository` must contain a nonempty `id` and `full_name`;\n  `full_name` must equal the requested `OWNER\u002FREPO`. Missing or mismatched\n  identity keeps the audit row incomplete and prevents cancellation.\n- PR runs require exactly one structurally valid raw `pull_requests`\n  association before normalization (malformed entries are never dropped), with matching\n  PR number and numeric `head.repo.id`, plus equal association\u002Frun\u002Ffetched-PR\n  base repository IDs. Incomplete identity or lookups keep the run.\n  Push events remain ambiguous and are never cancellation candidates.\n\nEvery mode requires `superseded=True` before cancellation. Neither old\ncommits nor MERGED\u002FCLOSED state authorizes cancellation of current-head\nwork, which may include legitimate cleanup or deployment after closure.\nThe same classifier is reused at mutation time.\n\n## Protected Branches and Workflows\n\n- **Protected branches** (never cancelled automatically):\n  `main`, `master`, `production`, `staging`, `release`, `deploy`.\n- **Workflow cancellation is opted-in via `--allow-workflow PATH`**\n  (repeatable). The default is an empty allowlist, which keeps every\n  workflow — i.e. **no workflow is cancellable out of the box**. Operators\n  must explicitly enumerate the exact normalized workflow paths they\n  consider safe to cancel.\n- **Workflow protection is opt-in via `--protect-workflow PATH`** (repeatable).\n  `--allow-workflow` enables cancellation; `--protect-workflow` protects\n  even if the same path is in `--allow-workflow`. The two flags are\n  independent.\n- The `@\u003Cref>` suffix on a workflow path (e.g.\n  `release.yml@refs\u002Fheads\u002Ffeature\u002Fx`, `deploy.yml@v2`) is stripped\n  before matching via `partition('@')[0]` — refs containing slashes are\n  preserved.\n- Reusable workflows invoked via `workflow_call` are protected by\n  **event semantics**, not by fuzzy name matching.\n\n---\n\n## Tooling & Command Syntax\n\nThe skill includes a pre-built, standalone Python helper. Resolve the\nskill root via the standard Claude home convention and substitute in\nthe commands below:\n\n```bash\n\"${CLAUDE_HOME:-$HOME\u002F.claude}\u002Fskills\u002Fci-queue-trim\u002Fscripts\u002Fci_queue_trim.py\"\n```\n\nThis resolves the helper under the active Claude home on both Linux and macOS.\n\n### 1. Dry-Run Audit (Default)\nInspects the queue, classifies each run via the pure classifier, and\nprints cancel candidates without cancelling anything. Explicit `--dry-run`\nalso overrides `--cancel` if both flags are supplied:\n```bash\npython3 ~\u002F.claude\u002Fskills\u002Fci-queue-trim\u002Fscripts\u002Fci_queue_trim.py\n```\n\n### 2. Execute Cancellations\nEach candidate is re-fetched and re-classified immediately before its\n`gh run cancel` call:\n```bash\npython3 ~\u002F.claude\u002Fskills\u002Fci-queue-trim\u002Fscripts\u002Fci_queue_trim.py \\\n    --allow-workflow .github\u002Fworkflows\u002Fci.yml --cancel\n```\n\n### 3. Superseded-Only Compatibility Flag\n`--superseded-only` remains accepted for existing callers. The default now\nhas the same cancellation rule: only proven obsolete heads are eligible.\nMatching heads remain queued regardless of PR state or commit age.\n`pull_request_target` runs are always kept because their SHA is base-side.\n```bash\npython3 ~\u002F.claude\u002Fskills\u002Fci-queue-trim\u002Fscripts\u002Fci_queue_trim.py \\\n    --allow-workflow .github\u002Fworkflows\u002Fci.yml --superseded-only --cancel\n```\n\n### 4. Enable Cancellation for Specific Workflows\n`--allow-workflow PATH` (repeatable) opts a workflow INTO cancellation.\nDefault is empty (no workflow cancellable). Use `--protect-workflow PATH`\nto also keep a path safe even if it was added to the allowlist.\n```bash\npython3 ~\u002F.claude\u002Fskills\u002Fci-queue-trim\u002Fscripts\u002Fci_queue_trim.py \\\n    --allow-workflow .github\u002Fworkflows\u002Fci.yml \\\n    --allow-workflow .github\u002Fworkflows\u002Flint.yml@v2 \\\n    --protect-workflow .github\u002Fworkflows\u002Fci.yml \\\n    --cancel\n```\n\n### 5. Customize Report Age Threshold and Target Repo\nThe age threshold affects reporting only; cancellation still requires proven\nsupersession and an explicitly allowed workflow. Without `--repo`, the target is\n`$GITHUB_REPOSITORY`, else the repository `gh repo view` resolves from the current\ndirectory; with neither, the script exits non-zero naming `GITHUB_REPOSITORY`.\n```bash\npython3 ~\u002F.claude\u002Fskills\u002Fci-queue-trim\u002Fscripts\u002Fci_queue_trim.py \\\n    --repo \u003Cowner>\u002F\u003Crepo> --max-age-hours 4 \\\n    --allow-workflow .github\u002Fworkflows\u002Fci.yml --cancel\n```\n\n### 6. Host & Colima Preflight (`--check-host`)\nChecks local macOS host conditions that cause runner starvation or\nadmission lockouts:\n```bash\npython3 ~\u002F.claude\u002Fskills\u002Fci-queue-trim\u002Fscripts\u002Fci_queue_trim.py --check-host\n```\n- **Colima Sockets:** Verifies `~\u002F.colima\u002F_lima\u002F_networks\u002Fuser-v2\u002Fuser-v2_fd.sock`\n  exists and is backed by exactly 1 active `limactl usernet` process.\n- **Host Disk Space:** Checks `\u002FSystem\u002FVolumes\u002FData` against the 7.0 GB\n  admission safety floor.\n\n### 7. Structured JSON Output (`--json`)\nStdout contains exactly one JSON object with `stats` and `runs`, including\nfor empty queues and queue-fetch errors. Human audit, host, dry-run, and\ncancellation messages go to stderr. Queue-fetch errors still exit nonzero;\ncancellation acceptance is reported on stderr and is not terminal-state proof.\nThis contract also applies with `--cancel`, `--dry-run`, and `--check-host`:\n```bash\npython3 ~\u002F.claude\u002Fskills\u002Fci-queue-trim\u002Fscripts\u002Fci_queue_trim.py --json\n```\nEach row carries:\n`run_id, name, branch, event, pr_number, pr_state, head_commit_age,\npr_updated_age, deceptive_delta, superseded, audit_incomplete, verdict,\nreason`. `head_commit_age` is the actual immutable committer-timestamp\nage (reporting only). `pr_updated_age` is the PR\n`updated_at` age, reported for visibility only — not used for\ndecisions.\n\n---\n\n## Diagnostic Follow-up\n\n### 1. Colima Networking\nHost-health observations are diagnostic hints, not proof that a process or\nsocket is orphaned. Resolve the host Colima installation and its owning\nconfiguration; inspect exact process arguments, socket ownership, and active\nVM connections using that installation's read-only status tools. Any repair\nmust follow the owning service instructions and normal authorization boundary\nwith exact validated targets. This skill does not authorize termination,\nsocket removal, or service restart.\n\n### 2. Host Disk Floor\nA low-space observation does not identify safe deletion targets. Follow the\nhost's disk-diagnosis owner instructions, attribute usage to exact paths, and\ncheck their owners and active users. Cleanup requires a separate authorized\nscope with validated targets; this portable queue skill provides no deletion\nrecipe.\n\n### 3. Self-Hosted Runner Capacity\nRunner health belongs to the runner installation. Resolve the actual\n`ez-gh-actions` repository path and read its instructions before invoking its\n`doctor-runner` checker. That checker is not included in this portable skill;\nthere is no working-directory-relative command here. Report observed worker\nexecution per configured slot using the owning fleet contract; cycling alone\nis not execution proof.\n\n### 4. Audit-Incomplete Runs\nIf a run is reported with `audit_incomplete=True`, the script could not\nverify its PR\u002Fbranch\u002Fcommit at audit time. To investigate:\n```bash\ngh api repos\u002F\u003Cowner>\u002F\u003Crepo>\u002Factions\u002Fruns\u002F\u003Crun_id> | jq '.event, .head_sha, .pull_requests'\ngh api repos\u002F\u003Cowner>\u002F\u003Crepo>\u002Fpulls\u002F\u003Cpr_number> | jq '.head.sha, .state'\n```\nDo **not** manually cancel an `audit_incomplete` run unless you have\nindependently confirmed the head SHA mismatch.\n\n---\n\n## Architecture\n\nThe script is structured around one **pure classifier** (`classify_run`)\nthat consumes pre-fetched facts and returns a `Classification` namedtuple\n(`verdict, superseded, audit_incomplete, reason, pr_state`):\n\n- `audit_queue` fetches each run's record + the exact PR (via the run\n  detail's `pull_requests` array),\n  then calls `classify_run` once per run.\n- `cancel_with_per_item_refresh` re-runs the same fetch + classifier\n  pipeline per candidate immediately before each `gh run cancel`.\n\nBecause the same classifier is reused, audit-time verdicts and\npre-mutation verdicts cannot drift.","# \u002Fci-queue-trim — CI Queue Inactivity Triage & Trimming\n\nUse this skill when GitHub Actions self-hosted or cloud runner queues become backlogged with queued runs whose head SHA is no longer current. PR closure and commit age alone never authorize cancellation.\n\n## The Pitfalls Resolved at Audit Time\n\n### 1. Deceptive `PR.updatedAt` (bots touch it constantly)\nWhen filtering PRs by activity, `PR.updatedAt` is **fundamentally deceptive**:\n- Automated bots (merge queues, label synchronizers, automated status\n  comments, rebase checks) constantly touch `updatedAt`.\n- A PR whose code has not been touched in 10–30 days frequently shows\n  `updatedAt` of \"2 minutes ago\".\n- The script uses the **immutable head-commit committer timestamp** as\n  the reporting source — fetched from\n  `GET repos\u002F{head.repo.full_name}\u002Fcommits\u002F{head.sha}` via\n  `commit.committer.date`. NEVER substituted with `pushed_at`,\n  `updated_at`, or run age.\n- `PR.updated_at` is reported separately for operator visibility only\n  (the `pr_updated_age` field); it is NOT used for cancellation decisions.\n- `--max-age-hours` labels matching-head commit age in the report only.\n  Exceeding it never authorizes cancellation. If commit age is unknown,\n  matching-head runs are KEEP incomplete; proven obsolete heads do not\n  require a timestamp.\n\n### 2. Superseded runs (`run.head_sha` ≠ PR\u002Fbranch current head)\nA run can be queued against an older SHA even though the PR has since\nadvanced. The script compares `run.head_sha` against the current head SHA\nto detect this without false-positive dormancy cancellations.\n\n- `PR.head.sha` is the **head branch tip SHA** — NOT the merge ref.\n  `merge_commit_sha` is a separate field and must NOT be used for\n  supersede comparison.\n- For `pull_request` events: comparison ref is `PR.head.sha`.\n- For `pull_request_target`: base-side semantics. The run's `head_sha`\n  is the BASE branch SHA, not the PR head SHA. Tip advances on the PR\n  are NOT proven supersede — always keep, including MERGED\u002FCLOSED PRs.\n- For `push` events: always KEEP with `audit_incomplete=True`. The run\n  record does not prove the original branch\u002Ftag namespace. Current tag\n  absence cannot exclude a deleted tag; same-name branch\u002Ftag collisions\n  are ambiguous. No branch or tag lookup authorizes cancellation.\n- For `merge_group` and any unsupported event: never apply the generic\n  stale-head comparison.\n\n### 3. Lookup failure (PR \u002F commit \u002F run detail unknown)\nIf the audit cannot verify the PR or run detail, the run is\nkept with `audit_incomplete=True`. A missing head-commit date marks\nmatching-head age reporting incomplete; it does not block proven\nsupersession. Run age never substitutes for head-commit age.\n\nA failed `gh run list` (queue fetch) is propagated as\n`stats[\"queue_fetch_failed\"]=True`, NOT silently turned into a healthy\nempty success. The CLI exits nonzero on queue fetch failure.\n\n### 4. PR association — branch names that collide between forks\nBranch-name lookup is **never** used to bind a run to a PR. The script\nreads `actions\u002Fruns\u002F{id}.pull_requests` (the only authoritative pointer).\nTwo forks pushing a branch named `feature\u002Fx` will not cross-bind the run\nto the wrong PR.\n\n- The audit requires **exactly one** PR association (0 or >1 ⇒ UNKNOWN,\n  `audit_incomplete=True`). There is no \"pick the first\" fallback.\n- Identity between the run's PR pointer and the fetched `pulls\u002F{n}`\n  record is verified by the stable **numeric `repo.id`**. The live\n  shape of `actions\u002Fruns\u002F{id}.pull_requests[].head.repo` is\n  `{id, name, url}` (no `full_name`); requiring `full_name` would mark\n  every real run unknown. The `pulls\u002F{n}.head.repo` record carries\n  `{id, full_name, name, ...}` — match by `id`.\n- Absent or mismatched `repo.id` ⇒ UNKNOWN. The association base repo ID,\n  run repository ID, and fetched PR base repo ID must all be present and equal.\n  PR number plus base repository identifies the PR; head ref is not used as\n  an alternative identity. Historical association head SHA may differ from\n  the current tip and is not required to equal it.\n\n### 5. Per-item refresh before cancellation\nBefore every individual `gh run cancel`, the script re-fetches the run\nrecord and the exact PR for PR events, re-runs the\n**same pure classifier** the audit used, and only cancels if the verdict\nis still CANCEL. If state moved on between audit time and mutation\ntime, the candidate is dropped.\n\nBoth audit and refresh use the same run-response validation:\n- Run IDs, PR numbers, and repository IDs must be positive JSON integers;\n  strings, booleans, floats, zero, and negative values are rejected.\n- `data.id` MUST equal the requested `run_id` (mismatched id ⇒ drop,\n  even if the rest looks valid).\n- `head_sha`, `head_branch`, `event`, `path`, and `status` must be nonempty\n  strings; `status` must be\n  `queued` before mutation.\n- `repository` must contain a nonempty `id` and `full_name`;\n  `full_name` must equal the requested `OWNER\u002FREPO`. Missing or mismatched\n  identity keeps the audit row incomplete and prevents cancellation.\n- PR runs require exactly one structurally valid raw `pull_requests`\n  association before normalization (malformed entries are never dropped), with matching\n  PR number and numeric `head.repo.id`, plus equal association\u002Frun\u002Ffetched-PR\n  base repository IDs. Incomplete identity or lookups keep the run.\n  Push events remain ambiguous and are never cancellation candidates.\n\nEvery mode requires `superseded=True` before cancellation. Neither old\ncommits nor MERGED\u002FCLOSED state authorizes cancellation of current-head\nwork, which may include legitimate cleanup or deployment after closure.\nThe same classifier is reused at mutation time.\n\n## Protected Branches and Workflows\n\n- **Protected branches** (never cancelled automatically):\n  `main`, `master`, `production`, `staging`, `release`, `deploy`.\n- **Workflow cancellation is opted-in via `--allow-workflow PATH`**\n  (repeatable). The default is an empty allowlist, which keeps every\n  workflow — i.e. **no workflow is cancellable out of the box**. Operators\n  must explicitly enumerate the exact normalized workflow paths they\n  consider safe to cancel.\n- **Workflow protection is opt-in via `--protect-workflow PATH`** (repeatable).\n  `--allow-workflow` enables cancellation; `--protect-workflow` protects\n  even if the same path is in `--allow-workflow`. The two flags are\n  independent.\n- The `@\u003Cref>` suffix on a workflow path (e.g.\n  `release.yml@refs\u002Fheads\u002Ffeature\u002Fx`, `deploy.yml@v2`) is stripped\n  before matching via `partition('@')[0]` — refs containing slashes are\n  preserved.\n- Reusable workflows invoked via `workflow_call` are protected by\n  **event semantics**, not by fuzzy name matching.\n\n---\n\n## Tooling & Command Syntax\n\nThe skill includes a pre-built, standalone Python helper. Resolve the\nskill root via the standard Claude home convention and substitute in\nthe commands below:\n\n```bash\n\"${CLAUDE_HOME:-$HOME\u002F.claude}\u002Fskills\u002Fci-queue-trim\u002Fscripts\u002Fci_queue_trim.py\"\n```\n\nThis resolves the helper under the active Claude home on both Linux and macOS.\n\n### 1. Dry-Run Audit (Default)\nInspects the queue, classifies each run via the pure classifier, and\nprints cancel candidates without cancelling anything. Explicit `--dry-run`\nalso overrides `--cancel` if both flags are supplied:\n```bash\npython3 ~\u002F.claude\u002Fskills\u002Fci-queue-trim\u002Fscripts\u002Fci_queue_trim.py\n```\n\n### 2. Execute Cancellations\nEach candidate is re-fetched and re-classified immediately before its\n`gh run cancel` call:\n```bash\npython3 ~\u002F.claude\u002Fskills\u002Fci-queue-trim\u002Fscripts\u002Fci_queue_trim.py \\\n    --allow-workflow .github\u002Fworkflows\u002Fci.yml --cancel\n```\n\n### 3. Superseded-Only Compatibility Flag\n`--superseded-only` remains accepted for existing callers. The default now\nhas the same cancellation rule: only proven obsolete heads are eligible.\nMatching heads remain queued regardless of PR state or commit age.\n`pull_request_target` runs are always kept because their SHA is base-side.\n```bash\npython3 ~\u002F.claude\u002Fskills\u002Fci-queue-trim\u002Fscripts\u002Fci_queue_trim.py \\\n    --allow-workflow .github\u002Fworkflows\u002Fci.yml --superseded-only --cancel\n```\n\n### 4. Enable Cancellation for Specific Workflows\n`--allow-workflow PATH` (repeatable) opts a workflow INTO cancellation.\nDefault is empty (no workflow cancellable). Use `--protect-workflow PATH`\nto also keep a path safe even if it was added to the allowlist.\n```bash\npython3 ~\u002F.claude\u002Fskills\u002Fci-queue-trim\u002Fscripts\u002Fci_queue_trim.py \\\n    --allow-workflow .github\u002Fworkflows\u002Fci.yml \\\n    --allow-workflow .github\u002Fworkflows\u002Flint.yml@v2 \\\n    --protect-workflow .github\u002Fworkflows\u002Fci.yml \\\n    --cancel\n```\n\n### 5. Customize Report Age Threshold and Target Repo\nThe age threshold affects reporting only; cancellation still requires proven\nsupersession and an explicitly allowed workflow. Without `--repo`, the target is\n`$GITHUB_REPOSITORY`, else the repository `gh repo view` resolves from the current\ndirectory; with neither, the script exits non-zero naming `GITHUB_REPOSITORY`.\n```bash\npython3 ~\u002F.claude\u002Fskills\u002Fci-queue-trim\u002Fscripts\u002Fci_queue_trim.py \\\n    --repo \u003Cowner>\u002F\u003Crepo> --max-age-hours 4 \\\n    --allow-workflow .github\u002Fworkflows\u002Fci.yml --cancel\n```\n\n### 6. Host & Colima Preflight (`--check-host`)\nChecks local macOS host conditions that cause runner starvation or\nadmission lockouts:\n```bash\npython3 ~\u002F.claude\u002Fskills\u002Fci-queue-trim\u002Fscripts\u002Fci_queue_trim.py --check-host\n```\n- **Colima Sockets:** Verifies `~\u002F.colima\u002F_lima\u002F_networks\u002Fuser-v2\u002Fuser-v2_fd.sock`\n  exists and is backed by exactly 1 active `limactl usernet` process.\n- **Host Disk Space:** Checks `\u002FSystem\u002FVolumes\u002FData` against the 7.0 GB\n  admission safety floor.\n\n### 7. Structured JSON Output (`--json`)\nStdout contains exactly one JSON object with `stats` and `runs`, including\nfor empty queues and queue-fetch errors. Human audit, host, dry-run, and\ncancellation messages go to stderr. Queue-fetch errors still exit nonzero;\ncancellation acceptance is reported on stderr and is not terminal-state proof.\nThis contract also applies with `--cancel`, `--dry-run`, and `--check-host`:\n```bash\npython3 ~\u002F.claude\u002Fskills\u002Fci-queue-trim\u002Fscripts\u002Fci_queue_trim.py --json\n```\nEach row carries:\n`run_id, name, branch, event, pr_number, pr_state, head_commit_age,\npr_updated_age, deceptive_delta, superseded, audit_incomplete, verdict,\nreason`. `head_commit_age` is the actual immutable committer-timestamp\nage (reporting only). `pr_updated_age` is the PR\n`updated_at` age, reported for visibility only — not used for\ndecisions.\n\n---\n\n## Diagnostic Follow-up\n\n### 1. Colima Networking\nHost-health observations are diagnostic hints, not proof that a process or\nsocket is orphaned. Resolve the host Colima installation and its owning\nconfiguration; inspect exact process arguments, socket ownership, and active\nVM connections using that installation's read-only status tools. Any repair\nmust follow the owning service instructions and normal authorization boundary\nwith exact validated targets. This skill does not authorize termination,\nsocket removal, or service restart.\n\n### 2. Host Disk Floor\nA low-space observation does not identify safe deletion targets. Follow the\nhost's disk-diagnosis owner instructions, attribute usage to exact paths, and\ncheck their owners and active users. Cleanup requires a separate authorized\nscope with validated targets; this portable queue skill provides no deletion\nrecipe.\n\n### 3. Self-Hosted Runner Capacity\nRunner health belongs to the runner installation. Resolve the actual\n`ez-gh-actions` repository path and read its instructions before invoking its\n`doctor-runner` checker. That checker is not included in this portable skill;\nthere is no working-directory-relative command here. Report observed worker\nexecution per configured slot using the owning fleet contract; cycling alone\nis not execution proof.\n\n### 4. Audit-Incomplete Runs\nIf a run is reported with `audit_incomplete=True`, the script could not\nverify its PR\u002Fbranch\u002Fcommit at audit time. To investigate:\n```bash\ngh api repos\u002F\u003Cowner>\u002F\u003Crepo>\u002Factions\u002Fruns\u002F\u003Crun_id> | jq '.event, .head_sha, .pull_requests'\ngh api repos\u002F\u003Cowner>\u002F\u003Crepo>\u002Fpulls\u002F\u003Cpr_number> | jq '.head.sha, .state'\n```\nDo **not** manually cancel an `audit_incomplete` run unless you have\nindependently confirmed the head SHA mismatch.\n\n---\n\n## Architecture\n\nThe script is structured around one **pure classifier** (`classify_run`)\nthat consumes pre-fetched facts and returns a `Classification` namedtuple\n(`verdict, superseded, audit_incomplete, reason, pr_state`):\n\n- `audit_queue` fetches each run's record + the exact PR (via the run\n  detail's `pull_requests` array),\n  then calls `classify_run` once per run.\n- `cancel_with_per_item_refresh` re-runs the same fetch + classifier\n  pipeline per candidate immediately before each `gh run cancel`.\n\nBecause the same classifier is reused, audit-time verdicts and\npre-mutation verdicts cannot drift.",{"name":5,"type":55,"owner":56,"scope":57,"version":58,"triggers":59,"description":66,"allowed-tools":67},"skill","$USER","global","1.2.0",[33,60,61,62,63,64,65],"trim ci queue","cancel dormant ci runs","clean up ci queue","trim queued jobs","ci backlog cleanup","pr inactivity trim","Audit and trim queued GitHub Actions CI workflow runs whose head SHA is proven obsolete. PR association comes from `actions\u002Fruns\u002F{id}.pull_requests` (the only authoritative pointer); branch names that collide between forks MUST NOT cross-bind runs to a PR. Event semantics split pull_request from pull_request_target (the latter uses base-side SHA, so a tip advance is NOT a supersede signal) and merge_group \u002F unknown events skip the generic stale-head comparison. Per-item re-validation right before each `gh run cancel` catches concurrent state advances. Workflow importance is decided by an explicit configured allowlist (empty by default), never by fuzzy substring heuristics.\n",[44,68,69],"Read","Write","main","8144f00ebafc4306264c63239e4b9fa42e48a90e",".claude\u002Fskills\u002Fci-queue-trim",0,"https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills","https:\u002F\u002Fgithub.com\u002Fjleechanorg","2026-11-14 14:55:35",{"source":9,"skillName":5,"commands":78,"prompt":88,"zipAvailable":89},[79,82,85],{"tool":80,"command":81},"npx","npx skills add jleechanorg\u002Fjleechan-skills --skill ci-queue-trim",{"tool":83,"command":84},"bunx","bunx skills add jleechanorg\u002Fjleechan-skills --skill ci-queue-trim",{"tool":86,"command":87},"pnpm","pnpm dlx skills add jleechanorg\u002Fjleechan-skills --skill ci-queue-trim","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fci-queue-trim\u002FSKILL.md",true,[91,97],{"path":92,"resourceType":93,"resourceTypeDesc":94,"sizeBytes":95,"sourceHtmlUrl":96},"scripts\u002Fci_queue_trim.py","SCRIPT","脚本",39342,"https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fci-queue-trim\u002Fscripts\u002Fci_queue_trim.py",{"path":98,"resourceType":93,"resourceTypeDesc":94,"sizeBytes":99,"sourceHtmlUrl":100},"tests\u002Ftest_ci_queue_trim.py",72261,"https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fci-queue-trim\u002Ftests\u002Ftest_ci_queue_trim.py",[102,110,117,125,133,142],{"skillNo":103,"name":104,"nameZh":13,"description":105,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":109},"01M7DRVZXXMGY4G81K5GVF4V20","disk-reclaim-playbook","Use Disk Magician to diagnose disk growth or qualify cleanup on macOS or Linux.","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fdisk-reclaim-playbook\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":111,"name":112,"nameZh":13,"description":113,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":109},"01M7B63PNTT2TY78RFKHD8SP3X","claudea-bench","Compare `claudea` and normal `claude` on a fair split of comparable work by default; use `--strict` for duplicate runs of the exact same task.","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fclaudea-bench\u002FSKILL.md",[],[],{"skillNo":118,"name":119,"nameZh":13,"description":120,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":124},"01M7622KQJ32AV4K5BXEMVSSEB","pr","Alias for the canonical pr-lifecycle PR workflow skill (\u002Fpr-workflow, \u002Fprw).","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fpr\u002FSKILL.md",[],[],"2026-11-12 13:55:43",{"skillNo":126,"name":127,"nameZh":13,"description":128,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":129,"categories":130,"keywords":131,"publishedAt":132},"01M7432W92AKC4D1TKJ00VCMMT","whisper","OpenAI's general-purpose speech recognition model. Supports 99 languages, transcription, translation to English, and language identification. Six model sizes from tiny (39M params) to large (1550M params). Use for speech-to-text, podcast transcription, or multilingual audio processing. Best for robust, multilingual ASR.","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills_archive\u002F2026-11-09-no-usage-evidence\u002Fwhisper\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":134,"name":135,"nameZh":13,"description":136,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":137,"licenseFileUrl":138,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":132},"01M7432T6BN1A9SHB8RBQR5EMP","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills_archive\u002F2026-11-09-no-usage-evidence\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills_archive\u002F2026-11-09-no-usage-evidence\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":143,"name":144,"nameZh":13,"description":145,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":146,"categories":147,"keywords":148,"publishedAt":132},"01M7432NDC7S6C6MX7M6RW8CTT","pr-report","This skill should be used when the user asks for a PR report, PR audit, PR delta analysis, \u002Fpr-report, or wants per-PR summary with delta files\u002Flines. Generates a structured report for one or more open PRs covering purpose, files changed, +\u002F− line counts, \u002Fcode-standards + \u002Fthermo review findings, \u002Fponytail simplification opportunities, file-overlap combination candidates, and \u002Fgreen status per pr-green-definition. Output: machine-readable JSONL + human-readable markdown. Read-only by default; can apply simplifications if user opts in.","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills_archive\u002F2026-11-09-no-usage-evidence\u002Fpr-report\u002FSKILL.md",[],[]]