Communitygithub.com

lguidolin/merge-gates-and-automation

Use when setting up or changing CI, pre-push hooks, or a task runner, or deciding what must pass before merge. Symptoms — tempted to put authoritative checks only in a local hook, skip CI, bypass with --no-verify, or unsure what gates a merge vs. runs locally.

merge-gates-and-automation 是什麼?

merge-gates-and-automation is a Claude Code agent skill that use when setting up or changing CI, pre-push hooks, or a task runner, or deciding what must pass before merge. Symptoms — tempted to put authoritative checks only in a local hook, skip CI, bypass with --no-verify, or unsure what gates a merge vs. runs locally.

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/lguidolin/agent-skills/tree/main/skills/merge-gates-and-automation

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Verification Gate and Automation

Overview

Where verification lives and what makes it real. CI is the source of truth; the local hook is a convenience mirror. A rule not enforced by an unbypassable gate is a suggestion (Principle 7) — so where the platform cannot supply that gate, the project declares advisory mode and carries the rule deliberately, rather than assuming machinery it does not have.

The Rules

  • One task runner is the canonical entry to every everyday operation — test, build, dev, deploy are named recipes. A procedure that lives only in someone's head doesn't reliably happen and can't be handed to an agent.
  • CI is the source of truth — authoritative, shared, and unbypassable wherever the platform allows it. Lint, typecheck, contract checks, tests, security scans, commit validation all run here and must pass before merge in enforced mode. What CI says is what counts. In advisory mode the same checks run and report; the gate is discipline, and that is never a reason to run fewer checks.
  • The pre-push hook is a presubmit mirror, not a wall. It runs the same fast checks locally so you probably pass CI before pushing. It is explicitly bypassable (--no-verify) and only runs where the toolchain is installed. Its job is speed and early feedback, not enforcement. The hook never gates; CI gates wherever the platform allows it.
  • Keep CI fast by tiering, not by removing checks. When the full suite outgrows every-PR, split presubmit (fast subset, blocks PR) from postsubmit (full suite, after merge, blocks promotion) — never move authoritative checks back to the bypassable hook.
  • Container images build in CI, identified by content digest and published with a provenance attestation. Keep it affordable with registry layer caching or a self-hosted runner — never by moving the build back to a laptop, where the artifact's provenance cannot be verified by anyone else.
  • Declare the enforcement mode. enforced — CI blocks merge via branch protection; what CI says is what counts. advisory — CI runs and reports, and the gate is discipline, because branch protection is unavailable (a private repository on a free plan). Advisory is legitimate; claiming enforcement you do not have is not. State the mode in the project's first decision record, and what would move it to enforced.

The Named Tension

A bypassable local presubmit is fast but unenforceable; authoritative CI is enforceable but slower. Resolve by giving each a different mandate — the hook optimizes the inner loop, CI the correctness of record — and by making CI, not the hook, the thing that blocks a merge.

Common Rationalizations

ExcuseReality
"The pre-push hook runs the tests, so CI can be minimal"The hook is bypassable and toolchain-dependent. It cannot be the source of truth. CI must re-run everything.
"I'll just --no-verify this once"Fine — because CI will still catch it. That's exactly why CI, not the hook, is the gate.
"CI is slow, let's move tests to the hook"Tier CI (presubmit/postsubmit); never relocate authoritative checks to a bypassable gate.
"CI builds are slow, I'll build the image locally"A laptop-built artifact carries provenance no one else can verify. Fix the latency with a layer cache or a self-hosted runner.
"Branch protection costs money, so the rules don't apply"The rules apply; the enforcement differs. Declare advisory mode and keep the discipline, or make the repository public and get protection free.

Red Flags — STOP

  • Authoritative checks that exist only in a local hook
  • CI that doesn't re-run what the hook ran
  • A merge allowed while CI is red
  • An image built anywhere but CI, or promoted by tag rather than by digest
  • A project behaving as though CI gates merge when no branch protection exists

Full rationale: Article VIII of the constitution, bundled at engineering-constitution/references/engineering-constitution.md. Deploy/k8s specifics: cloud-delivery-aks.

Individual skills in this repo

This repo contains 18 individual skills — each has its own dedicated page.

lguidolin/change-hygiene-and-code-craft

Use when writing or refactoring code, structuring a commit or PR, or deciding whether to abstract duplication. Symptoms — mixing reorg with logic changes, a PR doing several things at once, a file growing large, the second copy of similar code, or unsure whether to DRY something up.

lguidolin/cloud-delivery-aks

