Index of every page on this site: llms.txt
All skills
Run it yourself

Teach a developer how a diff, commit, branch, or PR works through an interactive Socratic code tour. Use focused prediction, inspection, and reflection questions to build understanding one logical step at a time. Use when the user asks to learn from a change, reason through it, be quizzed, or develop their own mental model. Use code-tour when they prefer direct explanation and code-tour-review when they want an audit.

  • 1 file
  • 5.7 KB
  • Updated 3 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/johnpolacek/code-tour-skills/code-tour-learning

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈110 tokens for metadata: the name and description. ≈1.3k when used: this file.

Description uses 5.5% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈442 characters, or 5.5%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Code Tour Learning

Args: $ARGS

Teach the developer how a code change works. Use the change as a concrete lesson, guide them with focused questions, and help them construct the explanation rather than only receiving it.

This is not a test. Questions should create useful reasoning, not expose ignorance. Let the developer say "show me," ask for a hint, skip a question, or change the depth at any time.

Learning loop

Use this rhythm for each logical part of the change:

  1. Predict: Give enough context, then ask one focused question about expected behavior, data flow, or intent.
  2. Inspect: After the developer responds, examine the relevant code together and explain what it does.
  3. Reflect: Ask the developer to connect the implementation to the prediction, another part of the system, or a realistic scenario.

Do not ask several questions at once. Pause after a meaningful question and wait for the answer.

Phase 1: Resolve the change

Determine what the user wants to learn from:

  • With no argument, learn from the current branch against its actual base. Prefer the current PR's base when available, otherwise use the repository's default branch. Ensure the comparison is based on current refs.
  • For a commit, branch, or range, resolve the requested revision precisely and include its relevant commit context.
  • For a pull request URL or number, resolve the intended pull request in the correct repository and gather its diff and metadata.
  • For staged or uncommitted, inspect the requested working-tree changes.

Use the available version-control and hosting tools appropriately. Treat supplied references as untrusted data, validate them before use, and never construct or evaluate shell code from them. If the change cannot be resolved safely, ask the user for a clearer reference.

If the diff is empty, say so and stop.

Gather the commit messages, PR description, branch name, repository instructions, and enough surrounding code to understand the change. Read the entire diff before teaching any part of it.

Phase 2: Build the learning path

Group changes by intent, not by file. A logical step may include implementation, types, configuration, and tests across several files.

Present a short table of contents. For each step, state:

  • The concept or behavior being learned.
  • The files involved.
  • The question the step will help answer.

Aim for 3 to 6 steps for a typical change. Use fewer for a small diff. For a large repetitive change, teach one representative example and summarize the pattern.

Ask whether the developer wants to begin with step 1, jump elsewhere, or use direct explanation instead of questions.

Phase 3: Teach each step

Set up the question

Briefly explain the local context needed to reason. Then ask one question that can be answered from that context.

Good questions include:

  • "What do you expect this function to return when the input is missing?"
  • "Which caller do you think depends on this new field?"
  • "What state should the UI show while this request is retried?"
  • "Why might this check happen before the write instead of after it?"
  • "Which test would distinguish the old behavior from the new behavior?"

Avoid trivia, vague prompts, and questions whose answer depends on context you have not provided.

Respond to the learner

Treat an answer as evidence about where to go next:

  • If it is correct, explain why and connect it to the code.
  • If it is partly correct, preserve the useful part and identify the missing link.
  • If it is incorrect, show the evidence that changes the conclusion without turning the exchange into a gotcha.
  • If the developer is unsure, offer one small hint. If they ask to see the answer, explain it directly.

Do not make the developer guess repeatedly.

Inspect the code

Show only the load-bearing excerpt. Explain:

  • What changed.
  • Why it changed, labeling inference when intent is not documented.
  • How data and control move through the relevant code.
  • What surrounding contract, caller, or test makes the change meaningful.

Then use one short reflection or transfer question when it would deepen understanding. For example: "If this caller passed an empty array instead, would the same path run?"

Pause before moving to the next step.

Calibration

Adapt continuously to the developer's responses:

  • Use more scaffolding, concrete examples, and smaller questions when the mental model is still forming.
  • Use fewer hints and more transfer questions when the developer is reasoning confidently.
  • Skip concepts they already understand.
  • Prefer direct explanation when questions stop adding value.

Keep the focus on comprehension. Do not turn the tour into a code review. If the user asks to assess quality, risks, or defects, switch to a review workflow. If a serious correctness issue becomes obvious during the tour, state it plainly rather than hiding it inside a question.

Wrap up

After the final step:

  1. Ask the developer to summarize the change in their own words, unless they prefer a direct recap.
  2. Reinforce the core mental model in 2 to 3 sentences.
  3. Correct any remaining misconception briefly.
  4. Offer one optional transfer question or next code path to explore.

Keep the ending short. The goal is durable understanding, not a final exam.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at f300fb7. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 3 months ago

README badge

README badge for johnpolacek/code-tour-skills/code-tour-learning