/teach-me:teach-me [PR number or URL, owner/repo#123, "my changes", or a concept]from teach-me
Turns a PR, commit, local diff, or named concept into short lessons with an interactive diagram and quiz, verified against the code and saved as an Artifact.
Ships in teach-me. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Run this only when the user typed /teach-me or asked for teach-me by name. Don't start it on your own because a conversation touches a code change or a concept.
The request: $ARGUMENTS
A teach-me page explains the few ideas a reader needs to judge a code change, or to understand a concept they named. Each idea gets a short lesson, usually an interactive diagram, and a quiz. Every lesson is checked against the code before it's published.
Make a new working folder with a unique name, for example with mktemp -d, in the session's scratchpad or temp directory and never inside the user's repo. Save everything there. A fresh folder keeps two runs from overwriting each other's files.
gh pr view --json number,title,body,url). If there isn't one, use your uncommitted changes (git diff HEAD, plus new untracked files), and if there are none, the current branch's diff against its base.git diff HEAD plus new untracked files; "staged" is git diff --cached; "the last commit" or a commit hash is git show <commit>; a branch or range is git diff <base>...<branch>.gh (gh pr view <n> -R owner/repo --json title,body,url,files,headRefOid and gh pr diff <n> -R owner/repo). Read whole files at the PR's head when the diff isn't enough: gh api repos/owner/repo/contents/<path>?ref=<sha> -q .content | base64 -d. For a big PR, clone it shallowly into the working folder instead.For a change, save the diff as change.diff and note the PR's title, URL and description. For a concept there's no diff; note any files you ground the example in.
For a code change, read references/concepts.md and pick the concepts. Tell the user the list in one line each, then carry on without waiting. If there's nothing worth learning, say why in a sentence and stop: don't make a page. For a concept, that concept is the list; still decide its kind and visual form with concepts.md.
Read references/lesson.md and references/figure.md. Write every lesson and figure new, from the code or the concept in front of you; don't start from any other lesson file. Write lessons.json for the page, and for each concept its own lesson-c1.json (c2, c3…) and, when it has a visual form, its figure c1.html. With more than one concept, you can write them in parallel with one subagent each: give each one the paths to the two reference files, the concept, the diff and the paths it may read. Each one writes only its own lesson and figure files.
For each lesson, start a separate agent and tell it to follow the brief below the line in ${CLAUDE_SKILL_DIR}/references/check.md. Give it the paths to that lesson's lesson-cN.json and figure file, and what to check against: change.diff and the repository or files it can read, or for a concept, the files the example uses (if any). It fixes what's wrong in place and reports each fix. Run the checks in parallel and wait for all of them before building the page. Don't skip this step: the lessons are written to be checked.
Build the page:
python3 "${CLAUDE_SKILL_DIR}/scripts/build_page.py" "<folder>/lessons.json" > "<folder>/page.html"
On Windows, use python instead of python3 if python3 isn't found or opens the Microsoft Store.
It prints a warning for each figure that won't read well on a phone. Fix those in the figure and build again before going on.
If you can open a page in a browser (a browser tool, or Playwright), also build --standalone --check to <folder>/check.html, open it, and read the box with id layout-report. It lists text in each figure that overlaps, gets cut off or is too small to read, at the figure's width and at 380px. Fix those with small edits to the figure (move, shorten or wrap labels, let rows wrap, size drawings to their container), rebuild, and check again. Keep a fix only if the report gets shorter.
Publish page.html with the Artifact tool, as a new artifact. Its title is a short name for the page, like "Retry with backoff". When the Artifact tool isn't available, build with --standalone into the directory the session started in (not the working folder), as teach-me-<short-name>.html, so the user can find it after the temp files are gone. Give them its path.
Finish with one or two lines: the link (or path), and the concepts it covers.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
learning, code-explanation, interactive-diagram, quiz, pull-request
Other plugins' skills for the same job
npx claudepluginhub sshah03/teach-me --plugin teach-me