sheaf-ingest
The product sentence:
Take this folder / repo / knowledge base. Build a typed index. Draw it as a lattice. Leave a structure you can run on the next folder.
That is this skill. A later write-gate is optional.
What you emit (always these four)
| User said | File | What it is |
|---|---|---|
| create a sheaf | index / bound parts |
parts with locators + typed fields + observed links only |
| lattice knowledge base | lattice.json |
drop into stalks-and-sections docs/examples/ |
| reusable structure | domain.package.yaml |
what a part is, shared fields, how links are observed |
| repeatable | STRUCTURE.md |
rebuild command + what was skipped |
Procedure
- Look at the folder. Infer kind: Python code, Markdown wiki, TypeScript monorepo, or mixed. State the assumption in one line.
- Walk parts with locators you can open (
path:symbolorpage#heading). Skipnode_modules,dist,.git, binaries. - Walk overlaps only with evidence:
import/from X import,[text](path),[[page]], a citation key. No complete graph. - Shared fields default to
{path, symbol}for code and{page, title}for markdown. Prose goes in evidence, never in those fields. - Write the four files.
residualMeaningon the lattice is one sentence in the domain ("these two symbols disagree on path"). - Tell the user how to rebuild on a sibling folder using the same
domain.package.yaml.
Speedups if the tooling is present
- Python / Markdown folder in this repo:
PYTHONPATH=src python -m sheaf_port ingest <folder> --out <out-dir> - TypeScript monorepo in stalks-and-sections:
npm run sheaf:ingest -- --job job.jsonStill writedomain.package.yamlhere so the structure is reusable.
If those commands are missing, do the walk with list/read/grep. Do not block the skill on a walker covering Go or Rust.
MUST NOT
- Treat a paragraph, README blob, or embedding as a part
- Invent links so the graph looks connected
- Fill lattice sections with random numbers
- Call the folder "ported"
- Treat teal / energy as permission to write
- Ask the user questions — infer grain and proceed
Done when
- Someone can open two locators and see why an edge exists
- Someone can point
domain.package.yamlat a sibling folder and get the same field names lattice.jsonhas a one-sentenceresidualMeaningin domain EnglishSTRUCTURE.mdlists what was skipped
Honesty
This skill builds the index, the lattice, and the reusable package. It does not refuse writes. That is a later check if they ask for a write gate.