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.

referencesanti-patterns.md

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

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 to the data it uses.

Premature Abstraction

Abstracting before there are multiple concrete cases. Diff signals: An interface with exactly one implementation. A factory that creates only one type. A generic solution for a problem that exists only once. Suggest: Wait for the second or third use case before abstracting (Rule of Three).

Copy-Paste Programming

Duplicated code blocks with minor variations. Diff signals: Similar code appearing in multiple places in the diff. Functions that differ by only a parameter or two. Repeated patterns that could be parameterized. Suggest: Extract shared logic, parameterize the differences.

Magic Numbers / Strings

Literal values without explanation. Diff signals: Hardcoded numbers in conditions (if (retries > 3)). String literals used as keys or identifiers. Timeouts, limits, or thresholds without named constants. Suggest: Extract to named constants that explain the "why."

Long Method

Functions that do too much. Diff signals: New functions over 40-50 lines. Functions with multiple levels of nesting. Functions that require scrolling to read. Suggest: Extract sub-steps into named functions. Each function should do one thing.

Excessive Comments

Comments explaining "what" instead of "why." Diff signals: Comments restating the code (// increment counter). Large comment blocks before straightforward code. Commented-out code left in place. Suggest: Make the code self-documenting through better naming. Use comments only for "why" -- intent, trade-offs, non-obvious constraints.

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.