Yeda AI Tips · #066

Español

Tour Files: Persona-Targeted Code Walkthroughs

A file tree is a map. A code tour is a GPS route through your code. Drop a new developer into an unfamiliar repo and a directory listing tells them what exists, not where to start. A .tour file fixes that: a checked-in JSON walkthrough whose steps are anchored to real files and lines, played back stop by stop inside the editor.

What a .tour file actually is

CodeTour is a free, open-source VS Code extension from Microsoft. A tour is one JSON file with a title and a steps array; each step points at a file (workspace-relative path) plus a line, and carries a markdown description — one note on why that spot matters. The extension discovers tours from a .tours, .vscode/tours, or .github/tours directory (sub-directories are fine), or from a single .tour file at the repo root.

// .tours/backend-request-path.tour
{
  "title": "1 - Backend: life of a request",
  "description": "For new backend devs — follow one request end to end.",
  "steps": [
    {
      "file": "src/api/router.py",
      "line": 42,
      "description": "Every request enters here. Note the auth middleware on line 42 — it runs before any handler."
    },
    {
      "file": "src/services/orders.py",
      "line": 118,
      "description": "Business logic lives in services, never in handlers. This is the pattern to copy."
    }
  ]
}

Playback is in-editor: each step opens the file, jumps to the line, and shows the note as a comment bubble. You don't hand-write the JSON either — run CodeTour: Record Tour, click the comment bar on the line you want, type the note, and steps append in order.

One tour per persona

The tip that makes tours scale: don't write one grand tour of everything. Write one route per audience.

PersonaTour routeStops
New backend devLife of a request: router → service → DB5–8
New frontend devComponent tree → state store → API client5–8
On-call engineerLogging, feature flags, kill switches4–6
ContributorBuild, test, and release entry points4–6

CodeTour supports this directly: number the titles (1 - Backend, 2 - Frontend) and it links them with Next/Previous, mark one isPrimary so first-time openers get the default route, and use a when clause to show a tour only when its condition holds.

Keep the anchors honest

Line numbers drift as code changes — a tour that points at the wrong line is worse than no tour. CodeTour gives you three tools:

Power moves

Resources

Building an AI feature? Yeda AI designs, audits, and ships production LLM systems.

Talk to us · Read the blog