Catalog
softaworks/lesson-learned

softaworks

lesson-learned

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.

global
0installs0uses~1.2k
v1.1Saved Apr 20, 2026

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.

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

  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

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.
Files4
4 files · 12.2 KB

Select a file to preview

Overall Score

87/100

Grade

A

Excellent

Safety

92

Quality

88

Clarity

89

Completeness

80

Summary

Analyzes recent git history to extract software engineering lessons from actual code changes. The skill determines scope (feature branch, last N commits, specific commit, or working changes), gathers diffs and commit messages, identifies dominant patterns, and presents 1-3 principle-grounded, code-specific takeaways reflecting back what the user's code demonstrates.

Detected Capabilities

Git log analysis with scope detection (feature branch vs. main)Differential code analysis (git diff, git show, selective file reading)Principle-to-pattern mapping using curated SE principles catalogAnti-pattern detection (god object, shotgun surgery, copy-paste, etc.)Commit message parsing for developer intentLarge diff handling (git diff --stat selective reading)Balanced reflection (recognizing good patterns, not just failures)

Trigger Keywords

Phrases that MCP clients use to match this skill to user intent.

what is the lesson hereengineering takeawayreflect on code changeswhat did i just learnreview recent commitsanalyze git history

Risk Signals

INFO

Git commands with user-provided scope (git log, git diff, git show)

Phase 1: Determine Scope table; Phase 2: Gather Changes
INFO

Reads source files selectively based on git diff output

Phase 2: Gather Changes (step 3-4)
INFO

References external data files (references/se-principles.md, references/anti-patterns.md)

Before You Begin section

Use Cases

  • Reflect on a completed feature or pull request to understand what principles were applied
  • Extract engineering lessons from a debugging session or refactor
  • Understand trade-offs made in recent commits (readability vs. performance, DRY vs. clarity, etc.)
  • Recognize good structural decisions in your own code to reinforce them
  • Plan improvements by identifying anti-patterns in recent work before the next iteration

Quality Notes

  • Excellent scope documentation. Phase 1 clearly maps user context (feature branch vs. main) to specific git commands, with explicit default behavior.
  • Strong principle of least surprise in conversation style. Explicitly avoids prescriptive language ('you should have') in favor of reflective patterns ('the approach shows').
  • Well-structured analysis phases. Each phase has clear entry conditions and outputs, reducing ambiguity.
  • Good balance in output expectations. Template specifies 1-3 lessons with clear reasoning for the upper bound ('one well-grounded lesson beats seven vague ones').
  • Excellent 'What NOT to Do' section with practical trade-offs. Helps agent avoid common pitfalls (generic advice, scope creep, abstract takeaways).
  • Clear dependency management. 'Before You Begin' explicitly requires loading references/se-principles.md first.
  • Commit message prominence. Correctly prioritizes commit messages as 'intent that raw diffs miss,' not just data.
  • Large diff handling is pragmatic. Uses git diff --stat first, then selective file reading for diffs >500 lines — avoids overwhelming context windows.
  • Supporting reference files are comprehensive. se-principles.md includes code signals (what to look for), anti-patterns.md provides balanced counterpoint.
  • Good negative guidance. 'If the changes are trivial' instruction shows the skill knows when NOT to force a lesson.
  • Conversation style section reinforces specificity as a core value, with examples of good vs. bad framing.
  • Missing: No guidance on how to handle merge commits, rebased branches, or non-linear history.
  • Missing: No explicit guidance on how to handle cases where the user is on main but has uncommitted working changes (conflict between 'default N=5' and 'working changes' scope).
  • Minor: README mentions 'most-changed files' but Phase 2 doesn't specify ranking criteria (by line count? by complexity?).
Model: claude-haiku-4-5-20251001Analyzed: Apr 20, 2026

Reviews

Add this skill to your library to leave a review.

No reviews yet

Be the first to share your experience.

Version History

v1.1

Content updated

2026-04-20

Latest
v1.0

No changelog

2026-04-12

Add softaworks/lesson-learned to your library

Command Palette

Search for a command to run...