generate-ci-fix

为 CI 配置问题生成最小且安全的修复方案。针对依赖项、测试、代码检查、基础设施、Docker 与超时故障提供修复模板。

仓库最近推送
GitHub Stars
109
Forks
26
Issues / PRs
1

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "generate-ci-fix":https://skillpi.com/zh/skills/deepskill-b9f8c980399802565a76b418fb38a8e02f4d02bf615dba29752ada0b63e1bbfc。安装前核对上游来源和版本:https://github.com/dykyi-roman/awesome-claude-code。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

为 CI 配置问题生成最小且安全的修复方案。针对依赖项、测试、代码检查、基础设施、Docker 与超时故障提供修复模板。

0 下载

介绍来源: third_party · dykyi-roman · 0.0.1 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
限制与区别
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: generate-ci-fix
description: Generates minimal, safe fixes for CI configuration issues. Provides fix templates for dependency, test, lint, infrastructure, Docker, and timeout failures.

CI Fix Generator

Templates and patterns for generating minimal, safe CI configuration fixes.

Fix Generation Principles

1. Minimal Change

  • Fix only what's broken
  • Don't restructure entire pipeline
  • Don't add unrelated improvements
  • Preserve existing job structure

2. Safe Change

  • Preserve existing behavior
  • Maintain security settings
  • Keep backward compatibility
  • Don't expose secrets

3. Validated Change

  • Provide local verification command
  • Include rollback instructions
  • Test fix before committing

Fix Templates by Category

1. Memory Exhausted

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

2. Composer Conflicts

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

3. PHPStan Baseline

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

4. Service Not Ready

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

5. Docker Build Failure

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 .

6. Timeout Issues

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">

7. Permission Denied

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

8. Cache Miss

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"

9. PHP Extension Missing

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

10. Environment Variable Missing

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 Composition Rules

Order of Operations

  1. Identify failure category
  2. Match error pattern
  3. Select minimal fix
  4. Verify fix doesn't break other jobs
  5. Provide rollback instructions

What NOT to Change

  • Security settings (unless fixing vulnerability)
  • Secret management approach
  • Existing job names (may break branch protection)
  • Trigger conditions (unless causing issue)

Commit Message Format

fix(ci): <short description>

<detailed description of what was wrong and how it's fixed>

Issue: <link if applicable>

Verification Commands

Local Testing

# 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

Rollback Instructions

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

当前收录版本

0.0.1

核对来源版本 ↗

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值95/100

亮点

  • 提供针对 CI/CD 配置问题的最小化且安全的修复方案,直接解决开发者常见痛点
  • 覆盖多种 CI 故障类型,包括依赖项、测试、代码检查、基础设施、Docker 和超时故障
  • 包含详细的修复模板和验证命令,显著提升日常高频场景的效率
触发精准90/100

亮点

  • 触发词精准完整,覆盖多种变体,边界清晰
  • description 明确描述了功能和适用场景
结构规范95/100

亮点

  • Phase/步骤清晰,有出口条件,含端到端示例
  • frontmatter完整,单文件≤500行
  • 结构非常清晰,包含原则、模板、验证和回滚
执行可靠90/100

亮点

  • 工具来源明确,参数正确,覆盖主要异常
  • 不可逆操作有确认机制,提供了验证命令和回滚说明
证据可验 (前四项均值)93/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

  • 覆盖或清理工作区

    可能覆盖未提交文件或清除未跟踪文件。先查看 git status,提交或备份改动,确认目标文件后再操作。

    主文档提及 · 第 406 行
  • 删除文件

    先确认绝对路径及作用范围,保留可恢复备份;不要直接对重要目录运行示例命令。

    主文档提及 · 第 208, 209 行
  • 管理员或提升权限

    确认确有必要再提升权限;不要关闭防护、绕过证书验证或扩大整个系统的访问权限。

    主文档提及 · 第 208, 209 行

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。