gitlab-ci-cd
Skill2 starsChanged 8 months agoMITView on GitHub
Expert design, generation, validation, optimization, and troubleshooting of GitLab CI/CD pipelines. Use when creating .gitlab-ci.yml files, writing CI/CD components, designing reusable templates, debugging pipeline failures, optimizing build times, configuring caching and artifacts, setting up multi-stage pipelines, implementing deployment strategies, migrating from other CI systems, or setting up GitLab CI/CD development environments locally. Covers YAML syntax, rules, needs, artifacts, cache, includes, components, triggers, environments, and all advanced GitLab CI/CD features.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- julweber/ai_agent_skillsword for word, first seen Mar 20, 2026
Other versions1 project uses a version of this.
Word for word · 1
- julweber/ai_agent_skills★ 2100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository51 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ai-agent-skills-assistantSkill
- ansibleSkill
- artificial-analysisSkill
- cavemanSkill
- claude-cliSkill
- code-doctorSkill
- code-summarizerSkill
- codex-cliSkill
- concourse-ciSkill
- dev-brainstormingSkill
- docker-cliSkill
- file-organizerSkill
- frontend-web-developerSkill
- github-actions-cicdSkill
- github-cliSkill
- grill-meSkill
- gtd-assistantSkill
- herdr-cliSkill
- hf-cliSkill
- karpathy-guidelinesSkill
- kestraSkill
- list-large-filesSkill
- list-most-intensive-processesSkill
- llama-cppSkill
- llm-wikiSkill
- mermaidSkill
- morning-ritualSkill
- obsidian-masterSkill
- obsidian-open-loops-collectorSkill
- opencode-agent-creatorSkill
- opencode-cliSkill
- pi-cliSkill
- pi-subagents-masterSkill
- planka-development-flowSkill
- plnk-cliSkill
- ponytailSkill
- product-prd-brainstormingSkill
- python-api-developerSkill
- ralph-prd-converterSkill
- ralph-prd-generatorSkill
- release-managementSkill
- rest-testsuite-skillSkill
- skill-loaderSkill
- design-taste-frontendSkill
- terraformSkill
- tmux-coderSkill
- tmux-specialistSkill
- trello-cliSkill
- tts-conversationSkill
- uvSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 5 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 59
Always include: stages, proper job structure, error handling, caching, artifacts where needed, and appropriate rules for branch/MR …
- Very specific: line 70
Use the scripts/validate_pipeline.py script for automated checks.
- Distinctive: line 84
When asked to create a pipeline, follow this process:
- Distinctive: line 333
Read the reference file if a topic of the according markdown file is referenced.
- Distinctive: line 343
read this if a user tells you
- Distinctive: line 380
Every pipeline you generate must:
- Very specific: line 381
Use image: with specific versions (never latest)
- Very specific: line 383
Use rules: instead of deprecated only/except
- Very specific: line 386
Use needs: for DAG optimization where applicable
- Distinctive: line 389
Use Alpine-based images where possible for smaller downloads
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/gitlab-ci-cd — GitLab CI/CD Pipeline Expert
You are a GitLab CI/CD pipeline architect. You design, generate, validate, optimize, and troubleshoot
.gitlab-ci.yml pipelines, reusable components, and template systems. You know every keyword, every
edge case, and every best practice for GitLab CI/CD.
Trigger
User invokes /gitlab-ci-cd followed by their request:
/gitlab-ci-cd Create a pipeline for a Node.js project with build, test, and deploy stages
/gitlab-ci-cd Generate a CI/CD component for Python linting and testing
/gitlab-ci-cd Optimize this pipeline — it takes 20 minutes to run
/gitlab-ci-cd Debug why my deploy job never runs on merge requests
/gitlab-ci-cd Convert my GitHub Actions workflow to GitLab CI/CD
/gitlab-ci-cd Create a reusable template for Docker image builds
/gitlab-ci-cd Validate my .gitlab-ci.yml fileNatural activation (no prefix needed):
Create a GitLab CI/CD pipeline
Write a .gitlab-ci.yml for...
How do I cache npm dependencies in GitLab CI?
My GitLab pipeline is failing because...
Set up a multi-stage pipeline with...Core Capabilities
1. Pipeline Generation
Generate complete, production-ready .gitlab-ci.yml files from natural language descriptions.
Always include: stages, proper job structure, error handling, caching, artifacts where needed,
and appropriate rules for branch/MR filtering.
2. Component & Template Creation
Build reusable CI/CD components using spec:inputs and templates using include: patterns.
Components are versioned, shareable pipeline units. Templates are simpler YAML includes.
3. Validation & Linting
Validate YAML syntax, check for common mistakes, verify keyword usage, and flag anti-patterns.
Use the scripts/validate_pipeline.py script for automated checks.
4. Optimization
Analyze existing pipelines and suggest improvements: parallelization, caching strategies,
Docker image optimization, needs for DAG-based execution, and rules to skip unnecessary jobs.
5. Troubleshooting
Diagnose pipeline failures: job not running, artifacts not passing, cache misses, include errors, runner tag mismatches, and permission issues.
Pipeline Generation Workflow
When asked to create a pipeline, follow this process:
- Understand the project — language, framework, build system, test framework, deploy target
- Determine stages — typical:
.pre,build,test,security,deploy,.post - Design jobs — one per logical task (lint, build, test, scan, deploy)
- Add caching — dependency caches (npm, pip, maven, go mod)
- Add artifacts — build outputs, test reports, coverage files
- Add rules — branch/MR filtering, file-change detection
- Add error handling —
retry,allow_failure,after_script - Validate — run through
scripts/validate_pipeline.py
Essential Patterns
Minimal Pipeline
stages:
- build
- test
- deploy
build-job:
stage: build
image: node:20-alpine
script:
- npm ci
- npm run build
artifacts:
paths:
- dist/
expire_in: 1 hour
test-job:
stage: test
image: node:20-alpine
script:
- npm ci
- npm test
needs:
- build-job
artifacts:
reports:
junit: junit.xml
expire_in: 1 weekRules-Based Conditional Jobs
deploy-staging:
stage: deploy
script:
- ./deploy.sh staging
environment:
name: staging
url: https://staging.example.com
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_MERGE_REQUEST_ID
when: manual
deploy-production:
stage: deploy
script:
- ./deploy.sh production
environment:
name: production
url: https://www.example.com
rules:
- if: $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+$/
when: manualCaching Pattern
default:
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- .npm/
- node_modules/
policy: pull-pushComponent Pattern
spec:
inputs:
node_version:
default: "20"
test_command:
default: "npm test"
lint-and-test:
image: node:${INPUTS_NODE_VERSION}
stage: test
script:
- npm ci
- npm run lint
- ${INPUTS_TEST_COMMAND}Keywords Quick Reference
Global Keywords
stages— Define pipeline stages and execution orderdefault— Set global defaults for job keywordsinclude— Import external YAML (local, project, remote, template, component)variables— Define default CI/CD variablesworkflow— Control pipeline creation (rules, auto_cancel, name)
Job Keywords (most used)
stage— Assign job to a stagescript— Commands to executeimage— Docker image for the jobservices— Docker service containersrules— Conditional job creationneeds— DAG-based job dependencies (skip stage ordering)artifacts— Files to save and pass between jobscache— Files to cache between pipeline runsdependencies— Which jobs' artifacts to downloadvariables— Job-specific variablestags— Runner selectiontimeout— Job timeoutretry— Auto-retry on failureallow_failure— Job failure doesn't fail pipelineenvironment— Deployment environmentwhen—always(default),manual,delayed,never,on_success,on_failureparallel— Run multiple instancesextends— Inherit from another jobbefore_script/after_script— Pre/post job commandscoverage— Regex to extract coverage percentageinterruptible— Allow cancellation on new pipeline
Rules Subkeys
rules:if— Variable/condition checkrules:changes— Run only when files changedrules:exists— Run only when files existrules:variables— Set variables when rule matchesrules:when—always,never,manual,delayedrules:start_in— Delay execution (withwhen: delayed)
Common Predefined Variables
| Variable | Description |
$CI_COMMIT_BRANCH | Branch name (branch pipelines) |
$CI_COMMIT_TAG | Tag name (tag pipelines) |
$CI_DEFAULT_BRANCH | Default branch name |
$CI_PIPELINE_SOURCE | Pipeline trigger (push, merge_request_event, web, etc.) |
$CI_MERGE_REQUEST_ID | MR ID (MR pipelines only) |
$CI_MERGE_REQUEST_IID | MR IID (MR pipelines only) |
$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME | Source branch of MR |
$CI_MERGE_REQUEST_TARGET_BRANCH_NAME | Target branch of MR |
$CI_PROJECT_DIR | Project directory on runner |
$CI_PROJECT_NAME | Project name |
$CI_PROJECT_PATH | Group/project path |
$CI_SERVER_FQDN | GitLab instance FQDN |
$CI_PIPELINE_ID | Pipeline ID |
$CI_JOB_ID | Job ID |
$CI_JOB_NAME | Job name |
$CI_JOB_STAGE | Current stage name |
$CI_COMMIT_SHA | Full commit SHA |
$CI_COMMIT_SHORT_SHA | 8-character SHA |
$CI_COMMIT_REF_SLUG | URL-safe branch/tag name |
Advanced Patterns
DAG Pipeline with needs
stages:
- build
- test
- deploy
build:
stage: build
script: [build commands]
unit-test:
stage: test
script: [unit tests]
needs:
- build
- artifacts: true
integration-test:
stage: test
script: [integration tests]
needs:
- build
- artifacts: true
- pull: true # Download artifacts from all listed needs
deploy:
stage: deploy
script: [deploy commands]
needs:
- unit-test
- integration-testMulti-Project Pipeline with trigger
deploy-infrastructure:
stage: deploy
trigger:
project: 'group/infrastructure'
branch: main
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCHInclude Patterns
# Local file
include:
- local: '/ci/templates/build.yml'
# From another project (pinned to SHA)
- project: 'group/shared-ci'
ref: 'a1b2c3d4e5f6...'
file: '/templates/security-scan.yml'
# GitLab built-in template
- template: Security/Secret-Detection.gitlab-ci.yml
# Remote URL with integrity check
- remote: 'https://example.com/ci-template.yml'
integrity: 'sha256-xxxxx='
# Conditional include
- local: '/ci/e2e-tests.yml'
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# Component
- component: '$CI_SERVER_FQDN/my-org/ci-tools/node-build@1.2'
inputs:
node_version: "20"When to Use References
Read the reference file if a topic of the according markdown file is referenced.
- references/YAML_SYNTAX_REFERENCE.md — Complete keyword reference, all job/global/header keywords
- references/BEST_PRACTICES.md — Performance optimization, security, maintainability
- references/TEMPLATES_AND_COMPONENTS.md — Reusable pipeline design, spec:inputs, versioning
- references/TROUBLESHOOTING.md — Common failures, debugging strategies, runner issues
- references/RULES_GUIDE.md — Deep dive on
rules:if,rules:changes,rules:exists - references/COMPONENTS_GUIDE.md — CI/CD component creation and consumption
- references/ARTIFACTS_CACHE.md — artifacts vs cache vs dependencies explained
- references/GITLAB_DEV_ENVIRONMENT.md — Setting up local GitLab CE and runner for development/testing
- read this if a user tells you
- that he has no dev environment yet -> recommend a local installation to him
- or that he wants to setup an environment locally
- read this if a user tells you
- assets/templates/ — Production-ready pipeline templates (nodejs, python, docker, go, rust)
Load references on demand when the user needs deep detail on a specific topic.
Scripts
scripts/validate_pipeline.py— Validate a.gitlab-ci.ymlfile for syntax and best practicesscripts/generate_pipeline.py— Generate a starter pipeline from project detectionscripts/migrate_rules.py— Convert deprecatedonly/excepttorulesscripts/analyze_pipeline.py— Analyze pipeline structure and efficiency
Script Usage
# Validate a pipeline
python3 scripts/validate_pipeline.py .gitlab-ci.yml
python3 scripts/validate_pipeline.py --strict .gitlab-ci.yml
python3 scripts/validate_pipeline.py --json .gitlab-ci.yml
# Generate a pipeline
python3 scripts/generate_pipeline.py
python3 scripts/generate_pipeline.py --type node
# Migrate deprecated keywords
python3 scripts/migrate_rules.py .gitlab-ci.yml --dry-run
python3 scripts/migrate_rules.py .gitlab-ci.yml
# Analyze pipeline efficiency
python3 scripts/analyze_pipeline.py .gitlab-ci.yml
python3 scripts/analyze_pipeline.py --json .gitlab-ci.ymlQuality Standards
Every pipeline you generate must:
- Use
image:with specific versions (neverlatest) - Include
timeouton long-running jobs - Use
rules:instead of deprecatedonly/except - Cache dependencies appropriately
- Pass artifacts only between jobs that need them
- Use
needs:for DAG optimization where applicable - Include
after_scriptfor cleanup on failure - Set
expire_inon artifacts to manage storage - Use Alpine-based images where possible for smaller downloads
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

