Skip to main content
Alison Aquinas logoAlison's LLM Skills Marketplace

gitlab-ci

Included in skill bundleci-cdView on GitHub ↗

Files

SKILL.mdagentsreferences

Install

Install only this skill with npx skills
npx skills add alisonaquinas/llm-ci-dev --skill 'gitlab-ci' -g -y
Install the containing skill bundle
/plugin install ci-cd@llm-skills
Download gitlab-ci-skill.zip
This skill is bundled inside ci-cd. Use npx skills when you only want this skill, or install the bundle once to make every included skill available through the plugin marketplace flow. Browse the full skill bundle repository at github.com/alisonaquinas/llm-ci-dev.

Invoke

Invoke this skill after installation
/ci-cd:gitlab-ci

SKILL.md


name: gitlab-ci description: > Write and maintain GitLab CI pipelines in .gitlab-ci.yml with jobs, stages, testing, caching, runners, variables, and secrets.

GitLab CI

Write and maintain GitLab CI pipelines to automate testing, building, and deployment workflows. This skill covers .gitlab-ci.yml structure, job anatomy, runners, caching, testing strategies, and secrets management.


Intent Router

Load reference files for depth on specific topics:

TopicFileLoad when...
Pipeline Basicsreferences/pipeline-basics.mdStructuring .gitlab-ci.yml, jobs, stages, dependencies, rules, extends, include, parallel, trigger, MR pipelines
Runners & Cachingreferences/runners-and-caching.mdRunner types, executor selection, tags, cache key design, artifacts, Docker-in-Docker, service containers
Testing & Qualityreferences/testing-and-quality.mdJUnit reports, code coverage, SAST/DAST/dependency scanning, merge request tests, matrix testing
Variables & Secretsreferences/variables-and-secrets.mdPredefined variables, custom variables, protected+masked, vault integration, dotenv, CI_JOB_TOKEN, OIDC

Quick Start

Minimal Pipeline Structure

A .gitlab-ci.yml file at the repository root defines all pipeline stages and jobs:

stages:
  - build
  - test
  - deploy

build:
  stage: build
  script:
    - make build

test:
  stage: test
  script:
    - make test

deploy:
  stage: deploy
  script:
    - make deploy

Common Keywords

KeywordPurpose
stagesDefine pipeline order (executed sequentially)
scriptCommands to execute in the job
stageWhich stage this job belongs to
needsExplicit job dependencies; allows parallel jobs in same stage
rulesConditional execution (if/when/variables)
cachePersist data between jobs (e.g., dependencies, build artifacts)
artifactsPreserve build outputs for download or downstream jobs
before_scriptRun before job commands
after_scriptRun after job commands (even if job fails)
extendsReuse job templates from local or included YAML
includeImport external .gitlab-ci.yml files
retryRetry job on failure
timeoutJob execution timeout
tagsSelect runner by tag
variablesJob-level or global environment variables
only/exceptLegacy conditional execution (use rules instead)

File Placement

.gitlab-ci.yml must be at the repository root to be automatically detected. Additional configuration files can be included via include keyword.

YAML Validation

Validate .gitlab-ci.yml locally before pushing:

# Using gitlab-runner (if installed)
gitlab-runner verify

# Using yamllint (with custom config)
yamllint -d relaxed .gitlab-ci.yml

# Using curl to GitLab API (requires authentication)
curl --header "PRIVATE-TOKEN: $CI_JOB_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{"dry_run": true, "ref": "main"}' \
  https://gitlab.example.com/api/v4/projects/:id/ci/lint

Related References

  • Load Pipeline Basics to design job dependencies, use extends, and structure stages
  • Load Runners & Caching for executor selection and performance optimization
  • Load Testing & Quality to integrate testing reports and code scanning
  • Load Variables & Secrets to manage CI/CD secrets safely

Cross-References

Related skills in this collection:

  • ci-architecture — High-level CI/CD pipeline design patterns
  • gitlab-docs — GitLab API and web UI reference
  • yaml-linting — Validate .gitlab-ci.yml syntax and style
  • yaml-lsp — YAML editor integration for .gitlab-ci.yml
← Back to marketplace