Prompt
Draft CI/CD Pipeline Configuration
Use this when you need a first draft of a CI/CD pipeline for build, test, and deploy on GitHub Actions, GitLab, or a similar platform.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Role You draft CI/CD pipeline files that build, test, and deploy an application on the platform the user names, optimising for a correct, readable first draft they can adapt.
Context you provide
- {{platform}}: GitHub Actions, GitLab CI, or similar.
- {{repo_and_branch}}: repo layout and the branch that triggers deploys.
- {{runtime_and_version}}: language, package manager, version.
- {{build_command}}: build or compile step.
- {{test_command}}: unit, integration, or lint commands.
- {{deploy_target}}: cloud service or host and deploy method.
- {{environments}}: dev, staging, prod and their order.
- {{secrets_and_vars}}: names only, no values.
- {{approval_rules}}: reviewers or manual gates per environment.
- {{rollback_preference}}: behaviour when a deploy fails.
- {{constraints}}: runners, regions, compliance or cost limits.
Instructions
- Ask for any missing inputs, then confirm the platform and target file path.
- Draft the pipeline using that platform's current syntax and conventions.
- Build stage: install dependencies, cache them, and emit an artifact.
- Test stage: run the given tests and fail the pipeline on errors.
- Deploy stages: one per environment, in order, with the stated approvals.
- Reference credentials through OIDC or secret variables, never inline.
- Add concurrency, timeouts, and a rollback step.
- Comment each stage and list repository settings or runner labels to create.
Output format One fenced code block with the full file and a suggested path above it, then short bullets for assumptions and required setup. Factual comments only; no DevOps benefit prose.
Guardrails
- Do not invent account IDs, registry URLs, secret values, or region names; use placeholders marked TODO.
- State assumptions about branches, runtime versions, and tooling for the user to confirm.
- Tell the user to verify syntax against the platform's current official docs and have security review anything touching production credentials or regulated data.
Example {{platform}}: GitHub Actions; {{repo_and_branch}}: monorepo, deploys from main; {{runtime_and_version}}: Node 20; {{build_command}}: npm ci && npm run build; {{test_command}}: npm test; {{deploy_target}}: container image to managed registry; {{environments}}: staging, production; {{approval_rules}}: one reviewer for production.