agentleFS
rakaarwakyrakaarwaky/agents-arwaky/skills/devops/setup-ci-quality-gates/SKILL.md

setup-ci-quality-gates

Skill0 starsChanged 4 days agoMITView on GitHub

Set up CI quality gates and architecture checks on GitHub Actions, and reproduce those gates locally via a ci.sh mirror. Use when creating workflows, branch protection rulesets, auto-merge, AI review layers, or building scripts/ci.sh to mirror .github/workflows when GitHub Actions is quota-blocked.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Create a ruleset "Protect main - quality gates" (Settings → Rules → Rulesets), target: branch, enforcement active:

    line 120

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

CI Quality Gates System

Replicate the CI setup used by this repo: quality gates enforced by GitHub Actions + a branch-protection ruleset, architecture enforcement via the project's own linter (self-lint), and two AI review layers (cubic, Repowise). This is a copy-and-extend blueprint, not a one-off checklist — adapt names and paths to the target repo.

Language-agnostic. The pattern (quality gates → branch protection → AI review) applies to any language. The commands below are this repo's Rust flavor; substitute per language:

ConcernRustPythonTypeScript/JS
Formatcargo fmt --checkruff format --checkprettier --check
Lintcargo clippy -D warningsruff check + mypyeslint + tsc --noEmit
Testscargo nextest runpytestvitest / jest
Security depscargo auditbandit + pip-auditnpm audit / eslint-plugin-security
Buildcargo build --releasepython -m buildtsc / vite build

The self-lint job is the one part that is inherently project-specific: it runs this linter (lint-arwaky-cli) on the repo's own multi-language workspace (crates/, modules/, packages/).

Architecture overview

PR opened / pushed
   │
   ├─ CI workflow (.github/workflows/ci.yml)
   │    ├─ Format  (cargo fmt --check)
   │    ├─ Clippy  (cargo clippy -D warnings)
   │    ├─ Build   (cargo build --release)
   │    ├─ Tests   (cargo nextest run)
   │    └─ Self-Lint (lint-arwaky-cli check .  == 0 violations)
   │
   ├─ cubic AI reviewer (www.cubic.dev) — ultrareview
   └─ Repowise bot (.repowise/bot.yaml) — health gate advisory
   │
   └─ Ruleset "Protect main" (GitHub rulesets)
        ├─ required_status_checks: Format, Clippy, Build, Tests,
        │    Self-Lint
        ├─ strict: true (must be up to date)
        ├─ non_fast_forward + deletion: blocked
        └─ auto-merge workflow (squash) merges when all pass

```text

## 1. GitHub Actions workflow (.github/workflows/ci.yml)

Five jobs on `ubuntu-latest` (Rust flavor shown; see the table at the top
for Python/TypeScript equivalents). Cache with sccache + Swatinem/rust-cache.

| Job | Command | Notes |
|---|---|---|
| `fmt` | `cargo fmt --all -- --check` | rustfmt component only |
| `clippy` | `cargo clippy --all-targets -- -D warnings` | clippy component; install `mold` linker |
| `build` | `cargo build --release` | needs: build for downstream |
| `test` | `cargo nextest run --workspace --lib --tests -j 2` | needs: build; install nextest via curl |
| `self-lint` | `lint-arwaky-cli check .` == 0 violations | needs: build; also assert ≥24 AES codes on `workspaces-bad` |

Key env in `.github/workflows/ci.yml`: `RUSTC_WRAPPER=sccache`,
`CARGO_BUILD_JOBS=4`, `RUST_MIN_STACK=33554432`. (`CARGO_INCREMENTAL=0`
belongs in `scripts/ci.sh` for local runs, not in the workflow.)

### Self-lint job (architecture enforcement)

The differentiator: CI fails if the repo violates its own architecture
rules — the `self-lint` job asserts zero whole-repo violations plus the
AES rule engine still firing all 24 codes on the intentional-violation
fixture workspace (`workspaces-bad`), catching a linter that silently
stops detecting anything.

See `references/self-lint.md` for the job script (exit-code-authoritative
check, fixture assertion, and the `cargo build --release` prerequisite).

## 2. Branch protection: GitHub Ruleset

Create a ruleset "Protect main - quality gates" (Settings → Rules →
Rulesets), `target: branch`, enforcement `active`:

- **required_status_checks**: Format, Clippy, Build, Tests, Self-Lint —
  with `strict: true` (requires up-to-date).
- **non_fast_forward**: blocked.
- **deletion**: blocked.

Effect: no direct push to `main`; every change must go through a PR that
passes all gates. (This is why all work here uses worktrees + PRs.)

## 3. Auto-merge (.github/workflows/auto-merge.yml)

See `references/auto-merge.yml.md` for the squash-merge workflow and
PR-metadata env-var rules.

## 4. AI review layers

See `references/ai-review-layers.md` for cubic and Repowise configuration.

## 5. Local quality gates (scripts/ci.sh)

Reproduce CI locally before pushing — the pre-push hook runs the same
gates (Rust flavor; swap commands per language from the table at the top):

```bash
bash scripts/ci.sh               # fmt + clippy + self-lint + AES codes + tests
CARGO_INCREMENTAL=0 cargo clippy --workspace --all-targets -- -D warnings
cargo nextest run --workspace --lib --tests
lint-arwaky-cli check .        # whole repo, must be 0 violations

scripts/ci.sh should also accept --container and run the identical gates inside a Podman/Docker image where every dependency, browser, and the linter are baked in. That removes the hosted-runner quota as a merge dependency.

See references/local-ci.md for the full local-mirror procedure (script structure, container image design, runtime verification, and the version-drift pitfall that makes local runs disagree with CI), merged from the former local-ci skill.

6. Supporting workflows

WorkflowPurpose
release.ymlBuild release binaries, smoke-test, attest-build-provenance
release-tag.ymlTag release PRs
auto-release.ymlRelease on workflow_run after merge
cleanup-branches.ymlDelete merged branches
labeler.ymlAuto-label PRs (uses actions/labeler)

Checklist — replicate on a new repo

  • .github/workflows/ci.yml with fmt/clippy/build/test/self-lint jobs
  • Self-lint job runs the project's own linter, fails on violations
  • Ruleset on main: required status checks + strict + no fast-forward
  • Auto-merge workflow (squash) gated on the same checks
  • cubic + Repowise apps installed on the repo
  • .repowise/bot.yaml + .repowiseIgnore + health-rules.json
  • scripts/ci.sh mirrors CI for local run + pre-push hook (see references/local-ci.md)
  • Release/labeler/cleanup workflows if the release train is needed

Routing

ReferencePurpose
references/branch-protection.mdGitHub Ruleset and required status checks
references/ci-workflow.mdThe five CI jobs (fmt, clippy, build, test, self-lint)
references/container-image.mdContainer image design for local CI mirroring
references/self-lint.mdSelf-lint job script and AES rule assertion
references/auto-merge.yml.mdSquash-merge auto-merge workflow
references/ai-review-layers.mdcubic and Repowise configuration
references/local-ci.mdLocal quality gates mirror via scripts/ci.sh
references/verify-runtimes.mdRuntime version verification

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.