All skills
softaworks avatar

/lesson-learned

@7e4ba85
by softaworkssoftaworks/agent-toolkit2.5k stars
230

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.

Use this Skill: https://skilld.dev/gh/softaworks/agent-toolkit/lesson-learned

This session only. Nothing lands on disk.

README.md

≈692 tokens on demand. Your agent reads this file only when SKILL.md points to it.

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

## 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

Source: SKILL.md on GitHub

1 warning16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill analyzes git history and code diffs to extract software engineering lessons. While it processes external data (code and commit messages) which could potentially contain malicious instructions, the skill lacks dangerous capabilities such as network access or file modification, making the risk minimal.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    4/4 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 7e4ba85. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Dormantupdated 8 months ago

README badge

README badge for softaworks/agent-toolkit/lesson-learned

Analyzes recent git changes to extract concrete software engineering lessons grounded in the user's actual code. Loads a principles reference to map patterns like trade-offs, structural decisions, and missed opportunities, then reflects them back without prescribing what "should" have happened.

Generated from the current SKILL.md.

What git scopes does this skill analyze?
The skill analyzes feature branches (vs main), the last N commits on main, specific commits, or uncommitted working changes. It defaults to analyzing your current branch against main, or the last 5 commits if you're on main.
Do I need to load reference files before using this skill?
Yes. You must load references/se-principles.md before analysis begins. Optionally load references/anti-patterns.md if you suspect the changes include areas for improvement.
How does this skill handle large diffs?
If the diff exceeds 500 lines, the skill uses git diff --stat first, then selectively reads the top 3-5 most-changed files rather than the entire diff.
What if my recent changes are trivial or don't contain a meaningful lesson?
The skill will say so honestly rather than forcing a lesson. It focuses on concrete, grounded insights tied to actual code changes.

Generated from the current SKILL.md. These answers refresh after source changes.