| name | reflect |
| description | Mid-session structured reflection — analyze patterns, compare against infrastructure (skills, memory, knowledge docs), produce actionable growth suggestions. Use mid-session to capture insights and reorient. Triggers on "/reflect", "回顧一下", "整理一下", "reflect". |
| allowed-tools | Bash, Read, Glob, Grep |
| version | 1.0.0 |
| scope | public |
/reflect — Mid-Session Growth Check
Pause mid-session to do a structured analysis of patterns so far, and identify things worth capturing.
Unlike /done: /reflect doesn't save files or archive — it only produces suggestions for the user to pick from.
Workflow
1. SCAN → Review what's been done in the session so far
2. CHECK → Compare against existing infrastructure, find gaps
3. SUGGEST → Produce tiered suggestions
4. ORIENT → Quick direction confirmation
Step 1: Scan
Internal analysis (don't show to user), quick review:
- Session topic/domain
- What operations were done (reading code, writing code, debug, research, design...)
- Where the most time was spent
- Any repeated patterns (similar queries, similar operations)
- Any workarounds or detours
Step 2: Check
Compare against existing infrastructure, find gaps:
2a. Skills Coverage
ls ~/.claude/skills/ | head -50
Does this domain have a corresponding skill? If so, were there patterns this session that go beyond the skill's coverage?
2b. Memory Coverage
Read the current project's MEMORY.md to see how much is recorded for this domain.
Also scan the memory directory for related topic files:
ls ~/.claude/projects/
2c. Knowledge Docs
Check for related knowledge docs or cheatsheets:
ls <project-memory-dir>/*.md 2>/dev/null
2d. Past Learnings
grep -i "<domain-keyword>" ~/.claude/skills/learnings.md 2>/dev/null | tail -5
Any B/C records from past sessions in this domain? Any patterns?
Step 3: Suggest
Based on Scan + Check results, produce suggestions. Three tiers:
Tier 1: Quick Capture (can do now, < 5 minutes)
- Update MEMORY.md (newly discovered patterns, paths, commands)
- Record workarounds in existing knowledge docs
- Expand existing skill coverage
Tier 2: Build (takes a while, can do now or schedule for later)
- Create new skill (with initial outline: what it covers, how many workflow steps)
- Write new knowledge doc / cheatsheet
- Do a structured deep research pass
Tier 3: Explore (directions for future sessions)
- Topics worth deeper research
- Upstream changes or ecosystem dynamics to watch
- Cross-domain connections (can this pattern be used in other projects?)
Suggestion format
Each suggestion must be specific, with observed evidence:
BAD: "Suggest creating a skill"
GOOD: "You looked up Compact's cast syntax 3 times this session, disclose usage twice,
plus memory already has compiler version management and shielded token workaround.
These can be consolidated into a midnight-compact skill covering:
- Syntax quick-reference (cast, disclose, import, kernel)
- Common bugs/workarounds
- compile → deploy standard workflow
Want to build it now?"
Only list suggestions backed by evidence. If no clear pattern is observed, don't force it.
Step 4: Orient
A brief direction confirmation in conversational tone:
We're currently working on [X], at the [stage] point.
Suggested next step is [Y].
Continue the current direction, or handle one of the suggestions above first?
Possible user responses:
- "Continue" → return to work
- "Do the tier 1 one first" → execute quick capture
- "Build that skill now" → switch to building skill
- "Wrong direction" → discuss adjustment
When to skip
- Session just started (< 10 turns), too early to reflect meaningfully
- User is in the middle of urgent debugging, not appropriate to pause
- Pure conversation/discussion session with no capturable patterns
Safety
- /reflect only produces suggestions, does not automatically create files or modify skills
- Only execute after user selects
- If nothing is worth suggesting, just say "Nothing particularly worth capturing right now, let's continue"