Course overview
Lesson 1 of 8 · 3 promptsAI for DevOps Engineers
LESSON 01 OF 8

CI/CD Pipeline Drafts

3 prompts for DevOps Engineers

Prompts for DevOps Engineers: copy one, fill it in, paste it into your AI.

Track progress as a member

In this lesson

  1. 01Draft GitHub Actions CI/CD WorkflowUse this when you need a starting pipeline for build, test and deploy.
  2. 02Debug Failing CI Pipeline LogsUse this when you have CI error output pasted and need ranked likely causes with concrete fixes.
  3. 03Add Deployment Approval Gates to CI/CDUse this when you want to insert manual or policy checks before production deployment.
1Copy the promptClick Copy on the prompt you need.
2Paste it into your AIChatGPT, Claude, Gemini or Copilot.
3Fill in the {{brackets}}Your own details, or let the AI ask you.
4Follow up and checkUse the follow-ups, then check the facts.
01

Draft GitHub Actions CI/CD Workflow

Use this when you need a starting pipeline for build, test and deploy.

Prompt

Role You draft GitHub Actions workflows for a DevOps team, optimising for a pipeline that builds, tests and deploys reliably and is easy to audit.

Context you provide

  • {{repository_language}} - main language or runtime
  • {{package_manager}} - dependency install tool
  • {{build_command}} - build or bundle command
  • {{test_command}} - test suite command
  • {{deploy_target}} - where the built artifact goes
  • {{branch_model}} - branches for build and test, and which branch deploys
  • {{runner_os}} - runner label to use
  • {{secrets_needed}} - secret names only, no values

Instructions

  1. Ask for any missing inputs, then draft the workflow.
  2. Output one YAML file for .github/workflows/ci-cd.yml with separate build, test and deploy jobs.
  3. Use only real GitHub Actions, referenced by owner, name and major version. Do not invent actions or versions.
  4. Set triggers from the branch model and add concurrency so superseded runs cancel.
  5. Cache dependencies keyed on the lockfile. Fail the pipeline when tests fail.
  6. Gate deploy on test success and the correct branch. Keep deploy steps reversible.
  7. Comment non-obvious steps and mark every value the user must confirm.
  8. Close with a short pre-commit checklist.

Output format One YAML code block, then a checklist of at most eight items. Plain, concise language. Leave out filler, invented environment names, secret values and cloud account details.

Guardrails

  • Do not invent action names, versions, secret values or provider identifiers.
  • Flag assumptions about runner images, permissions and branch protection.
  • Tell the user to confirm secret handling and OIDC settings against GitHub Actions documentation and their organisation's security policy before merging.

Example Language: Node, package manager: npm, build: npm run build, test: npm test, deploy target: container registry, branches: main deploys, runner: ubuntu-latest, secrets: REGISTRY_TOKEN.

Open as its own page

02

Debug Failing CI Pipeline Logs

Use this when you have CI error output pasted and need ranked likely causes with concrete fixes.

Prompt

Role You are a CI/CD debugging assistant for DevOps engineers. You optimise for the fastest safe path from a failing pipeline log to a verified fix.

Context you provide

  • {{ci_platform}}: the CI service running the job
  • {{pipeline_stage}}: stage or job name that failed
  • {{error_log_excerpt}}: pasted error output, last 50 to 100 lines
  • {{build_command}}: the command the stage runs
  • {{runtime_or_image_version}}: runner image, language or tool version
  • {{recent_changes}}: commits, dependency bumps or config edits before the failure
  • {{language_and_package_manager}}: stack and lockfile tool

Instructions

  1. Ask for any missing inputs, then restate the failure in one sentence.
  2. Classify the failure: dependency resolution, test failure, permission or secret, network, resource limit, cache, or config syntax.
  3. List likely causes ranked by probability, each tied to a specific line in the log.
  4. Give a concrete fix per cause: exact command, config snippet or file change.
  5. Add one quick verification step to confirm the fix before rerunning the full pipeline.
  6. Note anything that must be checked against the CI provider's docs or a runner image manual.

Output format Markdown with headings: Failure Summary, Ranked Causes, Fixes, Verify, Watch Out For. Keep under 400 words. Plain language, no filler. Skip generic CI advice that is not tied to the pasted log.

Guardrails

  • Do not invent error codes, version numbers, plugin names or provider features. Quote only what appears in the log.
  • Label every assumption and state what evidence would confirm it.
  • Tell the user when a fix touches secrets, production credentials or provider-specific runner settings that must be verified in the provider's documentation.

Example CI platform: GitHub Actions; stage: build-and-test; error: "npm ERR! ERESOLVE unable to resolve dependency tree"; recent change: bumped a test library.

Open as its own page

03

Add Deployment Approval Gates to CI/CD

Use this when you want to insert manual or policy checks before production deployment.

Prompt

Role: You are a DevOps engineer assistant that designs CI/CD pipeline configurations with deployment approval gates. Your goal is to propose a safe, clear gate structure that fits the user's existing pipeline and tooling.

Context you provide:

  • {{ci_tool}}: CI/CD platform
  • {{pipeline_stages}}: current stages in order
  • {{target_environment}}: environment where the gate applies (e.g., production)
  • {{approval_type}}: manual, policy-based, or automated check
  • {{approvers}}: roles or groups who can approve
  • {{gate_conditions}}: conditions before approval (e.g., tests pass, scan clean)
  • {{notification_channel}}: how approvers are notified (e.g., Slack, email)
  • {{rollback_procedure}}: steps if deployment fails after gate
  • {{compliance_requirements}}: regulatory or internal policy constraints

Instructions:

  1. Ask for any missing inputs, then review the provided pipeline stages and target environment.
  2. Identify the best insertion point for the approval gate based on gate_conditions and approval_type.
  3. Draft the pipeline configuration changes for the chosen CI tool, using the correct syntax for that tool. If syntax is uncertain, ask for a sample config.
  4. Define the approval workflow: who approves, how they are notified, timeout duration, and escalation path.
  5. Include a rollback plan that triggers if the gate fails or deployment fails after approval.
  6. Provide a short checklist to test the gate in a non-production environment.
  7. List any assumptions and points that require human verification, such as policy compliance.

Output format: Use markdown with these sections: Gate Placement, Gate Configuration, Approval Workflow, Rollback Plan, Testing Checklist, Assumptions. Keep it under 500 words. Use a technical, direct tone. Leave out generic DevOps advice, tool tutorials, and invented standards or numbers.

Guardrails:

  • Do not invent CI tool syntax or policy names; ask for a sample if unsure.
  • Flag any assumption about approver roles, compliance, or timeout values.
  • Tell the user to verify gate behavior in staging and consult security or compliance teams for policy checks.

Example: CI tool: GitLab CI; stages: build, test, deploy_staging, deploy_prod; target environment: production; approval type: manual; approvers: release-manager group; gate conditions: all tests pass and security scan clean; notification: Slack #deployments; rollback: revert to previous commit.

Open as its own page

Skills for these tasks

Give your AI these skills and it does these tasks the expert way. Connect your AI once and it picks them up by itself.