Use when deploying to Kubernetes or Azure Kubernetes Service (AKS), configuring cloud secrets, setting up progressive rollout/canary, per-PR ephemeral environments, or k8s health probes. Keywords — Kubernetes, AKS, Key Vault, Argo Rollouts, Flagger, canary, blue-green, liveness, readiness, PodDisruptionBudget, HPA, rollback, GHCR.

lguidolin/commit-history-rewrite

Use when an existing repository has messy commit history that needs to conform to conventional commits before adopting release-please, or when intermediate WIP/fixup/merge commits need to be cleaned up.

lguidolin/conventional-commits-and-releases

Use when committing, writing a commit message, opening a PR that will be squash-merged, or configuring automated versioning/changelogs. Keywords — conventional commits, release-please, semver, feat/fix/chore, breaking change, changelog.

lguidolin/defense-in-depth-security

Use when handling untrusted input, secrets, authentication/authorization, or dependencies — or threat-modeling a new surface. Keywords — STRIDE, threat model, least privilege, secrets management, supply chain, dependency scanning, input validation, audit log, defense in depth.

lguidolin/designing-before-building

Use when starting a feature, fixing a non-trivial bug, or about to write implementation code — before any code exists. Symptoms you need this: "this is simple, I'll just code it", reaching for the editor before a design is approved, or an idea that hasn't been turned into a spec and plan.

lguidolin/engineering-constitution

Use when starting work in a project that follows the engineering constitution, orienting to its rules, or deciding which engineering practice applies to a task — spec writing, commits, testing, security, deploys, database, or UI work.

lguidolin/graphql-contract-testing

Use when writing a GraphQL query/mutation that the UI and a test will share, or building route/schema contract or smoke tests. Symptoms — copying a query into a test, a test asserting on query text, schema change that didn't break the UI build, or RLS/permission drift. Keywords — graphql-codegen, typed document, contract test, route smoke test.

lguidolin/init-repo-CI

Use when setting up a new repository with conventional commits, release-please, and CI automation, or when retrofitting an existing repository that lacks automated versioning and PR validation workflows.

lguidolin/interface-craft-and-accessibility

Use when building or styling UI — components, layouts, forms, design tokens — or making accessibility decisions. Keywords — a11y, WCAG, keyboard navigation, focus state, contrast, design system, minimalist UI, component reuse, ARIA, semantic HTML.

lguidolin/observability-and-slos

Use when adding logging, metrics, tracing, health checks, SLOs, or alerting — or when building a service surface that needs to be operable and debuggable. Keywords — structured logs, OpenTelemetry, correlation id, RED metrics, liveness, readiness, SLI, SLO, error budget, alerting.

lguidolin/performance-and-scale

Use when working on hot paths, list endpoints, pagination, data-access in loops, or public interfaces/schemas. Symptoms — unbounded queries, N+1 access, no latency budget, optimizing without measuring, or changing an interface many consumers depend on. Keywords — pagination, N+1, Hyrum's Law, performance budget, bundle size.

lguidolin/postgres-postgraphile-rls-and-sql

Use when writing PostgreSQL, PostGraphile config, Row-Level Security policies, SQL schema files, or working on the Browser→App→PostGraphile→Postgres data path. Keywords — RLS, SECURITY DEFINER, search_path, pgSettings, grants, roles, GraphQL depth limit, query cost, statement_timeout, SQL file organization.

lguidolin/recording-decisions

Use when a design or architecture decision has been made and needs to be captured — writing a decision record or ADR, updating a decision index, noting a deferred idea, or superseding a past decision. Keywords — ADR, decision record, rationale, rejected alternatives, dependency index.

lguidolin/resilience-and-deploy-safety

Use when planning a deploy, designing a rollback, or responding to an incident or writing a postmortem. Keywords — deploy safety, rollback, immutable artifact, progressive delivery, canary, blast radius, incident response, blameless postmortem, error budget.

lguidolin/ship-it

Use when the user wants to ship work — push, PR, archive decision records, merge, and clean up. Handles the full lifecycle from committing final changes through post-merge cleanup including converting specs/plans to compact decision records.

lguidolin/tests-as-a-control

Use when writing or modifying tests, when a test breaks during a refactor, or when testing permission/role rules. Symptoms — tempted to edit a test to make it pass, testing only the happy path, a deny-test that started passing, flaky tests, or unsure what to assert.

lguidolin/zero-downtime-migrations

Use when changing a database schema where data must survive the change — adding/removing/renaming columns, constraints, indexes, or backfilling. Symptoms — a destructive migration bundled with a code deploy, a NOT NULL column with a backfill, a table-locking UPDATE, or a rename. Keywords — expand/contract, parallel change, backfill, NOT VALID, CREATE INDEX CONCURRENTLY, graphile-migrate.

相關技能