/docbrain:docbrain-capturefrom docbrain
Captures knowledge from conversations into DocBrain so the organization can find decisions, fixes, caveats, procedures, and system wiring later. Checks for existing records, drafts in team language, and writes only after confirmation.
Ships in docbrain. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The knowledge worth keeping is created in the middle of work and gone by Friday. This skill turns the moment it exists into a record a stranger can find, act on, and that DocBrain can flag the day it stops being true. It works through the DocBrain MCP tools. Nothing leaves the session until the person says yes; everything else is automated.
Offer once, at a natural breakpoint, in one sentence: "Worth capturing to DocBrain: ?". Never interrupt a task to offer. Never offer twice for the same thing. If the person says no, drop it.
docbrain_context with file_paths, an array of the repo-relative paths the knowledge
concerns — always the array, even for one path; bare paths such as deploy/ingress.yaml, never
deploy/ingress.yaml:42. When no file is involved, call docbrain_ask with the question a future
engineer would type instead; never call docbrain_context without paths.docbrain_revise with its id. If it should simply stop being served, ask for a one-line reason
and call docbrain_revise with withdraw_reason. Someone else's capture is credited to its author
on its page: say so and suggest they ask that author; never revise it./mcp, choose docbrain and sign in (if DocBrain says app sign-in is off, ask your
DocBrain admin to turn on Sign-in for apps)" and stop. Do not search the repository instead.
Captured knowledge does not live in the repository, so an absent connector looks exactly like an
empty knowledge base and is not one.One capture per fact. Fill resources/capture-template.md; finished examples are in
resources/examples.md. The rules:
Say what, why and how, with the exact command, path, flag and value. A capture a stranger can act on without asking anyone.
Anchor it. Give the file and line range it concerns (file_path, line_range). Read the file first:
the lines you name must hold what the capture says. If the change described is not in the file, say
so and ask where it lives; never anchor a capture to lines that do not contain it. Pass those exact
lines as code_snippet. DocBrain keeps their hash but does not re-check them; the code premise below is what it checks.
If your statement stops being true when the code changes, name what it rests on as one code premise of two different
lines of code, each on its own line of the premise:
<repository>:<path>#<text>
<repository>:<path>#<text>
<repository> is the repository holding both files: github:owner/name or gitlab:group/name, read from
git remote get-url origin in that checkout, without .git. If it is on neither, declare none. Copy each <text>
exactly from the file, and take the smallest piece of that line that would have to change for your statement to stop
being true: a name and its value, not a whole call. Quote a call's arguments only if the arguments are what you are
saying. Pick two lines that would both have to change for your statement to stop being true. DocBrain warns readers only
when both are gone, so a line that would outlive your statement keeps a wrong note quiet. If you cannot find two such
lines, declare none. Take none too if your statement is that something is absent, or if it rests on behaviour spread over
many lines: say so in the capture instead.
docbrain_commit_capture is for one moment: the person is about to commit, or asks to record why
a commit was made, and the reason is not in the message. The signals are the person's own words —
"about to commit", "before I commit", "the message will say", "record why I changed" — and when
one is present the diff is the anchor: the intent, the files and the message go through
docbrain_commit_capture, never an annotation on lines that are about to change. Send file_paths:
DocBrain turns each changed file into a premise and flags the capture the day one of them moves or
disappears, so the file list is what keeps a commit capture checkable — without it nothing can ever
tell whether the reasoning still holds. Everything else — a fix, a procedure, a caveat, a fact —
goes through docbrain_annotate, anchored to the lines that hold it. A change that is already
committed is not a commit capture: it is a fact about the file, whatever commit put it there, so do
not go looking for its commit — read the file.
When no file holds the knowledge — a process, a fact about how two systems are wired — anchor to the
document a reader would open first (a README, a runbook, a manifest, a config) and say so in the
capture. If no repository holds anything for it, use docbrain_commit_capture with the intent alone;
it is served at once and labelled Not checked against code, so readers know nothing checks it.
Declare the premises it rests on: paths that must exist for the capture to hold
(premise_type: "path"). Both capture tools take them; on a commit capture they are what the
reasoning rests on beyond the files it changed. Every premise path must exist in the repository right
now — check it before you show or send the draft; a path that does not exist is not a premise, and a wrong one
goes silent forever. DocBrain re-checks the paths and flags the capture the day one disappears. A
capture is served the moment it is written, labelled with who wrote it and what checks it: with
premises that hold it reads Cited code still there; with none it reads Not checked against code.
Declaring the premises is what earns the first label.
When the capture relies on something another team's or a library's code provides — a module, a file, an entry point you import or call — and that thing is a file, the premise names the exact file that provides it, never its directory: a directory goes on existing after the one file in it that mattered is gone, and the premise would go on holding.
A path premise checks that a file exists, nothing more. When what the capture relies on is a value or a behaviour in that file — a default, a version, a key's value, an ordering, an error shape, how input is parsed — say in the capture that this is not checked; never write a path premise as a stand-in for it, because the file survives while what is in it changes.
DocBrain checks a path exists, a value matches, and that two cited lines are still there. It does not check behaviour, absence, or anything spread over many lines: say those in the capture.
When the capture answers an open question DocBrain suggested (docbrain_suggest_capture), pass that
question's id as gap_id: the question closes for whoever asks next.
Choose the type: decision (why something was chosen), fact (how something works), caveat (a
gotcha or limit), procedure (steps — a capture with steps to run is a procedure even when it also
explains why), context (background a reader needs first).
Keep it to what was actually established. No guesses, no "probably", no restating the code. A relative date that names one day ("yesterday", "this morning") becomes that date, worked out from the day the person said it. One that names no single day ("last week", a weekday without its week) stays as given, with that said, and so does a date given without its month or year ("the 9th; month not stated"): never work out the missing part yourself. A space goes in only when the person or DocBrain named it; never guess one.
Leave out: hostnames from .env files, customer or personal names, pasted logs, chat, opinions
without a reason, and anything the person said to keep out; secrets have their own section below.
When in doubt, leave it out. Say what kind of thing was left out ("a key, a hostname, a name") —
never repeat the value, not even to say it was omitted.
Other people retrieve what you capture, so a secret in a capture is shared with every one of them.
DB_PASSWORD..env file, a credential file or a connection string with a password, not even part
of one.password, token, secret or key, an Authorization header, a private key block, a URL with
user:password@, a long random string that is not a hash or an id — and replace it with where it
lives.Show the draft exactly as it will be sent: the fields and their values, nothing hidden. Ask for a
yes. If the person asks for changes, show the edited draft in full and ask again. Write only a draft
that was shown and answered with a yes, or one a yes given in advance covers (below), unchanged, with
docbrain_annotate (or docbrain_commit_capture, or docbrain_revise). On no, stop.
A yes given in advance ("if your draft says exactly this, write it") covers a draft that says what the person said (for a revise, also the stored capture's own text that it corrects), anchored by these rules (the file, lines, snippet, premises and type; for a commit, the diff summary and the files), plus the notes these rules add that only qualify it: what DocBrain cannot check, a one-day relative date worked out as above, or a date kept as given. A note names what is not checked and never carries a value of its own: "the API's own limit is not checked", not "the API allows 50 MB (not checked)" unless the person said 50 MB. Write that draft once, without asking again, and in the report show exactly what was sent and name each note you added. It never covers a fact, value, date, reason or step the person did not state (a month you worked out, a cause or a "no restart needed" of your own): show that draft and wait for a yes.
If the write fails — permission, validation, the server unreachable — say exactly what the tool
reported and stop: no silent retry, no writing anywhere else. Leave the draft in the conversation so it
can be sent once the cause is fixed. A refusal names its reason — a capture limit, a duplicate (with
the existing id), an instruction in the text, a key with no user — repeat it and do not retry; for a
duplicate, offer docbrain_revise on the id it gave. A premise path no connected repository has any
more (premise_removed): check the path in the file tree, correct that premise or drop it, and show
the corrected draft for a new yes; never resend it unchanged. A refusal for a secret goes by Secrets above.
In one line, repeat what the tool reported: the capture's id, its status in the tool's word (indexed: it is
served now and Ask can answer from it), and any warning it returned (for example a premise path that does not exist). Its page in the console says
who recorded it, what checks it and where it helped.
Do not summarise the capture again; only after a yes given in advance, show once what was sent (Step
3). Do not offer another one.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub docbrain-ai/docbrain --plugin docbrainOther plugins' skills for the same job