Home
cd ../playbooks
Developer ToolsIntermediate

CI/CD Pipeline Generator

Create production-ready CI/CD pipeline configurations for GitHub Actions, GitLab CI, CircleCI, and Jenkins with deployment to Vercel, Netlify, or AWS.

15 minutes
By AI LabsSource
#cicd#github-actions#gitlab#jenkins#devops#automation#deployment

Setting up CI/CD means hours of YAML debugging, cryptic error messages, and copying snippets from Stack Overflow that don't quite fit your stack. Your pipeline either doesn't exist or was cobbled together two years ago and nobody dares touch it.

Who it's for: developers setting up their first CI/CD pipeline, DevOps engineers standardizing across projects, teams migrating between CI platforms, startups shipping without deployment automation, solo developers who deploy manually

Example

"Set up GitHub Actions for our Next.js app deploying to Vercel" → Production-ready workflow with build, lint, test stages, caching for node_modules, preview deployments on PRs, and production deploy on merge to main

CLAUDE.md Template

New here? 3-minute setup guide → | Already set up? Copy the template below.

# CI/CD Pipeline Generator

## Your Role
You are my DevOps engineer specializing in CI/CD pipeline configuration. Help me create production-ready pipelines for various platforms and deployment targets.

## Supported Platforms
- **GitHub Actions**: Native GitHub integration
- **GitLab CI/CD**: Complex pipeline needs on GitLab
- **CircleCI**: Docker workflows with optimized builds
- **Jenkins**: Self-hosted, highly customizable

## Deployment Targets
- **Vercel**: Frontend and Next.js applications
- **Netlify**: Static sites and serverless functions
- **AWS**: S3 + CloudFront, ECS, Lambda

## Pipeline Architecture

### Standard Stages
1. **Install Dependencies**: Code checkout, runtime setup, caching
2. **Lint**: ESLint, TypeScript checks
3. **Test**: Unit/integration tests with coverage
4. **Build**: Production build and artifacts
5. **Deploy**: Environment-specific deployments

## Configuration Workflow

### Step 1: Gather Requirements
Ask about:
- CI/CD platform preference
- Project type (Next.js, React, Node.js, etc.)
- Deployment target
- Environment needs (staging, production)
- Special requirements (monorepo, scheduled runs)

### Step 2: Generate Configuration

#### GitHub Actions Example
```yaml
name: CI/CD Pipeline

on:
  push:
    branches: [main, develop]
  pull_request:
    branches: [main]

jobs:
  install:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
          cache: 'npm'
      - run: npm ci

  lint:
    needs: install
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
          cache: 'npm'
      - run: npm ci
      - run: npm run lint
      - run: npm run type-check

  test:
    needs: install
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
          cache: 'npm'
      - run: npm ci
      - run: npm test -- --coverage

  build:
    needs: [lint, test]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
          cache: 'npm'
      - run: npm ci
      - run: npm run build

  deploy:
    needs: build
    runs-on: ubuntu-latest
    if: github.ref == 'refs/heads/main'
    steps:
      - uses: actions/checkout@v4
      - 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'
```

### Step 3: Configure Secrets
Provide list of required secrets:
- Deployment tokens (Vercel, Netlify, AWS)
- API keys for external services
- Environment-specific variables

### Step 4: Add Advanced Features

**Caching Strategy**
```yaml
- uses: actions/cache@v4
  with:
    path: ~/.npm
    key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
```

**Matrix Testing**
```yaml
strategy:
  matrix:
    node-version: [18, 20, 22]
    os: [ubuntu-latest, macos-latest]
```

**Scheduled Runs**
```yaml
on:
  schedule:
    - cron: '0 0 * * *'  # Daily at midnight
```

## Best Practices

### Security
- Never hardcode secrets
- Use least-privilege tokens
- Rotate credentials regularly
- Audit access logs

### Performance
- Cache dependencies aggressively
- Parallelize independent jobs
- Use matrix builds wisely
- Fail fast on errors

### Reliability
- Pin Node.js versions
- Commit lockfiles
- Add retry logic for flaky steps
- Set appropriate timeouts

## Deployment Configurations

### Vercel
```yaml
- 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 }}
```

### Netlify
```yaml
- run: npm install -g netlify-cli
- run: netlify deploy --prod
  env:
    NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
    NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
```

### AWS S3 + CloudFront
```yaml
- 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 ./dist s3://${{ secrets.S3_BUCKET }}
- run: aws cloudfront create-invalidation --distribution-id ${{ secrets.CF_DIST_ID }} --paths "/*"
```

Get new playbooks like this one

One email a week with new Claude Code workflows. Free, like everything here.

No spam. Unsubscribe anytime.

README.md

What This Does

Generate production-ready CI/CD pipeline configurations for multiple platforms. Includes build, test, lint, and deployment stages with best practices for security, caching, and performance.


Quick Start

Step 1: Navigate to Your Project

cd ~/your-project

Step 2: Download the Template

Click Download above, then:

mv ~/Downloads/CLAUDE.md ./

Step 3: Generate Your Pipeline

claude

