trace-decision
Skill1 starsChanged 5 days agoMITView on GitHub
Use when the user asks the reason for a decision or about an earlier version, or before you overturn a decision. Do not search history for other reasons.
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- commitSkill
- pull-requestSkill
- review-architectureSkill
- review-designSkill
- review-prSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 6 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Read the current docs first: Look at the reason, the accepted costs and the rejected options next to the decision.
- Very specific: line 19
If the heading changed or the section moved, search for a phrase in all files.
- Very specific: line 23
If the file has a new name, add --follow: git log --follow --format='%h %s' -- ':(top)docs/design/architecture.md'.
- Distinctive: line 27
Read the comments next to the code.
- Very specific: line 33
If the line --- references: not read names a reference that can explain the decision, run the script again with a larger --max-references.
- Distinctive: line 36
Use this step when no comment links a design section about the decision, and no changed design section is about it:
- Distinctive: line 41
Do not use git log --first-parent.
- Distinctive: line 45
Keep the current reason and accepted costs (from the docs) separate from the reason and costs at that time (from commits).
- Very specific: line 46
If the question is about a downside, say if a design doc or a Cost: line lists it.
- Very specific: line 49
Commit: give its hash and author date.
- Distinctive: line 54
Before you overturn a decision, give the user what you found.
- Very specific: line 55
After the maintainer decides, update the docs as docs/doc-rules.md says.
≈ “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
Find the reason for a decision
Docs show only the current state. Commit bodies show why a decision changed (see History and Commits in CONTRIBUTING.md).
- Old content in history is not the current decision. Do not act on it.
Steps
- Read the current docs first. Look at the reason, the accepted costs and the rejected options next to the decision. These usually answer the question.
- Find the history of a doc section:
If the heading changed or the section moved, search for a phrase in all files. Replacegit log --format='%h %ad %s' --date=short -L '/^## Modules/,/^## /:docs/design/architecture.md'<phrase>with a quoted sentence from the section.:(top)makes the path start at the repo root:
If the file has a new name, addgit log --format='%h %ad %s' --date=short -S <phrase> -- ':(top)docs'--follow:git log --follow --format='%h %s' -- ':(top)docs/design/architecture.md'. - Find overturned decisions:
git log --grep='^Supersedes:' --format='%h %s%n%b'. - Read each commit that you found:
git show --stat <hash>. Read theWhy,Rejected,Cost,EvidenceandSupersedeslines and the change. - Go from code to design:
- Read the comments next to the code. If a comment links a design section, follow it with step 2 (Find the history of a doc section).
- Collect the sources of all lines of the decision. The lines of one decision can come from more than one commit. The script prints each commit with its lines, its full message and its design doc diff. Through
gh, it also prints the pull request of each commit, with the body, the other commits and the design doc diff. It also prints the issues and comments that they name. Its--helptext gives the parameters and the exit codes. The command finds the script from the repo root, and<file>is a path from the current directory:
If the script exits with 1, fix the input. If it exits with 2, each status linenode "$(git rev-parse --show-toplevel)/tools/trace-decision/collect.mjs" <file> <start> <end>--- <source>: not readmarks one source that you did not read. A line--- <source>: not read in fullmarks a source that you read only in part. A line--- pull request: not confirmedmeans that the script could not confirm which pull request contains the commit. The evidence of such a pull request can still be in acandidate pull requestblock. A line--- github: not readmeans that the script read only Git. Only these status lines give the status. The text from Git and GitHub has 4 spaces before each line. The other sources in the same block are read. If the line--- references: not readnames a reference that can explain the decision, run the script again with a larger--max-references. - Judge each block, the commits first. A commit or a pull request can also do more than the decision in the code. Its
Whyand its changed design sections can be about a different decision. If a changed section is about the decision, follow it with step 2 (Find the history of a doc section). Follow a reference that explains the decision. You do not need to read every source that a pull request names. Acandidate pull requestblock holds a pull request that the script could not confirm for a commit. Its evidence can be about a different change. If you give a reason from it, say that the pull request is not confirmed. - Use this step when no comment links a design section about the decision, and no changed design section is about it:
- Report the sources that you read: the comment, the commits, and the pull requests, issues and comments.
- Say that none of them links a design section about the decision. Do not say that no design section exists.
- Give each reason that is about the decision: from the
Whyof a commit, a pull request, an issue or a comment. If none is about it, say that the sources that you read do not give the reason.
Do not use git log --first-parent. It hides the commits inside a merged PR.
Report
- Keep the current reason and accepted costs (from the docs) separate from the reason and costs at that time (from commits).
- If the question is about a downside, say if a design doc or a
Cost:line lists it. - Cite each reason and cost by source:
- Design doc: link the section. For a code comment, give its file path and line.
- Commit: give its hash and author date. Use the date in the collector output. If it is missing, use
git show -s --format=%ad --date=short <hash>if the commit is local. Otherwise, say that the date is unknown. - Pull request or issue: link its URL. For an issue comment or review comment, link the URL of that comment, not the discussion page.
- A commit can have no reason or no
Cost:line. In that case, say that you did not find it. Do not conclude that the author accepted or missed a downside. Do not give a guess from the diff as a fact. - Report each source that the script of step 5 marks as "not read" as not read, and each source that it marks as "not read in full" as read in part. Do this also when you found a design section.
- For a commit whose pull request is "not confirmed", say that its pull request is not known. Report what you read from each candidate pull request apart from that.
- Before you overturn a decision, give the user what you found. The maintainer decides.
- After the maintainer decides, update the docs as
docs/doc-rules.mdsays. PutSupersedes:in the commit body.
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.

