skill
learn-from-code-skill
Agent Skill to build codebase mental models, prevent comprehension debt, and practice debugging from AI-generated code and git diffs.
Set up
Skills are installed by placing their folder where your agent loads skills.
The download comes from github.com/HarleySw/learn-from-code-skill itself, not from our server, so what you get is exactly what its author published.
Install instructions come from the README
README
synced Oct 21, 2026learn-from-code
English | Tiếng Việt
An Agent Skill that helps you actually understand AI-generated code and git diffs—turning complex changes into clear mental models, visual state traces, and debugging intuition instead of walls of text.
Quick Start
Install via the Skills CLI (supports Claude Code, Cursor, Antigravity, OpenCode, Codex, Windsurf, Cline, and 70+ agents):
# Install in current project
npx skills add HarleySw/learn-from-code-skill
# Or install globally
npx skills add -g HarleySw/learn-from-code-skill
Copy skills/learn-from-code/SKILL.md into your agent's skill/rules folder:
- Claude Code:
.claude/skills/learn-from-code/SKILL.md - Cursor:
.cursor/rules/learn-from-code.mdc - Google Antigravity / OpenCode / Codex:
.agents/skills/learn-from-code/SKILL.md
Usage
Mode A — Understand a commit, git diff, or module (Default):
/learn-from-code
/learn-from-code explain commit 0bb8705
Mode B — Practice hands-on coding (TODO(human)):
Use learn-from-code in Mode B to implement the retry backoff logic.
How It Works
When reviewing code (Mode A), the agent follows a structured 2-turn workflow:
Turn 1 — Understand the Change:
- Big Picture: Plain-language symptom, everyday analogy, root cause, and a
Before -> Aftersnippet (❌vs✅). - Main Execution Flow: Chronological steps anchored to real-world user or system triggers (max 1 primary function per step).
- Core Code Steps: Focused snippets with inline comments, concrete examples, Contrastive Why sub-bullets, and conversational vertical case walkthroughs (plus ASCII Rulers for slice/offset math).
- Verification & Hidden Risks: Audits unseen callers, backward compatibility (
localStorage/DB), and edge cases, flagging real bugs with⚠️ Defect Alertand a compact❌ Current -> ✅ Fixcode slice. - Debugging Check: Self-contained boundary scenarios—each with its own focused code slice so you never have to scroll back up—dynamically scaled to test your mental model before moving on.
Turn 2 — Consolidate & Transfer (after you reply):
- Answer Review: Step-by-step feedback on your answers pinpointed to exact
filename:linelocations. - Transferable Patterns: Reusable engineering patterns extracted from the diff (when to use vs. when not to use).
- Blast Radius & Next Actions: Cross-file co-change rules and missing edge-case tests worth adding.
Features
- Beginner-Friendly & Senior-Deep: Explains the big picture in plain everyday words before diving into code mechanics, with zero arbitrary length caps.
- Visual Breathing Room: Uses bite-sized
1 idea = 1 bulletsub-bullets, vertical case walkthroughs, and< 76-charASCII rulers that render cleanly in both 80-col CLI terminals and narrow IDE sidebars. - Anti-Hallucination & Caller Audit: Grounds domain terms in repo docs/tests first and checks callers outside the
git difffor regressions. - Auto-Localized: Automatically responds in your language (English, Vietnamese, Japanese, etc.) using natural developer phrasing rather than stiff machine translation.
License
MIT © HarleySw