CI Pipeline Generator
Detect Project Stack
!ls package.json requirements.txt pyproject.toml go.mod Cargo.toml *.csproj *.sln Gemfile composer.json mix.exs Makefile Dockerfile 2>/dev/null
!ls .github/workflows/ .gitlab-ci.yml Jenkinsfile .circleci/ .travis.yml bitbucket-pipelines.yml 2>/dev/null
!cat package.json 2>/dev/null | grep -E '"(scripts|devDependencies)"' -A 10 | head -20
Pipeline Design
Step 1: Detect Requirements
From project files, determine:
- Language and version (Node 20, Python 3.12, Go 1.22, etc.)
- Package manager (npm, pnpm, yarn, pip, poetry, cargo, etc.)
- Test command
- Lint command
- Build command
- Required services (database, Redis, etc.)
Step 2: Generate Pipeline Stages
Stage 1: Install
- Cache dependencies for fast subsequent runs
- Use lock file hash as cache key
Stage 2: Lint
- Run linter (ESLint, ruff, golangci-lint, clippy, etc.)
- Run type checker if applicable (tsc, mypy, go vet)
- Run formatter check (prettier, black, gofmt)
Stage 3: Test
- Run unit tests with coverage
- Run integration tests (with service containers if needed)
- Upload coverage report
Stage 4: Build
- Production build
- Verify build artifacts are created
Stage 5: Security (optional)
- Dependency vulnerability scan
- Secret scanning
- SAST if available
Stage 6: Deploy (placeholder)
- Staging deployment (on push to main)
- Production deployment (on tag/release)
- Mark as manual/approval required
Step 3: Platform-Specific Output
GitHub Actions:
name: CI
on: [push, pull_request]
jobs:
ci:
runs-on: ubuntu-latest
steps: ...
GitLab CI:
stages: [install, lint, test, build, deploy]
Step 4: Optimizations
- Dependency caching (npm cache, pip cache, cargo cache)
- Parallel test execution where possible
- Matrix builds for multiple versions (if needed)
- Fail-fast on lint errors (don't waste time on tests)
- Artifact upload for build output
Rules
- Always include a lint stage — catch issues early
- Always include caching — speed up repeat runs
- Keep the pipeline under 10 minutes for PRs
- Don't hardcode versions — use variables or matrix
- Include both push and PR triggers
1---2name: ci-pipeline3description: Generates a CI/CD pipeline configuration for the project. Auto-detects the stack and creates GitHub Actions, GitLab CI, or other CI configs with lint, test, build, and deploy stages.4---56# CI Pipeline Generator78## Detect Project Stack9!`ls package.json requirements.txt pyproject.toml go.mod Cargo.toml *.csproj *.sln Gemfile composer.json mix.exs Makefile Dockerfile 2>/dev/null`10!`ls .github/workflows/ .gitlab-ci.yml Jenkinsfile .circleci/ .travis.yml bitbucket-pipelines.yml 2>/dev/null`11!`cat package.json 2>/dev/null | grep -E '"(scripts|devDependencies)"' -A 10 | head -20`1213---1415## Pipeline Design1617### Step 1: Detect Requirements18From project files, determine:19- Language and version (Node 20, Python 3.12, Go 1.22, etc.)20- Package manager (npm, pnpm, yarn, pip, poetry, cargo, etc.)21- Test command22- Lint command23- Build command24- Required services (database, Redis, etc.)2526### Step 2: Generate Pipeline Stages2728**Stage 1: Install**29- Cache dependencies for fast subsequent runs30- Use lock file hash as cache key3132**Stage 2: Lint**33- Run linter (ESLint, ruff, golangci-lint, clippy, etc.)34- Run type checker if applicable (tsc, mypy, go vet)35- Run formatter check (prettier, black, gofmt)3637**Stage 3: Test**38- Run unit tests with coverage39- Run integration tests (with service containers if needed)40- Upload coverage report4142**Stage 4: Build**43- Production build44- Verify build artifacts are created4546**Stage 5: Security (optional)**47- Dependency vulnerability scan48- Secret scanning49- SAST if available5051**Stage 6: Deploy (placeholder)**52- Staging deployment (on push to main)53- Production deployment (on tag/release)54- Mark as manual/approval required5556### Step 3: Platform-Specific Output5758**GitHub Actions:**59```yaml60name: CI61on: [push, pull_request]62jobs:63 ci:64 runs-on: ubuntu-latest65 steps: ...66```6768**GitLab CI:**69```yaml70stages: [install, lint, test, build, deploy]71```7273### Step 4: Optimizations74- Dependency caching (npm cache, pip cache, cargo cache)75- Parallel test execution where possible76- Matrix builds for multiple versions (if needed)77- Fail-fast on lint errors (don't waste time on tests)78- Artifact upload for build output7980## Rules81- Always include a lint stage — catch issues early82- Always include caching — speed up repeat runs83- Keep the pipeline under 10 minutes for PRs84- Don't hardcode versions — use variables or matrix85- Include both push and PR triggers