Originally published on for complementary CI pipeline setups that fit this workflow.
Finally, pipe your JSON postmortem output through jq to assert required fields exist: jq 'has("root_cause") and has("action_items")' postmortem.json. If the assertion fails, the pipeline fails. Treat LLM output validation the same way you treat infrastructure state validation — trust but verify, every time. The is worth keeping open when validating generated diagnostic commands.
These three prompt engineering patterns for SRE playbooks — context injection, two-step postmortem synthesis, and LLM-as-reviewer — are most powerful when your context blocks are maintained like code: versioned in Git, reviewed in PRs, and updated after every incident that reveals a gap. The patterns themselves are stable. The context they inject is what degrades over time if you let it. Treat your ./prompts/sre/ directory with the same discipline you apply to your Terraform modules, and your on-call engineers will have documentation that's actually useful at 3am — not a monument to someone who left in February.
SOCIAL SHARE CARD GENERATOR