障害対応とポストモーテム作成キット(タイムライン・TTD/TTR・お知らせ文 日英)
Incident postmortem kit: merged UTC timeline, TTD/TTR, status updates and notices (en/ja)
複数のログ・チャット・デプロイ記録を UTC の1本のタイムラインにまとめ、TTD/TTR と影響時間を計算し、非難しないポストモーテム、ステータスページ更新、顧客へのお知らせ(日英)を作ります。
できること
本番環境の障害について、対応中の連絡から事後のポストモーテム(振り返り文書)までをまとめて支援します。
- タイムラインの自動作成(
build_timeline.py): アプリのログ、Nginx/Apache のアクセスログ、syslog、デプロイ記録、PagerDuty などの CSV、Slack のエクスポート JSON、コピーしたチャット([14:03]のような時刻だけの形式)、問い合わせの CSV を読み、すべて UTC にそろえて時刻順に並べます。ISO 8601、2026/11/10 14:03 JST、2026年11月10日 14:03、アクセスログ形式、エポック秒など約11種類の時刻表記と、ファイルごとのタイムゾーン指定に対応。同じログの繰り返しはまとめ、デプロイ・アラート・受諾・緩和・復旧などの印を付け、重要な出来事の候補を示します。タイムゾーンを仮定した箇所は警告します - 指標の計算(
incident_metrics.py): 検知までの時間(TTD)、受諾までの時間(TTA)、緩和までの時間(TTM)、解決までの時間(TTR)を計算。エラー率の CSV やログから、しきい値を超えていた影響時間・ピーク・失敗件数の概算を出し、時刻の順序がおかしい場合は警告します - 再発防止策の点検(
action_items.py): 管理用 CSV の担当者・期日の抜け、期限切れ、「気をつける」のようなあいまいな表現や個人を責める表現を指摘します - テンプレート: ブレームレスなポストモーテム(日本語版・英語版)、ステータスページの更新文(調査中・原因特定・経過観察・解決、日英)、顧客向けのご報告とお詫びのメール(日英)
- ガイド: なぜなぜ分析と寄与要因の整理方法、指標の定義と落とし穴、対応中のチェックリスト(重大度・役割・連絡の間隔)
- 実例: 形式もタイムゾーンもばらばらな9つのサンプルファイルと、その出力、完成したポストモーテムの例
使い方
python scripts/build_timeline.py deploy.log::label=deploy app.log::label=app "chat.txt::kind=chat,tz=Asia/Tokyo,date=2026-11-10" --display-tz Asia/Tokyo --md timeline.md
python scripts/incident_metrics.py --metrics error_rate.csv --threshold 5% --detected ... --resolved ... --md metrics.md
エージェントは警告と候補を確認して本当の節目の時刻を選び、寄与要因を分析して、ポストモーテムとお知らせの下書きを作ります。Claude、Codex、Hermes Agent、Cursor で使えます。
必要な環境
- Python 3(標準ライブラリのみ)。ネットワークには接続しません
- 夏時間のあるタイムゾーン名(America/New_York など)を使う場合、Windows では
tzdataパッケージが必要なことがあります。Asia/Tokyo や+09:00のような固定の時差はそのまま使えます
注意点
- 出来事の印付けと節目の候補はキーワードによる推定です。最終的な時刻の判断と原因の分析は、エージェントと担当チームが根拠を見て行います
- 証拠にない数値や事実は書きません。不明な点は「不明」として確認を求めます
- お知らせやメールを自動で送信することはありません。補償や個人情報に関わる記述は、責任者の確認が必要です
- ログに個人情報が含まれる場合は、伏せたうえで文書に使ってください
English description
Merges logs, chat exports and deploy logs into one UTC timeline, computes TTD/TTR and the impact window, and drafts a blameless postmortem, status page updates and customer notices (en/ja).
What it does
Supports a production incident from live communication to the finished postmortem.
- Automatic timeline (
build_timeline.py): reads application logs, Nginx/Apache access logs, syslog, deploy logs, PagerDuty-style CSV exports, Slack export JSON, copied chat text with time-only stamps like[14:03], and support ticket CSVs, converts everything to UTC and sorts it. Handles about 11 timestamp styles (ISO 8601,2026/11/10 14:03 JST, Japanese dates, access-log format, epoch seconds and more) with a timezone per file. Collapses repeated lines, tags deploys, alerts, acknowledgements, mitigations and recovery, proposes key-event candidates, and warns wherever a timezone was assumed - Metrics (
incident_metrics.py): time to detect (TTD), acknowledge (TTA), mitigate (TTM) and resolve (TTR). From an error-rate CSV or log lines it finds the impact window above a threshold, the peak and an approximate failed-request count, and warns about milestones in the wrong order - Action item checks (
action_items.py): flags missing owners and due dates, overdue items, and vague or blame-style wording such as "be more careful" in the tracker CSV - Templates: blameless postmortem (English and Japanese), status page updates (investigating, identified, monitoring, resolved; en/ja), customer report and apology email (en/ja)
- Guides: five whys and contributing factors, metric definitions and pitfalls, a live-incident checklist (severity, roles, update cadence)
- Worked example: 9 sample files in mixed formats and timezones, their outputs, and a finished postmortem
How to use
python scripts/build_timeline.py deploy.log::label=deploy app.log::label=app "chat.txt::kind=chat,tz=Asia/Tokyo,date=2026-11-10" --display-tz Asia/Tokyo --md timeline.md
python scripts/incident_metrics.py --metrics error_rate.csv --threshold 5% --detected ... --resolved ... --md metrics.md
The agent reviews the warnings and candidates, picks the real milestones, analyzes contributing factors and drafts the postmortem and notices. Works with Claude, Codex, Hermes Agent and Cursor.
Requirements
- Python 3 (standard library only). No network access
- Timezone names with daylight saving time (such as America/New_York) may need the
tzdatapackage on Windows. Asia/Tokyo and fixed offsets like+09:00always work
Caveats
- Event tags and milestone candidates are keyword heuristics. The agent and the team make the final call on times and causes from the evidence
- Numbers and facts not supported by the evidence are not written; unknowns are marked and asked about
- Nothing is sent automatically. Statements about compensation or personal data need approval by the owner
- Mask personal data from logs before using it in documents
インストール方法
- ダウンロードしたZIPを展開します(中に
incident-postmortem-kit/フォルダとSKILL.mdがあります)。 - フォルダごと、使うエージェントのスキル置き場にコピーします。
- Claude:
~/.claude/skills/(プロジェクト単位なら.claude/skills/) - Hermes Agent:
~/.hermes/skills/ - Codex:
~/.agents/skills//Cursor:~/.cursor/skills/ - Claude アプリ(claude.ai):「カスタマイズ → スキル」からZIPをアップロード
- Claude:
- エージェントを再起動し、スキル一覧に表示されることを確認します。
出品者
Skills that make everyday developer work faster and safer: Git, testing, APIs and security.
出品スキル 8 件