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/php.yml

View on GitHub
# GitLab CI — PHP
# Template variables:
#   PHP_VERSION: e.g., '8.3'
#   HAS_PHPSTAN: boolean
#   HAS_PSALM: boolean
#   HAS_RECTOR: boolean
#   HAS_CS_FIXER: boolean
#   HAS_PINT: boolean
#   HAS_PHPCS: boolean
#   TEST_FRAMEWORK: phpunit | pest
#   WANT_COVERAGE: boolean
#   WANT_SECURITY: boolean

image: php:${PHP_VERSION}-cli

stages:
  - install
  - lint
  - test

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

default:
  interruptible: true

variables:
  COMPOSER_HOME: $CI_PROJECT_DIR/.composer

install:
  stage: install
  before_script:
    - apt-get update && apt-get install -y git unzip
    - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
  script:
    - composer install --no-interaction --prefer-dist --optimize-autoloader
  cache:
    - key:
        files:
          - composer.lock
      paths:
        - vendor/
        - $COMPOSER_HOME/cache/
      policy: pull-push
  artifacts:
    paths:
      - vendor/
    expire_in: 1 hour

code-style:
  stage: lint
  needs: [install]
  script:
    # PHP-CS-Fixer:
    - vendor/bin/php-cs-fixer fix --dry-run --diff
    # Or Pint:
    # - vendor/bin/pint --test
    # Or PHPCS:
    # - vendor/bin/phpcs

phpstan:
  stage: lint
  needs: [install]
  script:
    - vendor/bin/phpstan analyse --memory-limit=512M --error-format=gitlab > phpstan-report.json
  artifacts:
    reports:
      codequality: phpstan-report.json
    when: always

rector:
  stage: lint
  needs: [install]
  script:
    - vendor/bin/rector process --dry-run

tests:
  stage: test
  needs: [install]
  script:
    # PHPUnit:
    - vendor/bin/phpunit --coverage-clover coverage.xml --log-junit report.xml
    # Or Pest:
    # - vendor/bin/pest --ci --coverage --min=80
  coverage: '/^\s*Lines:\s*\d+\.\d+\%/'
  artifacts:
    reports:
      junit: report.xml
      coverage_report:
        coverage_format: cobertura
        path: coverage.xml
    when: always

security:
  stage: lint
  needs: [install]
  script:
    - composer audit
  allow_failure: true
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