lesson-learned
softaworks/agent-toolkit
Extract software engineering lessons from your recent code changes via git history.
What is lesson-learned?
Analyzes actual code diffs and commit messages to identify specific, grounded software engineering principles at work in your recent changes. Use when you want to reflect on what you've learned from your own code—not a lecture, but a mirror showing what your changes already demonstrate.
- Examines git history (feature branches, commit ranges, or working changes) to identify dominant patterns
- Maps code changes to concrete software engineering principles from a reference catalog
- Identifies structural decisions, trade-offs, and problems solved in your recent work
- Suggests improvements gently as "next time, consider..." rather than criticism
- Grounds every lesson in specific files, commits, and code references
How to install lesson-learned
npx skills add https://github.com/softaworks/agent-toolkit --skill lesson-learned- Git repository with commit history
- Access to references/se-principles.md (loaded automatically by the skill)
- Optional: references/anti-patterns.md for identifying areas for improvement
How to use lesson-learned
- 1.Invoke the skill with a scope: feature branch, last N commits, specific commit, or working changes
- 2.The skill loads the principles reference and determines scope (defaults to feature branch vs. main, or last 5 commits on main)
- 3.Provide git history and diffs; the skill reads commit messages and changed files
- 4.The skill identifies the dominant pattern and maps it to one or two key principles
- 5.Review the lesson output, which includes what happened, the principle at work, why it matters, and a concrete takeaway
Use cases
- Reflect on a completed feature branch to understand what engineering principles guided your design
- Extract lessons from the last 5 commits on main to reinforce good patterns you're already using
- Analyze a specific commit to understand the trade-offs you made (readability vs. performance, DRY vs. clarity)
- Review working changes before committing to identify structural decisions worth documenting
- Identify missed opportunities in recent refactoring work
- Software engineers wanting to reflect on and reinforce their own coding practices
- Teams conducting lightweight code reviews focused on learning rather than approval
- Developers seeking to articulate the principles behind their recent decisions
- Anyone looking to extract actionable takeaways from their own work
lesson-learned FAQ
The skill will say so honestly rather than forcing a lesson. Not every change yields a deep insight—sometimes good housekeeping is just good housekeeping.
Yes. Provide the commit SHA and the skill will analyze that single commit using `git show <sha>`.
The skill uses `git diff --stat` first to identify the most-changed files, then reads only the top 3-5 files to keep analysis focused and actionable.
No. It leads with what works and frames suggestions as "next time, consider..." rather than "you should have..." The goal is reflection, not judgment.
Yes, but the skill limits output to a maximum of 2–3 lessons. One well-grounded lesson beats seven vague ones.
Full instructions (SKILL.md)
Source of truth, from softaworks/agent-toolkit.
name: lesson-learned description: "Analyze recent code changes via git history and extract software engineering lessons. Use when the user asks 'what is the lesson here?', 'what can I learn from this?', 'engineering takeaway', 'what did I just learn?', 'reflect on this code', or wants to extract principles from recent work."
Lesson Learned
Extract specific, grounded software engineering lessons from actual code changes. Not a lecture -- a mirror. Show the user what their code already demonstrates.
Before You Begin
Load the principles reference first.
- Read
references/se-principles.mdto have the principle catalog available - Optionally read
references/anti-patterns.mdif you suspect the changes include areas for improvement - Determine the scope of analysis (see Phase 1)
Do not proceed until you've loaded at least se-principles.md.
Phase 1: Determine Scope
Ask the user or infer from context what to analyze.
| Scope | Git Commands | When to Use |
|---|---|---|
| Feature branch | git log main..HEAD --oneline + git diff main...HEAD | User is on a non-main branch (default) |
| Last N commits | git log --oneline -N + git diff HEAD~N..HEAD | User specifies a range, or on main (default N=5) |
| Specific commit | git show <sha> | User references a specific commit |
| Working changes | git diff + git diff --cached | User says "what about these changes?" before committing |
Default behavior:
- If on a feature branch: analyze branch commits vs main
- If on main: analyze the last 5 commits
- If the user provides a different scope, use that
Phase 2: Gather Changes
- Run
git logwith the determined scope to get the commit list and messages - Run
git difffor the full diff of the scope - If the diff is large (>500 lines), use
git diff --statfirst, then selectively read the top 3-5 most-changed files - Read commit messages carefully -- they contain intent that raw diffs miss
- Only read changed files. Do not read the entire repo.
Phase 3: Analyze
Identify the dominant pattern -- the single most instructive thing about these changes.
Look for:
- Structural decisions -- How was the code organized? Why those boundaries?
- Trade-offs made -- What was gained vs. sacrificed? (readability vs. performance, DRY vs. clarity, speed vs. correctness)
- Problems solved -- What was the before/after? What made the "after" better?
- Missed opportunities -- Where could the code improve? (present gently as "next time, consider...")
Map findings to specific principles from references/se-principles.md. Be specific -- quote actual code, reference actual file names and line changes.
Phase 4: Present the Lesson
Use this template:
## Lesson: [Principle Name]
**What happened in the code:**
[2-3 sentences describing the specific change, referencing files and commits]
**The principle at work:**
[1-2 sentences explaining the SE principle]
**Why it matters:**
[1-2 sentences on the practical consequence -- what would go wrong without this, or what goes right because of it]
**Takeaway for next time:**
[One concrete, actionable sentence the user can apply to future work]
If there is a second lesson worth noting (maximum 2 additional):
---
### Also worth noting: [Principle Name]
**In the code:** [1 sentence]
**The principle:** [1 sentence]
**Takeaway:** [1 sentence]
What NOT to Do
| Avoid | Why | Instead |
|---|---|---|
| Listing every principle that vaguely applies | Overwhelming and generic | Pick the 1-2 most relevant |
| Analyzing files that were not changed | Scope creep | Stick to the diff |
| Ignoring commit messages | They contain intent that diffs miss | Read them as primary context |
| Abstract advice disconnected from the code | Not actionable | Always reference specific files/lines |
| Negative-only feedback | Demoralizing | Lead with what works, then suggest improvements |
| More than 3 lessons | Dilutes the insight | One well-grounded lesson beats seven vague ones |
Conversation Style
- Reflective, not prescriptive. Use the user's own code as primary evidence.
- Never say "you should have..." -- instead use "the approach here shows..." or "next time you face this, consider..."
- If the code is good, say so. Not every lesson is about what went wrong. Recognizing good patterns reinforces them.
- If the changes are trivial (a single config tweak, a typo fix), say so honestly rather than forcing a lesson. "These changes are straightforward -- no deep lesson here, just good housekeeping."
- Be specific. Generic advice is worthless. Every claim must point to a concrete code change.
Related skills
More from softaworks/agent-toolkit and the wider catalog.

marp-slide
Create professional Marp presentation slides with 7 pre-designed themes and automatic quality improvements.

meme-factory
Generate memes using memegen.link API with 100+ templates and custom text styling.

mermaid-diagrams
Create professional software diagrams from text using Mermaid syntax.

naming-analyzer
Suggest better variable, function, and class names based on context and conventions.

openapi-to-typescript
Convert OpenAPI 3.0 specs to TypeScript interfaces and type guards.

plugin-forge
Create and manage Claude Code plugins with proper structure, manifests, and marketplace integration.