AgentSkillsCN

reflect

完成工作后进行反思,将经验教训保存到知识库。 确保知识为未来会话保留。 适用场景: - 完成工单后(归档前) - 完成阶段后 - 会话结束前(用户说“收尾”、“暂时停止”) - 用户说“反思”、“记录经验”、“我们学到了什么” 记录内容: - 模式:解决问题(已解决)或发现问题(打开) - 决策:做出的架构/设计选择 - 代码流程:对代码库的新理解 - 程序:值得记录的重复性任务 - 经验:在工单的5-final.md中

SKILL.md
--- frontmatter
name: reflect
description: |
  Perform reflection after completing work to capture learnings in KB.
  Ensures knowledge is preserved for future sessions.

  WHEN TO USE:
  - After completing a ticket (before archiving)
  - After completing a phase
  - Before session ends (user says "wrapping up", "stopping for now")
  - When user says "reflect", "capture learnings", "what did we learn"

  CAPTURES:
  - Patterns: problems solved (resolved) OR issues found (open)
  - Decisions: architectural/design choices made
  - Code flows: new understanding of codebase
  - Procedures: repetitive tasks worth documenting
  - Learnings: in ticket's 5-final.md

Reflect

Capture learnings and update KB after completing work.

Prerequisites

ALWAYS run /pmc:kb first to understand KB structure and document formats.

When to Reflect

TriggerScope
Ticket completeSingle ticket learnings
Phase completeAll phase tickets + integration learnings
Session endingEverything done this session
User requestSpecific topic or full review

Reflection Checklist

1. Patterns (6-patterns/)

Ask: Did we solve a problem or find an issue worth documenting?

TypeStatusWhen to Create
SolutionStatus: resolvedFixed a tricky bug, found a workaround
Known IssueStatus: openFound limitation, bug we can't fix now

Format: See kb/references/pattern-format.md

2. Decisions (5-decisions/D###-{name}.md)

Ask: Did we make architectural or design decisions?

Format: See kb/references/decision-format.md

3. Code Maps (7-code-maps/)

Ask: Did we learn how code works that wasn't documented?

  • Update existing code map if we learned more
  • Create new code map if we explored new area
  • Add Last updated: YYYY-MM-DD marker

4. Procedures (2-sop/)

Ask: Did we do something repetitive that should be a procedure?

Create SOP if:

  • Same steps done 2+ times
  • Complex process worth documenting
  • Future sessions will need these steps

5. Research (8-research/)

Ask: Did we do research worth keeping?

Save if:

  • External docs/APIs we referenced
  • Design alternatives we explored
  • Useful links or resources

6. Ticket Learnings (5-final.md)

Always update the ticket's 5-final.md with learnings, revealed intent, and decisions made.

Format: See kb/references/ticket-formats.md (5-final.md section)


Quick Reflection (Session Ending)

When time is short:

  1. Scan session - What did we work on?
  2. Key learnings - One-liner each
  3. Open issues - Anything unresolved?
  4. Next steps - What should next session start with?

Minimum output:

markdown
## Session Reflection - YYYY-MM-DD

### Completed
- T0000N: {brief summary}

### Key Learnings
- {insight}

### Open Issues
- {issue} (pattern created: Y/N)

### Next Session
- Start with: {task}

Reflection by Scope

After Ticket

code
1. Update 5-final.md
   └── Learned section
   └── Revealed Intent (if any)

2. Check for patterns
   ├── Problem solved? → 6-patterns/{name}.md (Status: resolved)
   └── Issue found? → 6-patterns/{name}.md (Status: open)

3. Check for decisions
   └── Design choice made? → 5-decisions/D###-{name}.md

4. Update code map (if learned new code flow)

After Phase

code
1. All ticket reflections done?

2. Integration learnings
   └── How tickets worked together
   └── Unexpected interactions

3. Update 4-status/health.md
   └── Test counts
   └── Open patterns count
   └── Technical debt notes

4. Phase retrospective
   └── What worked well
   └── What to improve

Before Session End

code
1. Uncommitted learnings?
   └── Anything not yet captured in docs

2. Current state
   └── What's in progress
   └── What's blocked

3. Next session setup
   └── What to start with
   └── Any context to preserve

Pattern Clarification

Patterns are for BOTH solutions AND open issues:

I found...Create pattern with...
Bug fix that was trickyStatus: resolved
Workaround for limitationStatus: resolved (document workaround)
Bug we can't fix nowStatus: open (document for future)
Platform limitationStatus: open (document workaround if any)
Technical debtStatus: open (document scope)

Open patterns are valuable - they prevent future developers from wasting time rediscovering known issues.


Output

After reflection, confirm:

code
## Reflection Complete

### Updated
- [ ] 5-final.md: Learned section
- [ ] 6-patterns/: {N} patterns (X resolved, Y open)
- [ ] 5-decisions/D###-{name}.md: {N} decisions
- [ ] 7-code-maps/: {files updated}
- [ ] 2-sop/: {new procedures}
- [ ] 8-research/: {research saved}

### Open Items
- {Any unresolved issues}

### Next Steps
- {What to do next}