learning-capture
Multi-trigger, dual-target learning capture patterns. Use this skill to understand how to capture learnings at different points in the development workflow and route them to appropriate targets (codebase docs or plugin improvements). Don't use when saving session state for resumption (use session-checkpoint instead), or for analyzing chat sessions at scale (use chat-insights instead).
What this skill does
# Learning Capture
This skill provides patterns for capturing learnings at the right moments and routing them to the right places. Learnings compound over time - the more you capture, the more future work benefits.
## Three Trigger Points
Learnings should be captured at three key moments, each with different depth and focus:
### 1. After Chat Session (Lightweight)
**When**: At the end of any significant agentic coding session
**Focus**: Quick capture of immediate insights
- What did we learn?
- What should be documented?
- Any quick process improvements?
**Depth**: Brief, 2-5 bullet points
**Time**: 2-5 minutes
**Example Output**:
```markdown
## Session Learning: 2026-01-25
- Discovered that the auth middleware requires explicit error handling
- Found undocumented API endpoint at `/internal/health`
- Process improvement: Always check existing tests before writing new ones
```
**Session Handoff** (if work continues later):
Also capture state for the next session:
- What's done and what's next
- Decisions made with reasoning
- Docs that need updating (stale conclusions)
- Where to start next session
### 2. After Project Completion (Comprehensive)
**When**: At project milestones or completion
**Focus**: Thorough retrospective
- What worked well?
- What didn't work?
- What to do differently next time?
**Depth**: Full retrospective with multiple sections
**Time**: 15-30 minutes
**Sections to Cover**:
- Project summary and outcomes
- What went well (successes, effective practices)
- What could be improved (challenges, pain points)
- Process improvements (suggested changes)
- Template refinements (updates needed)
- Action items (next steps)
### 3. After Overcoming Blockers (Targeted)
**When**: Immediately after solving a difficult problem
**Focus**: Capture while fresh
- What was painful?
- How was it solved?
- How to prevent next time?
**Depth**: Focused on the specific blocker
**Time**: 5-10 minutes
**Sections to Cover**:
- Context: What were you trying to do?
- Initial hypothesis: What did you think was wrong?
- Actual root cause: What was actually wrong?
- Solution: How was it fixed?
- Prevention: How to avoid this in the future?
## Two Output Targets
Learnings can improve two distinct areas:
### Target 1: Codebase Documentation
**What goes here**: Project-specific knowledge
- Patterns and gotchas for this codebase
- Architecture decisions and rationale
- Debugging solutions for this project
- Troubleshooting guides
- API quirks and workarounds
**Location**: `[current-codebase]/docs/` (appropriate subfolder)
**Subfolder Guidelines**:
| Content Type | Location |
|--------------|----------|
| Problem solutions | `docs/solutions/` |
| General learnings | `docs/learnings/` |
| Architecture decisions | `docs/architecture/` |
| Troubleshooting | `docs/troubleshooting/` |
### Target 2: Plugin/Workflow Improvements
**What goes here**: Process and tool improvements
- Workflow optimizations
- New patterns to add to skills
- Command/agent refinements
- Template improvements
- Cross-project patterns
**Location**: Plugin repository (commands, skills, or docs)
**Improvement Types**:
| Type | Action |
|------|--------|
| Command enhancement | Update command markdown |
| New skill pattern | Add to skill SKILL.md |
| Template fix | Update resources/templates/ |
| New workflow | Create new command or skill |
## Deep Session Analysis Patterns
When performing a deep retrospective (analyzing SpecStory session files in `.specstory/history/`), use these patterns to extract insights the agent missed during the session.
### Pattern: Repetition Detection
**Signal**: Same action performed multiple times without progress.
**How to detect**: Scan for repeated file reads (same path 3+ times), repeated errors, repeated user corrections, and solution/revert cycles.
**What it means**: The agent lacked context, had a faulty mental model, or didn't learn from previous attempts.
**Improvement**: Add the missing context to CLAUDE.md or MEMORY.md so future sessions start with it.
### Pattern: Frustration Signal Detection
**Signal**: User communication shifts from collaborative to directive.
**Severity scale**:
1. Mild — User provides more specific instructions than before
2. Moderate — Short corrective phrases ("no", "not that", "just X")
3. Strong — User takes over the task themselves
4. Severe — User explicitly states frustration
**Improvement**: Identify the specific mismatch and encode it as a behavioral rule.
### Pattern: Wasted Effort Detection
**Signal**: Work that didn't contribute to the final outcome.
**How to detect**: Compare final git diff to all changes during session, look for "let me try a different approach" patterns, count debugging cycles per issue (>2 = wasted).
**Improvement**: Document the correct approach so future sessions don't repeat wrong paths.
### Pattern: Scope Drift Detection
**Signal**: Work expanded significantly beyond original request.
**How to detect**: Compare first user message to final summary. Count files touched vs expected.
**Improvement**: If unintentional, add scope-check trigger to MEMORY.md.
### Pattern: CLAUDE.md Growth
**Signal**: CLAUDE.md size exceeds 32,000 chars or triggers the performance warning (>40k).
**How to detect**: Run `wc -c CLAUDE.md`. Check for RESOLVED issues still inline, niche guides that belong in `docs/guides/`, duplicate content (e.g., test commands listed in both Quick Reference and a Common Workflows section).
**Root cause**: The learnings promotion workflow is additive-only — it promotes content UP to CLAUDE.md but never demotes stale content DOWN to docs/guides/ or docs/learnings/.
**Improvement**: Before promoting new learnings to CLAUDE.md, check size and archive stale content. Resolved issues should be moved to `docs/learnings/resolved-issues.md`. Niche guides should be moved to `docs/guides/` with a 1-line reference in CLAUDE.md.
---
## YAML Frontmatter Schema
All learnings should include searchable frontmatter:
```yaml
---
title: "Brief descriptive title"
date: YYYY-MM-DD
trigger: chat-session | project-completion | blocker-overcome
target: codebase | plugin | both
category: performance | database | integration | workflow | debugging | testing | security | design | generation | infrastructure
tags: [relevant, searchable, keywords]
severity: critical | high | medium | low
module: "affected_module_name"
---
```
### Field Guidelines
**trigger**: Which trigger point captured this learning
- `chat-session`: Quick session insight
- `project-completion`: Full retrospective
- `blocker-overcome`: Problem solution
**target**: Where the improvement applies
- `codebase`: This specific project
- `plugin`: The playbook plugin itself
- `both`: Applies to both
**category**: Primary classification
- `performance`: Speed, efficiency issues
- `database`: Data layer issues
- `integration`: External service issues
- `workflow`: Process issues
- `debugging`: Investigation patterns
- `testing`: Test-related learnings
- `security`: Security-related learnings
- `design`: Visual design, UX, branding learnings
- `generation`: AI content/image generation learnings
- `infrastructure`: DevOps, CI/CD, deployment learnings
**severity**: Impact level
- `critical`: Must know, high impact
- `high`: Important, significant impact
- `medium`: Good to know
- `low`: Nice to have
**tags**: Searchable keywords (3-7 tags)
**module**: Specific code module affected (if applicable)
## Decision Matrix: Which Target?
Use this matrix to decide where learnings should go:
| Learning Type | Codebase? | Plugin? |
|---------------|-----------|---------|
| Bug fix for specific code | Yes | No |
| General debugging pattern | Maybe | Yes |
| Architecture decision | Yes | No |
| Workflow improvement | No | Yes |
| Template enhancement | No | Yes |
| Cross-project pattern | Maybe | Yes |
| Project-specific gotcha | Yes | No |
| Tool usage tip | No | Yes |
## Capture Workflow
### Step 1: Identify Trigger
Ask: "What kRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.