gitlab-ci

gitlab-ci is a cursor rule for Cursor from sanjeed5/awesome-cursor-rules-mdc. It costs 3,962 tokens per session, scanned A, original, CC0-1.0.

A set of guidelines for GitLab CI/CD pipelines. These pipelines automatically build, test, and deploy software when changes are made.

In plain words
What is it for?
Use it to split GitLab pipeline configuration into smaller files, reuse common steps, and organize builds, tests, and deployments.
Why use it?
It helps avoid large, confusing pipeline files while improving reuse, reliability, speed, and security.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is - ./scripts/deploy.sh staging.

Good fit Use it to split GitLab pipeline configuration into smaller files, reuse common steps, and organize builds, tests, and deployments.

Compare 6 cursor rules from other repositories ↓
About the project

awesome-cursor-rules-mdc is a generator that creates Cursor MDC rule files from structured library information, using semantic search and language models to gather and organize guidance. Developers use it to produce reusable rules for libraries in Cursor, and the catalogue includes 200 of those rules.

sanjeed5/awesome-cursor-rules-mdc · 3,571 stars · on GitHub

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/sanjeed5/awesome-cursor-rules-mdc
agentmods
npx agentmods add rules/sanjeed5/awesome-cursor-rules-mdc/gitlab-ci

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gitlab-ci

README.md
[![agentmods](https://agentmods.dev/badge/rules/sanjeed5/awesome-cursor-rules-mdc/gitlab-ci.svg)](https://agentmods.dev/rules/sanjeed5/awesome-cursor-rules-mdc/gitlab-ci)
Your own site
<a href="https://agentmods.dev/rules/sanjeed5/awesome-cursor-rules-mdc/gitlab-ci"><img src="https://agentmods.dev/badge/rules/sanjeed5/awesome-cursor-rules-mdc/gitlab-ci.svg" alt="Measured on agentmods" height="20"></a>
Per session 3,962 This file is loaded in full into every session.
When invoked 3,962 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.03962 $0.03962
Opus 5 $0.01981 $0.01981
Sonnet 5 $0.00792 $0.00792
Haiku 4.5 $0.00396 $0.00396

Measured 3d ago against content hash 2362ba220e7a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

gitlab-ci scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

rules-mdc/gitlab-ci.mdc · 640 lines

How it starts

The opening of the file, as written. The whole thing — 640 lines — stays where its author put it; the contents beside it link to each section on GitHub.

gitlab-ci Best Practices

GitLab CI/CD is the backbone of modern DevOps. This guide ensures your .gitlab-ci.yml files are robust, maintainable, performant, and secure. Follow these rules rigorously.

1. Code Organization and Structure

Your .gitlab-ci.yml is code. Treat it with the same discipline as application code.

1.1. Modularize with include

Break down large pipelines into smaller, focused YAML files. This improves readability, reusability, and reduces merge conflicts. Keep the root .gitlab-ci.yml as an orchestrator.

BAD: Monolithic .gitlab-ci.yml

# .gitlab-ci.yml (too long, hard to navigate)
stages:
  - build
  - test
  - deploy

build_frontend:
  stage: build
  script:
    - npm install
    - npm run build

test_frontend:
  stage: test
  script:
    - npm run test:unit

build_backend:
  stage: build
  script:
    - pip install -r requirements.txt
    - python setup.py build

test_backend:
  stage: test
  script:
    - pytest

deploy_staging:
  stage: deploy
  script:
    - deploy-script --env staging
  rules:
    - if: $CI_COMMIT_BRANCH == "main"
      when: manual

GOOD: Modularized with include

# .gitlab-ci.yml (root orchestrator)
include:
  - local: '.gitlab/ci/stages.yml'
  - local: '.gitlab/ci/frontend.yml'
  - local: '.gitlab/ci/backend.yml'
  - local: '.gitlab/ci/deploy.yml'

# .gitlab/ci/stages.yml
stages:
  - build
  - test
  - security
  - deploy

# .gitlab/ci/frontend.yml
.frontend_template: &frontend_template
  image: node:20-alpine
  cache:
    key: ${CI_COMMIT_REF_SLUG}-node-modules
    paths:
      - frontend/node_modules/
    policy: pull-push
  before_script:
    - cd frontend

build_frontend:
  <<: *frontend_template
  stage: build
  script:
    - npm install
    - npm run build
  artifacts:
    paths:
      - frontend/dist/
    expire_in: 1 day

test_frontend:
  <<: *frontend_template
  stage: test
  script:
    - npm run test:unit

# .gitlab/ci/backend.yml
.backend_template: &backend_template
  image: python:3.11-slim-buster
  cache:
    key: ${CI_COMMIT_REF_SLUG}-pip-cache
    paths:
      - backend/.venv/
    policy: pull-push
  before_script:
    - cd backend
    - python -m venv .venv
    - source .venv/bin/activate

build_backend:
  <<: *backend_template
  stage: build
  script:
    - pip install -r requirements.txt
    - python setup.py build
  artifacts:
    paths:
      - backend/dist/
    expire_in: 1 day

test_backend:
  <<: *backend_template
  stage: test
  script:
    - pytest

# .gitlab/ci/deploy.yml
deploy_staging:
  stage: deploy
  image: alpine/git:latest
  script:
    - echo "Deploying to staging..."
    - ./scripts/deploy.sh staging
  rules:
    - if: $CI_COMMIT_BRANCH == "main"
      when: manual
  environment:
    name: staging
    url: https://staging.example.com

Read the full file on GitHub · 640 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 640 lines · 3,962 tokens per session scan A 2362ba220e7a

Subscribe to this mod's changes

gitlab-ci is a cursor rule published in the GitHub repository sanjeed5/awesome-cursor-rules-mdc (3,571 stars, last pushed 3mo ago), licensed CC0-1.0. It adds 3,962 tokens to every session, about $0.0198 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.