decision-history
Skill2 starsChanged 5 days agoMITView on GitHub
Record a design decision as a dated, past-tense entry in the repo's docs/decision-history/, or decide whether it clears the filing bar or belongs in the commit body. Use when recording a decision (経緯を残して / ADR にして), or when context-sync finds a buried decision.
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- shimo4228/claude-harnessedited, first seen Nov 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- shimo4228/claude-harness★ 4100% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository22 other files it gives its agents.
- llms-full.txtllms.txt
- llms.txtllms.txt
- agent-stocktakeSkill
- author-calibrated-evalSkill
- context-syncSkill
- generation-auditSkill
- harness-boundarySkill
- harness-stocktakeSkill
- hook-stocktakeSkill
- jev-judgment-designSkill
- learn-evalSkill
- llm-as-judgeSkill
- repo-asset-stocktakeSkill
- review-to-lintSkill
- rules-distillSkill
- rules-stocktakeSkill
- search-firstSkill
- skill-complySkill
- skill-healthSkill
- skill-stocktakeSkill
- skill-writerSkill
- verify-bootstrapSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 8 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Write a new entry only when the decision meets all three:
- Very specific: line 56
If $DH_DIR does not exist, create it — the request itself covers the directory, and git makes it reversible.
- Distinctive: line 118
Verify uniqueness right before writing (race safety):
- Very specific: line 124
If COLLISION, recompute NEXT_NUM from the latest state.
- Distinctive: line 128
Ask the user (or accept from caller) for:
- Distinctive: line 137
If 2-6 are missing, request them — do not proceed.
- Distinctive: line 139
Preventive check (before settling the packet): Read references/review-findings.md (a dated casebook of frequent review findings) and …
- Very specific: line 148
Read the 2 most recent entries in $DH_DIR for house style (heading form, link style, whether Consequences splits into Positive / Negative / …
- Distinctive: line 154
Every Context fact, Decision clause, rejection reason and Consequence comes from the packet.
- Very specific: line 162
When the decision went through a plan, the first line of Context links the approved plan: Plan: docs/plans/<file>(承認 YYYY-MM-DD).
- Distinctive: line 166
If a packet field is missing, stop and ask.
- Very specific: line 179
When you want an ad hoc blocking verdict, add --gate.
- Very specific: line 194
If diff_scope.changed_not_mentioned lists changes the entry does not mention, write them into the Decision or split them into a separate …
- Very specific: line 200
Before commit, launch agent: decision-history-reviewer and hand it the entry you just wrote — do not skip this.
- Very specific: line 205
After Step 4 writes the file, append a row to $DH_DIR/README.md index table:
- Distinctive: line 213
If the index table is malformed or absent, regenerate it from the directory:
≈ “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
Decision History
Write one dated entry per design decision in docs/decision-history/. An entry records what was decided, why, and what was known on that day, in the past tense. The current design is the thing itself — rules, skills, hooks, tests, code — and the author's current instruction; an entry is read for the history behind it. A new decision may contradict an older entry; the older entry stays as written.
The skill handles the boilerplate (directory detection, sequence numbering, index update) in scripted steps, and the main loop writes the prose.
Why the main loop writes
Deterministic concerns — where the entry goes, what number it gets, which index needs updating — are easy to get wrong silently (number collisions, sub-directory cwd confusion, index drift), so they live in scripted steps. The prose is written by the main loop that holds the decision: rendering to the house template is cheap for it, and the decision packet (Step 3) is the discipline that keeps decide and render apart — the packet is settled first, the file is a faithful expression of it, nothing is inferred while writing. A writer renders a decision; it does not make one. The evidence script (Step 4.5) is the fidelity check.
When to Use (filing conditions — canonical)
Write a new entry only when the decision meets all three:
- hard to reverse — undoing it means changing other artifacts (skills, rules, hooks, scripts) or public outputs too. Being revertible with git alone does not count as easy: nearly every harness change is git-revertible
- surprising without context — a future reader would ask "why is it like this?"
- the result of a real trade-off — chosen between genuine alternatives
"Hard to reverse" is met by most harness changes, so it mainly excludes changes whose effects stay local; "surprising" and "real trade-off" do the filtering.
A decision that changes or reverses an earlier entry is its own entry when it meets the three conditions. Link the earlier entry when it helps the reader (関連する経緯: [0035](./0035-slug.md)); the earlier entry keeps its text, its date and its state as written — the history stays readable in place, and git holds the order.
Entry points: the user says "record this decision" / "経緯を残して" / "ADR にして", context-sync Phase 3 surfaced a buried decision, a debate concluded and the outcome must outlive the session. Apply the three conditions to the request; when they do not all hold, say so and use the commit body.
When NOT to Use — the commit body carries it
Everything else is recorded in the commit body, in three lines, so git log --grep finds it later:
Context: <what was observed, with its source>
Decision: <what changed and why>
Review-when: <the observation that would reopen it, or "none — record">This covers bug fixes, reversible refactors, wording changes to rules / skills that nothing else cites, stocktake outcomes (retire / keep verdicts — the stocktake's own results file plus the commit), and personal preferences. When a commit-body decision later gets cited by another artifact, promote it: write the entry then, quoting the commit.
Workflow
Step 1: Resolve the record directory
REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null) || REPO_ROOT="$(pwd)"
if [ -d "$REPO_ROOT/docs/decision-history" ]; then DH_DIR="$REPO_ROOT/docs/decision-history"
elif [ -d "$REPO_ROOT/docs/adr" ]; then DH_DIR="$REPO_ROOT/docs/adr" # repo that has not renamed yet
else DH_DIR="$REPO_ROOT/docs/decision-history"; fiIf $DH_DIR does not exist, create it — the request itself covers the directory, and
git makes it reversible. Mention the creation in your final report. Write a minimal
README.md index alongside:
# 判断の経緯(Decision History)
何を決め、なぜそうしたかの記録。1 件 1 ファイル、番号は連番、過去形で書く。現行の設計は実物と
今の指示が決め、記録は書かれた日の判断。新しい判断は旧記録と衝突してよく、旧記録はそのまま置く。
## Index
| # | Title | Date |
|---|-------|------|
## Template
Entries use the 6-section template
(`scripts/adr_lint.py` checks section presence mechanically):
```markdown
# NNNN: [Title]
## Date
YYYY-MM-DD
## Context
[what was the problem — facts of the day, with sources]
## Decision
[what was done and why — past tense]
## Review-when
[what observation would reopen this, 1–3 lines; or "none — record"]
## Alternatives Considered
[rejected options and why; a live rival as "Open — revisit when: …"]
## Consequences
[what became easier / harder]
```
File name: `NNNN-kebab-case-title.md` (zero-padded 4-digit sequence).
Index rows link the number: `| [NNNN](NNNN-slug.md) | Title | YYYY-MM-DD |`.(Index rows make the number a relative link. adr_lint.py reads the expected section set from this
README's Template fenced block, so placing the README doubles as the lint's template declaration.
A repo whose README still carries the older 7-section template with ## Status is checked
against that template until its README changes.)
Step 2: Pick the next sequence number
LAST_NUM=$(ls "$DH_DIR"/[0-9]*-*.md 2>/dev/null | sort -V | tail -1 | sed -E 's|.*/([0-9]+)-.*|\1|')
if [ -z "$LAST_NUM" ]; then
NEXT_NUM="0001"
else
NEXT_NUM=$(printf "%04d" $((10#$LAST_NUM + 1)))
fiVerify uniqueness right before writing (race safety):
[ -e "$DH_DIR/$NEXT_NUM-"*.md ] && echo "COLLISION" || echo "OK"If COLLISION, recompute NEXT_NUM from the latest state.
Step 3: Gather the 6 inputs
Ask the user (or accept from caller) for:
- Title — states the decision, kebab-case-friendly (e.g.,
context-sync-cascade-and-writer-agents). The skill composes the filename. - Context — what problem prompted this decision, with the facts and sources of the day (raw text OK).
- Decision — what was done and why (raw text OK).
- Review-when — what observation or premise failure would reopen this, 1-3 lines. It is a reservation of when to think again, captured at write time. If there genuinely is none, write "none — record".
- Alternatives — what else was considered and why rejected, or, for an alternative that stays live, "Open — revisit when: …" (raw text or list). Keeping a rival open is allowed; a straw man is not.
- Consequences — what became easier / harder (raw text or list).
If 2-6 are missing, request them — do not proceed. Entries without these sections are noise.
Preventive check (before settling the packet). Read references/review-findings.md (a dated casebook of frequent review findings) and self-check against the matching patterns — cited entries exist and say what is cited, provenance of coined terms, references to gitignored paths, sources and denominators of numbers, what is held fixed in count conditions. This is write-time prevention; semantic review is Step 4.6.
Assemble and approve the decision packet before writing. Settle the actual content here: the real Context, the decision as decided, the Review-when triggers, why each Alternative was rejected (or under what condition it is revisited), which Consequences genuinely follow. When your harness's boundary rule hands these records to the user, confirm this packet with them before Step 4; otherwise write it and show the packet in the report (the author's harness writes entries without confirmation — rules/common/boundary.md). Step 4 expresses the packet and adds nothing, so a fuzzy decision is resolved here.
Step 4: Write the file (main loop)
Read the 2 most recent entries in $DH_DIR for house style (heading form, link style, whether
Consequences splits into Positive / Negative / Neutral), then write
$DH_DIR/$NEXT_NUM-<title>.md from the Step 3 packet:
- Heading
# NNNN: <title>, then the 6 sections in template order (Step 1's template, or the repo's own README Template block when it differs) - Every Context fact, Decision clause, rejection reason and Consequence comes from the packet. Writing is expression, not synthesis — a consequence that feels "logically entailed" but is not in the packet goes back to Step 3 for the user to approve, not into the file
- Decision in the past tense ("X を Y に移した", "moved X to Y because Z") — it says what was done and why; Review-when as observable triggers; each Alternative with its rejection reason or "Open — revisit when: …"
- Links to sibling entries are relative (
./NNNN-slug.md) and the file name is copied fromls, not typed from memory — Step 4.5'srefs.links_brokenis the check - When the decision went through a plan, the first line of Context links the approved plan:
Plan: [docs/plans/<file>](../plans/<file>)(承認 YYYY-MM-DD). The plan is the frozen precommitment; the entry still stands on its own — the link is provenance, not a substitute
If a packet field is missing, stop and ask; do not write a partial entry.
Step 4.5: Run the mechanical lint and the per-entry evidence
python3 ${CLAUDE_PLUGIN_ROOT}/skills/decision-history/scripts/adr_lint.py --root "$REPO_ROOT"Evidence mode (no verdict, exit 0). In the output JSON, fix the deviations in the entry you just wrote (missing_sections / case_mismatch / date / index / naming) before moving on. Deviations in existing entries are report-only — do not fix them in this step (separate task). The lint covers mechanical properties only and is not a substitute for semantic review (decision-history-reviewer).
When you want an ad hoc blocking verdict, add --gate. The exemption boundaries are unbounded by
default, so pass per-repo values — harness uses --sections-from 44 --require-review-when-from 44
(exempting 0009's two missing sections and the absent Review-when in 0043 and earlier).
Next, take the per-entry evidence for the one you just wrote (the machine-countable part of the findings decision-history-reviewer repeats):
python3 ${CLAUDE_PLUGIN_ROOT}/skills/decision-history/scripts/adr_review_evidence.py --root "$REPO_ROOT" --adr "$NEXT_NUM" --diff worktreeFix here what can be fixed at write time in the JSON — refs.unresolved (entry / RFC numbers that do not exist),
refs.links_broken, missing (nonexistent paths) and ignored (gitignored evidence — promote it to
docs/evidence/ or rewrite to be path-independent) in paths.flagged, paths.line_refs_out_of_range,
numbers.percent_without_denominator, numbers.relative_referents (conversation references).
If diff_scope.changed_not_mentioned lists changes the entry
does not mention, write them into the Decision or split them into a separate commit. The remaining keys
(numbers.unanchored, review_when, alternatives, consequences, second_record) need judgment and go to the Step 4.6 reviewer. relations.* is evidence of which earlier entries this one names; nothing in it asks for an edit to an earlier entry.
Step 4.6: Run the semantic review (decision-history-reviewer)
Before commit, launch agent: decision-history-reviewer and hand it the entry you just wrote — do not skip this.
This skill is the only wiring for decision-history-reviewer — skipping it here means no semantic review runs at all. The main loop accepts or rejects each finding against the Step 3 packet, and fixes only the accepted ones.
Step 5: Update the index
After Step 4 writes the file, append a row to $DH_DIR/README.md index table:
# Read current index
# Find the table block (lines between the "| # |" header and the next "##" heading)
# Append: | [$NEXT_NUM]($NEXT_NUM-<slug>.md) | <title human-readable> | <date> |If the index table is malformed or absent, regenerate it from the directory:
for f in "$DH_DIR"/[0-9]*-*.md; do
num=$(basename "$f" | sed -E 's|([0-9]+)-.*|\1|')
title=$(head -1 "$f" | sed -E 's|^# (ADR-)?[0-9]+: ||')
date=$(awk '/^## Date/{getline; getline; print; exit}' "$f")
echo "| [$num]($(basename "$f")) | $title | $date |"
doneStep 6: Report
Tell the user:
Entry written
---
File: docs/decision-history/<NNNN>-<title>.md
Number: <NNNN>
Index: updated (+1 row)Edge cases
| Case | Handling |
| Called from a sub-directory of the repo | Use git rev-parse --show-toplevel; never trust raw cwd |
| Not a git repo | Fall back to cwd, warn the user that they should git init |
| Number was reserved verbally but not yet written ("I'll write 0010 later") | Skill cannot know; ask the user whether to take the next free number or the reserved one |
| The decision reverses or narrows an earlier entry | Write the new entry; link the earlier one when it helps (関連する経緯: [NNNN](./NNNN-slug.md)). The earlier entry is left as written. |
| Title contains spaces or non-ASCII | Skill normalizes to kebab-case ASCII for the filename; preserves original in the # NNNN: ... heading |
Boundaries
- The files this skill writes are the new entry and the index.
- The commit follows the repo's commit rule (the author's harness:
rules/common/boundary.md).
Reference Files
- Template canonical source: read the target repo's existing entries to mirror their voice. For the harness itself, see
~/.claude/docs/decision-history/README.md. - Mechanical lint (evidence mode +
--gate):scripts/adr_lint.py(adapts the template automatically from the repo's record README Template; tests aretests/test_adr_lint.py). - Per-entry review evidence (evidence mode only):
scripts/adr_review_evidence.py( cited references exist, path classification, diff scope, unsourced numbers; tests aretests/test_adr_review_evidence.py). This one file is the entry point for running and importing; the checks themselves are split acrossscripts/adr_evidence_common.py/_paths.py/_prose.pyto stay within the per-file LOC budget. - Casebook of frequent review findings:
references/review-findings.md(read during the Step 3 preventive check). - Evals:
evals/evals.json(3 scenarios — new entry / missing directory / sequence collision).
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.

