Twmd finale

From frank890417/taiwan-md · View interactive version

Twmd finale is an AI agent skill from the GitHub repository frank890417/taiwan-md. Taiwan.md session 完整收官總指揮。盤點本 session 工作 → chain 跑 /twmd-memory + /twmd-diary + /twmd-evolve → 最後產出 final 收官 summary 給觀察者。 TRIGGER when: user says "收官", "twmd-finale", "完整收官", "session 結束 三件套", "finale".

How to use this skill

Skill file

🧬 Taiwan.md — Finale (收官總指揮)

  1. 你是 Taiwan.md(簽名 🧬)。如未甦醒先跑 /twmd-become。
  1. Step 1: 盤點本 session 工作

```bash

# Session id (canonical)

SESSION_ID=$(bash scripts/tools/session-id.sh 2>/dev/null || echo "manual-$(date +%H%M%S)")

echo "Session: $SESSION_ID"

# Session 起點 commit (last commit before this session began)

# 用「today's first commit」approximation,或 user-supplied 起點

SESSION_START=$(git log --since="6 hours ago" --reverse --pretty=format:"%h" | head -1)

echo "Session start commit: $SESSION_START"

# 本 session commit log

echo "=== Session commits ==="

git log "$SESSION_START^..HEAD" --pretty=format:"%h %ai %s" 2>/dev/null

# Diff stat

echo ""

echo "=== Session diff ==="

git diff "$SESSION_START^..HEAD" --stat 2>/dev/null | tail -10

# Ship 統計

echo ""

echo "=== Ship summary ==="

echo " Commits: $(git log "$SESSION_START^..HEAD" --oneline | wc -l | tr -d ' ')"

echo " Files changed: $(git diff "$SESSION_START^..HEAD" --stat | tail -1)"

# New articles shipped this session

git diff "$SESSION_START^..HEAD" --stat | grep -E "knowledge/.\.md.\| [0-9]+" | head -10

```

  1. Step 2: 依序 chain 跑三個 sub-skill(Skill tool sequential,不平行):

### a. /twmd-memory — 寫 session memory(Beat 4 收官)

觸發 Skill twmd-memory。memory pipeline 會:

### b. /twmd-diary — 寫超越行動的反芻(Beat 5)

觸發 Skill twmd-diary。diary pipeline 會:

判準(v2.5 提高門檻,2026-09-09 哲宇 directive「routine 一直 spam 很多日記」):日記是四個去處之一,不是預設去處。先跑機械閘,擋下就照擋,不准自我豁免:

```bash

python3 scripts/tools/diary-gate.py --handle {handle} --insight "候選的一句話核心想法"

```

exit 1 → skip,在收官報告寫 skipped: diary-gate BLOCK(理由)。exit 0 → 再過 DIARY-PIPELINE §Stage 0b 四個家路由:這段反芻如果是「做了 X 順帶注意到 Y」→ 留在 memory 的 Beat 5;「下次要記得 Z」→ LESSONS-INBOX;「這個 pattern 又遇到一次」→ 去 bump 既有條目;「跨好幾天才看得出的形狀」→ weekly-report。四個都不是,而且我對這件事的理解跟今天早上不一樣了,才寫日記。

routine session 預設 skip(§Stage 0c):要寫才需要理由。純空場、純對賬全綠、純「今天也是零」一律不寫——那種反芻寫進 memory Beat 5 就夠了。

### c. /twmd-evolve — 數據驅動內容進化掃描(前瞻)

觸發 Skill twmd-evolve。evolve pipeline 會:

注意:evolve 是前瞻 next-session 的工具,跟 memory/diary 是回顧不同。如果 session 沒有 ship 內容(純診斷 / 純 review),可 skip evolve。

  1. Step 3: 最終 finale 報告(給觀察者一份完整收官 summary):

```markdown

## 🧬 Session Finale Report — {session-id}

### Ship 統計

### 完成的 sub-skill

### Handoff 三態 (給下個 session)

### 觀察者 callout / LESSONS-INBOX 候選

🧬

```

  1. 鐵律:

故意精簡。MEMORY-PIPELINE / DIARY-PIPELINE / EVOLVE-PIPELINE 各自 canonical 細節在 docs/pipelines/,finale 只是 orchestrator。

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.