gitlab-ci
FreeRuns bundled scriptsNot checkedAuthors, reviews, hardens and debugs GitLab CI/CD pipelines, and checks them with bundled scripts for server-side validation, image pinning, secret exposure…
by crewrig★ 24 GitHub starsAbout this skill
GitLab CI/CD
Work on a .gitlab-ci.yml the way a reviewer who has seen the usual failures would: run the checks below before presenting a pipeline, and give each retained rule its reason when you explain a change. Syntax tables live in the references; this file holds what is easy to get wrong.
Scripts
Run node scripts/<name>.ts from the skill directory, or give its full path from elsewhere. The three offline scripts read only the target you give them, a file or a directory (a directory means <dir>/.gitlab-ci.yml plus the YAML under <dir>/.gitlab/). lint-gitlab-ci.ts takes one file and queries GitLab.
| When | Command | Exit 1 means |
|---|---|---|
| After writing or changing a pipeline, to ask GitLab itself whether it is valid | node scripts/lint-gitlab-ci.ts .gitlab-ci.yml (add --repo <group/project> when the working copy is not a GitLab checkout, --timeout <seconds> to change the 30 s bound) |
GitLab reports the configuration invalid; each finding is one error line. |
| Reviewing, authoring or migrating any pipeline | node scripts/check-rules.ts <file-or-dir> |
A job still carries only: or except:, or jobs exist with no top-level workflow:rules. |
| Reviewing or authoring any pipeline | node scripts/check-pinned-images.ts <file-or-dir> (add --json for a structured result) |
An image: or services: reference is not pinned to an @sha256: digest, or the target does not exist. |
| Reviewing or authoring any pipeline | node scripts/check-secrets-exposure.ts <file-or-dir> |
A credential literal, a printed secret, set -x or CI_DEBUG_TRACE; also a target that does not exist. |
Two exit-code contracts coexist. lint-gitlab-ci.ts and check-rules.ts follow the full one, with --json giving {ok, data, findings}: 0 ok, 1 finding, 2 usage error, 3 the check could not run. The two older scripts keep their legacy codes, which existing callers rely on: 0 clean or nothing to scan, 1 a finding or a missing target, 2 usage error. They have no exit 3, and only check-pinned-images.ts has --json.
lint-gitlab-ci.ts is a read-only server-side query: it runs glab ci lint against GitLab, with a timeout, and writes nothing. Without --repo, glab fails before linting when the directory is not a GitLab checkout, and the script then exits 3 and says so, so pass --repo whenever you work outside a checkout. When it exits 3 the pipeline was not validated server-side, whatever the reason (no glab, no login, no network, a timeout). Run the three offline scripts instead, and tell the user plainly that the server-side validation did not happen. Never describe a pipeline as valid on the strength of an exit 3.
No script simulates or executes a pipeline; glab ci lint checks configuration only.
Rules whose reason is not obvious
- A pipeline without
workflow:rulesruns twice when a branch has an open merge request: once as a branch pipeline, once as a merge request pipeline. Add the guard from the skeleton below. only:/except:cannot share a job withrules:, and GitLab rejects the job. Migrate each job fully, not partly.check-rules.tsfinds the legacy keys.- Pin every image, and check what you wrote. A tag can be re-pointed in the registry under an unchanged pipeline, and a major tag such as
node:22moves with every release. When you author a new pipeline, or the user asks you to harden one, give eachimage:andservices:entry at least an exact version tag, patch version included (for examplenode:22.11.0-alpine3.20), neverlatestor a major-only tag. A digest (@sha256:plus 64 hex characters) is the strongest pin and the only formcheck-pinned-images.tsaccepts, so it still reports a tag. Run it on the file you wrote before answering, replace any reference you can resolve with its digest, and list the remaining findings for the user as tags still to be digest-pinned. Keep the readable tag in a comment next to a digest. When you diagnose or fix an existing pipeline, change only what the fix needs and report unpinned images as a finding instead of editing them, because unrequested edits hide the fix. - Masking is narrow. A masked variable must be at least 8 characters on one line from a restricted character set, or it logs in the clear. It is a substring replacement in the job log only, so a split, decoded or re-encoded value escapes it, and it does nothing against a job that sends the value elsewhere.
- Trace options defeat masking.
CI_DEBUG_TRACEandset -xprint every expanded variable, masked ones included, so keep them out of any job that sees a credential. - Protect deploy credentials as well as masking them. A protected variable reaches only pipelines on protected branches and tags, so a feature branch cannot read it.
- Bind a secret to the job or environment that needs it. A global
variables:entry is inherited by every job, including ones that run untrusted code. - **Prefer `id_tok
Install gitlab-ci in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
FAQ
What does the gitlab-ci skill do?
Authors, reviews, hardens and debugs GitLab CI/CD pipelines, and checks them with bundled scripts for server-side validation, image pinning, secret exposure and legacy only/except keys. Use when reading or writing `.gitlab-ci.yml`, `rules:` or `workflow:rules`, `include:` or CI/CD Components, `id_tokens`, a runner or `glab ci lint`, when a pipeline runs twice or a job stays pending, or when migrating a pipeline from GitHub Actions, Jenkins or CircleCI to GitLab. Not for GitHub Actions workflows, Jenkins or other CI systems except as the source of a migration to GitLab, generic YAML such as Kubernetes manifests or compose files, security or threat-model reviews (security), or merge request descriptions and logbook entries (pr-logbook).
How do I install the gitlab-ci skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the gitlab-ci skill run scripts?
Yes, this skill bundles executable scripts. Review the source before installing.
Related skills
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
by Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
by Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
by Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
by Anthropic