---
name: Pitfall Record
slug: pitfall-record
category: Writing
description: Pitfall Record adds a lesson learned to the postmortem log with category, cause, fix, prevention, and a 14-day due date. Use it after incidents or troubleshooting to capture what happened and how to avoid it again.
github: "https://github.com/Stanshy/AgentHub/tree/main/.knowledge/company/skill-templates/pitfall-record"
language: TypeScript
stars: 201
forks: 23
install: "npx degit https://github.com/Stanshy/AgentHub/tree/main/.knowledge/company/skill-templates/pitfall-record ~/.claude/skills/pitfall-record"
installs_to: ~/.claude/skills/pitfall-record
source_path: .knowledge/company/skill-templates/pitfall-record/SKILL.md
collection_size: 25
category_size: 1227
collection_url: "https://dirskills.com/collections/Stanshy/AgentHub"
added: 2026-09-05T05:30:46.650Z
last_synced: 2026-09-05T05:30:46.650Z
canonical_url: "https://dirskills.com/skills/pitfall-record"
---

# Pitfall Record

Pitfall Record adds a lesson learned to the postmortem log with category, cause, fix, prevention, and a 14-day due date. Use it after incidents or troubleshooting to capture what happened and how to avoid it again.

**Install:**

```bash
npx degit https://github.com/Stanshy/AgentHub/tree/main/.knowledge/company/skill-templates/pitfall-record ~/.claude/skills/pitfall-record
```

## README

# 踩坑紀錄

將踩坑經驗記錄到 postmortem log。

## 使用方式
```
/pitfall-record <category> <title>
```

## 參數
- `$0`: 分類（build / runtime / deploy / test / process）
- `$1`: 標題
- `$ARGUMENTS`: 完整描述

## 執行步驟

1. 讀取現有 postmortem log：
!`cat .knowledge/postmortem-log.md 2>/dev/null | tail -20 || echo "尚無踩坑紀錄"`

2. 計算到期日：紀錄日期 + 14 天，格式為 YYYY-MM-DD。

3. 在 `.knowledge/postmortem-log.md` 末尾 append：

```markdown
### {日期} — $1

| 項目 | 內容 |
|------|------|
| 分類 | $0 |
| 問題 | {問題描述} |
| 原因 | {根本原因} |
| 解法 | {解決方式} |
| 預防 | {未來如何避免} |
| 狀態 | open |
| 到期日 | {日期+14天, YYYY-MM-DD 格式} |
```

4. 如果涉及通用規則，建議是否需更新 CLAUDE.md 或公司規範。
