Structured reflection before the conversation ends. Extract knowledge worth retaining long-term from this conversation to avoid falling into the same pit twice.
Step 0: Scan the conversation
Review the complete conversation history and mark the following events:
Task list
List all tasks completed in this conversation:
- Task description (one sentence)
- Result: success / partial success / failure
- Key files involved
Errors and blockers
List all problems encountered:
- Tool call failures
- Corrections after wrong direction
- Approaches rejected by the user
- Retries or workarounds
User feedback
List the user's explicit expressions of preference:
- "Don't do this" "Use X instead"
- Evaluation of output quality
- Workflow preferences
ARGUMENTS filtering
If ARGUMENTS specifies a focus, only analyze the corresponding category in depth. Default all。
Step 1: Extract learnings
Extract reusable knowledge from the events in Step 0:
1A. Technical discoveries
- Non-intuitive behavior of tools/APIs
- Effective methods for bypassing limitations
- Performance observations (what is fast, what is slow)
1B. Pattern recognition
- Recurring workflows (worth automating?)
- Techniques used repeatedly in this conversation
- Common solutions across tasks
1C. Error root causes
- The root cause of each error (not the surface symptom)
- How to avoid it next time
- Whether it is a new variant of a known issue
1D. User preferences
- Newly discovered preferences (write to memory)
- Exceptions to known preferences
- Communication style observations
Step 2: Identify opportunities
2A. New skill opportunities
Did this conversation expose a repetitive workflow that could be made into a skill?
Criteria (must meet at least 2):
- Involves 3+ steps
- Likely to be reused in the future
- Requires domain-specific knowledge
- Currently not covered by any skill
2B. Improvements to existing skills
Did you encounter shortcomings when using a skill this time?
- Missing features or parameters
- Inaccurate decision rules
- Process steps that can be streamlined
2C. Memory updates
Which knowledge should be written to MEMORY.md?
- Stable technical discoveries (confirmed across multiple interactions)
- Preferences the user explicitly asked to remember
- New understanding of the project architecture
Which memories should be deleted or updated?
- Old records overturned by this discovery
- Completed to-do items
- Outdated architecture descriptions
Step 3: Present results + interactive execution
Produce a reflection report
## 對話反思
### 本次任務摘要
| 任務 | 結果 | 關鍵檔案 |
|------|------|---------|
| 建立 system-audit skill | ✅ 成功 | system-audit/SKILL.md |
| ... | | |
### 學習萃取
| # | 類別 | 洞察 | 建議動作 |
|---|------|------|---------|
| 1 | 技術發現 | hook 無法存取對話歷史 | 寫入 MEMORY.md |
| 2 | 使用者偏好 | 偏好合併相關 skill | 寫入 MEMORY.md |
| 3 | Skill 改進 | humanizer-tw 缺少 X | 開 task 追蹤 |
### 機會
- 🆕 新 skill:[描述]
- 🔧 改進 skill:[skill 名稱] — [改進項]
- 📝 Memory 更新:[新增/修改/刪除 項目]
AskUserQuestion interaction
Use multiSelect to let the user check which actions to execute:
- Write to memory: List a content preview of each memory entry
- Improve skill: List the skill to be modified and the specific items
- Create new skill: List the skill name and a description of its core functionality
- Skip: Perform no action
Execute
Execute each item checked by the user, one by one:
- Memory → Use the Edit tool to update MEMORY.md
- Skill improvement → Open a task or modify directly (depending on the scale)
- New skill → Create a skeleton SKILL.md + prompt the user to refine it later
Reflection principles
- Record only stable knowledge — Guesses from a single conversation are not written to memory; wait for multiple confirmations
- Except when the user explicitly requests it — If the user says "remember this," record it directly
- Root cause first — Record why the error occurred, not just what error occurred
- Actionable — Every insight must have a suggested action (write memory / modify skill / open task)
- Do not record duplicates — First check whether MEMORY.md has a similar entry; if so, update it rather than adding a new one
Now Execute
Start from Step 0 and review the current conversation.