一键导入
tour
Build a mental model of code changes — guided reading order, conceptual grouping, and context.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Build a mental model of code changes — guided reading order, conceptual grouping, and context.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when executing a multi-step plan and each implementation step should be delegated to subagents and independently reviewed.
Use when reviewing local changes — the working-copy diff, a branch, a commit, or a GitHub PR by number — with fresh reviewer subagents that return structured findings.
Use when a test failure, regression, exception, hang, wrong result, or unexpected behavior needs diagnosis — gathers evidence, traces the relevant path, and verifies the cause before recommending a fix.
Resolve jj (Jujutsu) conflicts. Use when jj log/status shows conflicted revisions, a rebase/squash/abandon reports 'new conflicts appeared', or files contain jj conflict markers.
Use when you want to work in an isolated jj working copy — parallel task, experimental scratch, subagent with its own tree. jj's equivalent of git worktrees: creating a workspace, working inside it from anywhere, and cleaning up without losing history.
Find things to improve in the current project
| name | tour |
| description | Build a mental model of code changes — guided reading order, conceptual grouping, and context. |
jj root >/dev/null 2>&1 && echo "jj" || echo "git"jj root >/dev/null 2>&1 && jj diff --stat 2>/dev/null || git diff --stat HEAD 2>/dev/nulljj root >/dev/null 2>&1 && jj log -r @ --no-graph -T 'bookmarks' 2>/dev/null || git branch --show-current 2>/dev/nulljj root >/dev/null 2>&1 && jj log --no-graph -r 'ancestors(@, 5)' -T 'change_id.shortest() ++ " " ++ description.first_line() ++ "\n"' 2>/dev/null || git log --oneline -5 2>/dev/null| Argument | Action |
|---|---|
| (empty) | Use AskUserQuestion; use repo state above to tailor options |
uncommitted | Tour uncommitted changes |
commit <hash> | Tour that commit |
pr <number-or-url> | Tour that GitHub PR |
branch <name> | Tour changes against that base branch |
file <path> | Tour only that file's changes |
<path>... | If argument matches an existing file or directory, treat as file <path>. Multiple paths OK. |
When empty, use AskUserQuestion. Show smart options based on repo state (hide "uncommitted" if clean, etc.).
Path detection: If the argument doesn't match any keyword (uncommitted, commit, pr, branch, file), check if it's a valid file or directory path. If so, tour changes scoped to those paths. For directories, include all changed files under that tree.
When the user picks "commit", show recent commits and ask which. For "PR", ask for the number. For "branch", show branches and ask which.
Use jj commands if VCS is "jj", git commands otherwise.
| Scope | git | jj |
|---|---|---|
| uncommitted | git diff HEAD | jj diff --git |
| commit | git show <hash> | jj diff --git -r <change-id> |
| pr | gh pr diff <n> + gh pr view <n> + gh pr view <n> --comments | same |
| branch | git diff $(git merge-base HEAD <branch>) | jj diff --git -r '<branch>..@' |
| file / paths | git diff HEAD -- <path>... | jj diff --git <path>... |
For PR tours, also fetch the PR title/description and reviewer comments for context.
Count the number of changed lines (additions + deletions) in the diff.
| Size | Changed lines | Format |
|---|---|---|
| Small | < 30 | One short paragraph: what changed and why. No sections, no headers. Done. |
| Medium | 30–200 | Overview + reading order + walkthrough (Parts 1–3). Include Part 4 only if something genuinely warrants it. |
| Large | > 200 | Full structure (Parts 1–4). |
For small diffs, skip directly to output after writing the paragraph — do not continue to Step 3.
Read source files as needed for context around changes — not just the diff lines, but enough surrounding code to understand the "before" state and how changed pieces connect.
A 2-4 sentence summary of what this changeset does and why. State the goal, not just the mechanics.
For large diffs, also include a conceptual map: which components/subsystems are involved, how they relate, and what the "before" state looked like. This is the mental model the reader needs before diving into details. A short list or a sentence per component is fine — don't over-produce.
An ordered list telling the reader exactly where to start and where to go next. Each entry is a file:line reference with a one-line note on what they'll find there.
Example:
- server.rs:45
handle_request()— new entry point, start here- validation.rs:12
validate()— called from handle_request, contains the core logic change- types.rs:8
RequestBody— new struct both of the above depend on
Group by concept, not by file. If a single concept spans three files, those three entries are adjacent. If one file has two unrelated changes, they appear in different groups.
For medium diffs this can be short (3-5 entries). For large diffs, use labeled groups:
Auth flow:
- ...
- ...
Database migration: 3. ...
Organized by concept (matching the reading order groups), not per-file. For each concept:
file:line.For simple/medium diffs where concepts and files are 1:1, per-file is fine — don't force artificial grouping.
Include this section only when there's something genuinely worth calling out. Combine two perspectives:
Decisions and tradeoffs visible in the diff:
Open questions the diff leaves unanswered:
Skip the entire section if nothing warrants it. Don't fabricate tradeoffs or invent questions.
file:line throughout. The reader should be able to follow along in their editor.