lessons-learned
Scannednpx machina-cli add skill lgbarn/shipyard/lessons-learned --openclawLessons 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
Natural Language Triggers
- "what did we learn", "capture lessons", "retrospective", "lessons learned"
Overview
The lessons-learned system captures discoveries, patterns, and pitfalls found during implementation and feeds them back into the project. Lessons are stored in .shipyard/LESSONS.md and optionally surfaced in CLAUDE.md so future agents benefit from past experience.
LESSONS.md Format
Store lessons in .shipyard/LESSONS.md using this exact structure:
# 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:
- What went well in this phase? -- Patterns, tools, or approaches that worked effectively.
- What surprised you or what did you learn? -- Unexpected behaviors, new techniques, or revised assumptions.
- What should future work avoid? -- Anti-patterns, dead ends, or approaches that caused problems.
- 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:
- Read all
SUMMARY-*.mdfiles in.shipyard/phases/{N}/results/. - Extract entries from "Issues Encountered" sections -- these often contain workarounds and edge cases.
- Extract entries from "Decisions Made" sections -- these capture rationale worth preserving.
- 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.
CLAUDE.md Integration
After the user approves lessons, optionally append to CLAUDE.md:
- If no
CLAUDE.mdexists, skip entirely. - Find or create a
## Lessons Learnedsection. - Append concise single-line bullets (omit phase dates, focus on actionable guidance).
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
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 7 for post-phase lesson capture.
Pairs with: shipyard:shipyard-verification for validating lesson quality before persisting.
Source
git clone https://github.com/lgbarn/shipyard/blob/main/skills/lessons-learned/SKILL.mdView on GitHub Overview
Lessons Learned captures discoveries, patterns, and pitfalls from implementation and feeds them back into the project. Lessons are stored in .shipyard/LESSONS.md and optionally surfaced in CLAUDE.md so future agents benefit from past experience.
How This Skill Works
The system prompts you with four questions after each phase, pre-populates suggestions from completed build summaries, and saves approved lessons under the Shipyard Lessons Learned header in LESSONS.md. New entries prepend so the latest phase appears first, and you can optionally append concise bullets to CLAUDE.md.
When to Use It
- After phase completion during /shipyard:ship (Step 3a), capture discoveries to reuse patterns.
- When reflecting on completed work to extract reusable knowledge, add structured lessons.
- When a build summary contains notable discoveries worth preserving for future work.
- Before finalizing LESSONS.md, use pre-populated suggestions from SUMMARY-*.md to accelerate capture.
- When you want to surface concise guidance to future agents by appending to CLAUDE.md.
Quick Start
- Step 1: After a phase completes, trigger the lessons capture prompt.
- Step 2: Answer the four structured questions or accept pre-populated suggestions.
- Step 3: Save the entry to .shipyard/LESSONS.md and optionally append to CLAUDE.md.
Best Practices
- Use the exact LESSONS.md structure with four subsections: What Went Well, Surprises/Discoveries, Pitfalls to Avoid, and Process Improvements.
- Pre-populate suggested lessons from SUMMARY-*.md to reduce capture friction and guide wording.
- Keep each entry focused on a single phase with a clear date; avoid duplicating existing entries.
- Limit each bullet to a concise, actionable statement (no longer than a couple sentences).
- After approval, append concise bullets to CLAUDE.md if it exists to surface learnings to future agents.
Example Use Cases
- ### What Went Well - Pre-population from SUMMARY-2024-07-01 Phase 2 reduced time to capture by 40%.
- ### Surprises / Discoveries - The build summary's 'Issues Encountered' often contains practical workarounds not visible in code.
- ### Pitfalls to Avoid - Referencing phase-specific file paths in LESSONS.md makes lessons non-portable.
- ### Process Improvements - Add a lightweight pre-commit reminder to prompt for a LESSONS.md entry before merging.
- ### CLAUDE.md Integration (optional) - If CLAUDE.md exists, add 'Lessons Learned' with concise bullets for future agents.