
Lesson Learned
Turn recent git commits and diffs into 1–3 named engineering principles with actionable next steps after you ship or debug.
Overview
Lesson Learned is an agent skill most often used in Ship (also Operate, Build) that extracts 1–3 principle-grounded takeaways from recent git history after you finish a feature, PR, debug session, or refactor.
Install
npx skills add https://github.com/softaworks/agent-toolkit --skill lesson-learnedWhat is this skill?
- Scopes work automatically: feature branch vs main (last five commits) or a user-specified SHA range
- Reads git log, messages, and diffs—with selective deep reads on the most-changed files when diffs are large
- Maps concrete changes to named principles (SOLID, DRY, KISS, YAGNI, and related SE patterns)
- Delivers 1–3 code-specific takeaways: principle, manifestation, why it matters, and a next action
- Trigger-ready after features, debugging sessions, refactors, or explicit reflection prompts
- Analyzes branch vs main on feature branches or the last 5 commits on main by default
- Presents 1–3 specific, code-grounded takeaways per run
Adoption & trust: 2.7k installs on skills.sh; 2k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You ship or fix code and move on without naming the trade-offs and principles you actually applied in the diff.
Who is it for?
Solo builders who want a lightweight retrospective from real commits without scheduling a team review.
Skip if: Teams that already run formal postmortems with approved write-ups, or repos with no meaningful recent git activity to analyze.
When should I use this skill?
After finishing a feature or PR, after a debugging session, after a refactor, when reflecting on recent work, or phrases like "what is the lesson here?", "what can I learn from this?", "engineering takeaway".
What do I get? / Deliverables
You get git-backed lessons tied to named SE principles plus actionable next steps you can apply on the next change set.
- 1–3 principle-named lessons with manifestation, rationale, and next step
- Scope summary (branch range or commit window analyzed)
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Canonical shelf is Ship because the skill is designed for post-PR and post-merge reflection—the natural checkpoint after code leaves your hands. Review is where solo builders reconcile what shipped with what they intended; git-grounded lessons belong on that shelf even when invoked after a local refactor.
Where it fits
After merging a PR, run it to name the coupling or abstraction trade-offs visible in the final diff.
After a production hotfix branch, capture what you would standardize next time to avoid repeat firefighting.
When a refactor lands locally, extract whether you favored DRY, YAGNI, or explicit duplication for a reason.
How it compares
Use for personal growth from your own diffs instead of a generic chat essay on best practices.
Common Questions / FAQ
Who is lesson-learned for?
Solo and indie developers using agent-assisted workflows who want structured reflection grounded in their actual git changes after shipping or debugging.
When should I use lesson-learned?
After finishing a feature or PR, after a debugging session, after a refactor, or when you ask what you can learn from recent work—in Ship review moments, Operate iteration, or late Build when wrapping a task.
Is lesson-learned safe to install?
It reads local git history and diffs; review the Security Audits panel on this page and only run it in repositories you trust with filesystem and git access.
SKILL.md
READMESKILL.md - Lesson Learned
# Lesson Learned Extract software engineering takeaways from your recent code changes. ## Purpose Most developers ship code and move on. But the fastest way to grow is to pause and reflect: what principle did I just apply? What trade-off did I make? What would I do differently? This skill analyzes recent git history and surfaces the engineering lesson embedded in the work you just did. ## When to Use - After finishing a feature or PR - After a debugging session - After a refactor - When you want to reflect on recent work - Trigger phrases: "what is the lesson here?", "what can I learn from this?", "engineering takeaway" ## How It Works 1. **Determine scope** -- Detects whether you're on a feature branch (analyzes branch vs main) or main (analyzes last 5 commits). You can also specify a commit range or specific SHA. 2. **Gather changes** -- Reads git log, diffs, and commit messages. For large diffs, selectively reads the most-changed files. 3. **Analyze patterns** -- Identifies structural decisions, trade-offs, and problems solved. Maps observations to named SE principles. 4. **Present the lesson** -- Delivers 1-3 specific, code-grounded takeaways with the principle name, how it manifested, why it matters, and an actionable next step. ## Key Features - **Git-history-driven** -- Works from actual code changes, not hypotheticals - **Principle-grounded** -- Maps observations to named SE principles (SOLID, DRY, KISS, YAGNI, etc.) - **Specific, not generic** -- Every insight references actual files and lines from your diff - **Balanced** -- Recognizes good patterns, not just areas for improvement - **Configurable scope** -- Feature branch, last N commits, specific SHA, or working changes ## Output Format ```markdown ## Lesson: Separation of Concerns **What happened in the code:** The `AuthController` was split into `AuthController` and `UserService` across commits abc123 and def456. Authentication logic stayed in the controller while user CRUD operations moved to a dedicated service. **The principle at work:** Separation of Concerns -- different responsibilities should live in different modules so each can change independently. **Why it matters:** Before the split, any change to user management risked breaking authentication. Now each module can evolve independently with a clear interface between them. **Takeaway for next time:** When a file handles two distinct responsibilities, split early -- it's cheaper than untangling them later. ``` ## Prerequisites - Must be in a git repository with commit history - Works best with descriptive commit messages ## Related Files - `references/se-principles.md` -- Curated SE principles catalog - `references/anti-patterns.md` -- Common anti-patterns to detect in diffs --- description: Common anti-patterns to detect in code diffs. Use alongside se-principles.md for balanced analysis -- principles show what's good, anti-patterns show what to watch for. --- # Anti-Patterns When analyzing a diff, check for these signals. Present findings gently -- as opportunities, not failures. ## God Object / God Class One module doing too much. **Diff signals:** A single file with many unrelated changes. One class/module imported everywhere. A file over 500 lines that keeps growing. **Suggest:** Extract responsibilities into focused modules (SRP). ## Shotgun Surgery One logical change scattered across many files. **Diff signals:** 10+ files changed for a single feature or fix. The same type of edit repeated in many places. A rename or config change touching dozens of files. **Suggest:** Consolidate the scattered logic. If one change requires editing many files, the abstraction boundaries may be wrong. ## Feature Envy A function that uses another module's data more than its own. **Diff signals:** Heavy cross-module imports. A function reaching deep into another object's properties. Utility functions that only serve one caller in a different module. **Suggest:** Move the function closer