agentleFS
hathachhathach/agentrc/skills/read-doc/SKILL.md

read-doc

Skill2 starsChanged 24 days agoMITView on GitHub

Use for primary-source hardware/protocol facts (datasheet, reference manual/TRM, errata, register/bitfield, memory map, pinout, schematic PDF, USB spec) before stating, changing or reviewing what depends on them, or to read, open or look up a manual, book, PDF or EPUB in the user's Calibre library. EAGLE/KiCad wiring is `read-pcb`'s.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 4 are distinctive, and 1 is 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.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every script: 0 a result, 1 looked and found nothing, 2 bad usage, 3 the library, a PDF or the index was unavailable.

    line 25
  2. Distinctive:

    Never read a manual hunting for one register:

    line 60
  3. Very specific:

    Read the pages find named, usually one to three.

    line 75
  4. Distinctive:

    When a lookup decides whether a claim or a proposed change holds, such as a review finding, record one outcome per claim:

    line 93
  5. Distinctive:

    undocumented in the checked sources: after searching and reading the relevant pages of the base document, the errata and any applicable …

    line 100

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

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

Read Doc

For hardware or protocol facts read the doc in the Calibre library (~/Documents/calibre-library, or CALIBRE_LIBRARY), not memory or the web. The scripts sit under this skill's directory and query the library's metadata.db and page index; never search the library tree, whose names lack the tags part numbers live in.

Hardware-facing agents carry this trigger verbatim in their own prompts:

Whenever a conclusion, hypothesis, review finding, experiment or code change depends on hardware or protocol behaviour (registers and bitfields, access order and side effects, interrupts, DMA or cache, clocks, timing, the USB IP's state machine and FIFO rules, errata, the USB specification), load the read-doc skill and check the base document and the errata of every affected part and variant before treating it as verified.

Exit codes

Every script: 0 a result, 1 looked and found nothing, 2 bad usage, 3 the library, a PDF or the index was unavailable. Only 1 is evidence; on 2 fix the invocation and retry; on 3 report what the message names as unavailable, never broaden the keywords.

An absent or unmounted library is exit 3 naming its metadata.db: a non-hardware question then falls back to normal sources silently, while a hardware or protocol claim stays unverified, reported unavailable, never settled from memory, the web or a filesystem search. Code and observed behaviour are not the documented semantics.

Find the book

Keywords: the skill arguments, else the part number, peripheral or spec name. search.py ANDs them over all metadata and prints book ids, a count per document kind, and the base documentation first:

python3 <skill dir>/scripts/search.py errata RT1064            # AND (default)
python3 <skill dir>/scripts/search.py RT1060 RT1064 --any
python3 <skill dir>/scripts/search.py --kind reference-manual stm32h7  # none of that kind: names the kinds found

Several matches → narrow with --kind or a keyword; genuinely ambiguous → ask. An erratum overrides the base document, so check a register claim against both; the count line says whether errata exist. Nothing → retry with fewer keywords (the part number alone; "datasheet" and "manual" are rarely in the metadata). Still nothing → report the document missing, never answer from memory.

A Chinese edition (-CN after the document ID) sits beside some English ones: read the English, and open the Chinese only for what the English lacks; it is often a revision ahead.

Find the page

Never read a manual hunting for one register:

python3 <skill dir>/scripts/locate.py find --book 2125 --term SIE_CTRL

It prints physical PDF page numbers with context lines, a definition ranked above a mention. The ranking is a heuristic: when the first excerpts are cross-references, continue with --offset N before concluding the term is undefined. --context, --limit and --max-chars bound the output. Exit 1 means no page's extracted text holds it; a schematic, scan or figure has none, so open the PDF pages of a graphical document first.

Read

Read the pages find named, usually one to three. Tables, bitfields, access types, register layouts, figures and footnotes do not survive extraction: for a claim about one, errata included, go from find straight to the PDF page. For prose (a description, an erratum's text, a sequence) use page (A or A-B as find numbers them), not pdftotext or search.py --path; its --max-chars default is 10000, about two dense pages:

python3 <skill dir>/scripts/locate.py page --book 2125 --pages 403-404

Exit 1 is a page out of range or without text. Text locates evidence; the PDF page is the authority (page's last line names the path and pages to read).

Cite book id, title, page and the lookup <id> logged ids from stderr.

Reporting a claim

When a lookup decides whether a claim or a proposed change holds, such as a review finding, record one outcome per claim:

  • verified or refuted: book id, title, revision, section, page and lookup ids, and the reasoning that ties them to the claim. For a proposed change, explain how the source change preserves the cited semantics for every affected variant, or where it breaks them.
  • undocumented in the checked sources: after searching and reading the relevant pages of the base document, the errata and any applicable IP-core documentation of every affected part; name the books, terms and lookup ids, and the premise nothing supports.
  • unavailable: exit 3 or a MISSING file; the attempted command, its diagnostic and the lookup id when one was logged.
  • pending: the lookup did not run or did not finish, an exit 2 not yet corrected and retried included. Never report it as undocumented.

More in REFERENCE.md

  • A (family match), an x in a part name, or a peripheral that is a licensed IP core: "Family names and IP cores".
  • A non-PDF format, a MISSING file, or a PDF with no text layer: "File formats and paths".
  • Pre-extracting the index, nightly builds, Calibre's Check Library: "Building the index".
  • Listing or replaying earlier lookups: "Lookup history".

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.