branch-tldr
Skill0 starsChanged 32 days agoMITView on GitHub
Summarize the committed changes of a Git branch (current branch by default, or a branch / PR number given as an argument) against the default branch in exactly three concise bullet points. Line length, writing style, and the reader's expertise level are adjustable via ~/.config/branch-tldr/config.toml, and the expertise level can also be overridden per run with --expertise. Use when the user wants a very short explanation of "this branch", "branch diff", or "changes on this branch". Not for commit messages, PR descriptions, code quality review, or uncommitted-only changes.
In this repository13 other files it gives its agents.
- ai-credit-efficient-reviewSkill
- drafting-tweet-from-todaySkill
- finding-unused-customizationsSkill
- hacker-news-digest-jaSkill
- japanese-tech-writingSkill
- natural-japaneseSkill
- pr-branch-composition-checkSkill
- prompt-feedback-skillSkill
- resume-improverSkill
- semantic-commit-helperSkill
- session-stockerSkill
- syncing-forked-skillsSkill
- tf-destroy-plan-inverterSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 5 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 55
Do not rely on a TOML parser.
- Very specific: line 73
If origin/HEAD is unavailable, fall back to main if it exists, then master if it exists.
- Distinctive: line 91
Read the patch with a size guard:
- Very specific: line 92
If the total changed lines in --stat are 800 or fewer, read the full patch:
- Distinctive: line 100
Only committed changes are in scope.
- Very specific: line 111
Keep each bullet body within max_line_length characters.
- Distinctive: line 112
Prefer explaining user-visible or operational impact over listing filenames.
- Distinctive: line 114
Do not include commands, raw diff snippets, commit hashes, or speculation beyond what the diff supports.
- Distinctive: line 115
Do not write a commit message or PR body unless the user explicitly asks for that instead.
- Very specific: line 119
Write for the resolved expertise level.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Branch Diff Three-Line Summary
Produce a compact explanation of what a Git branch changes, based on the committed diff from the default branch.
Arguments
$ARGUMENTS takes the form [<branch> | <PR number>] [--expertise high|medium|low]. The --expertise option may appear before or after the target.
First, take out --expertise <level> if present. It overrides the expertise value from the configuration for this run only. If --expertise has no value, or the value is not one of high, medium, or low, say so in one line and stop; do not fall back silently, because the user asked for a level explicitly.
What remains after removing the option may be empty, a branch name, or a PR number.
- Empty: summarize the current branch.
- Branch name: summarize that branch. Use
origin/<name>if the local branch does not exist. - PR number (digits only): resolve the head with
For a same-repo PR, fetch and use the head branch:gh pr view <n> --json headRefName,headRepositoryOwner,isCrossRepository
and takegit fetch --quiet origin <headRefName><target>asorigin/<headRefName>. For a cross-repository (fork) PR,origin/<headRefName>does not exist, so fetch it into a local ref instead:
and takegit fetch --quiet origin pull/<n>/head:refs/branch-tldr/pr-<n><target>asrefs/branch-tldr/pr-<n>. Ifghis unavailable or either command fails, say so in one line and stop.
Below, <target> means the resolved ref (HEAD when no argument is given), and <base> means the comparison base resolved in step 4 of the workflow.
Configuration
The config file always lives at ~/.config/branch-tldr/config.toml, regardless of where this skill itself is installed:
[output]
max_line_length = 100
style = "日本語の場合は常体 (だ・である調) を使う。"
expertise = "medium"max_line_length: maximum characters per bullet body, excluding the leading-. Count full-width and half-width characters as one each.style: an extra free-text instruction about writing style. An empty string means no extra instruction.expertise: how much technical background the reader has, one ofhigh,medium, orlow. See "Expertise levels" under the output rules. The--expertiseargument takes precedence over this value.
The values shown above are the built-in defaults. If the file does not exist, use those defaults and continue. Do not create the file and do not mention that it is missing; the output must stay three bullets. config.toml.template in this skill's directory exists only as a starting point for users who want to override the defaults by hand.
Do not rely on a TOML parser. Read the file with cat and pick up max_line_length = <integer>, style = "<string>", and expertise = "<string>" under [output]. Apply these fallbacks silently:
- Missing key, a
max_line_lengththat is not a positive integer, or anexpertiseother thanhigh,medium, orlow: use the built-in default shown above. style = ""set explicitly: no extra style instruction. This differs from a missingstyle, which falls back to the default 常体 instruction.
Workflow
- Load the configuration as described above.
- Confirm you are in a Git repository:
git rev-parse --show-toplevel - Identify the default branch:
Ifgit symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null | sed 's#^origin/##'origin/HEADis unavailable, fall back tomainif it exists, thenmasterif it exists. - Refresh the comparison base so the summary is not made against a stale default branch, then resolve
<base>:git fetch --quiet origin <default-branch> 2>/dev/null || true git rev-parse --verify --quiet origin/<default-branch><base>isorigin/<default-branch>when that ref resolves, otherwise the local<default-branch>. Use<base>in every command below; never assume theorigin/prefix, because a repository without anoriginremote only has the local branch. - Detached
HEADneeds no special handling: treatHEADas the target as usual. - Get the scope first. The
...form already compares from the merge base, so no separatemerge-basecall is needed:
Ifgit --no-pager diff --stat <base>...<target> git --no-pager diff --name-status <base>...<target>--statreports no changes, the branch has nothing of its own relative to<base>— this covers<target>being the default branch as well as an up-to-date branch. Return exactly three bullets saying there are no branch-specific changes and naming<base>. Judge this from the emptiness of the diff, not from the branch name: a local default branch that is ahead of<base>does have a real diff and must be summarized normally. - Read the patch with a size guard:
- If the total changed lines in
--statare 800 or fewer, read the full patch:git --no-pager diff <base>...<target> - Otherwise, do not dump the full patch. Exclude generated and vendored files (
*.lock,package-lock.json,composer.lock,dist/,build/,vendor/,node_modules/, minified assets, snapshot files), then read the remaining files one at a time withgit --no-pager diff <base>...<target> -- <path>, starting from the files with the most changed lines, until the intent of the branch is clear. Usegit log --oneline <base>..<target>as an additional hint for intent.
- If the total changed lines in
- Base the summary on the actual diff, not only file names. Understand behavior, not just which files moved.
- Only committed changes are in scope. Ignore staged and unstaged working tree changes, and do not mention them.
Output rules
- Output exactly three bullet points, no heading and no extra prose.
- Give each bullet a fixed role:
- What changed: the main functional or structural change of the branch.
- How or why: the approach taken, or the reason it was needed, as far as the diff shows it.
- Impact: affected scope, behavioral risk, or what to check before merging or applying.
- Match the user's language. If the user asks in Japanese, answer in Japanese.
- Apply the
styleinstruction from the configuration. With the default, Japanese output uses plain form (常体), not polite form. - Keep each bullet body within
max_line_lengthcharacters. If a bullet runs over, cut detail until it fits rather than wrapping. - Prefer explaining user-visible or operational impact over listing filenames.
- Include filenames only when they clarify the change. At
mediumandlow, rephrasing takes precedence over this. - Do not include commands, raw diff snippets, commit hashes, or speculation beyond what the diff supports.
- Do not write a commit message or PR body unless the user explicitly asks for that instead.
Expertise levels
Write for the resolved expertise level. The level changes only the wording; the three bullet roles and max_line_length stay the same at every level.
high: for engineers who work with the changed technology. Use domain terms and identifiers (resource types, variable names, filenames) as they are. In the impact bullet, state what to check before merging or applying.medium: for readers who know software in general but not this area. Replace tool-specific terms and identifiers with plain descriptions of what they do (for example, "permission settings" instead of "IAM"). In the impact bullet, first say whether behavior changes right away.low: for non-engineers. Use no technical terms. Explain what gets better and how it relates to users or day-to-day work.
Good output shape
high:
- 新リージョン向けの Terraform 設定を追加し、既存リージョンとの差分を最小限に抑えている。
- IAM と provider 設定を新リージョン向けに調整し、環境固有の値を変数へ分離した。
- 既存環境には影響しない追加変更だが、適用前に新リージョン向けの plan 確認が必要である。medium:
- 新しい地域のデータセンターでもシステムを動かせるよう、インフラの構成定義を追加した。
- 権限や接続先の設定を新しい地域に合わせ、環境ごとに変わる値は一か所にまとめて差し替えやすくした。
- 既存の環境は変わらない。ただし反映する前に、新しい地域で何が作られるかの事前確認が必要である。What to avoid
- Changed 12 files.
- Updated infra/env/example/main.tf.
- Looks good.This is too file-list oriented and does not explain the intent or impact of the branch.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

