[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CZ6N4RQDKTR9Y3JSVR1VS1":3,"skill-same:01M7CZ6N4RQDKTR9Y3JSVR1VS1":60},{"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":32,"commitSha":33,"skillDirectory":34,"forksCount":35,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":36,"ownerBlogUrl":37,"ownerDescription":38,"updatedAt":39,"install":40,"resources":53},"01M7CZ6N4RQDKTR9Y3JSVR1VS1","padosoft-ci-workflow-gates",null,"Use this skill when writing or reviewing a CI workflow or a gate that guards a merge — a GitHub Actions file, a required check, a validator script, a secret scan, a branch or tag ruleset — and whenever the user says a check went green without checking anything, a workflow did not start, a label does not trigger the run, CI minutes are being burned on every push, a required check cannot run before merge, or a rule can be bypassed. It covers what actually makes a gate a gate, the trigger and permission semantics that silently replace your defaults, and the cost tiering. Do not use it to design deployment pipelines, to pick a CI provider, or to debug a failing application test.","padosoft\u002Fskills","padosoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F10467753?v=4","01M7CZ3FRSM851DK225E3KK2VF","01M7CZ3FSY016E21VS6EABM21V",1,"MIT","https:\u002F\u002Fgithub.com\u002Fpadosoft\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fpadosoft-ci-workflow-gates\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: padosoft-ci-workflow-gates\ndescription: >-\n  Use this skill when writing or reviewing a CI workflow or a gate that guards a merge — a GitHub Actions\n  file, a required check, a validator script, a secret scan, a branch or tag ruleset — and whenever the user\n  says a check went green without checking anything, a workflow did not start, a label does not trigger the\n  run, CI minutes are being burned on every push, a required check cannot run before merge, or a rule can be\n  bypassed. It covers what actually makes a gate a gate, the trigger and permission semantics that silently\n  replace your defaults, and the cost tiering. Do not use it to design deployment pipelines, to pick a CI\n  provider, or to debug a failing application test.\nlicense: MIT\ncompatibility: >-\n  GitHub Actions for the trigger and ruleset specifics; the reasoning about what makes a gate real applies to\n  any CI system.\nmetadata:\n  version: 0.4.0\n  author: Padosoft\n  summary: A gate that cannot fail is not a gate.\n  profiles: devops\n  scope: project\n  repository: https:\u002F\u002Fgithub.com\u002Fpadosoft\u002Fskills\n  keywords: ci, github actions, gate, workflow, permissions, ruleset, secret scanning, required checks, supply chain, signing\n---\n\n# CI workflow gates\n\n**A gate that cannot fail is not a gate**, and the ways one stops being able to fail are rarely visible in\nthe diff that broke it. Most of what follows is a green check that had not looked at anything.\n\n---\n\n## 1. The gate has to be able to see the whole contract\n\nA manifest that lists what must exist, but **omits itself and its own workflow**, stays green after half the\ncontract is deleted. Enumerate every mandatory rule, workflow, validator and file — including the ones doing\nthe checking.\n\nRelated shapes of the same failure:\n\n- **Presence-only matching accepts an empty contract.** Checking that a `Tests:` marker exists says nothing\n  about whether anything follows it. Require non-empty content, and accept both inline prose and a following\n  block, because documents legitimately use both.\n- **A detector as strict as the parser cannot see malformed input.** If the strict parser only accepts\n  `M01-S02`, a candidate detector built on the same pattern is blind to `M01-SO2` and `M01-S100` — exactly\n  the typos it exists to catch. **The candidate detector must be broader than the parser**, then report what\n  it found that the parser rejected.\n- **Validating the items does not validate the set.** Unique ids and well-formed entries still allow one\n  entry to silently disappear. If the count is part of the contract, version the manifest and assert it.\n\n## 2. A security gate fails closed, or it is decoration\n\n```text\n❌ files larger than N are skipped      → a credential in a large file walks through\n✅ scan everything within the limit, and REJECT what exceeds it\n```\n\nSkipping is the failure mode that looks like handling. Anything the scanner cannot process is a **finding**,\nnot a pass.\n\nThree traps that come from the filesystem rather than from the rule:\n\n- **Symlinks escape.** Reading a candidate path before checking its link metadata lets a tracked symlink\n  point outside the repository. Check link metadata first — and check again *after* creating output\n  directories, because an intermediate link can redirect a write that is lexically inside the repo.\n- **Path listings are display forms.** Tools quote or escape non-ASCII and control characters in their\n  human-readable output; treating that form as a literal path makes the file silently unreachable, so the\n  scanner reports clean on a file it never opened. Use the tool's machine-readable output.\n- **Encoding hides patterns.** Decoding every stream as UTF-8 leaves NUL bytes between ASCII characters of a\n  UTF-16 file, and regexes stop matching. Scan the decoded content **and** a NUL-normalised view.\n\n## 3. Do not regex a structured file\n\nA workflow, a manifest, a front matter block: parse it, then traverse the parsed structure.\n\nRegex over raw text cannot tell an executable expression from a comment that mentions it, so a safety comment\nbecomes a false positive — and, worse, a real occurrence inside a quoted string is missed. It also breaks on\nlayouts that are perfectly valid: a key wrapped across lines, keys in a different order.\n\nAnd it misses what is not at the top level: **validating only the root `permissions` map misses a job-level\none**, which replaces the safe root grant rather than narrowing it. Validate the root and **every job**.\n\n## 4. Trigger semantics that replace your defaults\n\n- **Declaring `pull_request.types` replaces the default list.** A workflow that declares only\n  `labeled, unlabeled` no longer runs on `opened`, `reopened` or `synchronize` — a new PR, or a pushed head,\n  gets no run at all. List every type you still need.\n- **A label-gated job is inert if the trigger does not subscribe to the label event.** The condition can be\n  perfectly correct and never evaluated, because adding the label starts no run.\n- **A `branches:` filter on a `pull_request` trigger matches the PR's base branch, not its head.** Pull\n  requests stacked on a non-default branch get no run at all, and a rule of \"merge when no required check\n  fails\" then passes vacuously, because there are no checks to fail. List the intermediate base patterns, or\n  drop the filter, and give those branches the same rules (§7).\n- **A required check cannot run on the merge commit before the merge exists.** Gating on \"the exact merge\n  SHA\" makes the pre-merge gate impossible: require the checks on the final PR **head** SHA.\n- **Pass the base SHA in from the event**, and verify or fetch it. Building a diff-based gate on an assumed\n  remote-tracking ref works until a checkout mode changes.\n- **Normalise and compare a complete condition**, never a substring: two substring checks are both satisfied\n  by an impossible `A && B`, and the job never runs.\n- **Requiring a script by name in the run text accepts `echo script.ps1`.** Compare the parsed command.\n\n## 4b. Path and topology traps that end green\n\nA step can succeed having looked at the wrong place. None of these fails the job.\n\n- **`defaults.run.working-directory` applies to `run:` steps, not to `uses:` steps.** A\n  `cache-dependency-path`, an artifact `path` or a `hashFiles()` expression is resolved from the repository\n  root: write it relative to the root even when every script runs in a subfolder.\n- **An artifact upload drops dotfiles and dot-directories by default and still succeeds.** A report folder\n  with a leading dot arrives empty. Opt in to hidden files explicitly, and have the job that consumes the\n  artifact fail on an empty one.\n- **The setup step validates its cache path as it runs**, so an `if:` guard written on a later step cannot\n  protect it. Put the guard on the setup step itself, or give it a path that always exists.\n- **\"Build once, reuse\" has to be checked against the job topology.** Every job starts on a fresh runner, so\n  a job that needs the build output gets nothing from `needs:` alone, which only orders the jobs. The build\n  job uploads the output as an artifact and the consumer downloads it (or rebuilds). Draw the dependency; do\n  not assume the order.\n- **A `push` and a `pull_request` trigger on the same branch run the workflow twice** for every commit on a\n  pull request branch. Restrict `push` to branches that are not pull request heads.\n\n## 5. Conclusions are not the whole result\n\nA job can succeed **and** emit an annotation — a deprecated runtime, a rate limit, a fallback. Inspect\nannotations as part of the gate, not only the conclusion, or the deprecation notice nobody read becomes a\nbroken action six months later.\n\nPin actions to an **immutable SHA**, not a floating tag, and check that the tag you pinned is the current\nofficial one before freezing it.\n\n## 5b. Supply chain: what runs is not what you reviewed\n\nPinning the action is the start of it, not the end.\n\n- **Hardened runtime flags do not pin the bytes.** Read-only filesystems, dropped capabilities and\n  no-new-privileges protect the *invocation*; a mutable image tag can change the executable between two\n  runs. Require an immutable digest, and fail **before** dispatch when the operator has not supplied one.\n  Render deployment templates with `repository@digest`, and keep the tag fallback as a visibly\n  non-production choice.\n- **An integrity hash is not an identity.** It proves the bytes did not change, not who produced them.\n  Verifying a signature proves the supplied key signed it — **pin the expected key identity too**, or an\n  authentic document signed by the wrong key passes. Rotate the approved key and its identifier together.\n- **A parsed signing bundle is not a trust decision.** Verification has to bind the payload, the certificate\n  identity, the issuer and the transparency evidence, and fail closed on a malformed or policy-less bundle.\n  Pin a maintained verifier and track its advisories rather than reimplementing the cryptography.\n- **A signature on a manifest does not cover the content the manifest lists.** Load listed resources before\n  the first use, reject missing paths, duplicate ids and symlink escapes, and expand only explicit\n  references. Signing policy belongs at the **import** boundary, where the content enters.\n- **A clean dependency dashboard is not a gate.** Run the audit on every lockfile change, and re-run the\n  build, the bundle and the full suite after a toolchain upgrade — the findings that matter are transitive\n  and invisible to application tests. One repository can hold **more than one dependency perimeter**.\n- **Test the published bundle, not the working tree.** Assets resolve differently once packaged, an offline\n  or air-gapped bundle has its own release identity, and an optional driver pulled into the main bundle\n  changes what every user downloads. The shipped examples are part of the supply chain too.\n- **A package ships what the ignore list lets through.** Everything not export-ignored (or not in the\n  `files` whitelist) goes to consumers, and a documentation site or a development lock file then shows up in\n  their scanners as advisories against your runtime package. List the real archive\n  (`git archive HEAD | tar -t`, `npm pack --dry-run`) instead of reading the ignore file. An install from\n  source bypasses the filter altogether, so it is a courtesy to dist installs, not a boundary.\n\n## 5c. Scanners earn their place by being read\n\nA scanner nobody reads is a line in a bill. Four decisions make the difference:\n\n- **Block on the diff, report on the history.** A secret introduced now must not merge; the accumulated\n  history starts as a report, because a job born red and left red is disabled within a week — and then the\n  diff is unprotected too. It becomes blocking after the triage.\n- **Run dependency audits on the pull request *and* on a schedule.** An advisory published tomorrow concerns\n  code nobody is touching, so a pull-request-only audit never sees it.\n- **Audit the lock file of an application, and do not exclude development dependencies** when the bundler\n  puts them in the shipped bundle. \"Which section is it declared in\" is the wrong question; \"does it reach\n  the bundle\" is the right one.\n- **A library that commits no lock is exposed by its range.** Advisories against a library are evaluated\n  against the manifest range, so a range such as `^4 || ^5` that admits a vulnerable release keeps the alert\n  open however clean your own install is. Raise the floor until the range excludes it, and verify with an\n  audit that includes the development perimeter. The reflex to resist is reaching for the lock file, which\n  a library does not commit.\n- **Ignore the unfixable, explicitly.** Output that contains items nobody can act on teaches people to skip\n  the output.\n\nAutomated dependency updates: group patches and minors, **exclude majors**, and treat the bot's lock file as\na notification — whoever lands it regenerates the lock in a stable environment. Check the first run of any\nnew ecosystem rather than assuming it worked: a path that matches nothing reports success.\n\n## 6. CI cost is part of the design\n\nRerunning every integration and browser matrix on every push makes feedback progressively slower and spends\nminutes without improving the loop.\n\nTwo tiers:\n\n| Tier | Runs on | Contains |\n|---|---|---|\n| **Fast** | every push | lint, types, unit, the cheap validators |\n| **Extended** | a label, a schedule, or the merge queue | integration, browser, matrix |\n\nThen make sure the extended tier's trigger actually subscribes to the label event (§4) and that the required\nchecks are the ones that can run pre-merge (§4).\n\n## 7. Repository rules leave gaps at the edges\n\n- **Protecting only the default branch** leaves every intermediate branch updatable directly, so a review\n  requirement between feature and integration branches is bypassed by pushing to the integration branch.\n  Apply a companion ruleset to the intermediate pattern.\n- **Tag protection prevents update and deletion but does not reject an unsigned tag** created by an\n  authorised actor. Verify the annotated tag's signature if that is what you meant.\n- **A bypass actor on one combined ruleset bypasses everything in it.** Split creation from\n  immutability so a bypass for one does not grant the other.\n- **\"Require a pull request\" plus a separate \"restrict updates\" rule, with no bypass actor, can lock out the\n  maintainers** and the platform itself from merging a valid PR. Test the rule with the account that will\n  have to use it.\n- **A prefix check accepts refs the VCS cannot create** (`..`, trailing dot) and refs that are nested deeper\n  than intended — `task\u002Fa\u002Fb` passes a `task\u002F` prefix check while breaking a one-segment topology. Validate\n  the format with the VCS's own checker, and validate the segment count separately. Calling an external\n  checker once per item can be slow: batch it, or check the format in-process and shell out once.\n\n---\n\n## Gotchas\n\n- **The gate that never fired is not evidence of health.** Before trusting a new check, make it fail on\n  purpose and watch the pipeline go red. A check that has only ever been green has not been tested.\n- **Generated evidence is a versioned schema**, not a shape to guess. An ad hoc assertion guessing camelCase\n  against a snake_case schema rejects valid output — and the fix is to read the schema, not to add the other\n  spelling.\n- **A gate that lives on someone's machine is not a gate.** It must be in the repository or installed\n  reproducibly; anything else is supplementary and must be labelled as such.\n- **Validator startup dominates its own runtime** when each case spawns a fresh repository and process, and\n  more so where endpoint protection inspects every launch. Batch the cases rather than optimising the checks.\n- **When the platform is down, a strict remote-first sequence idles everything.** Decide in advance what\n  local work may continue and what must wait for the gate, and write it down before you need it.\n\n## Checklist\n\n- [ ] The manifest enumerates every mandatory file, workflow and validator — including itself\n- [ ] Contracts require non-empty content, not just a marker\n- [ ] Candidate detectors are broader than the strict parser, and report the difference\n- [ ] Security gates fail closed; nothing is skipped silently\n- [ ] Structured files parsed and traversed, never regexed\n- [ ] `permissions` validated at root **and** every job\n- [ ] `pull_request.types` lists every type still needed; label triggers subscribed\n- [ ] `pull_request` branch filter read as a filter on the base: stacked pull requests still get a run\n- [ ] Required checks gate the PR head SHA, not a merge SHA that does not exist yet\n- [ ] Paths in `uses:` steps written from the repository root; no `push` plus `pull_request` double run\n- [ ] A job that consumes build output downloads the artifact the build job uploaded (`needs:` only orders\n  them); hidden files uploaded on purpose\n- [ ] Annotations inspected, not just conclusions; actions pinned to SHAs\n- [ ] Fast\u002Fextended tiers, with the extended trigger actually wired\n- [ ] Images and artifacts pinned by digest; key identity pinned alongside the signature\n- [ ] Dependency audit on every lockfile change; the published bundle tested, not the tree\n- [ ] Published archive listed, not inferred from the ignore file; a library's range raised past an advisory\n- [ ] Rulesets cover intermediate branches; tag creation and immutability split\n\n## Final report\n\n```\nWorkflow\u002Fgate: \u003Cname>\nTriggers: \u003Cevents and types> — label-gated? subscribed? yes\u002Fno\nPermissions: root \u003C…> · jobs \u003C…>\nRequired checks: \u003Cwhich, on which SHA>\nFail-closed: \u003Cwhat happens to what the gate cannot process>\nCost tier: fast \u003C…> | extended \u003C…>\nProven by failing on purpose: yes | no\n```\n","# CI workflow gates\n\n**A gate that cannot fail is not a gate**, and the ways one stops being able to fail are rarely visible in\nthe diff that broke it. Most of what follows is a green check that had not looked at anything.\n\n---\n\n## 1. The gate has to be able to see the whole contract\n\nA manifest that lists what must exist, but **omits itself and its own workflow**, stays green after half the\ncontract is deleted. Enumerate every mandatory rule, workflow, validator and file — including the ones doing\nthe checking.\n\nRelated shapes of the same failure:\n\n- **Presence-only matching accepts an empty contract.** Checking that a `Tests:` marker exists says nothing\n  about whether anything follows it. Require non-empty content, and accept both inline prose and a following\n  block, because documents legitimately use both.\n- **A detector as strict as the parser cannot see malformed input.** If the strict parser only accepts\n  `M01-S02`, a candidate detector built on the same pattern is blind to `M01-SO2` and `M01-S100` — exactly\n  the typos it exists to catch. **The candidate detector must be broader than the parser**, then report what\n  it found that the parser rejected.\n- **Validating the items does not validate the set.** Unique ids and well-formed entries still allow one\n  entry to silently disappear. If the count is part of the contract, version the manifest and assert it.\n\n## 2. A security gate fails closed, or it is decoration\n\n```text\n❌ files larger than N are skipped      → a credential in a large file walks through\n✅ scan everything within the limit, and REJECT what exceeds it\n```\n\nSkipping is the failure mode that looks like handling. Anything the scanner cannot process is a **finding**,\nnot a pass.\n\nThree traps that come from the filesystem rather than from the rule:\n\n- **Symlinks escape.** Reading a candidate path before checking its link metadata lets a tracked symlink\n  point outside the repository. Check link metadata first — and check again *after* creating output\n  directories, because an intermediate link can redirect a write that is lexically inside the repo.\n- **Path listings are display forms.** Tools quote or escape non-ASCII and control characters in their\n  human-readable output; treating that form as a literal path makes the file silently unreachable, so the\n  scanner reports clean on a file it never opened. Use the tool's machine-readable output.\n- **Encoding hides patterns.** Decoding every stream as UTF-8 leaves NUL bytes between ASCII characters of a\n  UTF-16 file, and regexes stop matching. Scan the decoded content **and** a NUL-normalised view.\n\n## 3. Do not regex a structured file\n\nA workflow, a manifest, a front matter block: parse it, then traverse the parsed structure.\n\nRegex over raw text cannot tell an executable expression from a comment that mentions it, so a safety comment\nbecomes a false positive — and, worse, a real occurrence inside a quoted string is missed. It also breaks on\nlayouts that are perfectly valid: a key wrapped across lines, keys in a different order.\n\nAnd it misses what is not at the top level: **validating only the root `permissions` map misses a job-level\none**, which replaces the safe root grant rather than narrowing it. Validate the root and **every job**.\n\n## 4. Trigger semantics that replace your defaults\n\n- **Declaring `pull_request.types` replaces the default list.** A workflow that declares only\n  `labeled, unlabeled` no longer runs on `opened`, `reopened` or `synchronize` — a new PR, or a pushed head,\n  gets no run at all. List every type you still need.\n- **A label-gated job is inert if the trigger does not subscribe to the label event.** The condition can be\n  perfectly correct and never evaluated, because adding the label starts no run.\n- **A `branches:` filter on a `pull_request` trigger matches the PR's base branch, not its head.** Pull\n  requests stacked on a non-default branch get no run at all, and a rule of \"merge when no required check\n  fails\" then passes vacuously, because there are no checks to fail. List the intermediate base patterns, or\n  drop the filter, and give those branches the same rules (§7).\n- **A required check cannot run on the merge commit before the merge exists.** Gating on \"the exact merge\n  SHA\" makes the pre-merge gate impossible: require the checks on the final PR **head** SHA.\n- **Pass the base SHA in from the event**, and verify or fetch it. Building a diff-based gate on an assumed\n  remote-tracking ref works until a checkout mode changes.\n- **Normalise and compare a complete condition**, never a substring: two substring checks are both satisfied\n  by an impossible `A && B`, and the job never runs.\n- **Requiring a script by name in the run text accepts `echo script.ps1`.** Compare the parsed command.\n\n## 4b. Path and topology traps that end green\n\nA step can succeed having looked at the wrong place. None of these fails the job.\n\n- **`defaults.run.working-directory` applies to `run:` steps, not to `uses:` steps.** A\n  `cache-dependency-path`, an artifact `path` or a `hashFiles()` expression is resolved from the repository\n  root: write it relative to the root even when every script runs in a subfolder.\n- **An artifact upload drops dotfiles and dot-directories by default and still succeeds.** A report folder\n  with a leading dot arrives empty. Opt in to hidden files explicitly, and have the job that consumes the\n  artifact fail on an empty one.\n- **The setup step validates its cache path as it runs**, so an `if:` guard written on a later step cannot\n  protect it. Put the guard on the setup step itself, or give it a path that always exists.\n- **\"Build once, reuse\" has to be checked against the job topology.** Every job starts on a fresh runner, so\n  a job that needs the build output gets nothing from `needs:` alone, which only orders the jobs. The build\n  job uploads the output as an artifact and the consumer downloads it (or rebuilds). Draw the dependency; do\n  not assume the order.\n- **A `push` and a `pull_request` trigger on the same branch run the workflow twice** for every commit on a\n  pull request branch. Restrict `push` to branches that are not pull request heads.\n\n## 5. Conclusions are not the whole result\n\nA job can succeed **and** emit an annotation — a deprecated runtime, a rate limit, a fallback. Inspect\nannotations as part of the gate, not only the conclusion, or the deprecation notice nobody read becomes a\nbroken action six months later.\n\nPin actions to an **immutable SHA**, not a floating tag, and check that the tag you pinned is the current\nofficial one before freezing it.\n\n## 5b. Supply chain: what runs is not what you reviewed\n\nPinning the action is the start of it, not the end.\n\n- **Hardened runtime flags do not pin the bytes.** Read-only filesystems, dropped capabilities and\n  no-new-privileges protect the *invocation*; a mutable image tag can change the executable between two\n  runs. Require an immutable digest, and fail **before** dispatch when the operator has not supplied one.\n  Render deployment templates with `repository@digest`, and keep the tag fallback as a visibly\n  non-production choice.\n- **An integrity hash is not an identity.** It proves the bytes did not change, not who produced them.\n  Verifying a signature proves the supplied key signed it — **pin the expected key identity too**, or an\n  authentic document signed by the wrong key passes. Rotate the approved key and its identifier together.\n- **A parsed signing bundle is not a trust decision.** Verification has to bind the payload, the certificate\n  identity, the issuer and the transparency evidence, and fail closed on a malformed or policy-less bundle.\n  Pin a maintained verifier and track its advisories rather than reimplementing the cryptography.\n- **A signature on a manifest does not cover the content the manifest lists.** Load listed resources before\n  the first use, reject missing paths, duplicate ids and symlink escapes, and expand only explicit\n  references. Signing policy belongs at the **import** boundary, where the content enters.\n- **A clean dependency dashboard is not a gate.** Run the audit on every lockfile change, and re-run the\n  build, the bundle and the full suite after a toolchain upgrade — the findings that matter are transitive\n  and invisible to application tests. One repository can hold **more than one dependency perimeter**.\n- **Test the published bundle, not the working tree.** Assets resolve differently once packaged, an offline\n  or air-gapped bundle has its own release identity, and an optional driver pulled into the main bundle\n  changes what every user downloads. The shipped examples are part of the supply chain too.\n- **A package ships what the ignore list lets through.** Everything not export-ignored (or not in the\n  `files` whitelist) goes to consumers, and a documentation site or a development lock file then shows up in\n  their scanners as advisories against your runtime package. List the real archive\n  (`git archive HEAD | tar -t`, `npm pack --dry-run`) instead of reading the ignore file. An install from\n  source bypasses the filter altogether, so it is a courtesy to dist installs, not a boundary.\n\n## 5c. Scanners earn their place by being read\n\nA scanner nobody reads is a line in a bill. Four decisions make the difference:\n\n- **Block on the diff, report on the history.** A secret introduced now must not merge; the accumulated\n  history starts as a report, because a job born red and left red is disabled within a week — and then the\n  diff is unprotected too. It becomes blocking after the triage.\n- **Run dependency audits on the pull request *and* on a schedule.** An advisory published tomorrow concerns\n  code nobody is touching, so a pull-request-only audit never sees it.\n- **Audit the lock file of an application, and do not exclude development dependencies** when the bundler\n  puts them in the shipped bundle. \"Which section is it declared in\" is the wrong question; \"does it reach\n  the bundle\" is the right one.\n- **A library that commits no lock is exposed by its range.** Advisories against a library are evaluated\n  against the manifest range, so a range such as `^4 || ^5` that admits a vulnerable release keeps the alert\n  open however clean your own install is. Raise the floor until the range excludes it, and verify with an\n  audit that includes the development perimeter. The reflex to resist is reaching for the lock file, which\n  a library does not commit.\n- **Ignore the unfixable, explicitly.** Output that contains items nobody can act on teaches people to skip\n  the output.\n\nAutomated dependency updates: group patches and minors, **exclude majors**, and treat the bot's lock file as\na notification — whoever lands it regenerates the lock in a stable environment. Check the first run of any\nnew ecosystem rather than assuming it worked: a path that matches nothing reports success.\n\n## 6. CI cost is part of the design\n\nRerunning every integration and browser matrix on every push makes feedback progressively slower and spends\nminutes without improving the loop.\n\nTwo tiers:\n\n| Tier | Runs on | Contains |\n|---|---|---|\n| **Fast** | every push | lint, types, unit, the cheap validators |\n| **Extended** | a label, a schedule, or the merge queue | integration, browser, matrix |\n\nThen make sure the extended tier's trigger actually subscribes to the label event (§4) and that the required\nchecks are the ones that can run pre-merge (§4).\n\n## 7. Repository rules leave gaps at the edges\n\n- **Protecting only the default branch** leaves every intermediate branch updatable directly, so a review\n  requirement between feature and integration branches is bypassed by pushing to the integration branch.\n  Apply a companion ruleset to the intermediate pattern.\n- **Tag protection prevents update and deletion but does not reject an unsigned tag** created by an\n  authorised actor. Verify the annotated tag's signature if that is what you meant.\n- **A bypass actor on one combined ruleset bypasses everything in it.** Split creation from\n  immutability so a bypass for one does not grant the other.\n- **\"Require a pull request\" plus a separate \"restrict updates\" rule, with no bypass actor, can lock out the\n  maintainers** and the platform itself from merging a valid PR. Test the rule with the account that will\n  have to use it.\n- **A prefix check accepts refs the VCS cannot create** (`..`, trailing dot) and refs that are nested deeper\n  than intended — `task\u002Fa\u002Fb` passes a `task\u002F` prefix check while breaking a one-segment topology. Validate\n  the format with the VCS's own checker, and validate the segment count separately. Calling an external\n  checker once per item can be slow: batch it, or check the format in-process and shell out once.\n\n---\n\n## Gotchas\n\n- **The gate that never fired is not evidence of health.** Before trusting a new check, make it fail on\n  purpose and watch the pipeline go red. A check that has only ever been green has not been tested.\n- **Generated evidence is a versioned schema**, not a shape to guess. An ad hoc assertion guessing camelCase\n  against a snake_case schema rejects valid output — and the fix is to read the schema, not to add the other\n  spelling.\n- **A gate that lives on someone's machine is not a gate.** It must be in the repository or installed\n  reproducibly; anything else is supplementary and must be labelled as such.\n- **Validator startup dominates its own runtime** when each case spawns a fresh repository and process, and\n  more so where endpoint protection inspects every launch. Batch the cases rather than optimising the checks.\n- **When the platform is down, a strict remote-first sequence idles everything.** Decide in advance what\n  local work may continue and what must wait for the gate, and write it down before you need it.\n\n## Checklist\n\n- [ ] The manifest enumerates every mandatory file, workflow and validator — including itself\n- [ ] Contracts require non-empty content, not just a marker\n- [ ] Candidate detectors are broader than the strict parser, and report the difference\n- [ ] Security gates fail closed; nothing is skipped silently\n- [ ] Structured files parsed and traversed, never regexed\n- [ ] `permissions` validated at root **and** every job\n- [ ] `pull_request.types` lists every type still needed; label triggers subscribed\n- [ ] `pull_request` branch filter read as a filter on the base: stacked pull requests still get a run\n- [ ] Required checks gate the PR head SHA, not a merge SHA that does not exist yet\n- [ ] Paths in `uses:` steps written from the repository root; no `push` plus `pull_request` double run\n- [ ] A job that consumes build output downloads the artifact the build job uploaded (`needs:` only orders\n  them); hidden files uploaded on purpose\n- [ ] Annotations inspected, not just conclusions; actions pinned to SHAs\n- [ ] Fast\u002Fextended tiers, with the extended trigger actually wired\n- [ ] Images and artifacts pinned by digest; key identity pinned alongside the signature\n- [ ] Dependency audit on every lockfile change; the published bundle tested, not the tree\n- [ ] Published archive listed, not inferred from the ignore file; a library's range raised past an advisory\n- [ ] Rulesets cover intermediate branches; tag creation and immutability split\n\n## Final report\n\n```\nWorkflow\u002Fgate: \u003Cname>\nTriggers: \u003Cevents and types> — label-gated? subscribed? yes\u002Fno\nPermissions: root \u003C…> · jobs \u003C…>\nRequired checks: \u003Cwhich, on which SHA>\nFail-closed: \u003Cwhat happens to what the gate cannot process>\nCost tier: fast \u003C…> | extended \u003C…>\nProven by failing on purpose: yes | no\n```\n",{"name":5,"license":14,"metadata":23,"description":7,"compatibility":31},{"scope":24,"author":25,"summary":26,"version":27,"keywords":28,"profiles":29,"repository":30},"project","Padosoft","A gate that cannot fail is not a gate.","0.4.0","ci, github actions, gate, workflow, permissions, ruleset, secret scanning, required checks, supply chain, signing","devops","https:\u002F\u002Fgithub.com\u002Fpadosoft\u002Fskills","GitHub Actions for the trigger and ruleset specifics; the reasoning about what makes a gate real applies to any CI system.","main","8ff266762b08cab7f5be5551fa221309dc9db48b","skills\u002Fpadosoft-ci-workflow-gates",0,"https:\u002F\u002Fgithub.com\u002Fpadosoft","https:\u002F\u002Fwww.padosoft.com","Software House","2026-10-19 01:02:17",{"source":8,"skillName":5,"commands":41,"prompt":51,"zipAvailable":52},[42,45,48],{"tool":43,"command":44},"npx","npx skills add padosoft\u002Fskills --skill padosoft-ci-workflow-gates",{"tool":46,"command":47},"bunx","bunx skills add padosoft\u002Fskills --skill padosoft-ci-workflow-gates",{"tool":49,"command":50},"pnpm","pnpm dlx skills add padosoft\u002Fskills --skill padosoft-ci-workflow-gates","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fpadosoft\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fpadosoft-ci-workflow-gates\u002FSKILL.md",true,[54],{"path":55,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":58,"sourceHtmlUrl":59},"evals\u002Fqueries.json","REFERENCE","参考文档",1776,"https:\u002F\u002Fgithub.com\u002Fpadosoft\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fpadosoft-ci-workflow-gates\u002Fevals\u002Fqueries.json",[61,68,74,81,88,94],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":18},"01M7CZNKCTMWK7F2J6KKPAR8YM","report-opus","Writes the weekly status report from the team's tickets. Use when the user asks for the weekly report or a status summary. Do not use it for incident reports.","https:\u002F\u002Fgithub.com\u002Fpadosoft\u002Fskills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskill-audit\u002Fproject\u002Fdot-claude\u002Fskills\u002Freport-opus\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":18},"01M7CZNFEN8XK6S8NC6KGREYGS","report-haiku","https:\u002F\u002Fgithub.com\u002Fpadosoft\u002Fskills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskill-audit\u002Fproject\u002Fdot-claude\u002Fskills\u002Freport-haiku\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":18},"01M7CZND182TKGGM7R4134ND00","kitt-stub","Builds the guided-tour reference for an admin page. Use when the user asks for the tour reference. Trigger \"tour\", \"reference\", \"guided tour\".","https:\u002F\u002Fgithub.com\u002Fpadosoft\u002Fskills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskill-audit\u002Fproject\u002Fdot-claude\u002Fskills\u002Fkitt-stub\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":18},"01M7CZN9F2A6BFTFW5RSRNAGB1","good-skill","Generates the release notes of a project from its merged pull requests. Use this skill when the user asks for release notes, a changelog entry or a summary of what shipped since the last tag. Do not use it to write commit messages, that is the job of a commit skill.","https:\u002F\u002Fgithub.com\u002Fpadosoft\u002Fskills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskill-audit\u002Fproject\u002Fdot-claude\u002Fskills\u002Fgood-skill\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"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":91,"categories":92,"keywords":93,"publishedAt":18},"01M7CZN6BJASPD4DH8DFR63GQF","broken-frontmatter","https:\u002F\u002Fgithub.com\u002Fpadosoft\u002Fskills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskill-audit\u002Fproject\u002Fdot-claude\u002Fskills\u002Fbroken-frontmatter\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":18},"01M7CZN498TRNC30GSYMMAZNXM","Bad_Skill","I can help you with reports.","https:\u002F\u002Fgithub.com\u002Fpadosoft\u002Fskills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskill-audit\u002Fproject\u002Fdot-claude\u002Fskills\u002Fbad-skill\u002FSKILL.md",[],[]]