Skip to content
Back to skills

Lessons Capture

ASecurity

Use when concluding significant work to extract reusable patterns and anti-patterns

  • 666 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added February 9, 2026
education

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add majiayu000/claude-skill-registry --skill lessons-capture --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Lessons Capture?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Lessons Capture
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-lessons-capture/badge)](https://www.skillsdirectory.com/skills/majiayu000-lessons-capture)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: lessons-capture
description: Use when concluding significant work to extract reusable patterns and anti-patterns
---

# Lessons Capture

## Overview

Distills session experiences into transferable, project-scoped knowledge.

**Core principle:** Extract patterns that will help future sessions on this project.

**Announce at start:** "Applying lessons-capture skill to extract reusable patterns."

## When to Use

- After completing a significant feature or bugfix
- When a pattern emerges that should be reused
- When discovering an anti-pattern to avoid
- When resolving a discrepancy (updating stale lesson)

> [!IMPORTANT]
> Lessons persist in the **PROJECT** (`<workspace>/.ai-memory/lessons/`), not the conversation.

## The Process

### Step 1: Identify Lesson-Worthy Patterns

Ask:
- Did I solve a problem that will recur?
- Did I discover a project-specific constraint?
- Did I find an anti-pattern to avoid?

### Step 2: Check for Existing Lessons

1. List `<workspace>/.ai-memory/lessons/`
2. If similar lesson exists: Update it with `supersedes` field
3. If new: Create fresh lesson

### Step 3: Write the Lesson

Create `<workspace>/.ai-memory/lessons/<slug>.md`:

```markdown
# Lesson: [Descriptive Title]

**Context**: [When this applies]
**Discovered**: YYYY-MM-DD
**Last Validated**: YYYY-MM-DD

## Pattern
[What to do - the reusable approach]

## Anti-Pattern
[What NOT to do - common mistakes]

## Evidence
- [Link to code or walkthrough showing this in action]

## Supersedes
- [Previous lesson file if updating, or omit]
```

### Step 4: Verify Lesson Quality

- Is it general enough to apply to similar future work?
- Is it specific enough to be actionable?
- Does it include both pattern AND anti-pattern?

## Common Mistakes

- Writing lessons too specific to one case
- Forgetting to link to evidence
- Not including the anti-pattern section
- Creating duplicate lessons instead of updating existing
- Using vague language ("handle appropriately")

## Checklist

Before committing lesson:

- [ ] Has clear `Context` for when it applies
- [ ] Has concrete `Pattern` (what to do)
- [ ] Has concrete `Anti-Pattern` (what NOT to do)
- [ ] Links to evidence (code, walkthrough, PR)
- [ ] Checked for existing similar lessons
- [ ] `Last Validated` date is current

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.