brief-backfill
Skill2 starsChanged 2 months agoApache-2.0View on GitHub
Reconstruct a brief decision layer for an existing codebase from its code, docs, and comments. Use when adopting brief in a repo that already has ADRs / design docs / rationale comments — it maps what exists, verifies each decision against current code, carries forward the correct ones, re-grounds the drifted ones, and discovers decisions that live only in code. Invoke for "backfill brief", "adopt brief here", "reconstruct decisions".
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- brief-amendSkill
- brief-author-decisionSkill
- brief-feature-mapSkill
- brief-reviewSkill
- dispatchSkill
- ghostSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
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 19
Read map.md. It gives you: decision-genre docs (adr/design/spec/contract) with their status-field + git-tracked flags, other docs …
- Very specific: line 44
Use the brief-author-decision skill's format (frontmatter, one anchor per decision, invariant stated as the *why*).
- Very specific: line 46
Genre split: do NOT import plans, reviews, runbooks, or readmes as decisions — they are snapshots/guides.
- Very specific: line 48
Prefer *few load-bearing* decisions over many trivial ones.
- Very specific: line 49
Verify before you assert: If you can't confirm a claim against code, mark the doc status: draft and flag it for human review — never invent …
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
brief backfill — reconstruct the decision layer
Turn an existing repo into a governed one. This is migration + drift-audit + discovery in one pass — not a blind regeneration. Most existing decision docs are probably right; verify and carry them forward, and only rebuild what has actually drifted.
1. Map (mechanical)
brief backfill # writes .brief/backfill/map.mdRead map.md. It gives you: decision-genre docs (adr/design/spec/contract) with their
status-field + git-tracked flags, other docs (plans/reviews/runbooks — NOT decisions),
decision signals in code (existing doc:// refs + rationale comments), and the module tree.
2. Reconcile each existing decision doc — verify, don't assume
For every decision-genre doc, extract its load-bearing claims and check them against current code (read/grep the relevant module). Classify and act:
- Current (claims match code) → carry forward: author
.brief/docs/<id>.md, preserve the existing prose (it's correct), add frontmatter (status: active), a stable anchor, andrelated_codeglobs. Don't rewrite good content. - Stale (decision holds, details drifted) → carry forward + fix the drifted detail; note what you corrected.
- Superseded / Contradicts / Orphaned → do NOT import as active. Author the current
decision (from code reality) and set
supersedes:; leave the old doc in place but mark itstatus: superseded. Never delete.
3. Discover decisions that live only in code
Rationale/context comments and existing refs with no governing doc are decisions nobody
wrote down. Author them as new .brief/docs/ decisions, scoped to the code they govern.
4. Author rules
- Use the
brief-author-decisionskill's format (frontmatter, one anchor per decision, invariant stated as the why). - Genre split: do NOT import plans, reviews, runbooks, or readmes as decisions — they
are snapshots/guides. (Give plans/reviews a
Snapshot as of DATEnote instead.) - Prefer few load-bearing decisions over many trivial ones. Scope
related_codetightly. - Verify before you assert. If you can't confirm a claim against code, mark the doc
status: draftand flag it for human review — never invent a decision. - Then
brief publish <id>each, add// Context: doc://…@latest#<anchor>refs at the governing sites the map flagged, andbrief pin.
5. Reconciliation report
End with a summary: carried-forward, re-grounded (+ the drift found), newly-discovered (decisions only in code), superseded/archived, and needs human review (drafts you couldn't verify). This report is a docs-health audit — surface it.
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.

