Token导航 LogoToken导航TokenDH.com
运维和基础设施敏感数据github未标认证来源可访问clear审计通过

cicd-pipeline-generatorCICD 管道生成器

Agent Skill

cicd-pipeline-generator 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

12,442

周安装

529

GitHub Stars

356

下载量

4,359
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:cicd-pipeline-generator(CICD 管道生成器)
来源仓库:https://github.com/ailabs-393/ai-labs-claude-skills
仓库路径:skills/cicd-pipeline-generator
安装命令:
npx skills add https://github.com/ailabs-393/ai-labs-claude-skills --skill cicd-pipeline-generator
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/ailabs-393/ai-labs-claude-skills --skill cicd-pipeline-generator

简介

cicd-pipeline-generator 能自动生成生产就绪的 CI/CD 配置文件,支持 GitHub Actions、GitLab CI 等多种平台。

  • 它提供 linting、测试、构建和部署的完整模板,特别适合 Node.js 和 Next.js 项目的自动化集成。
  • 内置平台选型建议与安全扫描集成,确保工作流符合现代 DevOps 最佳实践。
  • 安装时需注意是否会触发文件写入或外部 API 调用,建议在沙箱或测试环境先行验证。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

CI/CD Pipeline Generator

Overview

Generate production-ready CI/CD pipeline configuration files for various platforms (GitHub Actions, GitLab CI, CircleCI, Jenkins). This skill provides templates and guidance for setting up automated workflows that handle linting, testing, building, and deployment for modern web applications, particularly Node.js/Next.js projects.

Core Capabilities

1. Platform Selection

Choose the appropriate CI/CD platform based on project requirements:

  • GitHub Actions: Best for GitHub-hosted projects with native integration
  • GitLab CI/CD: Ideal for GitLab repositories with complex pipeline needs
  • CircleCI: Optimized for Docker workflows and fast build times
  • Jenkins: Suitable for self-hosted, highly customizable environments

Refer to references/platform-comparison.md for detailed platform comparisons, pros/cons, and use case recommendations.

2. Pipeline Configuration Generation

Generate pipeline configs following these principles:

Pipeline Stages

Structure pipelines with these standard stages:

  1. Install Dependencies

- Checkout code from repository - Setup runtime environment (Node.js version) - Restore cached dependencies - Install dependencies with npm ci - Cache dependencies for future runs

  1. Lint

- Run ESLint for code quality - Run TypeScript type checking - Fail fast on linting errors

  1. Test

- Execute unit tests - Execute integration tests - Generate code coverage reports - Upload coverage to reporting services (Codecov, Coveralls)

  1. Build

- Create production build - Verify build succeeds - Store build artifacts

  1. Deploy

- Deploy to staging (develop branch) - Deploy to production (main branch) - Run post-deployment smoke tests

Caching Strategy

Implement effective caching to speed up builds:

# Cache node_modules based on package-lock.json
cache:
  key: ${{ hashFiles('package-lock.json') }}
  paths:
    - node_modules/
    - .npm/

Environment Variables

Configure necessary environment variables:

  • NODE_ENV: Set to production for builds
  • Platform-specific tokens: Store as secrets
  • Build-time variables: Pass to build process

3. Template Usage

Use provided templates from assets/ directory:

GitHub Actions Template (assets/github-actions-nodejs.yml):

  • Multi-job workflow with lint, test, build, deploy
  • Matrix builds for multiple Node.js versions (optional)
  • Vercel deployment integration
  • Artifact uploading
  • Code coverage reporting

GitLab CI Template (assets/gitlab-ci-nodejs.yml):

  • Multi-stage pipeline
  • Dependency caching
  • Manual production deployment
  • Automatic staging deployment
  • Coverage reporting

To use a template:

  1. Copy the appropriate template file
  2. Place in the correct location:

- GitHub Actions: .github/workflows/ci.yml - GitLab CI: .gitlab-ci.yml

  1. Customize deployment targets, environment variables, and branch names
  2. Add required secrets to platform settings

4. Deployment Configuration

Vercel Deployment

For GitHub Actions:

- uses: amondnet/vercel-action@v25
  with:
    vercel-token: ${{ secrets.VERCEL_TOKEN }}
    vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
    vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
    vercel-args: '--prod'

Required Secrets:

  • VERCEL_TOKEN: Get from Vercel account settings
  • VERCEL_ORG_ID: From Vercel project settings
  • VERCEL_PROJECT_ID: From Vercel project settings

Netlify Deployment

- run: |
    npm install -g netlify-cli
    netlify deploy --prod --dir=.next
  env:
    NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
    NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}

AWS S3 + CloudFront

- uses: aws-actions/configure-aws-credentials@v4
  with:
    aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
    aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
    aws-region: us-east-1

- run: |
    aws s3 sync .next/static s3://${{ secrets.S3_BUCKET }}/static
    aws cloudfront create-invalidation --distribution-id ${{ secrets.CF_DIST_ID }} --paths "/*"

5. Testing Integration

Configure test execution with proper reporting:

Jest Configuration:

- name: Run tests with coverage
  run: npm test -- --coverage --coverageReporters=text --coverageReporters=lcov

- name: Upload coverage
  uses: codecov/codecov-action@v4
  with:
    files: ./coverage/lcov.info
    flags: unittests

Fail Fast Strategy:

# Run quick tests first
jobs:
  lint:  # Fails in ~30 seconds
  test:  # Fails in ~2 minutes
  build: # Fails in ~5 minutes
    needs: [lint, test]
  deploy:
    needs: [build]

6. Branch-Based Workflows

Implement different behaviors per branch:

Feature Branches / PRs:

  • Run lint + test only
  • No deployment
  • Add PR comments with test results

