Agent skill

Spec Explain

by leo-kuang-ai in leo-kuang-ai/spec-first

Create a durable, visual teaching artifact for a concept, diff, idea, or recent-work window, with an optional check-in that makes it stick.

MITAuto-check passedDevelopment

Install Spec Explain

skills CLI
$ npx skills add leo-kuang-ai/spec-first --skill spec-explain -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install leo-kuang-ai/spec-first spec-explain --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/leo-kuang-ai/spec-first.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/spec-explain .claude/skills/spec-explain && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
spec-explain
GitHub stars
107
Token cost
~3.3k tokens
SKILL.md length
1,731 words
Files
14 (incl. references)
Skills in repo
35
Repo updated
First seen
Licence
MIT

At a glance

Create a durable, visual teaching artifact for a concept, diff, idea, or recent-work window, with an optional check-in that makes it stick.

  • Works in 6 steps: Classify the input → Ground → Check-in gate — before anything is… → …
  • The user asks to be taught
  • SKILL.md covers Who the explainer is for, Interaction Method, Model Tiers and Dispatch Authorization Boundary, plus 2 more sections
  • Runs Shell and JavaScript scripts from its folder

What it does

Spec Explain is an agent skill from leo-kuang-ai/spec-first. Create a durable, visual teaching artifact for a concept, diff, idea, or recent-work window, with an optional check-in that makes it stick. Use when the user asks to be taught or wants a deep explainer; not for ordinary Q&A, brief why-followups, diagnosis, status updates, or concise trade-off answers.

Its SKILL.md is about 3.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 22 other files, including reference files (for example `evals/cases/simple-qa-not-triggered.yaml`, `evals/eval.yaml` and `evals/fixtures/repos/mini-ledger/README.md`).

It sits in Development. The repository describes itself as: 仓库原生 AI Coding Harness —— 把一次性 AI 对话变成可治理、可验证、可沉淀的工程闭环 · spec-first.cn. The licence is MIT.

When your agent uses it

  • The user asks to be taught
  • Wants a deep explainer
  • Not for ordinary Q&A
  • Brief why-followups

Example prompts

  • “/spec-explain”

Requirements

  • Node.js
  • A Bash shell

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Classify the input
  2. Ground
  3. Check-in gate — before anything is revealed
  4. Compose the explainer
  5. Exercises (when warranted)
  6. Destination ask and close

What it can do on your machine

Read from SKILL.md and the folder at commit 74655dc. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Shell and JavaScript, from the files we listed), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Spec Explain loads about 3.3k tokens when it runs, and up to ~7.1k if it reads all its reference files. Until then it costs about 79 tokens; SKILL.md has 1,731 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~79
When it runs · the whole SKILL.md, loaded when a task matches
~3.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~7.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from leo-kuang-ai/spec-first at commit 74655dc, republished under its MIT licence (© leo-kuang-ai). 1,731 words, ~3,318 tokens.

Download SKILL.mdSave it as .claude/skills/spec-explain/SKILL.md (or your agent's skills folder). This skill also uses 13 other files; get the full folder from GitHub.
name
spec-explain
description
Create a durable, visual teaching artifact for a concept, diff, idea, or recent-work window, with an optional check-in that makes it stick. Use when the user asks to be taught or wants a deep explainer; not for ordinary Q&A, brief why-followups, diagnosis, status updates, or concise trade-off answers.
argument-hint
[a concept, a diff ref, an idea, or 'what happened this week?'] — or invoke bare to be asked

Explain It To Me

Teach the user one thing well: a concept, a change, an idea, or a window of their own recent work. Agent-driven development removed the learning that writing code by hand used to provide; this skill is the replacement — the human keeps learning while agents do the writing.

Use the user's current request from the conversation as the explainer input.

Note: Use the current date from the active host context. Use this when weighting external sources and dating artifacts.

Who the explainer is for

The user personally — dense, technical, one voice, no audience adaptation. Meeting prep preps the user; it never produces the deck. The artifact is display-only: no embedded quizzes, forms, or widgets — the doing happens in the session, where answers can be checked.

Interaction Method

When you must ask the user a question, use the platform's blocking question tool: AskUserQuestion in Claude Code (call ToolSearch with select:AskUserQuestion first if its schema isn't loaded), request_user_input in Codex. Fall back to numbered options in chat only when no blocking tool exists in the harness or the call errors (e.g., Codex edit modes) — not because a schema load is required. In the fallback, stop and wait for the user's reply. Never silently skip the question. Ask one question at a time.

