From project-toolkit
Captures learnings from conversations to improve skills by extracting high/medium/low confidence patterns from corrections, praise, edge cases, and heavy skill use.
npx claudepluginhub rjmurillo/ai-agents --plugin project-toolkitThis skill uses the workspace's default tool permissions.
**Critical learning capture system** that prevents repeating mistakes and preserves successful patterns across sessions.
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
Critical learning capture system that prevents repeating mistakes and preserves successful patterns across sessions.
Analyze the current conversation and propose improvements to skill-based memories based on what worked, what didn't, and edge cases discovered. Every correction is a learning opportunity - invoke proactively to build institutional knowledge.
| Trigger Phrase | Operation |
|---|---|
reflect on this session | Extract learnings from conversation |
learn from this mistake | Capture correction patterns |
capture what we learned | Document session insights |
improve skill {name} | Target specific skill memory |
what did we learn | Review and store patterns |
Also monitor user phrasing such as "what if...", "ensure", or "don't forget". These phrases should immediately route into the MEDIUM trigger tables below.
| Trigger | Example | Why Critical |
|---|---|---|
| User correction | "no", "wrong", "not like that", "never do" | Captures mistakes to prevent repetition |
| Chesterton's Fence | "you removed that without understanding" | Documents architectural decisions |
| Immediate fixes | "debug", "root cause", "fix all" | Learns from errors in real-time |
| Trigger | Example | Why Important |
|---|---|---|
| User praise | "perfect", "exactly", "great" | Reinforces successful patterns |
| Tool preferences | "use X instead of Y", "prefer", "rather than" | Builds workflow preferences |
| Edge cases | "what if X happens?", "don't forget", "ensure" | Captures scenarios to handle |
| Questions | Short questions after output | May indicate confusion or gaps |
| Trigger | Example | Why Useful |
|---|---|---|
| Repeated patterns | Frequent use of specific commands/tools | Identifies workflow preferences |
| Session end | After skill-heavy work | Consolidates all session learnings |
| Phrase | Action |
|---|---|
| "reflect" | Full analysis of current session |
| "improve skill" | Target specific skill for improvement |
| "learn from this" | Extract learnings from recent interaction |
| "what did we learn" | Summarize accumulated learnings |
Use this skill when:
Use retrospective instead when:
Don't wait for users to ask! Invoke reflect immediately when you detect:
Why this matters: Without proactive reflection, learnings are LOST. The Stop hook captures some patterns, but manual reflection is MORE ACCURATE because you have full conversation context.
Cost: ~30 seconds of analysis. Benefit: Prevents repeating mistakes forever.
Locate the skill-based memory to update:
-observations.md in .serena/memories/{skill-name}-observations.md (skill observations pattern)Storage Locations:
.serena/memories/{skill-name}-observations.md via mcp__serena__write_memoryScan the conversation for learning signals with confidence levels:
User actively steered or corrected output. These are the most valuable signals.
Detection patterns:
Example:
User: "No, use the PowerShell skill script instead of raw gh commands"
โ [HIGH] + Add constraint: "Use PowerShell skill scripts, never raw gh commands"
Output was accepted or praised. Good signals but may be context-specific.
Detection patterns:
Example:
User: "Perfect, that's exactly what I needed"
โ [MED] + Add preference: "Include example usage in script headers"
Scenarios the skill didn't anticipate. Opportunities for improvement.
Detection patterns:
Example:
User: "What if the file doesn't exist?"
โ [MED] ~ Add edge case: "Handle missing file scenario"
Accumulated patterns over time. Need more evidence before formalizing.
Detection patterns:
Example:
User consistently uses `-Force` flag
โ [LOW] ~ Note for review: "User prefers -Force flag for overwrites"
Only propose changes when sufficient evidence exists:
| Threshold | Action |
|---|---|
| โฅ1 HIGH signal | Always propose (user explicitly corrected) |
| โฅ2 MED signals | Propose (sufficient pattern) |
| โฅ3 LOW signals | Propose (accumulated evidence) |
| 1-2 LOW only | Skip (insufficient evidence), note for next session |
Present findings using WCAG AA accessible colors (4.5:1 contrast ratio):
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ SKILL REFLECTION: {skill-name} โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ [HIGH] + Add constraint: "{specific constraint}" โ
โ Source: "{quoted user correction}" โ
โ โ
โ [MED] + Add preference: "{specific preference}" โ
โ Source: "{evidence from conversation}" โ
โ โ
โ [MED] + Add edge case: "{scenario}" โ
โ Source: "{question or workaround}" โ
โ โ
โ [LOW] ~ Note for review: "{observation}" โ
โ Source: "{pattern observed}" โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Apply changes? [Y/n/edit] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Color Key (accessible):
[HIGH] - Red/bold: Mandatory corrections (user explicitly said "no")[MED] - Yellow/amber: Recommended additions[LOW] - Blue/dim: Notes for later reviewUser Response Handling:
| Response | Action |
|---|---|
| Y (yes) | Proceed to Step 4 (update memory) |
| n (no) | Abort update, ask "What would you like to change or was this not useful?" |
| edit | Present each finding individually, allow user to modify/reject each one |
On rejection (n):
On edit:
ALWAYS show changes before applying.
After user approval:
.serena/memories/{skill-name}-observations.mdStorage Strategy:
Serena MCP (canonical):
mcp__serena__write_memory(memory_file_name="{name}-observations", memory_content="...")
If Serena unavailable (contingency):
path=".serena/memories/{name}-observations.md"
# Append new learnings to existing file (create if missing)
echo "$newLearnings" >> "$path"
git add "$path"
git commit -m "chore(memory): update {name} skill sidecar learnings"
Record the manual edit in the session log so Serena MCP can replay the update when the service is available again.
Memory Format:
# Skill Sidecar Learnings: {Skill Name}
**Last Updated**: {ISO date}
**Sessions Analyzed**: {count}
## Constraints (HIGH confidence)
- {constraint 1} (Session {N}, {date})
- {constraint 2} (Session {N}, {date})
## Preferences (MED confidence)
- {preference 1} (Session {N}, {date})
- {preference 2} (Session {N}, {date})
## Edge Cases (MED confidence)
- {edge case 1} (Session {N}, {date})
- {edge case 2} (Session {N}, {date})
## Notes for Review (LOW confidence)
- {note 1} (Session {N}, {date})
- {note 2} (Session {N}, {date})
When persisting learnings that reference specific code locations, automatically capture citations:
Detect code references in learning text:
`path/to/file.ext` line N`functionName()` in `file.ext`Extract citation metadata: file path, line number, snippet (if available)
Add citations to memory frontmatter:
python -m memory_enhancement add-citation <memory-id> --file <path> --line <num> --snippet <text>
Update confidence score based on initial verification
Detection Patterns:
| Pattern | Example | Extraction |
|---|---|---|
| Inline code + line | In `src/client/constants.ts` line 42 | file=src/client/constants.ts, line=42 |
| Function in file | `handleError()` in `src/utils.ts` | file=src/utils.ts (file-level) |
| Explicit citation | See: src/api.py:100 | file=src/api.py, line=100 |
Integration Point:
After user approves learnings (step 4 above), before writing to Serena:
python -m memory_enhancement add-citation <memory-id> --file <path> --line <num> --snippet <text>Example:
Learning text: "The bug was in scripts/health.py line 45, where we forgot to handle None"
python -m memory_enhancement add-citation memory-observations --file scripts/health.py --line 45 --snippet "handle None"User says "reflect" or similar?
โ
โโโบ YES
โ โ
โ โโโบ Identify skill(s) used in conversation
โ โ โ
โ โ โโโบ Skill identified?
โ โ โ
โ โ โโโบ YES โ Analyze conversation for signals
โ โ โ โ
โ โ โ โโโบ Meets confidence threshold?
โ โ โ โ
โ โ โ โโโบ YES โ Present findings, await approval
โ โ โ โ โ
โ โ โ โ โโโบ User says Y โ Update memory file
โ โ โ โ โ โ
โ โ โ โ โ โโโบ Serena available? โ Use MCP write
โ โ โ โ โ โโโบ Serena unavailable? โ Use Git fallback
โ โ โ โ โ
โ โ โ โ โโโบ User says n โ Ask for feedback
โ โ โ โ โ โ
โ โ โ โ โ โโโบ User wants revision โ Re-analyze
โ โ โ โ โ โโโบ User skips โ End workflow
โ โ โ โ โ
โ โ โ โ โโโบ User says edit โ Interactive review
โ โ โ โ โ
โ โ โ โ โโโบ Per-finding [keep/modify/remove]
โ โ โ โ
โ โ โ โโโบ NO โ Report "Insufficient evidence. Note for next session."
โ โ โ
โ โ โโโบ NO โ Ask user which skill to reflect on
โ โ โ
โ โ โโโบ User specifies skill โ Continue with that skill
โ โ โโโบ User says "none" โ End workflow
โ โ
โ โโโบ Multiple skills?
โ โ
โ โโโบ Analyze each, group findings by skill, present together
โ
โโโบ NO โ This skill not invoked
Conversation:
User: "Create a PR for this change"
Agent: [runs gh pr create directly]
User: "No, use the github skill script!"
Analysis:
[HIGH] + Add constraint: "Always use .claude/skills/github/ scripts for PR operations"
Source: User correction - "No, use the github skill script!"
Conversation:
User: "Add error handling"
Agent: [adds try/catch with specific error types]
User: "Perfect! That's exactly what I wanted"
Analysis:
[MED] + Add preference: "Use specific error types in catch blocks, not generic [Exception]"
Source: User approval after seeing specific error types
Conversation:
User: "Run the build"
Agent: [runs build command]
User: "Wait, what if the node_modules folder doesn't exist?"
Analysis:
[MED] + Add edge case: "Check for node_modules existence before build"
Source: User question about missing dependencies
Capture learnings about code review patterns:
Example memory: .serena/memories/code-review-observations.md
Track API design decisions:
Example memory: .serena/memories/api-design-observations.md
Remember testing preferences:
Example memory: .serena/memories/testing-observations.md
Learn documentation patterns:
Example memory: .serena/memories/documentation-observations.md
| Avoid | Why | Instead |
|---|---|---|
| Applying without showing | User loses visibility | Always preview changes |
| Overwriting existing learnings | Loses history | Append with timestamps |
| Generic observations | Not actionable | Be specific and contextual |
| Ignoring LOW confidence | Lose valuable patterns | Track for future validation |
| Creating memory for one-off | Noise | Wait for repeated patterns |
Run reflection at session end as part of retrospective:
## Session End Checklist
- [ ] Complete session log
- [ ] Run skill reflection (if skills were used)
- [ ] Update Serena memory
- [ ] Commit changes
Skill memories integrate with the memory system:
# Search skill sidecar learnings
python3 .claude/skills/memory/scripts/search_memory.py --query "github-observations constraints"
# Read specific skill sidecar
Read .serena/memories/github-observations.md
If Serena MCP is available:
mcp__serena__read_memory(memory_file_name="github-observations")
mcp__serena__write_memory(memory_file_name="github-observations", memory_content="...")
| Action | Verification |
|---|---|
| Analysis complete | Signals categorized by confidence |
| User approved | Explicit Y or approval statement |
| Memory updated | File written to .serena/memories/ |
| Changes preserved | Existing content not lost |
| Commit ready | Changes staged, message drafted |
{skill-name}-observations.mdDecision: Skill memories follow the ADR-007 sidecar pattern (e.g., github-observations.md).
Rationale:
{domain}-{description} format while making "skill-sidecar" explicitmemory-index.md, preventing orphaned learningsMigration: Rename {skill}-observations.md (or legacy skill-{name}.md) to {skill}-observations.md and update index references.
{skill}-observations.md file.skill-{name} and reference the Serena sidecar instead of duplicating the content.curating-memoriescurating-memories = general-purpose maintenance of any memory artifact (linking, pruning, marking obsolete).reflect = targeted retrospective that feeds those artifacts with new learnings.curating-memories for cleanup.curating-memories for consolidation.memory skill for search/recall before proposing redundant learnings.skill-{name} tags for semantic recall.session-log-fixer.| Skill | Relationship |
|---|---|
memory | Skill memories are part of Tier 1 |
using-forgetful-memory | Alternative storage for skill learnings |
curating-memories | For maintaining/pruning skill memories |
retrospective | Full session retrospective (this is mini version) |
When committing skill observation updates:
chore(memory): update {skill-name} skill sidecar learnings (session {N})
- Added {count} constraints (HIGH confidence)
- Added {count} preferences (MED confidence)
- Added {count} edge cases (MED confidence)
- Added {count} notes (LOW confidence)
Session: {session-id}