Develop Branch:

  • Run lint + test + build
  • Deploy to staging environment
  • Automatic deployment

Main Branch:

  • Run lint + test + build
  • Deploy to production
  • Manual approval (optional)
  • Create release tags

Example:

deploy_staging:
  if: github.ref == 'refs/heads/develop'
  # Deploy to staging

deploy_production:
  if: github.ref == 'refs/heads/main'
  environment: production  # Requires manual approval
  # Deploy to production

Workflow Decision Tree

Follow this decision tree to generate the appropriate pipeline:

  1. Which platform?

- GitHub → Use assets/github-actions-nodejs.yml - GitLab → Use assets/gitlab-ci-nodejs.yml - CircleCI/Jenkins → Adapt GitHub Actions template - Unsure → Consult references/platform-comparison.md

  1. What stages are needed?

- Always include: Lint, Test, Build - Optional: Security scanning, E2E tests, performance tests - Add deployment stage if deploying from CI

  1. Which deployment platform?

- Vercel → Use Vercel deployment examples - Netlify → Use Netlify CLI approach - AWS → Use AWS Actions/CLI - Custom → Implement custom deployment script

  1. What triggers?

- On push to main/develop - On pull request - On tag creation - Manual workflow dispatch

  1. What environment variables needed?

- Platform tokens (Vercel, Netlify, AWS) - API keys for external services - Build-time environment variables - Feature flags

Best Practices

Security

  • Store all secrets in platform secret management (never in code)
  • Use least-privilege tokens (read-only when possible)
  • Rotate secrets regularly
  • Audit secret access permissions
  • Never log secrets (use *** masking)

Performance

  • Cache dependencies aggressively
  • Parallelize independent jobs
  • Use matrix builds for multi-version testing
  • Fail fast: Run quick checks before slow ones
  • Optimize Docker layer caching

Reliability

  • Pin exact Node.js versions (18.x not just 18)
  • Commit lockfiles (package-lock.json)
  • Add retry logic for flaky external services
  • Set reasonable timeouts (10-15 minutes max)
  • Use continue-on-error for non-critical steps

Maintainability

  • Add comments explaining complex logic
  • Use reusable workflows/templates
  • Keep configs DRY (Don't Repeat Yourself)
  • Version control all pipeline changes
  • Document required secrets in README

Common Patterns

Multi-Environment Deployment

deploy_staging:
  environment: staging
  if: github.ref == 'refs/heads/develop'

deploy_production:
  environment: production
  if: github.ref == 'refs/heads/main'
  needs: [deploy_staging]

Matrix Testing

strategy:
  matrix:
    node-version: [16.x, 18.x, 20.x]
    os: [ubuntu-latest, windows-latest]

Conditional Steps

- name: Deploy
  if: github.event_name == 'push' && github.ref == 'refs/heads/main'
  run: npm run deploy

Artifact Management

- name: Upload build
  uses: actions/upload-artifact@v4
  with:
    name: build-output
    path: .next/
    retention-days: 7

- name: Download build
  uses: actions/download-artifact@v4
  with:
    name: build-output

Troubleshooting

Pipeline Failures

  1. Check action/job logs for error messages
  2. Verify environment variables and secrets are set
  3. Test commands locally before adding to pipeline
  4. Check for platform-specific issues in documentation

Slow Builds

  1. Verify cache is working (check cache hit/miss logs)
  2. Parallelize independent jobs
  3. Use faster runners if available
  4. Optimize dependency installation

Deployment Failures

  1. Verify deployment tokens are valid
  2. Check platform status pages
  3. Review deployment logs
  4. Test deployment commands locally

Resources

Templates (assets/)

  • github-actions-nodejs.yml: Complete GitHub Actions workflow
  • gitlab-ci-nodejs.yml: Complete GitLab CI pipeline

Reference Documentation (references/)

  • platform-comparison.md: Detailed comparison of CI/CD platforms, deployment targets, best practices, and common patterns

Example Usage

User Request: "Create a GitHub Actions workflow that runs tests and deploys to Vercel"

Steps:

  1. Copy assets/github-actions-nodejs.yml template
  2. Create .github/workflows/ directory if it doesn't exist
  3. Save as .github/workflows/ci.yml
  4. Update deployment section with Vercel credentials
  5. Add secrets to GitHub repository settings:

- VERCEL_TOKEN - VERCEL_ORG_ID - VERCEL_PROJECT_ID

  1. Commit and push to trigger workflow

User Request: "Set up GitLab CI with staging and production environments"

Steps:

  1. Copy assets/gitlab-ci-nodejs.yml template
  2. Save as .gitlab-ci.yml in repository root
  3. Configure GitLab CI/CD variables:

- VERCEL_TOKEN - Other deployment credentials

  1. Review manual approval settings for production
  2. Commit to trigger pipeline

Advanced Configuration

Monorepo Support

paths:
  - 'apps/frontend/**'
  - 'packages/**'

Scheduled Runs

on:
  schedule:
    - cron: '0 2 * * *'  # Daily at 2 AM

External Service Integration

- name: Notify Slack
  uses: 8398a7/action-slack@v3
  with:
    status: ${{ job.status }}
    webhook_url: ${{ secrets.SLACK_WEBHOOK }}

Security Scanning

- name: Run security audit
  run: npm audit --audit-level=moderate

- name: Check for vulnerabilities
  uses: snyk/actions/node@master
  env:
    SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

28.62%
按下载量换算1,248

Codex

22.66%
按下载量换算988

OpenCode

19.96%
按下载量换算870

Gemini CLI

12.59%
按下载量换算549

Antigravity

8.13%
按下载量换算354

Cursor

3.87%
按下载量换算169

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills