jpskill.com
🛠️ 開発・MCP コミュニティ

cicd-pipeline-generator

自動テスト、ビルド、デプロイメントのためのCI/CDパイプライン設定ファイルを、GitHub Actions、GitLab CI、CircleCIなどを用いて生成し、Node.js/Next.jsアプリの自動化を支援するSkill。

📜 元の英語説明(参考)

This skill should be used when creating or configuring CI/CD pipeline files for automated testing, building, and deployment. Use this for generating GitHub Actions workflows, GitLab CI configs, CircleCI configs, or other CI/CD platform configurations. Ideal for setting up automated pipelines for Node.js/Next.js applications, including linting, testing, building, and deploying to platforms like Vercel, Netlify, or AWS.

🇯🇵 日本人クリエイター向け解説

一言でいうと

自動テスト、ビルド、デプロイメントのためのCI/CDパイプライン設定ファイルを、GitHub Actions、GitLab CI、CircleCIなどを用いて生成し、Node.js/Next.jsアプリの自動化を支援するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o cicd-pipeline-generator.zip https://jpskill.com/download/16530.zip && unzip -o cicd-pipeline-generator.zip && rm cicd-pipeline-generator.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/16530.zip -OutFile "$d\cicd-pipeline-generator.zip"; Expand-Archive "$d\cicd-pipeline-generator.zip" -DestinationPath $d -Force; ri "$d\cicd-pipeline-generator.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して cicd-pipeline-generator.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → cicd-pipeline-generator フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
4

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

CI/CD Pipeline Generator

概要

様々なプラットフォーム (GitHub Actions, GitLab CI, CircleCI, Jenkins) 向けに、本番環境に対応した CI/CD パイプライン構成ファイルを生成します。このスキルは、最新の Web アプリケーション、特に Node.js/Next.js プロジェクトの、lint、テスト、ビルド、デプロイを処理する自動化されたワークフローをセットアップするためのテンプレートとガイダンスを提供します。

主要な機能

1. プラットフォームの選択

プロジェクトの要件に基づいて、適切な CI/CD プラットフォームを選択します。

  • GitHub Actions: ネイティブ統合された GitHub ホストのプロジェクトに最適
  • GitLab CI/CD: 複雑なパイプラインのニーズを持つ GitLab リポジトリに最適
  • CircleCI: Docker ワークフローと高速なビルド時間に最適化
  • Jenkins: 自己ホスト型で高度にカスタマイズ可能な環境に適しています

詳細なプラットフォームの比較、長所/短所、ユースケースの推奨事項については、references/platform-comparison.md を参照してください。

2. パイプライン構成の生成

以下の原則に従ってパイプライン構成を生成します。

パイプラインのステージ

以下の標準的なステージでパイプラインを構成します。

  1. 依存関係のインストール

    • リポジトリからコードをチェックアウト
    • ランタイム環境のセットアップ (Node.js のバージョン)
    • キャッシュされた依存関係の復元
    • npm ci で依存関係をインストール
    • 将来の実行のために依存関係をキャッシュ
  2. Lint

    • コード品質のために ESLint を実行
    • TypeScript の型チェックを実行
    • lint エラーが発生したらすぐに失敗
  3. テスト

    • ユニットテストを実行
    • 統合テストを実行
    • コードカバレッジレポートを生成
    • カバレッジをレポートサービス (Codecov, Coveralls) にアップロード
  4. ビルド

    • 本番環境ビルドを作成
    • ビルドが成功したことを確認
    • ビルド成果物を保存
  5. デプロイ

    • ステージング環境にデプロイ (develop ブランチ)
    • 本番環境にデプロイ (main ブランチ)
    • デプロイ後のスモークテストを実行

キャッシュ戦略

ビルドを高速化するために、効果的なキャッシュを実装します。

# package-lock.json に基づいて node_modules をキャッシュ
cache:
  key: ${{ hashFiles('package-lock.json') }}
  paths:
    - node_modules/
    - .npm/

環境変数

必要な環境変数を構成します。

  • NODE_ENV: ビルドのために production に設定
  • プラットフォーム固有のトークン: シークレットとして保存
  • ビルド時の変数: ビルドプロセスに渡す

3. テンプレートの使用

assets/ ディレクトリから提供されているテンプレートを使用します。

GitHub Actions テンプレート (assets/github-actions-nodejs.yml):

  • lint、テスト、ビルド、デプロイを含むマルチジョブワークフロー
  • 複数の Node.js バージョンに対するマトリックスビルド (オプション)
  • Vercel デプロイメントの統合
  • 成果物のアップロード
  • コードカバレッジレポート

GitLab CI テンプレート (assets/gitlab-ci-nodejs.yml):

  • マルチステージパイプライン
  • 依存関係のキャッシュ
  • 手動による本番環境へのデプロイ
  • 自動ステージング環境へのデプロイ
  • カバレッジレポート

テンプレートを使用するには:

  1. 適切なテンプレートファイルをコピーします
  2. 正しい場所に配置します:
    • GitHub Actions: .github/workflows/ci.yml
    • GitLab CI: .gitlab-ci.yml
  3. デプロイターゲット、環境変数、ブランチ名をカスタマイズします
  4. 必要なシークレットをプラットフォーム設定に追加します

4. デプロイメント構成

Vercel デプロイメント

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'

必要なシークレット:

  • VERCEL_TOKEN: Vercel アカウント設定から取得
  • VERCEL_ORG_ID: Vercel プロジェクト設定から取得
  • VERCEL_PROJECT_ID: Vercel プロジェクト設定から取得

Netlify デプロイメント

- 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. テストの統合

適切なレポートでテストの実行を構成します。

Jest の構成:

- 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 戦略:

# 最初にクイックテストを実行
jobs:
  lint:  # 約30秒で失敗
  test:  # 約2分で失敗
  build: # 約5分で失敗
    needs: [lint, test]
  deploy:
    needs: [build]

6. ブランチベースのワークフロー

ブランチごとに異なる動作を実装します。

フィーチャーブランチ / PR:

  • lint + テストのみを実行
  • デプロイメントなし
  • テスト結果を含む PR コメントを追加

Develop ブランチ:

  • lint + テスト + ビルドを実行
  • ステージング環境にデプロイ
  • 自動デプロイメント

Main ブランチ:

  • lint + テスト + ビルドを実行
  • 本番環境にデプロイ
  • 手動承認 (オプション)
  • リリースタグを作成

:

deploy_staging:
  if: github.ref == 'refs/heads/develop'
  # ステージング環境にデプロイ

deploy_production:
  if: github.ref == 'refs/heads/main'
  environment: production  # 手動承認が必要
  # 本番環境にデプロイ

ワークフローの決定木

この決定木に従って、適切なパイプラインを生成します。

  1. どのプラットフォームを使用しますか?

    • GitHub → assets/github-actions-nodejs.yml を使用
    • GitLab → assets/gitlab-ci-nodejs.yml を使用
    • CircleCI/Jenkins → GitHub Actions テンプレートを適用
    • 不明 → references/platform-comparison.md を参照
  2. どのステージが必要ですか?

    • 常に含める: Lint, Test, Build
    • オプション: セキュリティスキャン、E2E テスト、パフォーマンステスト
    • CI からデプロイする場合は、デプロイメントステージを追加
  3. どのデプロイメントプラットフォームを使用しますか?

    • Vercel → Vercel デプロイメントの例を使用
    • Netlify → Netlify を使用

(原文がここで切り詰められています)

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

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
  2. Lint

    • Run ESLint for code quality
    • Run TypeScript type checking
    • Fail fast on linting errors
  3. Test

    • Execute unit tests
    • Execute integration tests
    • Generate code coverage reports
    • Upload coverage to reporting services (Codecov, Coveralls)
  4. Build

    • Create production build
    • Verify build succeeds
    • Store build artifacts
  5. 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
  3. Customize deployment targets, environment variables, and branch names
  4. 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
  2. What stages are needed?

    • Always include: Lint, Test, Build
    • Optional: Security scanning, E2E tests, performance tests
    • Add deployment stage if deploying from CI
  3. Which deployment platform?

    • Vercel → Use Vercel deployment examples
    • Netlify → Use Netlify CLI approach
    • AWS → Use AWS Actions/CLI
    • Custom → Implement custom deployment script
  4. What triggers?

    • On push to main/develop
    • On pull request
    • On tag creation
    • Manual workflow dispatch
  5. 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
  6. 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
  4. Review manual approval settings for production
  5. 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 }}

同梱ファイル

※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。