gitlab-ci

GitLab CI/CD pipelines with runners and stages. Use for GitLab automation.

7 stars

Best use case

gitlab-ci is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

GitLab CI/CD pipelines with runners and stages. Use for GitLab automation.

Teams using gitlab-ci should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/gitlab-ci/SKILL.md --create-dirs "https://raw.githubusercontent.com/G1Joshi/Agent-Skills/main/skills/devops/gitlab-ci/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/gitlab-ci/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How gitlab-ci Compares

Feature / Agentgitlab-ciStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

GitLab CI/CD pipelines with runners and stages. Use for GitLab automation.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# GitLab CI/CD

GitLab CI/CD is known for its robust pipeline definition (`.gitlab-ci.yml`) and Auto DevOps capabilities. In 2025, **CI Components** replace legacy templates for modular pipeline composition.

## When to Use

- **GitLab Users**: It's integrated and excellent.
- **Complex Pipelines**: The DAG (Directed Acyclic Graph) capabilities are sophisticated (`needs` keyword).
- **On-Prem**: Excellent support for air-gapped instances.

## Quick Start

```yaml
# .gitlab-ci.yml
stages:
  - build
  - test

build-job:
  stage: build
  image: node:20
  script:
    - npm ci
    - npm run build
  artifacts:
    paths:
      - dist/

test-job:
  stage: test
  image: node:20
  script:
    - npm test
  needs: [build-job]
```

## Core Concepts

### `.gitlab-ci.yml`

The heart of the pipeline. Defines stages, jobs, and environment variables.

### Runners

The agents that run jobs. Unique feature: **Docker-in-Docker** support is first-class (using `services: docker:dind`).

### CI Components (2025)

Reusable pipeline parts listed in the CI Catalog. Replaces the old `include: template` method with versioned, input-driven components.

## Best Practices (2025)

**Do**:

- **Use CI Components**: Adopt the module catalog.
- **Use `rules`**: Control when jobs run (e.g., only on Merge Requests, or only when `package.json` changes).
- **Use `cache` vs `artifacts`**: Use `cache` for dependencies (node_modules) and `artifacts` for output binaries passed between stages.

**Don't**:

- **Don't use `only`/`except`**: They are deprecated. Use `rules`.

## References

- [GitLab CI/CD Documentation](https://docs.gitlab.com/ee/ci/)