From acc
Generates minimal safe fixes for CI failures including memory exhaustion, Composer conflicts, PHPStan baselines, and service readiness in GitHub Actions and GitLab CI.
How this skill is triggered — by the user, by Claude, or both
Slash command
/acc:generate-ci-fixThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Templates and patterns for generating minimal, safe CI configuration fixes.
Templates and patterns for generating minimal, safe CI configuration fixes.
Pattern: Allowed memory size of X bytes exhausted
GitHub Actions Fix:
# .github/workflows/ci.yml
jobs:
phpstan:
steps:
- name: Run PHPStan
run: php -d memory_limit=-1 vendor/bin/phpstan analyse
# Alternative: set in phpstan.neon
GitLab CI Fix:
# .gitlab-ci.yml
phpstan:
variables:
PHP_MEMORY_LIMIT: "-1"
script:
- php -d memory_limit=-1 vendor/bin/phpstan analyse
phpstan.neon Fix:
parameters:
parallel:
maximumNumberOfProcesses: 1
processTimeout: 300.0
Pattern: Your requirements could not be resolved
Fix Strategy:
# Diagnose
composer why-not package/name version
# Option 1: Update constraint
composer require package/name:^2.0 --no-update
composer update package/name
# Option 2: Add platform config
# composer.json
{
"config": {
"platform": {
"php": "8.2"
}
}
}
# Option 3: Allow specific plugin
{
"config": {
"allow-plugins": {
"plugin/name": true
}
}
}
GitHub Actions Fix:
- name: Install dependencies
run: |
composer config platform.php 8.2
composer install --prefer-dist --no-progress
env:
COMPOSER_MEMORY_LIMIT: -1
Pattern: PHPStan found X new errors or Baseline outdated
Fix:
# GitHub Actions
- name: Generate PHPStan baseline
run: |
vendor/bin/phpstan analyse --generate-baseline
git add phpstan-baseline.neon
phpstan.neon Fix:
includes:
- phpstan-baseline.neon
parameters:
reportUnmatchedIgnoredErrors: false
Pattern: Connection refused to database/redis/etc.
GitHub Actions Fix:
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: test
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- name: Wait for MySQL
run: |
until mysqladmin ping -h 127.0.0.1 --silent; do
echo 'Waiting for MySQL...'
sleep 2
done
GitLab CI Fix:
services:
- name: mysql:8.0
alias: mysql
variables:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: test
variables:
DB_HOST: mysql
DB_PORT: 3306
.wait-for-db: &wait-for-db
before_script:
- |
until mysqladmin ping -h mysql --silent; do
echo 'Waiting for MySQL...'
sleep 2
done
Pattern: COPY failed: file not found or no space left
Dockerfile Fix:
# Check .dockerignore doesn't exclude needed files
# Ensure COPY paths are correct relative to context
# Before:
COPY ./src /app/src
# After (if issue is path):
COPY src/ /app/src/
# For multi-stage builds:
FROM composer:2 AS deps
COPY composer.json composer.lock ./
RUN composer install --no-scripts
FROM php:8.2-fpm
COPY --from=deps /app/vendor /app/vendor
GitHub Actions Fix (space issue):
- name: Free disk space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
docker system prune -af
- name: Build Docker image
run: docker build -t app .
Pattern: Job exceeded maximum execution time
GitHub Actions Fix:
jobs:
test:
timeout-minutes: 30 # Increase from default 6 hours
steps:
- name: Run tests
timeout-minutes: 20 # Step-level timeout
run: vendor/bin/phpunit
GitLab CI Fix:
test:
timeout: 30 minutes
script:
- vendor/bin/phpunit --stop-on-failure
PHPUnit Fix:
<!-- phpunit.xml -->
<phpunit
executionOrder="depends,defects"
stopOnFailure="true"
timeoutForSmallTests="1"
timeoutForMediumTests="10"
timeoutForLargeTests="60">
Pattern: Permission denied on file operations
GitHub Actions Fix:
- name: Fix permissions
run: chmod +x ./scripts/*.sh
- name: Run script
run: ./scripts/deploy.sh
GitLab CI Fix:
before_script:
- chmod +x ./scripts/*.sh
# Or in Dockerfile:
RUN chmod +x /app/scripts/*.sh
Pattern: Cache not being used, slow installs
GitHub Actions Fix:
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: |
~/.composer/cache
vendor
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --prefer-dist --no-progress
GitLab CI Fix:
cache:
key:
files:
- composer.lock
paths:
- vendor/
policy: pull-push
variables:
COMPOSER_CACHE_DIR: "$CI_PROJECT_DIR/.composer-cache"
Pattern: PHP Fatal error: Uncaught Error: Call to undefined function
GitHub Actions Fix:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: mbstring, xml, ctype, iconv, intl, pdo_mysql, redis
coverage: xdebug
Dockerfile Fix:
RUN docker-php-ext-install pdo pdo_mysql
RUN pecl install redis && docker-php-ext-enable redis
Pattern: Undefined environment variable
GitHub Actions Fix:
env:
APP_ENV: testing
APP_DEBUG: true
DB_CONNECTION: mysql
jobs:
test:
steps:
- name: Create .env
run: cp .env.ci .env
GitLab CI Fix:
variables:
APP_ENV: testing
DB_HOST: mysql
# Or use CI/CD variables for secrets
# Settings > CI/CD > Variables
fix(ci): <short description>
<detailed description of what was wrong and how it's fixed>
Issue: <link if applicable>
# GitHub Actions - act
act -j <job-name>
# GitLab CI - gitlab-runner
gitlab-runner exec docker <job-name>
# Docker build
docker build -t test-image .
# Composer
composer install --dry-run
# PHPStan
vendor/bin/phpstan analyse --debug
For any CI fix, provide rollback:
# If fix causes issues, revert with:
git revert HEAD
# Or restore previous version:
git checkout HEAD~1 -- .github/workflows/ci.yml
npx claudepluginhub dykyi-roman/awesome-claude-code --plugin accDetects GitHub Actions CI failures in PRs, analyzes logs with gh CLI, fixes code, commits and pushes changes, then re-verifies up to 3 retries until passing.
Diagnoses and fixes GitHub Actions CI failures in pull requests by fetching job logs, identifying root causes like build or test errors, and proposing targeted code changes.
Diagnoses and fixes CI/CD pipeline failures including build errors, test failures, and pipeline issues. Uses git log analysis and structured debugging to identify root causes.