Skip to content

unxed/f4 / .agents/skills/aif-ci

aif-ci

Flagged

Generate CI/CD pipeline (GitHub Actions / GitLab CI) with linting, static analysis, tests, security. Use when user says "ci", "setup ci", "github actions", "gitlab ci", "pipeline".

templates/gitlab/python.yml

View on GitHub
# GitLab CI — Python
# Template variables:
#   PYTHON_VERSION: e.g., '3.13'
#   PACKAGE_MANAGER: uv | pip | poetry
#   HAS_RUFF: boolean
#   HAS_BLACK: boolean
#   HAS_MYPY: boolean
#   HAS_BANDIT: boolean
#   SOURCE_DIR: e.g., src/
#   WANT_COVERAGE: boolean
#   WANT_SECURITY: boolean

image: python:${PYTHON_VERSION}-slim

stages:
  - lint
  - test

workflow:
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

default:
  interruptible: true

variables:
  UV_CACHE_DIR: $CI_PROJECT_DIR/.uv-cache

# --- UV-based setup (modern) ---
.uv-setup:
  before_script:
    - pip install uv
    - uv sync --all-extras --dev
  cache:
    - key:
        files:
          - uv.lock
      paths:
        - .uv-cache/
        - .venv/
      policy: pull-push

ruff-lint:
  stage: lint
  extends: .uv-setup
  script:
    - uv run ruff check . --output-format=gitlab > ruff-report.json
  artifacts:
    reports:
      codequality: ruff-report.json
    when: always

ruff-format:
  stage: lint
  extends: .uv-setup
  script:
    - uv run ruff format --check .

# Or for black + isort + flake8:
# black:
#   stage: lint
#   extends: .uv-setup
#   script:
#     - uv run black --check .
#     - uv run isort --check-only .
#
# flake8:
#   stage: lint
#   extends: .uv-setup
#   script:
#     - uv run flake8 .

mypy:
  stage: lint
  extends: .uv-setup
  script:
    - uv run mypy ${SOURCE_DIR}

tests:
  stage: test
  extends: .uv-setup
  script:
    - uv run pytest -v --cov=${SOURCE_DIR} --cov-report=xml --junitxml=report.xml
  coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
  artifacts:
    reports:
      junit: report.xml
      coverage_report:
        coverage_format: cobertura
        path: coverage.xml
    when: always

security:
  stage: lint
  extends: .uv-setup
  script:
    - uv run bandit -r ${SOURCE_DIR} -f json -o bandit-report.json
  artifacts:
    paths:
      - bandit-report.json
    when: always
  allow_failure: true

# --- pip-based setup (traditional) ---
# .pip-setup:
#   before_script:
#     - pip install -r requirements-dev.txt
#   cache:
#     - key:
#         files:
#           - requirements.txt
#       paths:
#         - .cache/pip/
#       policy: pull-push
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall