先決定你現在是要學,還是要在專案裡做
網站負責解釋與分發工作包;真正的 Repository 掃描、缺口判斷與文件產出交給 Coding Agent。
SDLC 實作課 · 交付物練習
先理解這份文件替你消除什麼不確定
在 incident 發生前先決定『按哪顆按鈕』
Incident 發生時最貴的不是修復,是猶豫。Rollback Plan 預先寫好「什麼指標觸發、誰按、按完會發生什麼、多久確認」。
誰負責、交給誰
主責: DevOps + on-call SRE
協作: Dev Lead(資料兼容性)、DBA(schema 反向)、PO(業務影響告知)
下游收件: Go/No-Go、Incident Report
何時值得做
必要時機: schema migration、外部 API 變更、緩存格式變更
不需要時: 純 UI 文案、可由 flag 直接關閉
常見誤用: 寫「revert commit」就交差;忽略資料已寫入新格式
- 01讀大綱
- 02看案例
- 03填素材
- 04貼提示詞
- 05對照驗收
Anatomy · 文件解剖
輕量版先回答 6 個核心章節
章節名稱可以因團隊調整,但每一段要求的判斷不能被省略。先讀問題,再看格式。
- 01
Executive Summary
範本必要章節
3-5 行,on-call 5 分鐘內讀完即可決策。寫「觸發條件、總耗時、最大不可逆風險」
- 02
Triggers
範本必要章節
區分 SLO breach / error_rate / data_integrity 三類;每類含閾值 + 觀測窗口
- 03
Rollback Steps(ordered)
範本必要章節
每步 ordered、附 reversible flag、預估耗時、owner。Irreversible step 用 [CAUTION] 標出
- 05
Data Compatibility & Irreversible Points
範本必要章節
標明 forward / backward / both;irreversible 必列補救方案(forward-only fix)
- 07
Comms & Decision Maker
範本必要章節
最少 2 個 channel(internal + external);decision_maker 必填單一 role
- 10
Decision Log(key 1-2 條)
範本必要章節
每條必含 chosen + 至少 1 個 rejected option + 拒絕原因
Study · 對照學習
同一份交付物,先練核心,再看完整深度
輕量範本適合第一次練習與 MVP;完整範本保留跨職能交棒需要的細節。兩者都要求未知事項保持可見。
30 分鐘內先完成核心章節。
---
doc_type: "rollback-plan"
variant: "light"
status: "draft"
owner: "<your-name>"
last_updated: "YYYY-MM-DD"
upstream:
required: ["deploy-steps", "slo-spec"]
optional: ["migration-scripts"]
---
# Rollback Plan: <release-name>
**Status:** Draft v0.X · **Owner:** <DevOps + on-call SRE> · **Last updated:** YYYY-MM-DD
> [!IMPORTANT]
> **AI 填寫規則:** 本範本 6 段(編號 1, 2, 3, 5, 7, 10),全部必填——刻意沿用完整版的章節編號讓兩版可對照。每結論行內加 `(依據:deploy §XXX / slo §YYY)`;每量化欄位加 `[H]/[M]/[L]` confidence badge;rollback_steps 必須 ordered,每步附 `reversible: true/false` 與預估耗時;任何 irreversible step 必須在 Risk 段重述。
---
## 1. Executive Summary
<!-- ai-fill: 3-5 行,on-call 5 分鐘內讀完即可決策。寫「觸發條件、總耗時、最大不可逆風險」 -->
<3-5 行說明>
> **TL;DR:** <一句話:觸發 → 步驟 → 完成判定>
---
## 2. Triggers
<!-- ai-rule: 區分 SLO breach / error_rate / data_integrity 三類;每類含閾值 + 觀測窗口 -->
| Type | Signal | Threshold | Window | Confidence |
|---|---|---|---|---|
| SLO breach | error_rate | > 5% | 1 min | **[H]** |
| SLO breach | p95 latency | > baseline × 2 | 2 min | **[H]** |
| Data integrity | row count drift | > 1% | 5 min | **[M]** |
---
## 3. Rollback Steps(ordered)
<!-- ai-rule: 每步 ordered、附 reversible flag、預估耗時、owner。Irreversible step 用 [CAUTION] 標出 -->
| # | Action | Reversible? | Duration | Owner |
|---|---|---|---|---|
| 1 | Flip feature flag OFF | [YES] yes | 1 min | DevOps |
| 2 | Drain canary traffic to baseline | [YES] yes | 3 min | DevOps |
| 3 | Revert deployment to v<prev> | [YES] yes | 5 min | DevOps |
| 4 | [CAUTION] Run inverse migration (column rename) | [CAUTION] partial | 10 min | DBA |
| 5 | Verify health endpoints + smoke tests | [YES] yes | 2 min | SRE |
---
## 5. Data Compatibility & Irreversible Points
<!-- ai-rule: 標明 forward / backward / both;irreversible 必列補救方案(forward-only fix) -->
- **Compatibility direction:** backward (read old + new schema) **[H]**
- **Approach:** expand-contract
- **Irreversible points:**
- <例:drop column users.legacy_id> — **Forward-only fix:** restore from backup + replay events
---
## 7. Comms & Decision Maker
<!-- ai-rule: 最少 2 個 channel(internal + external);decision_maker 必填單一 role -->
- **Decision maker:** on-call SRE(半夜 3 點不需要 quorum)
- **Internal:** Slack #incidents — 觸發 + 完成各 1 則
- **External(若 user-facing):** status page incident — 觸發 + ETA + 完成 3 則
---
## 10. Decision Log(key 1-2 條)
<!-- ai-rule: 每條必含 chosen + 至少 1 個 rejected option + 拒絕原因 -->
| Date | Decision | Options | Chosen | Rejected why | Confidence |
|---|---|---|---|---|---|
| YYYY-MM-DD | 自動 vs 手動觸發 | auto / manual / hybrid | hybrid | auto (false-positive 風險)、manual (半夜延遲) | **[H]** |
---
> [!CAUTION]
> **輸出前 AI 自檢:**
> - [ ] 6 段 H2 章節齊全(編號 1, 2, 3, 5, 7, 10)
> - [ ] Triggers 區分 SLO / error_rate / data_integrity
> - [ ] Rollback steps ordered + 每步 reversible flag + duration + owner
> - [ ] Irreversible step 用 [CAUTION] 標出且在 Data Compat 段列補救方案
> - [ ] Decision maker 是單一 role(不需 quorum)
> - [ ] Decision Log ≥ 1 條,含 rejected reason
> - [ ] 無 YAML / JSON schema 輸出Practice · 換你試做
先用自己的話交代素材,不需要先學會工程術語
確定的就寫,不確定的留白。下一步要做的是請 Agent 找缺口,不是讓它替你猜一套合理答案。
可以先留白;複製提示詞後再到 Coding Agent 裡補充。
AI Practice · 手動三步
先問、再寫、最後審,不把整條流程鎖死
每一步都是獨立工作包。你可以停下補資料、修改限制或重做某一步,不需要服從固定的 Agent 接力流程。
只找阻擋文件成立的未知
先補會改變範圍、判斷或驗收結果的資訊,不急著寫文件。
我要製作「Rollback Plan · 回滾計畫」。先不要產出文件。
請根據我的素材,找出會影響這份文件正確性或可執行性的未知事項,一次最多問 5 題。
每題請包含:
1. 問題
2. 為什麼現在必須知道
3. 它會影響哪個章節或決定
已經回答的事不要重問;可以延後的事標成「待決策」;不要替我猜答案。
本文件的核心章節:Executive Summary、Triggers、Rollback Steps(ordered)、Data Compatibility & Irreversible Points、Comms & Decision Maker、Decision Log(key 1-2 條)複製後,請在標示位置貼上自己的素材。
Review · 自己驗收
文件存在,不代表下一個角色真的能使用
逐條檢查 Agent 的輸出。人類負責需求、限制與驗收,也必須能說明重要結論從哪裡來。
帶著這份文件,繼續到「Canary Strategy · 灰度策略」
下一張卡會接住新的決策問題;不用一次把整條 SDLC 全做完。