Model Tiers

Dispatch is tiered by task shape, never hardcoded to a model name:

  • Extraction tier — the work-recap scout and current-repo grounding scout: search-and-quote work. Request the cheapest capable tier only when worker_model_override: supported; otherwise inherit.
  • Ceiling tier — the explainer composition, the check-in reasoning, and the corrections. These run in the main conversation on the orchestrator's model; nothing is dispatched for them.

Dispatch Authorization Boundary

在派发 repo profiler 或 work-recap scout 前,记录:

yaml
worker_dispatch_authorization: authorized | missing
capability_probe: not_applicable | attempted | unavailable
worker_dispatch_capability: available | missing | unknown
worker_context_isolation: isolated | inherited | unknown
worker_model_override: supported | unsupported | unknown
worker_bounded_parallelism: supported | unsupported | unknown

workflow invocation does not authorize dispatch。只有当前用户或可见 upstream handoff 明确请求 subagent、delegated work、persona 或 parallel work 时才可派发。缺授权时不得探测 tool schema,固定为 capability_probe: not_applicable + worker_dispatch_capability: unknown,以同一预算 inline 或 serial 执行并记录 dispatch_authorization_missing。只有授权后才把 current-session registry/schema 作为 provider_untrusted evidence 检查:确认缺失时记录 subagent_capability_missing;surface 不可用、schema 不完整或候选不唯一时记录 worker_capability_unproven,均 inline 或 serial。隔离、模型覆盖和有界并发只取 live facts;required isolation 未满足时保持依赖 gate 打开,model unknown 时继承,parallelism unknown 时串行。记录 worker_dispatch_outcome。Inline fallback 不得声称 independent scout、fresh-context 或 multi-agent coverage。

Degradation rule. When authorized dispatch is available but worker_model_override is unsupported or unknown, dispatch scouts on the inherited model and keep their read budgets. When dispatch is unauthorized, missing, or unknown, run the scout work inline or serially with the same budgets and preserve the claim limitation above.

Execution Flow

Phase 1: Classify the input

Read references/intake.md now and classify the request into one of the four input shapes — concept, diff, idea, or work-recap window. It owns the token table (diff:, since:, output:), the explicit-token-beats-inference rule, the concept-vs-diff tiebreak, and conflict handling. Do not improvise classification.

Bare invocation (no input at all): ask one blocking question — "What should I explain?" — offering a shortcut option for a recap of recent work in this repo alongside free-text. Do not produce a default artifact unprompted.

Operational-question gate. When an inferred concept request is really an ordinary question about current behavior, configuration, status, or diagnosis, answer it directly in chat. Do not create a run directory or teaching artifact. Offer a durable visual explainer only when a substantial underlying concept is present and the user plausibly wants to learn it. Explicit teaching language, or a diff:/since: token, enters the full flow directly.

Phase 2: Ground

Match grounding to the input shape. Create the run directory first — every run gets one, before any artifact exists:

bash
umask 077
RUN_DIR="$(mktemp -d "${TMPDIR:-/tmp}/spec-first-explain.XXXXXX")"
[ -d "$RUN_DIR" ] && [ ! -L "$RUN_DIR" ] || { echo 'private scratch creation failed' >&2; exit 1; }
chmod 700 "$RUN_DIR"
echo "$RUN_DIR"

RUN_DIR is ephemeral, run-local scratch only. Recheck that it remains an owned, non-symlink directory before publishing any atomic temp-file rename into it; never leave the only durable explainer or handoff evidence there.

