agentleFS
MakiDevelopMakiDevelop/claude-skills/skills/postmortem/SKILL.md

postmortem

Skill3 starsChanged 8 months agoMITView on GitHub

事故記錄。收集資訊、分析 root cause、記錄修復步驟、防止再發。當服務出事故後使用。

26 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use premortem, refactor and 1 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • neurofooSkill

    premortem

    Pre-mortem analysis that imagines a plan has failed, then works backward to identify causes and preventions. Use before launches, major decisions, or risky initiatives to surface hidden risks.

    Also in 3 projects that use this

  • GitHubSkill

    refactor

    Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements.

    Also in 3 projects that use this

  • GoogleSkill

    code-review

    Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.

    Also in 3 projects that use this

The file

Files
SKILL.md

事故記錄(Postmortem)

目標

快速記錄事故,結構化分析 root cause,防止重複犯錯。

流程

Step 1: 收集資訊

詢問用戶(或從上下文取得):

  • 什麼壞了?
  • 什麼時候發現的?
  • 影響範圍?(用戶數、持續時間、資料損失?)

Step 2: 分析 root cause

  • 觸發的命令或操作
  • 錯誤訊息
  • 為什麼會走到這一步(5 Whys)

若有 repo,自動檢查:

  • git log --oneline -10 看最近改動
  • 搜尋相關錯誤訊息

Step 3: 記錄修復步驟

  • 怎麼修好的
  • 花了多久
  • 是否有 workaround 還是根本修復

Step 4: 寫入檔案

追加到當前專案的 logs/errors.md(沒有就建立),格式:

## YYYY-MM-DD: [簡述問題]

**影響**:[影響範圍和持續時間]
**觸發**:[什麼操作觸發的]
**錯誤**:[錯誤訊息]
**Root Cause**:[根本原因]
**修復**:[修復步驟]
**防止再發**:[應該怎麼避免]
**Timeline**:
- HH:MM 發現問題
- HH:MM 開始修復
- HH:MM 恢復正常

Step 5: 提出預防建議

  • 如果這類問題之前發生過,指出來
  • 建議加入自動化防護(CI check、monitoring、alert)
  • 建議更新文件(CLAUDE.md、README、runbook)

Quality Gates

  • Root cause 不是「設定錯誤」這種表面原因,要挖到為什麼會設定錯誤
  • 修復步驟可重現(別人照做也能修)
  • 防止再發有具體動作(不是「以後注意」)
  • Timeline 完整(從發現到恢復)

Heuristics

  • 事故後 24 小時內記錄,記憶最清楚
  • Root cause 用 5 Whys:問五次「為什麼」才算到底
  • 防止再發優先考慮自動化(人的注意力不可靠)
  • Blameless:記錄事實和流程,不指責個人

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.