After task completion, perform a session reflection.
Trigger conditions
A reflection should be generated after the following scenarios are completed (when kb_create_mode ≥ 1):
- Went through 2+ verification cycles before passing
- Debugging took more than 3 attempts to fix
- The approach changed during execution
- The user corrected a wrong assumption or direction
Reflection output
Append the reflection content to the "Experience" section of the relevant modules/*.md (incremental append, do not rewrite).
Append format:
- [{日期}] {经验教训} — 背景: {什么有效/什么失败的简述}
If multiple modules are involved, append to each respective modules/*.md. If it does not belong to any specific module (such as project-level experience), append it to the newly added "## Experience" section at the end of context.md.
Quality requirements
- Lessons learned must be abstract guidance, not specific code templates (specific templates will cause the AI to anchor on incorrect details)
- Each lesson ≤2 lines, concise and powerful
- Only record truly valuable findings, do not record the obvious
Delivery check
- Experience has been appended to the Experience section of the relevant modules/*.md
- Lessons learned are abstract guidance rather than specific templates
- Applicable scenarios can be inferred from the context