It is late on a Friday, the fix is ready, and the last step of the deploy is a wiki page someone wrote by hand eighteen months ago. That page is the reason deployments feel risky. These five Gemini prompts turn the page into a pipeline: steps, checks, rollback, and a secrets pass before anything runs unattended.
What to know before you paste
- Paste the runbook and the config as they are, including the steps that look obvious. The obvious steps are the ones people forget to automate.
- Scrub credentials before pasting. Replace tokens with placeholders such as [deploy token]; Gemini will keep whatever it is given.
- Name your CI provider and shell. Generated commands differ enough between them to matter.
The prompts
1. Runbook into pipeline steps
Here is our deploy runbook: [runbook]. Turn it into pipeline steps for [ci provider], with the exact command per step, and mark which step needs a manual approval.
What it does: Converts tribal knowledge into a file in the repository.
How to use: replace [runbook] and [ci provider]; run the pipeline in a staging branch before it touches production.
2. Failure modes per step
For these deployment steps: [steps], list what can fail at each one and what the pipeline should do when it does. Assume the deploy must be resumable.
What it does: Decides the failure behaviour while you are calm.
How to use: replace [steps]; for each failure, write the exit code and the message the on-call person will see.
3. A rollback you have rehearsed
For this deployment: [deployment], write the rollback procedure step by step, including how to verify the rollback actually worked.
What it does: Gives you the second half of the deploy that usually gets skipped.
How to use: replace [deployment]; run it once on purpose so the first attempt is not during an incident.
4. Secrets audit of the config
Here is the pipeline config: [config]. Point out where secrets are hardcoded, printed or passed on a command line, and what to replace each with.
What it does: Finds the credentials that leak into logs and build history.
How to use: replace [config]; rotate anything that was already committed, removing it is not enough.
5. Post-deploy smoke checks
Write the smoke checks to run right after this deploy completes: [services]. Each check needs a command and a pass condition.
What it does: Catches the deploy that succeeded and broke something.
How to use: replace [services]; keep the set small enough to run on every deploy without debate.
FAQ
Should deploys run on merge or on a tag?
On merge to the main branch for services that ship continuously, on a tag when you need a named, auditable release. Running both is fine as long as the tag path does not re-run the same migrations.
Can I automate a database migration in the same pipeline?
You can, with two rules: migrations run before the new code and must tolerate the old code still running. Anything destructive goes in a separate, later step that a person approves.
What belongs in a health check?
A check that proves the service can do its core job, not just that the process is up. Reaching the database and answering one real query tells you more than a ping that returns a constant string.
How do I deploy without downtime?
Run the new version next to the old one, move traffic over, then remove the old. That needs the app to tolerate both versions during the switch, which usually means the database change has to be backwards compatible for one release.
Is it worth automating a deploy that runs once a month?
Yes, because the monthly deploy is the one nobody remembers. Automation is less about frequency and more about not depending on someone’s memory at an inconvenient hour.
Keep going
- Browse the Coding prompt library
- Gemini Prompts for Terraform Configs: 5 Ready-to-Use Ideas
- Claude prompts for countdown posts
These prompts are free to use. Copy them, tweak the [variables], ship something.