Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

gitlab-ci

БесплатноЗапускает вложенные скриптыНе проверен

Authors, reviews, hardens and debugs GitLab CI/CD pipelines, and checks them with bundled scripts for server-side validation, image pinning, secret exposure…

crewrigот crewrig★ 24 звезды на GitHub

Об этом скилле

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:rules runs 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 with rules:, and GitLab rejects the job. Migrate each job fully, not partly. check-rules.ts finds 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:22 moves with every release. When you author a new pipeline, or the user asks you to harden one, give each image: and services: entry at least an exact version tag, patch version included (for example node:22.11.0-alpine3.20), never latest or a major-only tag. A digest (@sha256: plus 64 hex characters) is the strongest pin and the only form check-pinned-images.ts accepts, 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_TRACE and set -x print 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
Полный SKILL.md на GitHub

Установить gitlab-ci в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/caching-and-artifacts.mdreferences/includes-and-components.mdreferences/pipeline-syntax.mdreferences/rules-and-triggers.mdreferences/runners-and-executors.mdreferences/security-and-permissions.mdreferences/shared-friction-reporting.mdreferences/variables-and-secrets.mdscripts/check-pinned-images.tsscripts/check-rules.tsscripts/check-secrets-exposure.tsscripts/lint-gitlab-ci.ts

FAQ

Что делает скилл gitlab-ci?

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).

Как установить скилл gitlab-ci?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл gitlab-ci запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить gitlab-ci с