# Workflow Close Plan

> Move a completed plan to done/, record lessons learned, then commit + push. Call after /run completes or /review is APPROVED. Triggers: /close-plan, plan completion, move plan to done, record lessons.

- Skill: `marzun9620/workflow-close-plan` (Agent Skill)
- Install (CLI): `npx skillmds@latest add marzun9620/workflow-close-plan`
- Raw SKILL.md: https://api.skillmd.com/api/skills/marzun9620/workflow-close-plan/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: marzun9620 (https://skillmd.com/u/marzun9620)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/marzun9620/workflow-close-plan

---


# Close Plan — Plan 完了 + Lessons 記録

## Arguments

`/close-plan {plan-name-or-branch}` — plan ファイル名 or branch 名

## Protocol

### 1. Plan 特定
1. `.planning/plans/` から引数に一致する plan を探す（部分一致OK）
2. plan が見つからなければ `.planning/plans/done/` も確認（既に移動済みかもしれない）

### 2. Lessons 抽出
1. `.execlog/{branch}.md` を読む
2. 直近の /run セッションで発生した修正パターンを振り返る:
   - Codex review で出た Critical / Warning
   - post-check で直した integration test の失敗
   - Mode B review で指摘された cross-cutting issue
3. `.planning/lessons.md` を読み、既存の lessons と重複しないものだけを抽出
4. 新規 lessons を適切なセクションに追記:
   - 既存セクションに該当するものはそこに追加
   - 該当セクションがなければ新セクションを作成
   - 各 lesson は `- {rule}。Why: {reason}` のフォーマット

### 3. Plan 移動
1. Plan の Status を `done` に更新
2. Plan ファイルを `.planning/plans/done/` に移動

### 4. Commit + Push
```bash
git add .planning/plans/done/{plan}.md .planning/plans/{plan}.md .planning/lessons.md
git commit -m "chore: close {plan-name}, add lessons learned"
git push
```

## Rules

- lessons.md に重複する内容を追加しない
- lessons は将来の実装に役立つもののみ（一時的なバグ修正の詳細は不要）
- plan が既に done/ にある場合は lessons 追記のみ行う

