Lesson LearnedSAFE
A curated collection of skills for AI coding agents. Skills are packaged instructions and scripts that extend agent capabilities across development, documentation, planning, and professional workflows.
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
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
- 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.
- Gather changes -- Reads git log, diffs, and commit messages. For large diffs, selectively reads the most-changed files.
- Analyze patterns -- Identifies structural decisions, trade-offs, and problems solved. Maps observations to named SE principles.
- 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 move
28aecfe29fbfOBSERVED · 2026-10-08What it tells the agent
The instruction file, verbatim from the audited commit — this is the text the model reads, and the surface the audit's instruction layer examines. Quoted here so you can judge it without cloning anything.
--- 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.** 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: ```markdown ## 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): ```markdown --- ### 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.
Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | NA |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- none-observed
- Shell
- none-observed
- Dependencies
- pinned
- Secrets in source
- none-found
Findings (1)
CLAUDE.md
Gates applied: no_behavioural_pass.
28aecfe29fbffull audit observations/trust-audit/skill/softaworks__lesson-learned.json · Report an issue / request a re-scanAudit history
Every audit this skill has had.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-08 | 28aecfe29fbf | SAFE | B | 89 | first audit |
Questions
What does the Lesson Learned skill do?
A curated collection of skills for AI coding agents. Skills are packaged instructions and scripts that extend agent capabilities across development, documentation, planning, and professional workflows.
Is Lesson Learned safe to install?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean skill reads B.
What can Lesson Learned access on my machine?
The audit observed no filesystem, network or shell use at all in its source.
How current is this page?
The grade is for one exact copy of the source (28aecfe29fbf), read on 2026-10-08. The repository is watched, and a new audit runs when it changes — this is the first audit.