code-history
Skill2 starsChanged 14 days agoMITView on GitHub
A file or folder's git and PR history: turning points, recurring bugs, broken promises, who to ask
In this repository81 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- templates/CLAUDE.mdCLAUDE.md
- add-languageSkill
- audit-a11ySkill
- audit-archSkill
- audit-ciSkill
- audit-debtSkill
- audit-doc-driftSkill
- audit-flagsSkill
- audit-infraSkill
- audit-perfSkill
- audit-readinessSkill
- audit-securitySkill
- audit-slopSkill
- audit-testsSkill
- audit-tokensSkill
- audit-verifySkill
- backup-patternsSkill
- bash-patternsSkill
- claude-code-mods-patternsSkill
- code-challengeSkill
- code-contractSkill
- code-deep-reviewSkill
- code-evaluateSkill
- code-from-designSkill
- code-host-patternsSkill
- code-impactSkill
- code-migrateSkill
- code-tourSkill
- code-visualSkill
- depsSkill
- django-patternsSkill
- docker-patternsSkill
- drf-patternsSkill
- engineering-fundamentalsSkill
- fastapi-patternsSkill
- git-patternsSkill
- go-patternsSkill
- graphql-patternsSkill
- investigateSkill
- javascript-patternsSkill
- kit-rulesSkill
- logging-patternsSkill
- meta-conventionsSkill
- meta-promptSkill
- meta-refreshSkill
- meta-retroSkill
- meta-skillSkill
- monitoring-patternsSkill
- next-app-router-patternsSkill
- nuxt-patternsSkill
- opentofu-patternsSkill
- pr-descriptionSkill
- pr-publishSkill
- pr-queueSkill
- pr-replySkill
- pr-reviewSkill
- python-patternsSkill
- react-patternsSkill
- report-formatSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 5 are distinctive, and 4 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.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 36
Read every commit and every PR description that touches the path.
- Very specific: line 38
Commit list: git log --format='%H%x09%ad%x09%an%x09%s' --date=short -- <path>, saved to the raw folder.
- Distinctive: line 47
Write a chronological digest, one heading per PR linking to it, cleaned body below.
- Distinctive: line 107
Every person named is an inline link too, besides the files, PRs, and docs Readability covers.
- Very specific: line 110
Every claim about why something changed cites its PR.
- Distinctive: line 120
Check by script, not by eye:
- Very specific: line 122
Every #<n> in the report is in the collected PR list and resolves to a PR in this repo.
- Very specific: line 123
Every linked file or folder exists on the default branch (git cat-file -e <default>:<path>).
- Distinctive: line 125
No TL;DR bullet runs past two lines, and the story is under about 300 words.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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
/code-history
The git and PR history of a file or folder, as a report with turning points, recurring bugs, broken promises, who to ask, and a short story. With no argument, ask for the path before anything else.
Loading this skill isn't enough. Before the step a row names, read its file.
| Before | Read |
| Collecting commits or lines changed | reference/git-log.md |
Inputs
- Resolve the argument to a real path. A loose name ("Filter ds component") may not match one: search with
fdandrg, pick the match, and state the substitution in the report header. - Size the job:
git log --format='%h' -- <path> | wc -l. - Find the code host per
skills/kit-rules/reference/tooling.mdsection 4, and resolve the repo's path and default branch through it. With no CLI or connector for the host, say so and work from commits alone. - A docs or decision-log connector, found the same way, is optional. If one exists, search it for the component name and record whether any entry covers it.
Collect
Read every commit and every PR description that touches the path. Don't sample.
- Commit list:
git log --format='%H%x09%ad%x09%an%x09%s' --date=short -- <path>, saved to the raw folder. - PR numbers from subjects, in each form the host writes: a squash suffix
(#1234),Merge pull request #1234, orSee merge request <path>!1234. - Fetch PRs in batches through the host's API, never one call per PR. On GitHub: GraphQL through
gh api graphql, about 40 aliases per query (pr1234: pullRequest(number: 1234) { number title body author { login } mergedAt url }). Save the raw JSON. - Lines changed on the path per commit (
git log --numstat -- <path>), ranked. The top entries are the structural turning points, found faster than by title. Whendifftis installed, drop reformat-only ones first:DFT_CHECK_ONLY=true GIT_EXTERNAL_DIFF=difft git show --ext-diff --format=%h <sha> -- <path>printsNo syntactic changes.for a file whose diff is only formatting. Prose files printHas changes.either way. - For the biggest PRs with empty descriptions, read the squash commit body (it lists sub-commits) and the diffstat on the path. Label that "why" as inferred.
Digest
- Strip PR template boilerplate before reading: checklists, "Type of change", tooling notes. Otherwise the signal drowns.
- Write a chronological digest, one heading per PR linking to it, cleaned body below.
- Grep the digest for promises and reversals:
temporary,for now,will be removed,TODO,in the future,revert. Check each against the current code before calling it unkept. - Group fixes by bug class to find the ones that keep coming back.
- For "Who to ask":
git shortlog -sn --no-merges -- <path>for commits per author, andgit log --format='%ad %an' --date=short -- <path>for each one's first and last commit there.
Report shape
# <Component>: how we got here
Component: [path](link)
<N> commits, <M> PRs, <first month> to <last month>. Raw descriptions in `digest.md`.
---
## TL;DR
<3 to 5 bullets: what shapes today's code>
---
## Timeline
### <year>: <one-word theme>
- **<Mon>.** <what changed, one line>. [#123](link)
---
## Bugs that keep coming back
- **<class>.** <PR links>
---
## Promised, never done
- <quote of the promise>. [#123](link)
---
## Who to ask
- **[handle](link)**: <what they know> (<commit count>)
---
## The story
<5 to 8 short paragraphs, 2 to 3 sentences each, past tense, like a history lesson: why it was born, what reshaped it, what it's still carrying, where it stands today.>
---
## Caveats
- <empty descriptions, inferred rationale, gaps, decision log result>Writing rules
- Every person named is an inline link too, besides the files, PRs, and docs Readability covers.
- People link to their profile on the code host or to the path's commit history filtered by author. Handles, not guessed full names.
- Readability follows the report-format skill's Readability section.
- Every claim about why something changed cites its PR. One inferred from a diff is labelled per
skills/kit-rules/reference/evidence.mdsection 1. - "The story" is the last content section before Caveats, at most about 300 words, and introduces no fact missing from the sections above.
Output
- Report at the path
kit scratch-dir history <component-slug>prints. - Raw material in a sibling folder named after the report (without
.md):prs.json,commits.tsv,digest.md.
Verify before replying
Check by script, not by eye:
- Every
#<n>in the report is in the collected PR list and resolves to a PR in this repo. - Every linked file or folder exists on the default branch (
git cat-file -e <default>:<path>). - The header counts match
git log -- <path>and the collected PR list. - No TL;DR bullet runs past two lines, and the story is under about 300 words.
Reply
Per skills/kit-rules/reference/output.md section 3.
Out of scope
- Proposing fixes or refactors.
- Code review of the current state.
- History of code that only imports the path, unless a PR moved code into or out of it.
Arguments: $ARGUMENTS
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.

