Complete AI Training

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

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

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

  1. Ask for any missing inputs, then confirm the platform and target file path.
  2. Draft the pipeline using that platform's current syntax and conventions.
  3. Build stage: install dependencies, cache them, and emit an artifact.
  4. Test stage: run the given tests and fail the pipeline on errors.
  5. Deploy stages: one per environment, in order, with the stated approvals.
  6. Reference credentials through OIDC or secret variables, never inline.
  7. Add concurrency, timeouts, and a rollback step.
  8. 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.