librarian
Skill0 starsChanged 14 days agoMITView on GitHub
Repo documentation organisation: the canonical document set (README, CONTRIBUTING, CODING_STANDARDS, agent file, ADR surface, GLOSSARY) exists and cross-links, and every doc (and every section in a doc) lives where its content says it belongs. Modes: (1) AUDIT (default): report missing, misfiled and misnamed docs and sections as a shelving plan; (2) APPLY: execute it with history-preserving moves and link rewrites; (3) INIT: bootstrap docs/CONVENTIONS.md from the repo's own dialect or a named flavour (minimal/standard/rigorous); (4) INDEX: curate YAML siblings so docs are queryable with jq/yq and schema-gated. Use when asked to organise repo docs, check doc layout or placement, add missing canonical docs, relocate or rename docs, make docs machine-readable or generate YAML indexes for markdown, or on 'librarian'. Skip when the ask is prose quality, staleness/drift, or within-one-file readability; content-quality skills own those. Skip for what is inside the ADR surface: the adr skill owns it.
24 other projects use a version of this.
Adopted by
Most recently taken up by
- kultar/librariantheir own version, first seen Nov 29, 2026
- philippe-desplats/second-braintheir own version, first seen Nov 29, 2026
- tinhtute/monoharnesstheir own version, first seen Nov 22, 2026
- fworks-tech/agenthoodtheir own version, first seen Nov 16, 2026
- JetBrains/thinkrailtheir own version, first seen Nov 15, 2026
- skills-agents-co/skills-and-agents-librarytheir own version, first seen Nov 11, 2026
Used with
Projects with it also use sentry, hunt and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
OpenAISkillsentry
Use when the user asks to inspect Sentry issues or events, summarize recent production errors, or pull basic Sentry health data via the Sentry CLI; perform read-only queries using the `sentry` command.
Also in 4 projects that use this
ninehillsSkillhunt
Finds root cause before applying fixes for errors, crashes, regressions, failing tests, broken behavior, and screenshot-reported defects. Use when users report in any language errors, crashes, broken behavior, regressions, failing tests, screenshot evidence, or something that used to work and now fails. Not for code review or new features.
Also in 3 projects that use this
scottconverseSkillbuilder
Builder agent for the product development pipeline. Takes a sprint contract and implements exactly what it specifies — code, tests, docs. The Builder never declares work 'done' — only 'ready for review.' Only the Evaluator can declare done.
Also in 3 projects that use this
jaydubya818Skillhow
Use for runtime, ownership, layering, code-walkthrough, and placement questions.
Also in 4 projects that use this
vbrevikSkillwork
Use when the user says 'plan', 'todo', 'copy plan', 'append plan', 'resume plan', 'priorities', or 'what's next'.
Also in 3 projects that use this
cmpnd-aiSkilltmux
Instructions for using tmux to spawn multiple processes, inspect them, and capture their output. Useful for running servers or long-running tasks in the background.
Also in 3 projects that use this
Other versions24 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 24
- JetBrains/thinkrail★ 8.5ksame name
- mitsuhiko/agent-commands★ 3.2ksame name
- mitsuhiko/agent-stuff★ 3.2ksame name
- diodeinc/pcb★ 534same name
- ngmeyer/librarian-mcp★ 29same name
- roerohan/skills★ 29same name
- ivanrvpereira/.agents★ 19same name
- philippe-desplats/second-brain★ 8same name
- therealtinhtute/mono-harness★ 5same name
- tinhtute/monoharness★ 5same name
14 more not listed
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 repository28 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/adr/AGENTS.mdAGENTS.md
- skills/cli/AGENTS.mdAGENTS.md
- skills/concise-decisions/AGENTS.mdAGENTS.md
- skills/gooddocs/AGENTS.mdAGENTS.md
- skills/librarian/AGENTS.mdAGENTS.md
- skills/mermaidjs-diagrams/scripts/AGENTS.mdAGENTS.md
- skills/richdocs/AGENTS.mdAGENTS.md
- tools/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- skills/adr/CLAUDE.mdCLAUDE.md
- skills/cli/CLAUDE.mdCLAUDE.md
- skills/concise-decisions/CLAUDE.mdCLAUDE.md
- skills/gooddocs/CLAUDE.mdCLAUDE.md
- skills/librarian/CLAUDE.mdCLAUDE.md
- skills/mermaidjs-diagrams/scripts/CLAUDE.mdCLAUDE.md
- skills/richdocs/CLAUDE.mdCLAUDE.md
- tools/CLAUDE.mdCLAUDE.md
- adrSkill
- agnosticSkill
- ccw-setupSkill
- cliSkill
- concise-decisionsSkill
- gooddocsSkill
- mermaidjs-diagramsSkill
- richdocsSkill
- snr-prSkill
- tickety-booSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. 0 are common, 8 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 24 edited versions we read keep these.
8
Distinctive
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
- could be automatic: a setting could enforce it
- Distinctive: line 32
Treat as already-decided; do not re-litigate.
- Distinctive: line 41
Read-only: no file is created, moved, or renamed.
- Distinctive: line 56
If present, its Dialect lines and Layout map are the oracle.
- Distinctive: line 148
Never reword cargo in transit: if a moved section looks wrong or stale, flag it for a content-quality pass.
- Distinctive: line 155
Every moved/renamed path resolves from every inbound link (grep the old path returns only stubs/history).
- Distinctive: line 157
No file was lost (git status shows renames, not deletions).
- Very specific: line 162
Read resources/conventions_template.md and resources/flavours.md.
- Distinctive: line 184
Read resources/structured_siblings.md first: it holds the two arrangements, the adoption triggers, the output shape, and the gotchas.
- Very specific: line 189
Default to indexed-markdown: it changes nothing about how anyone authors, and it is reversible by deleting the artifacts.
- Very specific: line 198
Verify across the whole corpus, not a sample: Every document must pass --check.
- Very specific: line 202
Record the dialect: Add the arrangement, the generated-path glob, and the regeneration command to docs/CONVENTIONS.md so later audits treat …
- Very specific: line 208
Never judge content: No finding may be "this is stale/wrong/verbose".
- Distinctive: line 209
Loss-free or not at all: Every operation is reversible via git and leaves no dangling inbound link.
“Common” is measured: kept by at least 6 in 10 of the 24 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Librarian
Shelves the repository's documentation: the right documents exist, carry the right names, live in the right locations, and cross-link as required. Content is cargo: the librarian moves it, extracts it, and renames its containers, but never rewrites, fact-checks, or restyles it. Whether a doc is true, current, or well written is out of scope by design. Other skills own content quality, and they run independently of this one.
Resources (read on first use):
- resources/baseline.md: the universal compliance baseline (required document set, sibling/link obligations, canonical locations, docs/ taxonomy defaults, agent-file and naming rules).
- resources/misplacement_smells.md: the detection catalog of whole-document smells (M1-M10) and partial within-file smells (P1-P8), with severities and fixes. Load during audit.
- resources/conventions_template.md: the docs/CONVENTIONS.md template + bootstrapping guidance. Load for init, and during audit when the repo lacks a conventions file.
- resources/flavours.md: the named convention presets (minimal / standard / rigorous) and the graduation triggers for scale-up elements. Load for init, and during audit to check whether the repo has outgrown its declared flavour.
- resources/glossary_template.md: the preferred shape of GLOSSARY.md (four-line intro, relationship diagram, one alphabetical H2 per Title Case term) and its structural findings. Load when GLOSSARY.md is created or audited.
- resources/coding_standards_template.md: the preferred shape of CODING_STANDARDS.md, its seven baseline tenets and its structural findings. Load when CODING_STANDARDS.md is created or audited.
- resources/structured_siblings.md: the machine-readable layout in general. It covers authored-YAML records with generated markdown, or generated YAML indexes beside authored markdown, plus the adoption triggers and verification gate. Load for index mode, and during audit only when the repo already has generated siblings.
- resources/evidence.md: research citations and counter-evidence behind the baseline (dated; check freshness before extending doctrine).
resources/learned/(if present): prior user adjudications on placement rulings. Treat as already-decided; do not re-litigate.
The ADR surface is one document of the core set, and this skill only checks that it exists, sits where the dialect says, and is linked.
What happens inside it (record shape, setup, layout migration, the okf-yaml convention, compliance) belongs to the adr skill.
Point at /adr setup for a missing surface and /adr audit for one that may not comply; never load that skill's files.
Mode selection
audit(default, bare/librarian): discover the dialect, inventory, report a shelving plan. Read-only: no file is created, moved, or renamed.apply: execute a shelving plan (from this session's audit, or a plan the user supplies/edits). Mutating; every operation is loss-free.init: generatedocs/CONVENTIONS.mddescribing the repo's existing dialect and wire the root AGENTS.md reference to it.index: curate machine-readable YAML siblings for a document set: generate them, verify the round trip, and record the arrangement as a dialect line. Mutating; generated files only. It indexes markdown in place without changing how anyone authors. Asked forindex okf-yaml(orokf-yml), say that convention belongs to/adr migrate okf-yamland stop.- A path argument scopes audit/apply to that subtree (monorepo package case); the dialect is still resolved from the repo root downward.
Step 0: Discover the dialect (every mode)
Compliance is judged against an authority ladder; higher rungs win:
- Declared dialect:
docs/CONVENTIONS.md(or a file the root AGENTS.md names in that role). If present, its Dialect lines and Layout map are the oracle; the baseline fills only what it leaves unstated. - Observed dialect: strong existing conventions the repo already follows consistently (an established
adrs/tree, an existing docs taxonomy, scoped ADR logs, a dated-filename habit). Consistency is the test: a pattern followed in ≥3 places is a convention, one file is not. - Universal baseline: resources/baseline.md.
State which rung answered each question.
Never impose the baseline over a declared or consistently-observed choice.
For example, a repo on single-file ADRs.md is compliant even though the baseline prefers file-per-decision at scale.
Migrating layouts is a recommendation for the user, not a finding.
Where the repo is internally inconsistent (two ADR layouts, three naming styles), the majority pattern is the dialect and the minority files are findings.
The agent-file role: AGENTS.md is the canonical agent file and holds every instruction.
Beside each one sits a CLAUDE.md whose entire content is the single line @AGENTS.md, so Claude Code imports the canonical file.
Detect CLAUDE.md, AGENTS.md or AGENT.md as evidence of the role.
Each of these is smell M3:
- a
CLAUDE.mdcarrying anything beyond the import line, - a symlink,
- an agent file with no
AGENTS.md.
Audit mode
1. Inventory
Glob **/*.md plus the extensionless canonicals (LICENSE, CODEOWNERS), skipping vendored/generated/node_modules/build output.
Record per doc: path, name-style, which charter it apparently serves, inbound links (grep its path and anchors), and whether any hub references it.
Build the charter table first: one line per existing doc, from the dialect's layout map or inferred from baseline roles.
Misplacement is judged against charters, never taste.
2. Check existence and links
Against the resolved dialect + baseline §1-§2:
- Required set present? (README, CONTRIBUTING, CODING_STANDARDS.md, AGENTS.md + CLAUDE.md stub, ADR surface, GLOSSARY.md; dialect-required extras.)
- ADR surface present?
A missing one is a 🔴 finding whose operation is
/adr setup. Its internal compliance is never judged here: the plan carries one 🟣 line recommending/adr audit. - GLOSSARY.md structurally complete? Judge against the finding table in resources/glossary_template.md, never a definition's accuracy.
- CODING_STANDARDS.md carries every baseline tenet, mapped for every language the repo ships? Judge against the finding table in resources/coding_standards_template.md, never whether the code complies. A named convention is rung 1 or 2 evidence, so its rules displace the generic template, never the reverse.
- Required cross-links present?
- AGENTS.md → ADR surface, with a check-before-you-ask line.
- AGENTS.md → GLOSSARY.md, with both standing instructions: canonical terms for all naming, and new domain terms added in the same change.
- Root AGENTS.md → CONVENTIONS.md when it exists.
- README → CONTRIBUTING.
- CONTRIBUTING and AGENTS.md → CODING_STANDARDS.md.
- Locations recognised? (health-file precedence, baseline §3.)
- Flavour still fits? Compare observed scale against the declared flavour's graduation triggers (resources/flavours.md). Exceeded triggers become a Graduation section of the plan. They are 🟣 recommendations, applied only on user acceptance, never findings.
3. Detect misplacement
Apply resources/misplacement_smells.md: whole-document smells M1-M10 via the inventory; partial smells P1-P8 by reading each substantial doc's sections and asking which charter each serves. For large repos, fan out read-only subagents, one per directory or doc cluster. Each returns: finding → smell id → evidence (path / section heading + first line) → proposed move → confidence. A section that plausibly serves two charters is reported with both candidates and a recommendation: uncertain is a question, not a move.
4. The shelving plan
## Librarian audit: <N> docs · <E> existence gaps · <W> misfiled docs · <S> misfiled sections
Dialect authority: <declared | observed | baseline> (per question where mixed)
| # | Finding | Smell | Evidence | Operation | Severity |
|---|---------|-------|----------|-----------|----------|
| 1 | CONTRIBUTING.md missing | M1 | required set | create stub + README link | 🔴 |
| 2 | Release process inside README §Deploy | P1 | README.md#deploy | extract → docs/how-to/release.md, leave link | 🟡 |Order 🔴 → 🟡 → 🟣. Each row's Operation is one of: create-stub / move / rename / extract / merge / link / symlink. Offer:
- apply all,
- apply 🔴 only,
- report only.
Findings the user rejects are recorded in
resources/learned/adjudications.md(create on first use) so later audits honour the ruling.
Apply mode
Execute the plan mechanically, one numbered finding per commit-sized step:
- Moves/renames preserve history:
git mv(never delete+create). - Rewrite every inbound reference: grep the old path and old anchors repo-wide (markdown links, agent-file pointers, code comments, configs); update all. For externally-linked docs (published READMEs), leave a one-line redirect stub at the old path; internal-only docs need no stub.
- Extracts are verbatim: the section moves unchanged, though its heading level may be adjusted to fit the target. The source keeps a one-line link where the section was. Never reword cargo in transit: if a moved section looks wrong or stale, flag it for a content-quality pass; do not fix it here.
- Created stubs are minimal: title, one-sentence charter, the required cross-links, and an explicit
<!-- librarian stub: content pending -->marker. Authoring real content is out of scope. The ADR surface is never stubbed here: its row's operation is/adr setup, which writes the surface with its template. - ADR files are not moved here: renumbering, layout migration and reformatting records are
/adr migrateoperations. A whole surface moving to a new location is still a librarian move, and its ids and citations travel unchanged. - Verify before done:
- Every moved/renamed path resolves from every inbound link (grep the old path returns only stubs/history).
- Required cross-links exist.
- No file was lost (
git statusshows renames, not deletions). - Any table of contents in a touched file is regenerated.
Init mode
Read resources/conventions_template.md and resources/flavours.md.
With a flavour argument (init standard), the preset supplies the starting dialect.
Without one, apply the flavour-selection questions to the repo's evident use case, and say which flavour was chosen and why.
Then infer each Dialect line from what the repo already does.
This is rung 2 evidence: observed conventions outrank the preset.
Fill remaining gaps from the flavour, marking those lines as defaulted so the maintainer can veto.
Build the Layout map covering every doc-bearing path plus rows for missing required docs.
Wire the root AGENTS.md references (CONVENTIONS.md, GLOSSARY.md obligations, CODING_STANDARDS.md, and the ADR surface when one exists) in the same change, and write its sibling CLAUDE.md as exactly @AGENTS.md.
An existing full CLAUDE.md moves into AGENTS.md first (git mv), then the stub takes its place.
A missing GLOSSARY.md is written from resources/glossary_template.md with its seed terms.
A missing CODING_STANDARDS.md is written from resources/coding_standards_template.md.
It carries all seven baseline tenets, then one section per language mapping each tenet to its enforcing tool or config.
Map each tenet to the tools the repo already uses.
A tenet with no enforcing tool yet is written as a gap for the maintainer to fill, never guessed.
Coding rules already sitting in CONTRIBUTING or AGENTS.md move into it (smell P8).
A missing ADR surface is not created here.
Record the chosen layout as a Dialect line, and end the report by pointing at /adr setup to create the surface in that layout.
Show the draft before writing when running interactively.
Index mode
Curates machine-readable siblings for a document set. Read resources/structured_siblings.md first: it holds the two arrangements, the adoption triggers, the output shape, and the gotchas.
- Check a trigger fired. Adoption needs an observable consumer: a script, gate, or derived view that reads the records. Absent one, report that plain markdown is correct and stop; more structure is not a finding.
- Pick the arrangement and say which. Authored-YAML (records become data, markdown is generated) or indexed-markdown (markdown stays authoritative, YAML is generated beside it).
Default to indexed-markdown: it changes nothing about how anyone authors, and it is reversible by deleting the artifacts.
Authored-YAML decision records are the
okf-yamlconvention, which belongs to/adr migrate okf-yaml, not to this mode. Generate. For indexed-markdown, one index per document:
bun run .claude/skills/librarian/scripts/md2yaml.ts <doc.md> --out <doc.yml>--jsonemits the same index forjqinstead ofyq;--checkreconstructs the markdown and exits non-zero on any drift.- Verify across the whole corpus, not a sample. Every document must pass
--check. A document that fails is reported with the construct that broke it; never "fix" the document to suit the tool. - Wire the regeneration. A make target, and a banner in each generated file naming its generator. An index regenerated by a remembered command is a stale index.
- Record the dialect. Add the arrangement, the generated-path glob, and the regeneration command to
docs/CONVENTIONS.mdso later audits treat the artifacts as generated rather than as misfiled documents.
Generated siblings are build artifacts: exempt from naming and placement smells, never findings, and never hand-edited.
Cross-cutting rules
- Never judge content. No finding may be "this is stale/wrong/verbose"; the only verdicts are missing, misnamed, misfiled, unlinked, duplicated.
- Loss-free or not at all. Every operation is reversible via git and leaves no dangling inbound link; deletion is never an operation (merge leaves a link behind).
- Dialect beats baseline. Declared beats observed. User beats all. Prior adjudications in
resources/learned/are already-decided. - Audit is read-only; only apply, init and index mutate.
Init writes only missing core documents and the reference lines that wire them.
The core documents init writes are CONVENTIONS.md, the AGENTS.md + CLAUDE.md pair, GLOSSARY.md and CODING_STANDARDS.md.
The ADR surface is also core, but
/adr setupwrites it. Index writes only generated artifacts and never edits a source document to suit the generator. - Respect the repo's file-size conventions when extracting (a target file near its size ceiling gets a new sibling, not a forced append).
- Report which authority rung answered each contested question so the user can audit the librarian's own reasoning.
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.

