Skip to content
ci-templates logo

CI/CD Templates

ci-templates

Use when setting up CI/CD pipelines. Teaches pipeline design principles and references platform-specific templates.

SKILL.md

Full skill instructions

CI/​CD Templates

Principles for designing fast, reliable CI/​CD pipelines. Platform-specific templates in docs/​ci-templates/.

When to Use

  • Setting up a new CI/​CD pipeline
  • Optimizing slow pipelines
  • Adding security scanning
  • Migrating between CI platforms

Core Principles

1. Fail Fast

Run quick checks first. Don't waste 10 minutes building if linting fails in 10 seconds.

Stage Order:
1. Lint/​Format (seconds)
2. Type Check (seconds)
3. Unit Tests (minutes)
4. Integration Tests (minutes)
5. Build (minutes)
6. E2E Tests (minutes)
7. Deploy (varies)

2. Cache Dependencies

Never re-download what you already have.

FrameworkCache Path
PHP/​Composervendor/
Node.jsnode_modules/
Python.venv/ or ~/​.cache/​pip

3. Parallelize Independent Jobs

Jobs that don't depend on each other should run simultaneously.

✓ Good: lint + unit-tests + type-check (parallel)
✗ Bad: lint → unit-tests → type-check (sequential)

4. Use Artifacts for Handoffs

Don't rebuild between stages. Pass build artifacts.

5. Default to Public Images

Use Docker Hub, GitHub Container Registry, or official images by default. Custom registries are an optimization, not a requirement.

Platform Support

PlatformTemplate LocationConfig File
GitLab CIdocs/​ci-templates/​gitlab/.gitlab-ci.yml
GitHub Actionsdocs/​ci-templates/​github/.github/​workflows/​*.yml

Image Strategy

Option 1: Public Images (Recommended Start)

No setup required. Works everywhere.

FrameworkImageNotes
PHPphp:8.3-cliAdd extensions in before_script
Pythonpython:3.12Add deps in before_script
Nodenode:20Works out of the box
Playwrightmcr.microsoft.com/​playwright:latestAll browsers included
Securityaquasec/​trivy:latestMulti-language scanner

Option 2: Custom Registry (Optimization)

For faster builds, pre-bake dependencies into custom images.

Configure in .claude/​registry.json:

{
  "registry": "your-registry.example.com/​images",
  "images": {
    "php": { "testing": "php:8.3-testing" },
    "node": { "base": "node:20-base" }
  }
}

See docs/​registry-config.md for building custom images.

Security Scanning

Always include security scanning. Use allow_failure: true initially to avoid blocking deploys while you fix issues.

ScannerWhat It ChecksImage
composer auditPHP dependenciesphp:*
npm auditNode dependenciesnode:*
pip-auditPython dependenciespython:*
TrivyEverything + containersaquasec/​trivy
GitleaksSecrets in codezricethezav/​gitleaks

Quick Start

GitLab CI

# .gitlab-ci.yml - minimal working example
stages: [test]

test:
  image: node:20
  script:
    - npm ci
    - npm test
  cache:
    paths: [node_modules/]

GitHub Actions

# .github/​workflows/​test.yml - minimal working example
name: Test
on: [push, pull_request]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/​checkout@v4
      - uses: actions/​setup-node@v4
        with: { node-version: '20' }
      - run: npm ci
      - run: npm test

Template Reference

Full templates for common stacks:

StackGitLabGitHub
Laravel/​PHPdocs/​ci-templates/​gitlab/​laravel.ymldocs/​ci-templates/​github/​laravel.yml
Django/​Pythondocs/​ci-templates/​gitlab/​django.ymldocs/​ci-templates/​github/​django.yml
React/​Nodedocs/​ci-templates/​gitlab/​react.ymldocs/​ci-templates/​github/​react.yml
Full-Stackdocs/​ci-templates/​gitlab/​fullstack.ymldocs/​ci-templates/​github/​fullstack.yml

Checklist

When setting up a pipeline:

  • Stages ordered by speed (fast first)
  • Dependencies cached
  • Independent jobs parallelized
  • Artifacts passed between stages
  • Security scanning included
  • Works with public images (custom registry optional)

Common Mistakes

  1. No caching → Slow builds, wasted bandwidth
  2. Sequential everything → 20 min pipeline that could be 5 min
  3. Hardcoded registry → Breaks for contributors
  4. No security scanning → Vulnerabilities ship to prod
  5. E2E tests blocking → Flaky tests block all deploys

Integration

These templates work with:

  • /​laravel, /​python, /​react commands
  • /​architect security for security scanning
  • system-architect skill for infrastructure audits

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View