GitLab CI/CD Catalog Component Authoring Prompt
Design, version, and publish reusable CI/CD Catalog components (the modern replacement for copy-pasted include: snippets) with typed inputs, sane defaults, and a release workflow.
- Target user
- Platform teams standardizing pipelines across many GitLab projects
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a senior platform engineer who maintains an internal GitLab CI/CD Catalog used by 200+ repositories. You know the difference between fragile `include:` copy-paste and a properly versioned, input-driven component. I will provide: - The current shared pipeline snippets we copy between projects - The duplication / drift pain points we hit - Our GitLab tier and version, and whether the CI/CD Catalog is enabled - The languages and deploy targets these projects use Your job: 1. **Component vs. include vs. template** — explain when a Catalog component (`spec:inputs` + `templates/`) beats a plain `include:project` or `include:remote`, and when it is overkill. Be opinionated. 2. **Component design** — for each candidate, define the public contract: - `spec:inputs:` with `type` (string/number/boolean/array), `default`, `options`, and `regex` validation - Which inputs are required vs. optional, and why mandatory inputs are a smell if there are too many - Naming: one component per concern (build, test, scan, deploy) — not a god-component 3. **Repo layout** — show the canonical structure: `templates/<component>.yml`, `templates/<component>/template.yml` for directory components, plus `README.md` per component (the Catalog renders it). 4. **Versioning & release** — wire a `release:` job so tagging publishes to the Catalog; explain `~latest`, semantic version pinning, and why consumers must pin to a tag, never a branch. 5. **Consumption example** — show a consumer `.gitlab-ci.yml` using `include:component:` with the new `$CI_SERVER_FQDN/<path>@<version>` syntax and passing `inputs:`. 6. **Migration plan** — convert one existing copy-pasted snippet into a component, ship it, and roll it out to three pilot repos before mandating it. 7. **Testing** — how to test a component in isolation (a `.gitlab-ci.yml` in the component repo that consumes its own templates) so breaking changes are caught before release. Output as: (a) one full component with `spec:inputs` + template, (b) the release job, (c) a consumer example, (d) a migration checklist, (e) anti-patterns (unpinned versions, too many required inputs, leaking internal job names into the public contract). Bias toward: small composable components, validated inputs, strict version pinning.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
GitLab CI/CD Component spec:inputs Typed Interface Prompt
Design a reusable CI/CD component with a typed spec:inputs interface — defaults, enums, regex validation, and versioned releases — so consumers configure it through inputs instead of brittle global variables.
-
GitLab CI/CD Component Versioning and Release Publishing Prompt
Design a release and semantic-versioning workflow that publishes CI/CD Catalog components to the catalog on tag, manages ~latest vs. pinned versions, and gives consumers a safe upgrade path without breaking downstream pipelines.
-
GitLab CI/CD k6 Load Test Performance Gate Prompt
Design a .gitlab-ci.yml stage that runs k6 load/performance tests against a review or staging environment, enforces threshold-based pass/fail gates, and surfaces results as artifacts and metrics reports in merge requests.
-
GitLab CI/CD Publish to the Package Registry (npm, Maven, generic) Prompt
Design .gitlab-ci.yml jobs that build and publish versioned artifacts to the project or group Package Registry using CI_JOB_TOKEN auth, with proper version gating, immutability, and consumer install config.
More GitLab CI/CD prompts & error guides
Browse every GitLab CI/CD prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.