teach
Teach
Teach for understanding, not just orientation.
The goal is to help the user genuinely learn:
- what the relevant code or concept is for
- how the pieces fit together
- how control, data, and responsibilities move
- what assumptions or invariants matter
- what design tradeoffs or confusing parts are worth noticing
This skill is primarily explanatory. Stay focused on helping the user build a mental model. Point out important design issues or confusing structure when that would materially improve understanding, but do not drift into generic review mode.
Scope
This skill usually applies to the current codebase, but it may also cover:
- a library or framework used by that code
- a protocol, runtime mechanism, or pattern needed to understand the implementation
- a small amount of surrounding product or systems context if it clarifies the code
Prefer the smallest scope that lets the user understand the thing they asked about.
First-Class Inputs
Handle these as normal teaching targets:
- a module or package
- a feature or user flow
- a subsystem or architecture area
- an API boundary or integration
- a runtime path such as request handling, background jobs, or event flow
- a data model or state flow
- a library or framework behavior that is directly relevant to the code
If the user is actually asking about a diff, commit, PR patch, or file-to-file comparison, use change-explainer instead.
Core Behavior
- Start from the learner's question.
- Identify what the user is trying to understand, not just which files are nearby.
- Match the explanation depth to the request.
- If the user asks a broad question, narrow it to the smallest coherent mental model first.
- Build a mental model before details.
- Begin with purpose, role, and boundaries.
- Then explain the main flow.
- Then drill into important mechanisms, edge cases, and invariants.
- Avoid starting with line-by-line code reading unless the user explicitly wants that.
- Use snippets as the primary teaching aid.
- Embed short, focused snippets directly in the response.
- Start each snippet with a comment that names the file path it came from.
- Prefer the smallest snippet that makes the idea legible.
- Use multiple small snippets to explain separate ideas.
- Do not force the user back into the editor just to follow the explanation.
- Use ASCII diagrams when structure is easier to see than describe.
- Add a small diagram when it materially improves understanding of:
- control flow
- data flow
- component or module relationships
- state transitions
- layered architecture or request lifecycles
- Keep diagrams compact, readable, and ASCII-only.
- Do not add a diagram if prose and snippets already make the point clear.
- Teach relationships, not isolated facts.
- Explain who calls what, who owns what, and where decisions happen.
- Show how data changes shape as it crosses boundaries.
- Name the abstractions and responsibilities that matter to the flow.
- Surface important confusion points.
- Call out misleading names, blurred responsibilities, hidden invariants, or awkward control flow when they materially affect understanding.
- Treat these as teaching notes, not as a full review.
- If the structure is mostly sound, say so plainly.
- Use external context only when it helps.
- If library or framework behavior is necessary to explain the code, include only the part that changes how the code should be read.
- Keep external explanation tied to the code in front of you.
Workflow
- Identify the teaching target.
- Confirm whether the user wants to understand a module, flow, subsystem, data path, architecture area, or relevant external concept.
- Infer the likely target from the request and nearby context when needed.
- Read top-down.
- Start from entry points, exported symbols, route handlers, public interfaces, or the main flow the user is asking about.
- Then read supporting helpers, data structures, and tests only as needed.
- Pull in docs such as
AGENTS.md,ARCHITECTURE.md, or nearby notes when they materially change the explanation.
- Organize the lesson.
- Prefer an order like:
- what this part exists to do
- where it sits in the system
- the main runtime or data flow
- the key mechanisms or abstractions
- invariants, edge cases, and tradeoffs
- Reorder the material so the explanation is easy to learn, not so it mirrors file order.
- Teach with evidence.
- For each important point, include a small snippet, pseudocode summary, concrete example, or compact ASCII diagram when appropriate.
- Explain why the snippet matters.
- Connect the evidence back to the larger mental model.
- Close the loop.
- Summarize the model the user should now have.
- Mention the most important thing to remember about the design.
- If there is a major confusing or fragile area, call it out directly.
Snippet Rules
- Use fenced code blocks for snippets.
- Put the source file path in the first line of the snippet as a comment.
- Match the comment style to the language when practical, for example
// src/dashboard/load.tsor# backend/jobs/sync.py. - If the language is unclear, use a neutral comment style or label the snippet in surrounding prose.
- Keep snippets narrowly scoped to the mechanism being taught.
- Prefer signatures, conditions, branching points, state transitions, and interface boundaries over long contiguous code.
- When a relationship matters more than the exact syntax, summarize the flow around the snippet in prose.
- If helpful, pair snippets with a brief explanation like:
// src/dashboard/loadUserDashboard.ts
export async function loadUserDashboard(userId: string) {
const account = await accountRepo.getByUserId(userId);
return buildDashboardView(account);
}
This shows the boundary clearly: the function does orchestration, not heavy business logic. The repository fetches data, and the view builder shapes it for the caller.
Diagram Rules
- Use diagrams only when they make the lesson easier to understand.
- Use compact ASCII diagrams that render clearly in plain Markdown.
- Do not use Mermaid.
- Keep them small and purpose-built for one idea.
- Favor these diagram types:
- request or event flow
- module relationship map
- state transition sketch
- data transformation pipeline
- Put the diagram near the explanation it supports.
- Explain the diagram briefly instead of assuming it is self-explanatory.
Example:
Route -> Service -> Repo -> DB
This works when the main teaching problem is ownership or call flow rather than syntax.
Output Shape
Use this shape unless the user asks for something else:
Big Picture
- One short paragraph on what this part of the system is for and where it fits.
How It Works
- Explain the main flow in logical learning order.
- Use embedded snippets as evidence.
- Add a compact ASCII diagram if it makes the flow or relationships clearer.
- Focus on roles, boundaries, and movement of control or data.
Key Ideas
- Call out the few abstractions, invariants, or decisions that make the design make sense.
Important Confusion Points
- Include only when something materially affects understanding.
- Mention important design issues, awkward boundaries, or misleading structure briefly and concretely.
Communication Rules
- Optimize for learning, not exhaustiveness.
- Prefer a coherent lesson over a file-by-file tour.
- Do not default to path or line references; use snippets first.
- Do not dump every related file into the answer.
- Label inferences as inferences when the code does not prove intent directly.
- If the user seems to want a concise overview, stay high-level.
- If the user clearly wants deeper teaching, go further into mechanisms and tradeoffs.
Non-Goals
Do not use this skill as the default choice for:
- diff, commit, or patch explanation
- formal code review
- task-status catch-up for the current session
- broad external-library research disconnected from the current code
Use change-explainer for change-focused teaching, briefing for task-state recovery, and review-oriented skills when the user is asking for critique rather than understanding.
Example Triggers
- "Teach me how this feature works."
- "Explain this subsystem so I can actually understand the design."
- "I want to learn the request flow from the route down to the database. Show snippets."
- "Teach me this flow with a diagram if that would make it easier to follow."
- "Teach me this module in a logical order, not file order."
- "Help me understand how this library is being used here and why the code is structured this way."
More from sjunepark/custom-skills
summarize
Use the steipete/summarize CLI to summarize URLs, local files, stdin, YouTube links, podcasts, and media with LLM models. Trigger when users ask to install or run summarize, configure model/provider API keys, tune output flags (length/language/json/extract/slides), set defaults in ~/.summarize/config.json, or troubleshoot summarize CLI errors.
41skills-cli
Operate the skills CLI to discover, install, list, update, remove, and initialize skills for Codex, Claude Code, and Pi. Use when users ask to manage skills from skills.sh, restore from lock files, sync skills from node_modules, or troubleshoot agent/installation scope (project vs global).
36post-implementation-review
Manually review already-implemented code for design flaws, abstraction issues, structural problems, or refactors that only became clear in real code. Use only when the user explicitly asks for a post-implementation review, explicitly asks whether recent implementation work revealed design or structure problems, or explicitly wants refactor recommendations after the code exists. Do not auto-trigger for ordinary implementation, debugging, explanation, or generic code review requests. Prefer embedded snippets with file-path comments over editor-oriented file and line references. Prioritize real design, ownership, abstraction, and organization weaknesses over minor local polish, call out real tradeoffs, and separate straightforward recommendations from items worth discussion.
29architecture-md-writer
Create, update, review, and split ARCHITECTURE.md files that explain a codebase's shape, major components, runtime flow, code map, and important invariants. Use when a repository lacks architecture docs, an existing ARCHITECTURE.md is stale or too detailed, a subsystem needs its own nested ARCHITECTURE.md, or a root architecture doc should link to deeper module architecture docs.
27agents-md-writer
Create, edit, review, and improve AGENTS.md files for repositories used by agentic coding tools with concise, actionable instructions and correct precedence behavior. Use whenever AGENTS.md content is being changed, including updating existing guidance, drafting a new AGENTS.md, migrating legacy instruction files, defining nested overrides in monorepos, or debugging why tools load the wrong guidance.
26source-investigator
Investigate external libraries, frameworks, and unfamiliar repositories by cloning the exact repo into a project-local temp workspace, ignoring that workspace in git, and delegating code reading to focused subagents so the main thread stays clean. Use whenever docs are incomplete, version-specific behavior matters, you need to learn how a codebase works, or exploring lots of source inline would pollute the main context.
24