git-digest
Skill0 starsChanged 7 months agoMITView on GitHub
Bundle several git commands (status, log, diff --stat, branch -vv, stash list) into a single Markdown digest. Invoke instead of running 4–5 separate git commands when you need to understand the working-tree state, recent commits, and how the branch relates to its upstream.
In this repository9 other files it gives its agents.
- answer-cacheSkill
- api-contractSkill
- codemapSkill
- diff-summarySkill
- file-summarySkill
- log-extractSkill
- run-quietSkill
- session-handoffSkill
- test-failures-onlySkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 5 are distinctive, and 2 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.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
Do NOT invoke when:
- Distinctive: line 32
Run the commands below from the repo root.
- Distinctive: line 37
Run all of these in parallel (one Bash call per command):
- Very specific: line 64
Verify the chosen ref exists before diffing: git rev-parse --verify --quiet <ref>.
- Distinctive: line 65
If it fails, fall back to the next option.
- Distinctive: line 69
If the working tree is clean AND the branch has an upstream AND ahead = behind = 0, emit only this one-liner and stop:
- Very specific: line 125
If git is not on PATH or the cwd is not inside a git repo, report that in one line and stop.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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
git-digest
A Markdown-only skill — no Python, no external scripts. You (Claude) run the git commands listed below in parallel via the Bash tool, then format the results into the digest layout at the bottom of this file.
When to invoke
Invoke git-digest when ANY of these apply:
- You're starting work on an unfamiliar branch and need a quick orientation.
- The user asks "what's going on in this repo?" / "what's left on this branch?" / "what changed lately?".
- You're about to run more than two of:
git status,git log,git diff --stat,git branch -vv,git stash list.
Do NOT invoke when:
- You only need ONE specific piece of git state (just run that one command).
- You're inside a non-git directory.
- The user is asking about a specific commit or file history (use
git log <path>directly).
How to run it
Run the commands below from the repo root. They are all read-only and independent, so issue them as parallel Bash tool calls in a single message.
Required commands
Run all of these in parallel (one Bash call per command):
| # | Command | Purpose |
| 1 | git rev-parse --show-toplevel | Confirm we are inside a git repo + get the repo name (last path segment). |
| 2 | git symbolic-ref --quiet --short HEAD | Current branch name. Empty + non-zero exit ⇒ detached HEAD. |
| 3 | git rev-parse --abbrev-ref --symbolic-full-name '@{upstream}' | Tracked upstream (empty / error if none). |
| 4 | git rev-list --left-right --count '@{upstream}'...HEAD | Two numbers: <behind> <ahead> vs upstream. Skip if step 3 was empty. |
| 5 | git symbolic-ref --quiet --short refs/remotes/origin/HEAD | Default branch (e.g. origin/main). Strip the origin/ prefix. |
| 6 | git status --porcelain=v1 --untracked-files=normal | Working-tree state. |
| 7 | git log -5 --pretty=format:'- %h (%ar) %s — %an' | Last 5 commits (adjust -5 if user asks for more). |
| 8 | git diff --shortstat <ref>...HEAD | Diff stats vs <ref> (see "Choosing the diff ref" below). |
| 9 | git diff --numstat <ref>...HEAD | Per-file insertions/deletions vs the same ref. Sort by (insertions + deletions) desc, take top 10. |
| 10 | git stash list | Stash entries (empty output ⇒ no stashes). |
Steps 8 and 9 depend on knowing <ref> (which comes from step 3 or step 5), so
run them in a second batch after the first parallel batch returns.
Choosing the diff ref
Pick the first that resolves:
- The user's explicit
--against <ref>argument, if any. - The upstream from step 3 (e.g.
origin/feature/foo). origin/<default-branch>from step 5 (e.g.origin/main).HEAD~10as last resort.
Verify the chosen ref exists before diffing: git rev-parse --verify --quiet <ref>.
If it fails, fall back to the next option.
Short-circuit: pristine repo
If the working tree is clean AND the branch has an upstream AND ahead = behind = 0, emit only this one-liner and stop:
# git-digest — <repo-name>
clean working tree on `<branch>`, up to date with `<upstream>`.Output format
Print exactly one Markdown document to the user (do not include the commands you ran). Use the following sections, in this order, and omit sections whose data collection failed.
# git-digest — <repo-name>
## Branch
- Current: <branch> # or "(detached <short-sha>)" if detached
- Tracking: <upstream> (<rel>) # rel = "ahead N", "behind N", "ahead N, behind N", or "in sync"
# if no upstream: "- Tracking: (no upstream)"
- Default: <default-branch> # omit if same as current, or unknown
## Working tree (<S> staged, <M> modified, <U> untracked[, <C> conflicted])<porcelain output, one line per entry>
## Recent commits (last N)
<lines from `git log` step 7, already formatted as "- <sha> (<ago>) <subject> — <author>">
## Diff vs <ref>
- <shortstat output, e.g. "4 files changed, 87 insertions(+), 12 deletions(-)">
- Top files:
- <path> +<ins> / -<del>
- …
- … (<extra> more) # only if more than 10 files
## Stash
<one line "(empty)" OR "- " + each stash entry>Counting staged / modified / untracked / conflicted from porcelain
For each line of git status --porcelain=v1:
??⇒ untracked.- Two non-space chars from
{A, D, U}(e.g.AA,DU,UU) ⇒ conflicted. - Otherwise: first char non-space ⇒ staged; second char non-space ⇒ modified.
A single file can count as both staged AND modified (e.g. MM). Show the
porcelain lines verbatim inside a fenced block.
Notes
- If
gitis not onPATHor the cwd is not inside a git repo, report that in one line and stop. - Detached HEAD: skip the upstream / ahead-behind line.
- Submodules and other worktrees are not inspected.
- Output is always plain Markdown — safe to keep in context as-is.
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.

