How to write to a librocat library: what belongs and what doesn't, one concept per idea, the concept types, and a complete catalog record (title, description, tags from the thesaurus, sources, review date). Use whenever the user says "remember this", "save this", "note that", "put this in librocat", or asks to capture a decision, a runbook, a fact, or how some code works; and before any `ingest` or `update`.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Is that skill safe to install?
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
Are you the author of Librocat Write?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/laughinghermit-librocat-write)
---
name: librocat-write
description: >-
How to write to a librocat library: what belongs and what doesn't, one
concept per idea, the concept types, and a complete catalog record (title,
description, tags from the thesaurus, sources, review date). Use whenever
the user says "remember this", "save this", "note that", "put this in
librocat", or asks to capture a decision, a runbook, a fact, or how some
code works; and before any `ingest` or `update`.
---
# Writing to librocat
librocat stores knowledge as OKF concepts: Markdown with YAML frontmatter.
A concept is a catalog record (type, title, description, tags, sources)
plus a body. The record is what makes it findable later, by every agent
that reads this library, so never skip it. Write for two readers at once:
a person skimming and an agent retrieving.
## What belongs
Write a concept when it is **durable, decision-bearing, and not cheap to
re-derive**:
- a decision and why: the trade-offs, the option chosen, what it rules out;
- how to do a recurring task: deploy, migrate, rotate a key, debug the
known flaky thing;
- a fact a newcomer or a fresh agent would otherwise ask: names, limits,
conventions, who owns what;
- how the system fits together, which no single file states;
- instructions agents must follow every session (a `Note` tagged
`instructions`).
Do **not** write: whole files, pages, or transcripts (summarize and cite
them; to keep the original, `add_source`, or the ingest-document skill),
what the code already says line for line, small talk, secrets or
credentials, or a second concept about a subject the library already has.
Ask before storing personal data or anything the user may not want shared.
## Before you write
1. `search` for the subject in the words a concept about it would use: your
project's shelf first (`shelf`), then the whole library. If a concept
already covers it, `update` that one. (To answer a question rather than
write, `ask` gives the concept and passage that answer it, for a Libro
credit; `search` is free.)
2. `status` for the live vocabulary (`by_type`, `by_tag`), and `thesaurus`
for the preferred tags and their scope notes. If its `library.role` is
`reader`, the person can read this library but not change it: don't
write; tell them one of its admins can make them an Editor.
## One concept, one idea
- If a title needs "and", split it. A long document is its decisions,
facts, and procedures, typically 3 to 15 concepts, not one per page.
- Put the answer in the first paragraph; details follow. A reader stops as
soon as they have enough.
- A body holds at most 16 KB (16,000 bytes, about 2,500 words) on
librocat.com, and 64 KB on a self-hosted librocat. Long before that, split it
into concepts and link them.
- Link related concepts with Markdown links to `.md` targets:
`[the index layer](/architecture/index.md)` from the bundle root, or
`./sibling.md`. Those links are the graph (`get_concept`'s `links`,
`graph`); prose mentions are not. For a distinct concept a reader may
want next without a sentence to link it from, `update` with `related`
(ids, at most 10): a see-also.
## Types
Two types, so a person sees at a glance what a concept is:
| Type | For |
|------|-----|
| `Decision` | What was chosen and why: context, decision, consequences |
| `Note` | Everything else: how something works, steps for a recurring task, facts to look up, a module of a repository, agent instructions (tagged `instructions`) |
librocat files any other type as a `Note`. Say what kind of note it is in
the title and tags instead (`Deploying the site`, tag `runbook`). A concept
that cites a file shows it; there's no separate type for that.
## The catalog record
- **`id`**: a path without `.md`, grouped by directory
(`decisions/use-postgres`). **One library, many shelves:** put a
project's concepts under one leading directory, its shelf (`acme/…`).
Make a shelf for a project, never a separate library; separate libraries
only when access must differ.
Before a new id, look at the shelves the library has (`list` with
`format: "shelves"`, each with its count) and file into one that fits;
start a new shelf only when none does.
- **`title`**: the claim, not the topic. Weak: "Auth". Good: "Sessions
expire after 30 days".
- **`description`**: one standalone sentence a reader can act on without
opening the body; it is what `search` and `list` show first. Weak:
"Notes about the parser". Good: "The parser reads frontmatter in one pass
and never rejects unknown keys."
- **`tags`**: 2 to 4, from the thesaurus. Reuse a preferred tag; read its
scope note; file under the most specific tag that fits (`oauth`, not
`oauth` and `auth`). Writes map a `use_for` synonym onto its preferred
tag. For a new synonym, `set_term` it as `use_for` on the preferred tag
instead of coining a tag; give a new tag a `scope_note`.
- **`sources`**: what the concept describes or came from: repository paths
(`src/auth/login.ts`, or `src/auth/` for a directory), links, or a kept
source's `cite`. Then `files_changed` after a commit brings the concept
up for review when its code moves, instead of letting it go quietly wrong.
Always include the `cite` of every kept source you drew on: the
dashboard's Library shows a file's concepts by it, and nothing else ties
a concept to its file.
- **`stale_after`**: an ISO date, on anything time-bound (a plan, a price,
a version, an owner, a deadline), so the library asks later whether it
still holds. When you check one and it does, `update` it with
`verify: true`.
- **`status`**: `draft` while you write, `stable` (the default) when it
holds, `deprecated` when it no longer does, with `superseded_by` naming
its replacement.
A record left without a description or tags is filled in by Libro, the
library's cataloger; one you write yourself is better.
## Writing
- `ingest` with the full record and the body; several at once with
`concepts: [...]` (up to 100, a result per item).
- **`possible_duplicates`**: a new concept may come back with up to 3
concepts that share its words. Read them. If one is about the same
subject, `update` that concept with what's new and `delete` the one you
just wrote, or `propose` a merge when the person should decide. Two
concepts about one subject split every later search.
- `update` with only the fields that change; `new_id` moves a concept and
rewrites every link to it.
- After you commit code, call `files_changed` with the paths the commit
touched (`git diff-tree --no-commit-id --name-only -r HEAD`) and your
`shelf`, then `update` what the change made wrong, or `verify` what still
holds.
- Tell the user what you saved: each id and title.
- When the conversation settles a decision or a fact the library lacks,
offer to save it; write it on the user's yes.
## When a write waits for approval
A library can turn on **Approve changes**: then every new concept, edit,
and deletion from an agent waits as a change request until someone who
approves it (an admin, or an editor if the library allows) does, on the
dashboard. A held write returns `proposed: true`, its `request_id`, a
`title`, a `url`, and a `note`.
- Group related writes into one request, like a small pull request: on the
first, `request: {title, message}` (the message is your own words for the
reviewer: what changed and why); on the rest, the returned `request_id`.
At most 20 changes a request.
- Tell the person it waits, and give them the `url`. It isn't searchable,
and `get_concept` doesn't find it, until it's approved.
- Don't write it again unless something changed: a second write of the same
concept replaces your change (`replaced`).
- `review_shelf`'s `your_requests` says how each of yours stands (`state`):
`waiting`, `approved`, `rejected` (with a `note`), `withdrawn`,
`changes_requested` (fix what the `note` says, then send the same write
again with `request_id`), or `out_of_date` (the concept changed: read it
again and redo your change with `request_id`). `decide` with `withdraw`
takes back a request of yours.
- `set_term` is refused while approvals are on: `propose` a `synonym`
instead. Kept sources (`add_source`) and `files_changed` are not held.
- Any `update`: pass `base`, the `updated_at` you read with `get_concept`;
if someone wrote the concept since, you get `conflict: true` and nothing
is written, so read it again first.