From han-coding
Produces a human-readable overview of unfamiliar code or PR changes, focusing on the real problem it solves, then what it does and how it flows.
How this skill is triggered — by the user, by Claude, or both
Slash command
/han-coding:code-overview [size: small | medium | large] [target: file, directory, symbol, or PR reference — defaults to the current branch's changes][size: small | medium | large] [target: file, directory, symbol, or PR reference — defaults to the current branch's changes]sizeThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
- git installed: !`which git 2>/dev/null || echo "not installed"`
which git 2>/dev/null || echo "not installed"which gh 2>/dev/null || echo "not installed"find . -maxdepth 1 -name "CLAUDE.md" -type ffind . -maxdepth 3 -name "project-discovery.md" -type fRead these before doing anything. They constrain every step below.
han-core:codebase-explorer agents gather the surrounding code and context the synthesis draws on — they do not write the overview. After the draft is written, han-core:adversarial-validator re-reads the code to challenge the draft's claims for accuracy, and han-core:readability-editor rewrites the corrected draft against the shared readability standard, preserving every fact; the skill applies the validator's corrections and the editor's rewrite. The skill itself produces the grouping, the charts, the orientation, and the final rewrite.../../references/readability-rule.md, holding the default audience frame: a capable reader who did not do this work and lacks the author's context. The standard governs how the overview reads (main point first, descriptive headings, one idea per paragraph, progressive disclosure), never whether a required fact about the code appears. Its dedicated han-core:readability-editor pass (Step 7) replaces the older information-architect / junior-developer readability review; the accuracy validator is a separate pass and stays.code-review's job; this skill only helps the reader understand the PR before they review it. Crossing this line collapses the boundary between the two skills.project-documentation's job; this skill is an understand-now orientation aid.Bind $size. If the user passed small, medium, or large as the first positional argument, bind $size to it. Anything else is part of the target, not a size; bind $size to the literal none provided.
Note tool availability. Read git installed and gh installed from Project Context. If git installed is empty or reads not installed, git is unavailable — see the degraded paths below.
Resolve the target and mode by this fixed precedence, so an ambiguous string never silently selects the wrong mode:
#82, https://github.com/owner/repo/pull/82) → PR mode against that pull request. Requires gh; if gh installed is empty or reads not installed, tell the user gh is needed to read a named pull request and offer code mode against a local target instead.Handle the unresolvable and empty cases (state the problem plainly and stop; never guess):
Resolve project context. If CLAUDE.md is present, read its ## Project Discovery section for conventions; fall back to project-discovery.md. These resolve language and framework questions so the explorers infer less. If neither exists, note that surrounding-code inference applies and pass that into the briefs.
Classify the target's size. Default to small; escalate only on a clear signal, and stay at the smaller band when a signal is borderline.
Apply the size override. If $size is not none provided, use it as the band and skip the signal-based classification; a conversational override ("give me a large overview") is equivalent.
Announce the chosen mode and size in one line before dispatching any exploration — for example, Code mode, size medium: directory \src/auth/` spanning the session and token subsystems. State tool degradation in the same line when it applies (git unavailable — code mode only`). Proceed without a blocking confirmation; this skill is read-only and re-runnable, so a gate here would gate a reversible operation. Honor any adjustment the user makes.
Code mode. Read the target file, directory, or symbol and enough of its immediate neighbors to know its boundary — what it imports and what imports it.
PR mode. Gather the change set:
git symbolic-ref refs/remotes/origin/HEAD or fall back to main/master), then capture git diff {default-branch}...HEAD for committed work and git diff plus git diff --cached for uncommitted work. Run each diff as its own Bash command so large diffs stream incrementally. Also capture git log {default-branch}..HEAD --pretty=format:%B for the change's intent. When gh is available, also run gh pr view --json title,body,comments (no ref — resolves the PR for the current branch) so the change's stated intent and any screenshots are in scope; if no PR exists for the branch, skip this without failing.gh pr view {ref} --json title,body,comments for intent and screenshots, and gh pr diff {ref} for the change set. If the pull request cannot be reached (it does not exist, or access is unavailable), say so and offer code mode against a local target instead.Capture screenshots. When a PR body or a comment contains embedded images — Markdown  or <img src="url">, typically GitHub-hosted (user-attachments, githubusercontent.com) — record each image's URL together with the nearby caption or heading that says what it shows. These let the overview show a visual next to the text that describes it, so the reader does not have to switch back to the PR. If the PR has no images, capture nothing here.
Identify the set of files the change touches; that set scopes the exploration in Step 4.
Dispatch han-core:codebase-explorer agents to discover the surrounding code and context — the evidence of why the code exists (the problem it solves or goal it serves), plus entry points, directly-related context, uses, and the main process flow — that the synthesis draws on. Scale the count to size, and launch every agent in a single message so they run concurrently:
Each brief must contain: the resolved target (and, in PR mode, the changed-file set and the captured intent from Step 3); the project-context conventions from Step 1, or a note that surrounding-code inference applies; and the instruction to report the evidence of why the code exists — the problem it solves or goal it serves, drawn from commit messages, PR/issue intent, code comments, naming, and tests — alongside entry points, directly-related context, uses, and the main flow, as concrete, file-grounded findings. Instruct each explorer to report what it found, not to assess quality — this skill raises no findings — and, where the why is not stated anywhere in the evidence, to say so rather than infer one.
Wait for the whole wave to return before synthesizing. If the target proves too large to cover fully at the chosen size, the explorers cover the highest-signal areas; carry that into the coverage note in Step 5.
Read references/overview-template.md and render the structure for the resolved mode, drawing on the explorers' findings and the input from Step 3. The skill writes the overview; the explorers' raw findings are not pasted in.
Open the document with a title and a short intro paragraph naming what is being examined — the file, directory, symbol, pull request, or branch, and the part of the system it belongs to. Do NOT emit a Mode:, Generated:, or bare Target: metadata block; that metadata does not help the reader. Never state PR statistics — lines changed, files changed, additions/deletions, or commit counts — anywhere in the document; they go stale the moment the PR changes and add no understanding. Fold anything worth keeping into the intro sentence.
Lead with the why, and let everything else flow from it. The first section after the intro answers why this code (or this change) exists — the real problem it solves or the goal it accomplishes for the business or a user, then why it works the way it does and why it is the current solution to that need. Tell the why as a solution to a need, not as technical mechanics. Then frame every section that follows as serving that why: the flow shows how the code delivers on it, the context shows what it depends on to meet the need, the handoff shows where to start working on it. When the why is not recoverable from the code and its intent (commit messages, PR/issue text, comments, naming, tests), state what the code demonstrably does toward a goal and mark the inferred why as inferred — never invent a business rationale the evidence does not support.
Code mode renders, in order: the title and intro paragraph; a coverage note only if coverage was partial; Why it exists (the problem the code solves or goal it serves, then briefly what it is and why it works the way it does — all flowing from the why); Main flow (a Mermaid chart with a one-line scope label, read as how the code delivers on the why); Context and uses (context and uses kept distinguishable, framed as what it depends on to meet the need and where that need is served from); Where to start (the concrete entry points the reader opens first).
PR mode renders, in order: the same title and intro paragraph; the same conditional coverage note; Why this change exists (the problem the change solves or goal it advances, then briefly the bottom line of what it does); Changes by intent (grouped by the reader-visible outcome each group delivers — the why each group serves — not by file, layer, or author motivation; a single logical change is one narrative with no grouping header); How the change flows (a Mermaid chart with a scope label, placed after the grouped changes BECAUSE the reviewer must know what changed before that chart is meaningful); What to watch when reviewing (navigational only — where the change is hardest to follow and why; never a quality or risk judgment).
Place any captured screenshots inline next to the text they illustrate — embedded as  directly under the Changes-by-intent item or the flow step they depict, BECAUSE a visual next to its description spares the reader a trip back to the PR. Keep the image URL exactly as captured. Omit screenshots entirely when the PR had none; never invent or placeholder an image.
Apply the per-section detail rule from the template: minimal technical detail in the why, flow, and context sections — the why told as a problem solved or goal met, not technical mechanics; concrete named entry points in the handoff section. Give every chart a scope label. When coverage is partial, place the coverage note immediately after the intro paragraph so the reader calibrates before investing in the charts.
Write the rendered overview to a scratch file outside the repository — for example ${TMPDIR:-/tmp}/code-overview-{short-target-slug}.md. Never write it into the repository's documentation tree; this overview is ephemeral. The next step reviews and rewrites this file in place.
This step runs two distinct passes, in order: the accuracy validator first, then the readability rewrite. Accuracy is settled before readability so the editor never polishes a claim that is about to be cut.
Pass 1 — accuracy. Dispatch han-core:adversarial-validator over the draft overview. Pass it the scratch-file path and the resolved target (and, in PR mode, the changed-file set) so it knows what to re-read.
han-core:adversarial-validator — assume every claim the overview makes about the code is WRONG until the code and its intent prove it right. Re-read the target (and the diff, in PR mode) and challenge each material claim, starting with the one the document leads on: is the stated why — the problem the code solves or the goal it serves — grounded in real evidence (commit messages, PR/issue intent, code comments, what the code visibly does toward that goal), or is it an invented business rationale, and where the why is inferred rather than stated, is it marked as inferred; does the code actually do what Why it exists / Why this change exists says; does the Main flow / How the change flows chart match the real control flow, in the right order, with no invented or missing steps; do the named Where to start entry points exist and are they the right ones; does each Changes by intent grouping describe what that change actually does and the why it claims to serve. Surface every claim that is unsupported, overstated, contradicted by the code, or hallucinated — the why most of all, since it is the load-bearing claim — citing the file, line, or commit that disproves it. Validate the accuracy of the description only — do not assess the code's quality and do not raise findings about the code itself. Return a list of inaccurate or unsupported claims, each with the corrected fact or a note that the claim should be cut.Apply the validator's corrections to the scratch file first: fix or cut every claim it disproved. A sentence that reads beautifully but describes a flow the code does not follow must still be corrected or removed. If validation removed so much that coverage is now meaningfully partial, add or update the coverage note.
Pass 2 — readability rewrite. Dispatch han-core:readability-editor over the corrected draft. This dedicated pass replaces the older information-architect / junior-developer readability review; the deliverable gets one readability rewrite, not two overlapping reviews.
han-core:readability-editor — rewrite the overview against the shared readability standard for the default reader (a capable reader who did not do this work and lacks the author's context), preserving every fact. Pass it the scratch-file path and the rule path ../../references/readability-rule.md. It operates on prose regions only: it does not touch the Mermaid chart bodies, code fences, or the embedded screenshot markup, and it leaves every named file, symbol, and entry point exact. It applies the rewrite to the scratch file in place and returns a rubric verdict and a fact-preservation ledger. Tell it: rewrite the overview document for readability only — do not review the underlying code, and do not raise findings about it. This skill makes no quality judgment about the code; the validator guards truth, the editor guards clarity, and neither crosses into evaluating the work itself.Keep the spec-content discipline through both passes: the result is still an orientation aid with no quality findings, led by the why with everything flowing from it, minimal technical detail in the why/flow/context sections, and concrete entry points in the handoff section.
Readability self-check. After the rewrite, run the standardized readability self-check from ../../references/readability-rule.md over the overview's prose regions only — never inside the Mermaid chart bodies, code fences, screenshot markup, or file/symbol references. Confirm each criterion and fix any failure before presenting:
Fidelity wins: the standard governs how the overview reads, never whether a required fact about the code appears.
Present to the user in a short message: the scratch-file path, the mode and size used (and why), and any coverage gap the overview noted. Do not paste the whole overview into the conversation; point the user at the file, where the Mermaid charts render.
npx claudepluginhub testdouble/han --plugin han-codingFocused review of code, documents, or architecture — one deep pass with evidence-based findings and clear verdict. Auto-detects what you're reviewing: branch diff, PR, file path, plan, brainstorm, or spec. One reviewer that reads carefully beats nine that skim. Triggers: review, code review, review PR, review diff, review plan, review brainstorm, review spec, review document, evaluate, check.