agentleFS
jpeakaijpeakai/skills/skills/librarian/SKILL.md

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

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.
  • OpenAISkill

    sentry

    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

  • ninehillsSkill

    hunt

    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

  • scottconverseSkill

    builder

    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

  • jaydubya818Skill

    how

    Use for runtime, ownership, layering, code-walkthrough, and placement questions.

    Also in 4 projects that use this

  • vbrevikSkill

    work

    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-aiSkill

    tmux

    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

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
  1. Distinctive:

    Treat as already-decided; do not re-litigate.

    line 32
  2. Distinctive:

    Read-only: no file is created, moved, or renamed.

    line 41
  3. Distinctive:

    If present, its Dialect lines and Layout map are the oracle.

    line 56
  4. Distinctive:

    Never reword cargo in transit: if a moved section looks wrong or stale, flag it for a content-quality pass.

    line 148
  5. Distinctive:

    Every moved/renamed path resolves from every inbound link (grep the old path returns only stubs/history).

    line 155
  6. Distinctive:

    No file was lost (git status shows renames, not deletions).

    line 157
  7. Very specific:

    Read resources/conventions_template.md and resources/flavours.md.

    line 162
  8. Distinctive:

    Read resources/structured_siblings.md first: it holds the two arrangements, the adoption triggers, the output shape, and the gotchas.

    line 184
  9. Very specific:

    Default to indexed-markdown: it changes nothing about how anyone authors, and it is reversible by deleting the artifacts.

    line 189
  10. Very specific:

    Verify across the whole corpus, not a sample: Every document must pass --check.

    line 198
  11. Very specific:

    Record the dialect: Add the arrangement, the generated-path glob, and the regeneration command to docs/CONVENTIONS.md so later audits treat …

    line 202
  12. Very specific:

    Never judge content: No finding may be "this is stale/wrong/verbose".

    line 208
  13. Distinctive:

    Loss-free or not at all: Every operation is reversible via git and leaves no dangling inbound link.

    line 209

“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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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: generate docs/CONVENTIONS.md describing 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 for index okf-yaml (or okf-yml), say that convention belongs to /adr migrate okf-yaml and 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:

  1. 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.
  2. 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.
  3. 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.md carrying 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:

  1. Moves/renames preserve history: git mv (never delete+create).
  2. 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.
  3. 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.
  4. 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.
  5. ADR files are not moved here: renumbering, layout migration and reformatting records are /adr migrate operations. A whole surface moving to a new location is still a librarian move, and its ids and citations travel unchanged.
  6. 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 status shows 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.

  1. 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.
  2. 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-yaml convention, which belongs to /adr migrate okf-yaml, not to this mode.
  3. Generate. For indexed-markdown, one index per document:

    bun run .claude/skills/librarian/scripts/md2yaml.ts <doc.md> --out <doc.yml>

    --json emits the same index for jq instead of yq; --check reconstructs the markdown and exits non-zero on any drift.

  4. 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.
  5. 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.
  6. Record the dialect. Add the arrangement, the generated-path glob, and the regeneration command to docs/CONVENTIONS.md so 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 setup writes 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.