Then ask: "Create a GitHub Actions pipeline for my Next.js app deploying to Vercel"


Supported Platforms

Platform Best For
GitHub Actions GitHub-hosted projects
GitLab CI/CD Complex pipelines on GitLab
CircleCI Docker workflows with optimized build times
Jenkins Self-hosted, highly customizable

Deployment Targets

Target Configuration
Vercel Uses amondnet/vercel-action
Netlify Uses netlify-cli
AWS S3 + CloudFront Uses AWS Actions

Standard Pipeline Architecture

Install Dependencies → Lint → Test → Build → Deploy

Stage Details

  1. Install: Code checkout, runtime setup, dependency caching
  2. Lint: ESLint, TypeScript type checking
  3. Test: Unit/integration tests with coverage
  4. Build: Production build, artifact storage
  5. Deploy: Environment-specific deployments

Example Prompts

  • "Create a GitHub Actions pipeline for a React app"
  • "Set up GitLab CI with staging and production deployments"
  • "Generate a CircleCI config with parallel test jobs"
  • "Create a Jenkins pipeline with Docker builds"

Best Practices Included

Security

  • Secret management via environment variables
  • Least-privilege tokens
  • No hardcoded credentials

Performance

  • Aggressive dependency caching
  • Job parallelization
  • Matrix testing
  • Fail-fast execution

Reliability

  • Pinned Node.js versions
  • Committed lockfiles
  • Retry logic
  • Timeout configuration

Advanced Features

  • Monorepo Support: Path-based triggers
  • Scheduled Runs: Cron expressions
  • Notifications: Slack/Discord/Email alerts
  • Security Scanning: npm audit, Snyk integration

$Related Playbooks

Developer Tools

Codebase Documenter

Create comprehensive, beginner-friendly documentation for codebases including READMEs, architecture guides, API docs, and code comments.

10 minutes
Beginner
Developer Tools

Composio SDK with Claude Code: Connect 250+ APIs in Minutes

Connect Claude Code to 250+ APIs using Composio SDK. Build AI agents that send emails, create GitHub issues, and post to Slack — not just generate text.

15 minutes
Advanced
Developer Tools

Error Message Explainer — Decode Any Error in Plain English

Paste any error message and get a plain-English explanation, root cause diagnosis, and step-by-step fix. Works with Python, JavaScript, Docker, Git, and any CLI error.

5 minutes
Beginner
Developer Tools

Git Conflict Resolution Framework

A plan-first framework for resolving Git merge conflicts by combining both branches' intent instead of blindly picking a side — categorized resolution patterns for imports, tests, generated files, configs, code logic, and struct definitions, with a mandatory approval step before any file is touched.

5 minutes
Intermediate
Developer Tools

Building Animations in Expo and React Native

A construction discipline for React Native motion: a frequency gate that produces zero lines of code when nothing should animate, a cheapest-tool-that-fits selection table, spring/easing values instead of guesses, and the JS-thread rules that separate 60fps from 20fps on a real device.

10 minutes
Advanced
Developer Tools

Explanatory Coding Mode

Get educational insights about implementation choices and codebase patterns as Claude works — formatted, codebase-specific commentary woven into the session, not a generic tutorial.

2 minutes
Beginner
Developer Tools

7-Phase Feature Development Workflow

Structured feature development that explores the codebase, asks every clarifying question up front, presents multiple architecture options with a recommendation, and runs a three-angle quality review before calling it done.

5 minutes
Intermediate
Developer Tools

Ginkgo Table and Dynamic Specs

Parameterize and generate Ginkgo test specs correctly — DescribeTable/Entry, the four ways to name an entry, DescribeTableSubtree for multi-It rows, reusable entry sets, and the one gotcha (Entry params evaluate at construction time, not BeforeEach time) that causes most table-spec bugs.

5 minutes
Intermediate
Developer Tools

Ginkgo Timeouts and Async Testing

Make Ginkgo specs interruptible and test asynchronous behavior correctly — SpecContext cancellation, NodeTimeout/SpecTimeout/GracePeriod, Eventually/Consistently with proper context propagation, and the two goroutine rules (GinkgoRecover, poll-don't-block) that prevent one failed assertion from crashing an entire Go test suite.

5 minutes
Intermediate
Developer Tools

Writing Ginkgo Specs

Author correct Ginkgo specs — container vs. subject vs. setup nodes, the declare-in-container/initialize-in-setup rule that prevents the most common Ginkgo bug, JustBeforeEach for separating creation from configuration, DeferCleanup for restore-not-clear teardown, and GinkgoHelper() for failure locations that point at the caller instead of the helper.

5 minutes
Beginner
Developer Tools

Idea-to-Design Brainstorming Gate

A hard approval gate before any implementation — classify every request as a Spike, Bounded change, or Architectural project, then design collaboratively and never write code until the design is explicitly approved.

5 minutes
Intermediate
Developer Tools

Hookify Guardrails

Create custom Claude Code guardrails with lightweight markdown rule files instead of hand-editing hooks.json — pattern matching, no restart required, rules live-load on the next tool call.

5 minutes
Beginner

Browse all Developer Tools playbooks →