Repo-touching inputs (a concept with footprint in this repo, a diff, a recap): derive a run-local stack/conventions/vocabulary orientation from the current target repo/worktree. Record current git identity and dirty state when available, read active instructions and representative source directly, and retain direct source refs. Never persist or reuse the orientation across runs, branches, or worktrees. If git or a source cannot be read, record the exact degraded fact and narrow the explainer's project-specific claims. Topic-specific evidence — the diff, the concept's call-sites, and the window's commits — is always gathered fresh.

  • Diff mode: resolve the change (the diff: ref, or the most recent substantial change when the request points at one implicitly) and gather its evidence — the diff itself, the files it touches, any plan or solution doc that motivated it. Gather silently: nothing learned here is narrated to the user until Phase 3's ordering rule is satisfied.
  • Recap mode: when the Dispatch Authorization Boundary is satisfied, dispatch a generic subagent seeded with references/agents/work-recap-scout.md (extraction tier), passing the resolved window, the repo root, and $RUN_DIR. Otherwise execute the same bounded recap scan inline or serially, record the matching fallback reason, and do not claim independent scout coverage. The scan returns an evidence summary with commit shas and file:line pointers. Empty window (no git activity, no doc changes): say so, offer to widen the window, write no artifact, and end the run after the user responds.
  • External concepts (no footprint in this repo): skip repo grounding entirely — do not force repo context into the output. Research with whatever web tools are reachable. When none are, you may explain from model knowledge, but the artifact must label that content Unverified — from model knowledge, not checked against current sources in its metadata header.
  • Idea mode: the idea is a fixed given. Explain its implications, mechanics, and trade-offs for the user's understanding. Never scope it (spec-brainstorm's job), never generate and rank alternatives (spec-ideate's job).
Phase 3: Check-in gate — before anything is revealed

Judge whether the material warrants a check-in (a routine recap does not; a gnarly diff or a hard concept does), then offer it with the blocking question tool. The user can always decline, and declining is never re-litigated. Read references/check-in.md for the warrant test, the prediction protocol, and exercise design.

Diff mode with check-in accepted — hard ordering rule. No interpretive content — explanation, annotation, diagram, or surfaced opportunity — may be shown before the user's prediction turn ends. Show only the raw change reference (the diff or its stat summary), ask for the prediction ("What do you think this change does, and why was it made?"), and end the turn there. When no blocking tool exists, ask in chat and stop — never print the reveal in the same message as the prediction prompt. Compose the explainer only after the prediction lands; the reveal names the gaps between the prediction and what the change actually does.

Show full SKILL.md (658 more words)Show less
Phase 4: Compose the explainer

Read the rendering reference for the resolved format now, not earlier: references/explainer-html.md (default) or references/explainer-markdown.md (when intake resolved output:md). Compose per its contract — visible metadata header, show-n-tell form matched to the material, ~70ch measure, single self-contained file — and write the artifact to $RUN_DIR/explainer.html (or $RUN_DIR/explainer.md when intake resolved output:md) before anything else happens with it. Display it to the user (inline summary plus the file path; open locally per Phase 6 when chosen). The artifact exists at that stable path from this moment — a declined destination ask never loses it.

Phase 5: Exercises (when warranted)

For concepts, ideas, and dense recaps where the check-in was accepted: pose the exercises from references/check-in.md in chat, one at a time, using the blocking question tool where its option shape fits and free chat where the answer is narrative. Check each answer, correct it, and name the gap it exposed. Do not put exercises inside the artifact.

Phase 6: Destination ask and close

Detect destinations by capability — probe the agent's own toolset and session context, never a closed list, and never treat a missing binary, env var, or unloaded MCP tool as proof a destination is unavailable when a connector could supply it. Local file and Leave it are ungated and always offered. Offer only what is detected; absence hides an option silently. Ask once with the blocking question tool — counting visible options against the platform's cap first (Claude Code's AskUserQuestion allows up to 4 explicit options; Codex's request_user_input only 2-3): when the visible set exceeds the cap, render a numbered list in chat with "Pick a number or describe what you want." and wait instead. Per-option routing:

  • Artifact surface (offered when an artifact-publishing tool is present in the current session's tools) — publish per references/destinations.md: re-emit the explainer as body-only markup (no doctype/html/head/body, styles inline, no external font links); the surface wraps content in its own skeleton and blocks external hosts.
  • Local file — copy the artifact out of $RUN_DIR to the path the user names, then where the platform exposes a browser-opening primitive (open on macOS, xdg-open on Linux, start on Windows) offer to open it; otherwise print the absolute path.
  • Send to Thinkroom (offered only when a Thinkroom skill or CLI capability is detected) — send per references/destinations.md.
  • Leave it — materialize the canonical artifact under .spec-first/workflows/spec-explain/<run-id>/explainer.<html|md> using a private temp file and atomic rename, then report that repo-relative path. Never leave ephemeral $RUN_DIR as the only recoverable copy.

Non-interactive degradation: when no interaction is possible at this ask, do not hang or publish. Materialize the artifact under the same repo-local .spec-first/workflows/spec-explain/<run-id>/ owner, report the path, and end. If no target repo is available, preserve the owned private $RUN_DIR path and state the durability limitation explicitly; never imply that it survives reboot or cleanup.

Improvement observations. When composing the explainer surfaced things that could be better, route them by type after the destination ask — offer, don't auto-fire:

  • New-capability ideas — offer first; on acceptance invoke the spec-ideate skill via the platform's skill-invocation primitive, passing the observations as seed context. Do not merely tell the user to run it.
  • Code-clarity findings — offer first; on acceptance invoke the spec-simplify-code skill via the platform's skill-invocation primitive, passing the observations and the files they concern. Do not merely tell the user to run it.
  • UI/UX polish opportunities — present the observations in chat and tell the user to run spec-polish themselves; spec-polish is user-invoked only ; do not invoke it automatically — the in-session observations carry into their run.

Boundaries

  • Not a verdict. "Should we adopt X?" is spec-pov. spec-explain teaches what X is and how it works.
  • Not repo memory. Documenting a solved problem for future work is spec-compound. spec-explain teaches the human, not the repo.
  • Not ideation or scoping. An idea input is explained as given — implications and trade-offs — never expanded into options or a requirements dialogue.
  • The check-in is never headless. It exists to exercise the human; automating the answers deletes the product.

© leo-kuang-ai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 13 other files (references) in skills/spec-explain of leo-kuang-ai/spec-first.

  • SKILL.md
  • evals/cases/simple-qa-not-triggered.yaml
  • evals/eval.yaml
  • evals/fixtures/repos/mini-ledger/README.md
  • evals/fixtures/repos/mini-ledger/package.json
  • evals/fixtures/repos/mini-ledger/src/server.js
  • evals/fixtures/scripts/asks-a-question.sh
  • evals/fixtures/scripts/check-simple-qa.sh
  • references/agents/work-recap-scout.md
  • references/check-in.md
  • references/destinations.md
  • references/explainer-html.md
  • … and 2 more

Open the folder on GitHubat commit 74655dc

Compare with similar skills

Spec Explain next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Spec Explain compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Spec Explain this skillleo-kuang-ai/spec-first107—~3.3kAutomated safety check: PassMIT
Vercel Composition Patternssupabase/supabase111k58 repos~726Automated safety check: PassMIT
Finishing a Development Branchobra/superpowers297k5 repos~1.9kAutomated safety check: PassMIT
Typescript Advanced Typesrolling-scopes/rsschool-app10k25 repos~4.2kAutomated safety check: PassMPL-2.0
PR Babysitteropeninterpreter/openinterpreter69k3 repos~4.2kAutomated safety check: PassApache-2.0
Code Review ChecklistshareAI-lab/learn-claude-code78k4 repos~1.1kAutomated safety check: PassMIT

Similar skills

  • Official

    React composition patterns that scale. An agent skill from supabase/supabase.

    111k GitHub starsUsed in 58 repos~726 tokens
    DevelopmentAuto-check passed
  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    297k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Typescript Advanced Types

    rolling-scopes/rsschool-app

    Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications.

    10k GitHub starsUsed in 25 repos~4.2k tokens
    DevelopmentAuto-check passed
  • PR Babysitter

    openinterpreter/openinterpreter

    Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.

    69k GitHub starsUsed in 3 repos~4.2k tokens
    DevelopmentAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 4 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Greploop

    onyx-dot-app/onyx

    Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5/5 confidence score with zero unresolved comments.

    32k GitHub starsUsed in 4 repos~3.3k tokens
    DevelopmentAuto-check passed

More from leo-kuang-ai/spec-first

All 35 skills in this repo
  • Spec App Consistency Audit

    leo-kuang-ai/spec-first

    Audit mobile App PRD/Figma/local-source consistency across page routes, KMP/Clean Architecture, components, analytics, i18n, engineering quality, and industry lenses before runtime validation; use…

    107 GitHub stars~4.6k tokensUpdated 2 days ago
    Auto-check passed
  • Spec Handoff

    leo-kuang-ai/spec-first

    Create a durable cross-session handoff or resume from a user-selected continuity source.

    107 GitHub stars~1.8k tokensUpdated 2 days ago
    Auto-check passed
  • Spec Pov

    leo-kuang-ai/spec-first

    Give a decisive, project-grounded verdict on an external input — judged against the current project, not in the abstract.

    107 GitHub stars~4.5k tokensUpdated 2 days ago
    Auto-check passed
  • Spec Resolve PR Feedback

    leo-kuang-ai/spec-first

    Resolve PR review feedback by evaluating validity and fixing issues with conflict-aware resolver dispatch.

    107 GitHub stars~1.8k tokensUpdated 2 days ago
    Auto-check: notes
  • Spec Riffrec Feedback Analysis

    leo-kuang-ai/spec-first

    Analyze explicit Riffrec product-feedback captures, including riffrec-.zip, the Riffrec session.json + events.json + recording.webm + voice.webm bundle, or media/notes the user identifies as a…

    107 GitHub stars~1.4k tokensUpdated 2 days ago
    Auto-check passed
  • Spec Compound

    leo-kuang-ai/spec-first

    Document a recently solved problem or durable project vocabulary in docs/solutions/ or CONCEPTS.md.

    107 GitHub stars~18k tokensUpdated 2 days ago
    Auto-check passed

Categories

Questions about Spec Explain

What does Spec Explain do?

Create a durable, visual teaching artifact for a concept, diff, idea, or recent-work window, with an optional check-in that makes it stick. Spec Explain is an agent skill from leo-kuang-ai/spec-first. Create a durable, visual teaching artifact for a concept, diff, idea, or recent-work window, with an optional check-in that makes it stick.

When should I use Spec Explain?

Spec Explain fits situations like: the user asks to be taught; wants a deep explainer; not for ordinary Q&A; brief why-followups.

How do I install Spec Explain in Claude Code?

Run `npx skills add leo-kuang-ai/spec-first --skill spec-explain -a claude-code`. Or copy the skill folder (skills/spec-explain in leo-kuang-ai/spec-first) into .claude/skills/spec-explain in your project. Claude Code loads it when a task matches its description.

How do I install Spec Explain in Codex?

Run `npx skills add leo-kuang-ai/spec-first --skill spec-explain -a codex`. Or copy the skill folder (skills/spec-explain in leo-kuang-ai/spec-first) into .agents/skills/spec-explain in your project. Codex loads it when a task matches its description.

Can I use Spec Explain in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add leo-kuang-ai/spec-first --skill spec-explain -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/spec-explain, .gemini/skills/spec-explain, .github/skills/spec-explain and .opencode/skills/spec-explain in your project.

What does Spec Explain need to run?

Going by SKILL.md and its folder, Spec Explain needs a shell and JavaScript for the scripts in its folder. Our summary lists: Node.js; A Bash shell.

Does Spec Explain access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Spec Explain safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Spec Explain use?

Spec Explain is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Spec Explain use?

About 3.3k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.8k tokens, read only when the agent opens those files.

What are the alternatives to Spec Explain?

Skills that share tags, products or a category with Spec Explain: Vercel Composition Patterns (supabase/supabase, 111k stars), Finishing a Development Branch (obra/superpowers, 297k stars), Typescript Advanced Types (rolling-scopes/rsschool-app, 10k stars) and PR Babysitter (openinterpreter/openinterpreter, 69k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Spec Explain?

leo-kuang-ai (a GitHub user) maintains it in leo-kuang-ai/spec-first, which has 107 GitHub stars. The repository holds 35 skills in this directory. The repository was last updated on October 8, 2026.

Source: leo-kuang-ai/spec-first on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.