agentleFS
jggomezjggomez/expert-ai-developer-skills/skills/build-and-ci-gates/SKILL.md

build-and-ci-gates

Skill28 starsChanged 3 months agoApache-2.0View on GitHub

Implements linters, code formatters, and automated build pipelines (CI/CD) to prevent syntax errors, enforce style consistency, and prevent failing builds from being merged. Use this skill when asked to add linters, configure docker builds, or set up GitHub Actions workflows.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before submitting code changes or opening PRs, execute automated formatting and lint checks:

    line 26
  2. Very specific:

    If formatting or linting checks fail, immediately fix them using automated tools (e.g., ruff format, black ., eslint --fix).

    line 30
  3. Very specific:

    Containerization: Use multi-stage Dockerfile builds to produce minimal, non-root runner images.

    line 35
  4. Distinctive:

    Ensure the hook fails closed—aborting the commit immediately if any check fails.

    line 44
  5. Very specific:

    Claude Code: Run run_checks.py in the workspace terminal before generating pull requests.

    line 62
  6. Distinctive:

    Antigravity: Verify that CI gate checks pass prior to declaring build completion.

    line 63

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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

Build and CI Gates Skill

Overview

This skill establishes automated build pipelines, code quality gates, and Continuous Integration (CI/CD) workflows. It acts as a Build Automation and CI/CD Engineer, ensuring that code styling, linting, typing, and test suites are enforced deterministically by automated systems rather than subjective human debate, blocking defective code before it ever merges.

When to Use

Trigger Scenarios

  • Running comprehensive local code quality, formatting, and linting checks before committing.
  • Configuring or updating CI/CD pipelines (e.g., GitHub Actions workflows).
  • Installing local git pre-commit hooks to block defective commits fail-closed.
  • Designing containerized multi-stage Docker builds with minimal security attack surface.

When NOT to Use

  • Authoring unit tests and mocks: Route to test-driven-development.
  • Writing application feature code: Route to python-expert or code-implementer.
  • Stand-alone security penetration reviews: Route to security-audit.
  • Diagnosing code design smells: Route to code-smells-expert.

Process

Phase 1: Local Code Verification

Before submitting code changes or opening PRs, execute automated formatting and lint checks:

python3 ./skills/build-and-ci-gates/scripts/run_checks.py

If formatting or linting checks fail, immediately fix them using automated tools (e.g., ruff format, black ., eslint --fix).

Phase 2: Pipeline Integration (CI/CD)

Configure pipeline definitions using pinned versions and deterministic environments:

  1. GitHub Actions: Scaffold or update .github/workflows/ci.yml using the CI template reference.
  2. Containerization: Use multi-stage Dockerfile builds to produce minimal, non-root runner images.
  3. Configuration Pinning: Pin all linter and formatter settings (pyproject.toml, .eslintrc.json, pubspec.yaml) in repository root.

Phase 3: Git Hook Automation (Pre-Commit Gate)

Install the automated pre-commit gate to intercept syntax errors, failing tests, or secret leaks locally:

  1. Symlink or copy the hook script to .git/hooks/pre-commit:
    python3 ./skills/build-and-ci-gates/scripts/pre_commit_quality_gate.py
  2. Ensure the hook fails closed—aborting the commit immediately if any check fails.

Usage

Commands & Automation Scripts

# Run local code verification checks (lint, format, basic tests)
python3 ./skills/build-and-ci-gates/scripts/run_checks.py

# Run pre-commit quality gate check directly
python3 ./skills/build-and-ci-gates/scripts/pre_commit_quality_gate.py

Example Prompts

  • "Set up a GitHub Actions workflow that runs linting, type checks, and tests on every pull request."
  • "Configure pre-commit hooks to prevent unformatted code or secret leaks from being committed."
  • "Create a multi-stage Dockerfile for our Python service that runs as a non-root user."

Host Execution Instructions

  • Claude Code: Run run_checks.py in the workspace terminal before generating pull requests.
  • Antigravity: Verify that CI gate checks pass prior to declaring build completion.

Red Flags

  • Committing code without running local linter and formatter gates.
  • Configuring pre-commit hooks that fail open (allowing broken commits when tools are missing).
  • Building Docker images running as root or leaving compilers and build tools in production images.
  • Bypassing CI quality gates with force-pushes or --no-verify flags.

Verification

  • Automated check runner passes cleanly with zero errors:
    python3 ./skills/build-and-ci-gates/scripts/run_checks.py
  • Pre-commit hook executes and blocks defective commits:
    python3 ./skills/build-and-ci-gates/scripts/pre_commit_quality_gate.py
  • CI configuration passes schema validation and triggers on pull requests.
  • Production containers build using multi-stage non-root images.

References

For workflow templates, Dockerfiles, and pre-commit configurations:

  • CI/CD & Lint Templates Reference

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.