cf-adopt
Skill10 starsChanged 7 days agoMITView on GitHub
Applies the workbench to an Obsidian vault the person ALREADY has, in place, copying nothing - dry-runs tools/adopt.py, explains the plan and the debt in plain words, applies only after a clear yes. TRIGGERS - "I already have an Obsidian vault", "start from my current notes", "do not start from zero". Do NOT trigger to bring loose files into this vault (cf-import-knowledge), nor to open or close a session.
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- vault/CLAUDE.mdCLAUDE.md
- cf-adapt-skillSkill
- cf-askSkill
- cf-brainstormSkill
- cf-brandSkill
- cf-claude-cornerSkill
- cf-close-sessionSkill
- cf-extract-routineSkill
- cf-helpSkill
- cf-import-knowledgeSkill
- cf-know-my-productSkill
- cf-new-projectSkill
- cf-new-ruleSkill
- cf-onboardSkill
- cf-open-sessionSkill
- cf-studySkill
- cf-task-observerSkill
- cf-whats-realSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
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 17
No vault path, no run: Ask which folder is the vault.
- Distinctive: line 19
Read the plan before saying anything: Every statement points to a line of the output.
- Very specific: line 24
The tool writes, you do not: Do not edit the user's notes, areas.txt, hooks or baseline by hand.
- Distinctive: line 25
No invented links, nothing about the person: Do not propose links to lower the debt unless the user asks and you can point at the sentence …
- Very specific: line 64
Does NOT defend: the user pointing cogiforge.home at a clone they chose (adopt checks the scripts exist, not who wrote them), or a hook …
- Very specific: line 65
If the allowlist blocks something the user considers fine, they edit .git/config themselves.
- Very specific: line 82
Run git init, --no-verify, or --apply before the plan was read and confirmed.
- Distinctive: line 84
Call a vault "fine" when notes were skipped, or when it was empty ("nothing to adopt" is not OK).
≈ “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
cf-adopt: put the gate on the vault you already have
Why it exists
Starting from zero means losing a vault that already works; migrating means copying thousands of notes into an
inbox that nobody triages. tools/adopt.py does neither: it leaves every note where it is, measures how much
debt already exists, installs the gate, and promises one thing: from now on, new notes in a commit are checked,
and the old ones are not touched.
The rules
- No vault path, no run. Ask which folder is the vault. Never guess a path and never search the disk for one.
- Dry run first, always.
python3 tools/adopt.py <vault>writes nothing. Do not run--applybefore the user has seen the plan. - Read the plan before saying anything. Every statement points to a line of the output. If you did not read it, you do not claim it.
- Say what is pending first. Not a git repository (the tool never runs
git init; tell the user to run it themselves and try again), a CONFLICT (an existing file is kept as it is), skipped notes (iCloud placeholders not downloaded, unreadable, symlinks: they were NOT measured, which is not the same as fine), or "nothing to adopt". A DIFFERENT.git/hooks/pre-commit(or any other hook in.git/hooks) is code that already runs on git operations: the tool never overwrites nor chains it and applies nothing. Show the user the lines the plan prints, tell them to read that hook and decide; never delete, replace or activate it for them. A BLOCKING item about.git/config, a symlink, extra files in.githookswhilecore.hooksPath = .githooksis active (an older install), a globalcore.hooksPath, or a.gitfile means the vault may not be trusted or the hook would not run: report the listed keys as they are, do not edit that file yourself, and let the user decide. Also read the full hook text the plan prints and tell the user it will run on every commit. - Ask, then apply. Only after a clear "yes" to "do you want to apply this?" run
python3 tools/adopt.py <vault> --apply --confirm <sha>, where<sha>is theplan-sha256:line that the dry run you showed the user ended with (never a sha from an older run). A "maybe" or silence is a no. - The tool writes, you do not. Do not edit the user's notes,
areas.txt, hooks or baseline by hand. Never touch an existing note. - No invented links, nothing about the person. Do not propose links to lower the debt unless the user asks and you can point at the sentence that justifies each one. Do not infer who they are from their folder names.
- Talk to the user in the language they write in. Fixed tokens (paths,
areas.txt, rc codes) stay as they are.
The steps
1. Dry run (you)
python3 tools/adopt.py <vault> # the plan; writes nothing
python3 tools/adopt.py <vault> --json # same data, for you to read2. Explain the plan in plain words (you), in at most 8 lines
- The areas it found (the proposed
areas.txt), and that the user can change them later. - What would be created, and what already exists and will be kept.
- The debt today, as numbers: orphan notes, dead links, notes without
area:. It is saved as.cogiforge/baseline.json. - The warning, literally: the hook only judges the notes in the commit, so the old debt blocks nobody. It only stops new orphans, dead links and personal data. Notes git already has stay exempt while
.cogiforge/baseline.jsonlists them (no need to commit the baseline first); a note that arrives in a commit never is. - Anything pending (rule 4).
3. Ask
"Do you want to apply this?" One question, nothing else in the message.
4. Apply (you, only after yes)
python3 tools/adopt.py <vault> --apply --confirm <plan-sha256 of the dry run the user saw>Read its output and report what was written. Exit codes: 0 ok · 1 something pending · 2 usage or no confirmation · 3 vault unreadable · 5 the plan changed since the preview (nothing was written: run the dry run again, show the user the new plan, ask again).
Suggest a test: add a note with no link and run git commit; the hook should block it. Commit nothing yourself unless asked.
Threat model
- Defends: a vault received from a third party (zip, copy, sync) with a hostile
.git/config, symlinks, extra hooks or malicious note names. .git/configis listed by git itself (on a private copy, in a clean environment, running nothing), and only whatgit init/clonewrite (core basics, remote url/fetch, branch remote/merge, user name/email) plus adopt's own two keys passes; anything else blocks with the entry cited, and no git runs inside the vault..gitmust be a plain repository (default-deny layout:commondir,config.worktree,info/attributes, alternates, modules, worktrees, shallow, rebase state and hooks of the user all block). Symlinks in any component of a path it would write, a.gitthat is a file or symlink, and a different.git/hooks/pre-commit(never opened unless it is a regular file) all block, and nothing is written.- The hook only runs a cogiforge checkout given as a canonical absolute path with the three scripts inside.
- Does NOT defend: the user pointing
cogiforge.homeat a clone they chose (adopt checks the scripts exist, not who wrote them), or a hook they read and approved. Say so in one sentence when you explain the plan. - If the allowlist blocks something the user considers fine, they edit
.git/configthemselves; you never edit it for them and adopt never loosens it. - Defends: a file that LATER arrives in the versioned tree (a pull, merge or sync bringing
.githooks/post-merge) never runs as a hook. The hook lives in.git/hooks, which git never versions, and adopt sets nocore.hooksPath(an older install that set it is migrated: the key is unset).
What adopt does NOT guarantee
- That the cogiforge checkout is trustworthy: it checks that three scripts exist at
cogiforge.home, not who wrote them. - That a hook you approved, or a vault you cleaned by hand after a block, is safe: it judges what it sees at that moment.
- That a plain-looking
.githolds no hostile object, ref or index data: it validates the LAYOUT (default-deny names, no symlinks) andconfig, not the repository contents. - That your global git config, your
PATH, your shell or your terminal are not hostile. - That
core/*.pyprint safely when you run them by hand: only adopt and the generated hook filter their output. - That the debt numbers are complete: skipped, unreadable and non-UTF-8 notes are listed, not measured, and links are resolved by the gate's rules, not Obsidian's.
- That a blocked vault is dangerous, or an accepted one is safe: the allowlist is deliberately narrow, so real configs (
pull.rebase,autocrlf,lfs, credentials) block until you edit them. - Anything after the apply: later edits to
.git/hooksor to.git/config(by you or by another tool) are judged only if you run adopt again. - That the baseline exemption is a lock. Once
.cogiforge/baseline.jsonis committed, a commit cannot add an entry to it (the committed version is the ceiling). Before that, and in the first commit, whoever edits the file on the disk, or takes it out of git in a separate commit, can widen the exemption, the same way skipping the hook on purpose does: it takes wanting to get around it. On a filesystem that tells the two apart, two note names that differ only in NFC/NFD (two ways to write the same accent) count as the same note.
Never
- Run
git init,--no-verify, or--applybefore the plan was read and confirmed. - Overwrite or edit an existing note or config file, or activate a hook you did not generate.
- Call a vault "fine" when notes were skipped, or when it was empty ("nothing to adopt" is not OK).
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.

