Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
softaworks avatar

Lesson Learned

  • 2.8k installs
  • 2.2k repo stars
  • Updated March 5, 2026
  • softaworks/agent-toolkit

lesson-learned is an agent skill that analyzes recent git commits and diffs to extract specific, evidence-backed software engineering lessons from the user's own code.

About

lesson-learned is an agent skill that mirrors recent code changes back as specific software engineering takeaways. It loads references/se-principles.md first, optionally references/anti-patterns.md, then scopes analysis via git log and git diff for a feature branch against main, the last N commits on main, a specific SHA, or unstaged working changes. Phase 2 gathers commit messages and diffs, using git diff --stat and selective file reads when changes exceed 500 lines. Phase 3 hunts the dominant pattern across structural decisions, trade-offs, problems solved, and gentle missed opportunities mapped to named principles with file and line evidence. Phase 4 presents one primary lesson plus at most two secondary notes using a fixed template covering what happened, the principle, why it matters, and a concrete takeaway. Constraints forbid listing every principle, analyzing unchanged files, ignoring commit messages, prescriptive you-should language, or forcing lessons from trivial edits. Developers reach for it when they ask what the lesson is, want engineering takeaways from recent work, or need reflective feedback grounded in their own diffs.

  • Scopes analysis to feature branch vs main, last N commits, a SHA, or working tree changes.
  • Requires loading references/se-principles.md before mapping findings to named SE principles.
  • Uses git diff --stat and selective reads when diffs exceed 500 changed lines.
  • Presents one dominant lesson plus at most two secondary notes with file-level evidence.
  • Forbids analyzing unchanged files, ignoring commit messages, or forcing lessons from trivial edits.

Lesson Learned by the numbers

  • 2,816 all-time installs (skills.sh)
  • +16 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #60 of 1,382 Code Review & Quality skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

lesson-learned capabilities & compatibility

Capabilities
git scope selection · diff and commit analysis · principle mapping from references · structured lesson presentation
Use cases
code review · refactoring
From the docs

What lesson-learned says it does

Extract specific, grounded software engineering lessons from actual code changes. Not a lecture -- a mirror.
SKILL.md
If on a feature branch: analyze branch commits vs main
SKILL.md
Pick the 1-2 most relevant
SKILL.md
npx skills add https://github.com/softaworks/agent-toolkit --skill lesson-learned

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs2.8k
repo stars2.2k
Security audit3 / 3 scanners passed
Last updatedMarch 5, 2026
Repositorysoftaworks/agent-toolkit

What concrete software engineering principle does my recent code change demonstrate, grounded in actual diffs rather than generic advice?

Extract grounded software engineering lessons from recent git commits and diffs instead of generic lectures.

Who is it for?

Developers finishing a feature branch or recent commits who want reflective, evidence-based engineering takeaways from their own changes.

Skip if: Skip when there is no meaningful git history to analyze or you need forward-looking architecture planning instead of retrospective lessons.

When should I use this skill?

User asks what the lesson is, wants engineering takeaways from recent work, or says reflect on this code after commits landed.

What you get

A focused lesson write-up citing files, commits, and a named principle with a practical takeaway for future work.

  • engineering takeaway summary
  • trade-off analysis
  • improvement suggestions

Files

SKILL.mdMarkdownGitHub ↗

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.

1. Read references/se-principles.md to have the principle catalog available 2. Optionally read references/anti-patterns.md if you suspect the changes include areas for improvement 3. 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.

ScopeGit CommandsWhen to Use
Feature branchgit log main..HEAD --oneline + git diff main...HEADUser is on a non-main branch (default)
Last N commitsgit log --oneline -N + git diff HEAD~N..HEADUser specifies a range, or on main (default N=5)
Specific commitgit show <sha>User references a specific commit
Working changesgit diff + git diff --cachedUser 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

1. Run git log with the determined scope to get the commit list and messages 2. Run git diff for the full diff of the scope 3. If the diff is large (>500 lines), use git diff --stat first, then selectively read the top 3-5 most-changed files 4. Read commit messages carefully -- they contain intent that raw diffs miss 5. 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

AvoidWhyInstead
Listing every principle that vaguely appliesOverwhelming and genericPick the 1-2 most relevant
Analyzing files that were not changedScope creepStick to the diff
Ignoring commit messagesThey contain intent that diffs missRead them as primary context
Abstract advice disconnected from the codeNot actionableAlways reference specific files/lines
Negative-only feedbackDemoralizingLead with what works, then suggest improvements
More than 3 lessonsDilutes the insightOne 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

Forks & variants (3)

Lesson Learned has 3 known copies in the catalog totaling 215 installs. They canonicalize to this original listing.

How it compares

Use lesson-learned for personal post-ship reflection; use formal code-review skills when you need merge-blocking feedback.

FAQ

What git scope does lesson-learned use by default?

On a feature branch it diffs against main; on main it analyzes the last five commits unless the user specifies another range.

Which reference file must load before analysis?

references/se-principles.md is required before mapping findings to named software engineering principles.

How many lessons should it present?

One dominant lesson plus at most two secondary notes, each tied to specific files and commits.

Is Lesson Learned safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.