agent-md-refactor
Refactor bloated AGENTS.md, CLAUDE.md, or similar agent instruction files to follow…
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
$ npx -y skills add softaworks/agent-toolkit --skill lesson-learned --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/lesson-learnedContext preview
The summary Claude sees to decide when to auto-load this skill.
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
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."
Extract specific, grounded software engineering lessons from actual code changes. Not a lecture -- a mirror. Show the user what their code already demonstrates.
**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`.**
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:**
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.
Identify the **dominant pattern** -- the single most instructive thing about these changes.
Look for:
Map findings to specific principles from `references/se-principles.md`. Be specific -- quote actual code, reference actual file names and line changes.
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]
| 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 |
Opinionated skills shared by @leonardocouy for improving daily work efficiency with Claude Code. Skills are packaged instructions and scripts that extend agent capabilities across development, documentation, planning, and professional workflows.
Repo: softaworks/agent-toolkit
Refactor bloated AGENTS.md, CLAUDE.md, or similar agent instruction files to follow…
Create API handoff documentation for frontend developers. Use when backend work is complete…
Generate architecture documentation using C4 model Mermaid diagrams. Use when asked to create…
Use when the user asks to run Codex CLI (codex exec, codex resume) or references OpenAI Codex…
This skill should be used when creating a Claude Code slash command. Use when users ask to…
Create high-quality git commits: review/stage intended changes, split into logical commits,…