Skip to content
Back to skills

Lessons Learned

ASecurity

Use when capturing discoveries after phase completion, before shipping, or when reflecting on completed work to extract reusable patterns

  • 65 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added February 7, 2026
developmentgodebugging

Security analysis

A100/100

Scanned February 10, 2026

npx -y skills add lgbarn/shipyard --skill lessons-learned --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Lessons Learned?

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

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

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-learned
description: Use when capturing discoveries after phase completion, before shipping, or when reflecting on completed work to extract reusable patterns
---

<!-- TOKEN BUDGET: 155 lines / ~465 tokens -->

# Lessons Learned

<activation>

## When to Use

- After phase completion during `/shipyard:ship` (Step 3a)
- When reflecting on completed work to extract reusable knowledge
- When a build summary contains notable discoveries worth preserving

</activation>

## Overview

The lessons-learned system captures discoveries, patterns, and pitfalls found during implementation and feeds them back into project memory. Lessons are stored in `.shipyard/LESSONS.md` and optionally surfaced in `CLAUDE.md` so future agents benefit from past experience.

<instructions>

## LESSONS.md Format

Store lessons in `.shipyard/LESSONS.md` using this exact structure:

```markdown
# Shipyard Lessons Learned

## [YYYY-MM-DD] Phase N: {Phase Name}

### What Went Well
- {Bullet point}

### Surprises / Discoveries
- {Pattern discovered}

### Pitfalls to Avoid
- {Anti-pattern encountered}

### Process Improvements
- {Workflow enhancement}

---
```

New entries are prepended after the `# Shipyard Lessons Learned` heading so the most recent phase appears first. Each phase gets its own dated section with all four subsections.

## Structured Prompts

Present these four questions to the user during lesson capture:

1. **What went well in this phase?** -- Patterns, tools, or approaches that worked effectively.
2. **What surprised you or what did you learn?** -- Unexpected behaviors, new techniques, or revised assumptions.
3. **What should future work avoid?** -- Anti-patterns, dead ends, or approaches that caused problems.
4. **Any process improvements discovered?** -- Workflow changes, tooling suggestions, or efficiency gains.

Pre-populate suggested answers from build artifacts before asking (see Pre-Population below).

## Pre-Population

Before presenting prompts, extract candidate lessons from completed build summaries:

1. Read all `SUMMARY-*.md` files in `.shipyard/phases/{N}/results/`.
2. Extract entries from **"Issues Encountered"** sections -- these often contain workarounds and edge cases.
3. Extract entries from **"Decisions Made"** sections -- these capture rationale worth preserving.
4. Present extracted items as pre-populated suggestions the user can accept, edit, or discard.

This reduces friction and ensures discoveries documented during building are not lost.

## Memory Enrichment

If `shipyard:memory` is available, search memory for the milestone's date range to extract debugging struggles, rejected approaches, and key decisions. Add memory-derived insights to candidates (marked separately from summary-derived).

## CLAUDE.md Integration

After the user approves lessons, optionally append to `CLAUDE.md`:

1. If no `CLAUDE.md` exists, skip entirely.
2. Find or create a `## Lessons Learned` section.
3. Append concise single-line bullets (omit phase dates, focus on actionable guidance).

</instructions>

<rules>

## Quality Standards

Lessons must be **specific, actionable, and reusable**. Apply these filters:

**Anti-Patterns to reject:**
- Lessons that duplicate existing entries in LESSONS.md
- Lessons that reference specific line numbers or ephemeral file locations
- Lessons that are generic truisms rather than discovered knowledge
- Lessons longer than two sentences -- split or summarize

</rules>

<examples>

## Lesson Quality Examples

### Good Lesson -- specific, transferable, actionable

```
### Pitfalls to Avoid
- bats-core `run` captures exit code but swallows stderr -- use `2>&1` to capture both
```

Why it works: Names the exact tool and behavior, explains the symptom, and gives the fix.

### Good Lesson -- documents a non-obvious decision

```
### Surprises / Discoveries
- jq `.field // "default"` prevents null propagation in optional config values --
  without the fallback, downstream commands silently receive "null" as a string
```

### Bad Lesson -- vague platitude

```
### What Went Well
- Tests are important
```

Why it fails: Generic truism. Zero discovered knowledge.

### Bad Lesson -- too specific, not transferable

```
### Pitfalls to Avoid
- Fixed a bug on line 47 of parser.py
```

Why it fails: Line 47 will change. Future readers cannot act on this.

### Bad Lesson -- implementation detail, not a lesson

```
### Process Improvements
- Changed variable name from x to y
```

Why it fails: A code change, not a reusable insight.

</examples>

## Integration

**Referenced by:** `commands/ship.md` Step 3a for post-phase lesson capture.

**Pairs with:** `shipyard:shipyard-verification` for validating lesson quality before persisting.

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…