skills/explain-pr/SKILL.md
Explain a GitHub Pull Request (PR) or GitLab Merge Request (MR) to the user in plain, easy-to-understand language: WHAT was done, WHY/what for, and HOW — with the relevant code snippets embedded. Invoke this proactively and automatically right after creating or finishing a PR/MR (e.g. after running `gh pr create`, `glab mr create`, or pushing a branch and opening a PR/MR), even if the user did not explicitly ask for an explanation. Also use whenever the user asks to explain, summarize, walk through, recap, or 'tell me what you did' about a PR/MR or the changes in a branch. Works with any coding agent and relies on the local git diff, so it does NOT require gh/glab to function. Do NOT use for unrelated code reviews, bug hunting, or writing the PR/MR description itself — this skill only explains finished work back to the user.
npx skillsauth add mryll/skills explain-prInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Turn a freshly created Pull Request / Merge Request into a clear, friendly explanation the user can read in one pass to understand what changed, why it was done, and how it works — with the relevant code shown inline.
This replaces the manual prompt a user would otherwise type ("explain what you did, why, and how, in simple terms, with the relevant code"). The point is that the user shouldn't have to ask: once a PR/MR exists, they almost always want this recap.
Trigger it on your own, without waiting to be asked, right after a PR/MR is created or finished — that's the moment the user wants the recap. Concretely:
gh pr create, glab mr create, or opening a PR/MR through any other means.If you just finished a PR/MR in this same conversation, you already did the work — you know most of the why firsthand. Use that, but still anchor the what and how in the real diff (see below) so nothing is misremembered or invented.
You're explaining the changes a branch introduces relative to its base. Find that range, in this order of preference:
main/master/develop) and the title/description you wrote. Start there.gh/glab is available and you're unsure of the base:
gh pr view --json baseRefName,title,body,commitsglab mr view
These also hand you the title and description — useful for the why.main, then master, then develop), then use it below.Once you know the base branch, read the actual changes (the ... form diffs against the merge-base, which is what a PR/MR shows):
git diff <base>...HEAD --stat # scope first: which files, how much
git log <base>..HEAD --oneline # the commits on this branch
git diff <base>...HEAD # the actual changes
Look at --stat first to gauge scope, then read the diff. For a large diff, don't dump everything — focus on the changes that carry the intent and skim or skip noise (lockfiles, generated files, pure formatting, vendored code). Mention that you skipped them rather than pretending they don't exist.
If you can't establish a clean range (e.g. the PR is already merged, or you're sitting on the base branch), say so and work from the most recent commits and the conversation context instead of guessing silently.
The diff tells you what and how, but rarely why. Pull the intent from, in order: the conversation you just had, the PR/MR title and description, the commit messages, and any referenced issue/ticket. If, after all that, the reason for a change genuinely isn't recoverable, say so plainly ("I couldn't find what this change is based on") instead of inventing a motivation. A confident-sounding made-up reason is worse than an honest gap.
Compose the recap using the structure below. Keep it grounded: every code snippet you show must come from the real diff, with a path/to/file.ext:line reference so the user can click straight to it.
Deliver it in the chat using exactly these three sections, always, in this order. Use these exact headings, translated into the conversation's language when you're explaining in another language. This fixed shape is the whole point: it makes the output predictable across runs, models, and agents instead of leaving the format up to each model's interpretation. A reader should recognize the layout at a glance, every single time.
## 📋 What I did
<1–3 sentences, plain language: the change in a nutshell. No jargon dumps.>
## 🎯 Why / what for
<The problem, need, or goal this addresses. Tie it to the user's intent.>
## 🔧 How I did it
<The approach, walked through in the order that makes it easiest to follow.
Embed the relevant code as fenced blocks with a `file:line` reference, e.g.:>
`src/auth/token.ts:42`
```ts
export function verifyToken(raw: string) {
// ...the actual lines from the diff...
}
```
<Explain what each shown snippet does and why it matters. Group related
changes together rather than going file-by-file in arbitrary order.>
Keep all three sections even for a tiny PR (a one-line fix, a config tweak) — that consistency is what makes the output predictable. What scales with the size of the change is the amount of detail inside each section, not whether the section exists: for a trivial change each section can be a single line; for a large PR, lead How I did it with the headline change, group the rest by area, and prioritize what a reviewer most needs to understand. Trim filler, never drop a section.
Pin each snippet to the real line. The file:line reference must point to where the code actually lives so the user clicks straight to it — don't default to :1:
@@ -x,y +a,b @@ markers give you the new line numbers), or grep the file for the changed code to find its current line.:1, or the line where the relevant function/section starts.Show the before when a change alters existing behavior. Seeing only the final code hides what actually changed. When a PR modifies behavior that already existed, include the prior version too — a // before / // after pair of snippets, or a short before/after table — so the contrast makes the change obvious. Get the base side from git show <base>:<path> or the - lines of the diff. Skip this for brand-new files (there's no "before") and for trivial changes where it would just add noise; the goal is clarity, not ceremony.
For a PR that adds rate limiting to an API endpoint, a good recap reads like:
📋 What I did — Added a per-IP request limit to the login endpoint to curb brute-force attempts.
🎯 Why —
/loginhad no brute-force protection; an attacker could try thousands of passwords. This closes that door.🔧 How I did it — Added a sliding-window middleware… (then the actual middleware snippet with its
file:line, and a line on how it's wired in).
The headings are fixed; the prose, snippets, and depth come from the actual change.
tools
Explain anything — code, an error, a concept, or a non-technical topic — in the simplest, most plain-language way possible, ELI5-style, with a natural Río de la Plata (Argentine) voice that puts clarity first. Use ONLY when the user explicitly asks to have something dumbed down or simplified. Triggers (Spanish + English): 'explicámelo como si fuera de Boca' (or de River / de cualquier cuadro), 'explicámelo simple', 'explicalo fácil', 'más fácil', 'bajámelo un cambio', 'en criollo', 'como si tuviera 5 años', 'para tontos', 'ELI5', 'explain like I'm 5', 'dumb it down', 'in plain terms'. Optimized for technical material (code, architecture, tooling, errors) but the same method works for any topic. Do NOT use when the user wants full technical depth, a code review, or did not ask to simplify — this skill is for deliberate, on-request simplification, not for talking down to the user by default.
tools
Iterative non-code discussion between the local agent and Codex CLI on any open-ended topic: diet, fitness, writing, decisions, strategy, study plans, life choices, brainstorming. Orchestrates an automatic back-and-forth debate where both agents critique, propose alternatives, and iterate on the user's idea until reaching consensus. Codex CLI runs READ-ONLY, forms its own opinions, and normally does not navigate the filesystem unless the user provides file paths. Use when the user says discuss with codex, iterate with codex, consult codex, debate with codex, ask codex for a second opinion, get codex's take, or brainstorm with codex, including pasting or describing a plan, draft, idea, decision, or proposal and wanting a critical iterative review. Does NOT trigger on code review, plan-mode review of implementation plans, architecture discussions, or any technical software-engineering analysis; use codex-review for those.
development
Language-agnostic strategy for testing code at the boundary with external infrastructure (databases, APIs, queues): integration tests with real infrastructure (e.g. Testcontainers) prove the full chain works for happy paths; unit/slice tests with mocks prove error-handling and mapping logic (domain error to status, input validation, infra failure). Works in any language/framework — Go, .NET/C#, Java, Python, TypeScript and more — with concrete references for Go, .NET (ASP.NET Core) and Java (Spring Boot) and an explicit path to adapt when no reference matches your language. Apply when designing a test strategy, creating a handler/feature/worker that needs tests, or deciding what type of test a scenario needs. Triggers: 'dual testing', 'integration vs unit', 'testcontainers vs mocks', 'what type of test', 'where should this test go', 'error path coverage'. Does NOT trigger on writing individual test assertions or test naming conventions (use test-namer for those).
tools
Iterative code review and planning discussion between the local agent and Codex CLI. Orchestrates an automatic back-and-forth debate where both agents discuss findings, architecture decisions, or implementation plans until reaching consensus. Codex CLI runs READ-ONLY and never modifies files; model and reasoning effort come from the user's local Codex config. Supports plan mode: when the local agent has a plan ready, Codex evaluates and iterates on it before implementation, producing an updated consensus plan. Use when the user asks to review with codex, analyze with codex, discuss code with codex, iterate with codex, consult codex, ask codex, review the plan with codex, validate plan with codex, or any Codex CLI request for code review, architecture review, plan review, or implementation strategy. Does NOT trigger on non-code topics like diet, fitness, writing, life decisions, or general strategy; use codex-discuss for those.