Guide ingest
Purpose
Turn raw external research into a durable repo guide: a synthetic library
entry that captures what the internet says about a domain (the “afternoon of
Googling” artifact from create-guide).
kokoro-coreml runs Kokoro TTS on Apple Silicon via Core ML / ANE. Guides stock
external mechanism knowledge (Core ML conversion, ANE scheduling, Metal/MPS,
iSTFT, Swift/Core ML glue). They are not campaign go/no-go decisions.
Ingest must:
- Match this repository’s markdown conventions
(
README/Guides/content/markdown-authoring-guide.md).
- Correct documented library/API facts when Context7 (or other primary
docs) contradict the draft.
- Annotate contradictions from firsthand local knowledge — do not silently
rewrite the guide into a campaign memo, and do not delete useful external
synthesis just because it is unproven.
- Sit correctly in the bidirectional web of
README/Guides/ and
README/Notes/.
A guide remains an external-knowledge artifact, not a dial-a-friend verdict
for the current plan. Campaign go/no-go, measured latency/quality tables, and “do not launch
arm X” decisions belong in README/Notes/ (link them); keep the guide reusable
as domain synthesis.
Use When
- Importing deep-research (or similar) output into
README/Guides/....
- The user invokes guide-ingest, research-to-guide, or the same workflow
in natural language.
- A new guide needs outbound links to notes/guides and inbound links from existing docs.
Do Not Use When
- The task is only a small markdown typo fix (use
markdown).
- The task is only where to put a note (use
write-notes).
- The work is inline code documentation (use
documentation).
- There is no external raw artifact — stop and write a note instead of inventing
a guide from local reasoning alone.
Prerequisites
- Context7 MCP available for
resolve-library-id / query-docs (or the
repo’s equivalent Context7 tools). Read the tool schema in the MCP
descriptors before calling tools.
- Raw source: path to
raw-report.md (or equivalent browser-downloaded export).
Procedure
0. Provenance gate
- Confirm an external raw source path exists (usually
llm-workflows/outputs/create-guide/**/raw-report.md).
- Record that path (and SHA-256 when practical) near the top of the ingested
guide.
- If there is no raw external artifact, stop — use
write-notes, do
not mint a guide from agent synthesis alone.
1. Normalize to proper markdown
- Read the
markdown skill and the guide index
README/Guides/content/markdown-authoring-guide.md
(and README/Templates/guide-template.md when adding a new file)
for repo tone and structure.
- Produce guide-shaped markdown:
- real markdown links, not bare URLs
- blank lines around headings and lists
- language-tagged fences where applicable
- single trailing newline; no unnecessary HTML
- for messy exports: unescape punctuation, strip data-URI images / broken
image blocks, and repair Swift/code fences without inventing missing facts
- Add a short top-of-file purpose blurb if the template or sibling guides use
one; match the tone of nearby guides in the same folder.
- Strip or refuse campaign-advice framing from the draft (“you should kill this
arm”, “no-go for your bakeoff”) when it is clearly advice to this repo’s
plan. Preserve the underlying external mechanism, ratios, failure modes, and
recipes. Put the campaign decision in a note and link it.
2. Correct vs annotate (do not over-prune)
Guides are allowed to include plausible, unproven, “worth trying” material
from the public internet. Ingest is not a demand for 100% validation before a
claim may appear.
| Situation |
Action |
| Context7 / official docs contradict a library API, flag, default, or deprecation |
Correct the guide to match current docs |
| Obvious hallucination (invented API, fake flag, fabricated citation) |
Remove or rewrite; note the rejection briefly if useful |
| Community heuristic / paper recipe / “people report X” with no local proof |
Keep, labeled as community / secondary / worth-trying |
| Firsthand local measurement or pinned-stack run contradicts the draft |
Annotate in-place (correction callout + link to the note/receipt); do not delete the external claim without saying why |
| Claim outside Context7 (Core ML / ANE scheduling, Metal, Swift glue) |
Prefer primary docs / man pages / source pins when checking; else keep labeled, do not fake “verified” |
Procedure:
- Extract verifiable library/API claims and check them with Context7
(resolve library ID, then query docs). Prefer current official behavior for
those factual corrections.
- Scan
README/Notes/ and related guides for firsthand contradictions
(measured runs, pinned-stack corrections). Add explicit callouts such as
“Local evidence (link): … contradicts the draft’s claim that …”.
- Do not gut sections solely because they lack a Context7 hit or a local
A/B test. Unverified ≠ worthless for a synthetic external library.
- Do not rewrite the guide into a qualification-campaign status document
during ingest. Link status notes; keep the guide domain-scoped.
3. Add outbound links (guides and notes)
- While reading sections, identify concepts that already have a home in
README/Guides/ or README/Notes/.
- Add inline markdown links on the first strong mention in each section (or
a compact “Related Documentation” / “See also” list if inline would clutter).
Use repo-relative paths from the new guide file.
- Prefer linking to one canonical guide per topic rather than duplicating
long explanations.
- When local campaign decisions exist, link them as related notes, not as
the guide’s thesis.
4. Add inbound links (corpus updates)
Goal: related docs point back to the new guide so agents discover it from
both directions.
- Discover candidates: search
README/Guides/ and README/Notes/ for
overlapping keywords, library names, and headings (e.g. ripgrep). Include files that already link to adjacent topics.
- Edit sparingly: add a link in “Related”, “See also”, or the most
relevant paragraph—minimal diff, no drive-by rewrites.
- If a high-level notes file covers the same subsystem, add a short bullet or
sentence there with a link to the new guide (see
write-notes for
consolidation habits).
- Update
README/Wiki/canonical-source-coverage.md
(and README/Wiki/README.md when needed) when adding a new guide file.
5. Close the loop
- Rely on the
markdown skill for structure; run pytest only if the change overlaps Python/runtime code.
- Give the user a short summary:
- provenance path recorded
- API/docs corrections (Context7 or primary)
- firsthand contradiction annotations (and note links)
- what was kept as unlabeled or labeled “worth trying”
- inbound link files touched
Handoff Rules
| Situation |
Hand off to |
| Repo markdown rules, lint, structure |
markdown |
| Campaign decision / measurement write-up |
write-notes |
| Docstrings / inline code documentation |
documentation |
| Need a new external synthesis run |
create-guide |
| Advice / second opinion on what to do next |
second-opinion |
References
1---2name: guide-ingest3description: Ingests offline deep-research exports into README guides for kokoro-coreml: cleans markdown, corrects library/API claims with Context7 when docs contradict the draft, annotates firsthand repo contradictions without stripping useful “worth trying” external synthesis, and adds bidirectional cross-links in README/Guides and README/Notes. Use for guide-ingest, research-to-guide, or corpus linking of a new guide from Deep Research / browser export.4---56# Guide ingest78## Purpose910Turn raw external research into a **durable repo guide**: a synthetic library11entry that captures what the internet says about a domain (the “afternoon of12Googling” artifact from **create-guide**).1314`kokoro-coreml` runs Kokoro TTS on Apple Silicon via Core ML / ANE. Guides stock15external mechanism knowledge (Core ML conversion, ANE scheduling, Metal/MPS,16iSTFT, Swift/Core ML glue). They are not campaign go/no-go decisions.1718Ingest must:19201. Match this repository’s markdown conventions21 ([`README/Guides/content/markdown-authoring-guide.md`](../../../README/Guides/content/markdown-authoring-guide.md)).222. **Correct** documented library/API facts when Context7 (or other primary23 docs) contradict the draft.243. **Annotate** contradictions from firsthand local knowledge — do not silently25 rewrite the guide into a campaign memo, and do not delete useful external26 synthesis just because it is unproven.274. Sit correctly in the **bidirectional** web of `README/Guides/` and28 `README/Notes/`.2930A guide remains an **external-knowledge artifact**, not a dial-a-friend verdict31for the current plan. Campaign go/no-go, measured latency/quality tables, and “do not launch32arm X” decisions belong in `README/Notes/` (link them); keep the guide reusable33as domain synthesis.3435## Use When3637- Importing deep-research (or similar) output into `README/Guides/...`.38- The user invokes **guide-ingest**, **research-to-guide**, or the same workflow39 in natural language.40- A new guide needs **outbound** links to notes/guides and **inbound** links from existing docs.4142## Do Not Use When4344- The task is only a small markdown typo fix (use **`markdown`**).45- The task is only where to put a note (use **`write-notes`**).46- The work is inline code documentation (use **`documentation`**).47- There is no external raw artifact — stop and write a note instead of inventing48 a guide from local reasoning alone.4950## Prerequisites5152- **Context7 MCP** available for `resolve-library-id` / `query-docs` (or the53 repo’s equivalent Context7 tools). Read the tool schema in the MCP54 descriptors **before** calling tools.55- Raw source: path to `raw-report.md` (or equivalent browser-downloaded export).5657## Procedure5859### 0. Provenance gate60611. Confirm an external raw source path exists (usually62 `llm-workflows/outputs/create-guide/**/raw-report.md`).632. Record that path (and SHA-256 when practical) near the top of the ingested64 guide.653. If there is no raw external artifact, **stop** — use **`write-notes`**, do66 not mint a guide from agent synthesis alone.6768### 1. Normalize to proper markdown69701. Read the **`markdown`** skill and the guide index71 [`README/Guides/content/markdown-authoring-guide.md`](../../../README/Guides/content/markdown-authoring-guide.md)72 (and [`README/Templates/guide-template.md`](../../../README/Templates/guide-template.md) when adding a new file)73 for repo tone and structure.742. Produce guide-shaped markdown:75 - real markdown links, not bare URLs76 - blank lines around headings and lists77 - language-tagged fences where applicable78 - single trailing newline; no unnecessary HTML79 - for messy exports: unescape punctuation, strip data-URI images / broken80 image blocks, and repair Swift/code fences without inventing missing facts813. Add a short top-of-file purpose blurb if the template or sibling guides use82 one; match the tone of nearby guides in the same folder.834. Strip or refuse campaign-advice framing from the draft (“you should kill this84 arm”, “no-go for your bakeoff”) when it is clearly advice to *this* repo’s85 plan. Preserve the underlying external mechanism, ratios, failure modes, and86 recipes. Put the campaign decision in a note and link it.8788### 2. Correct vs annotate (do not over-prune)8990Guides are allowed to include **plausible, unproven, “worth trying”** material91from the public internet. Ingest is not a demand for 100% validation before a92claim may appear.9394| Situation | Action |95| --- | --- |96| Context7 / official docs contradict a library API, flag, default, or deprecation | **Correct** the guide to match current docs |97| Obvious hallucination (invented API, fake flag, fabricated citation) | **Remove or rewrite**; note the rejection briefly if useful |98| Community heuristic / paper recipe / “people report X” with no local proof | **Keep**, labeled as community / secondary / worth-trying |99| Firsthand local measurement or pinned-stack run **contradicts** the draft | **Annotate** in-place (correction callout + link to the note/receipt); do **not** delete the external claim without saying why |100| Claim outside Context7 (Core ML / ANE scheduling, Metal, Swift glue) | Prefer primary docs / man pages / source pins when checking; else keep labeled, do not fake “verified” |101102Procedure:1031041. Extract **verifiable** library/API claims and check them with Context7105 (resolve library ID, then query docs). Prefer current official behavior for106 those factual corrections.1072. Scan `README/Notes/` and related guides for **firsthand** contradictions108 (measured runs, pinned-stack corrections). Add explicit callouts such as109 “Local evidence (link): … contradicts the draft’s claim that …”.1103. Do **not** gut sections solely because they lack a Context7 hit or a local111 A/B test. Unverified ≠ worthless for a synthetic external library.1124. Do **not** rewrite the guide into a qualification-campaign status document113 during ingest. Link status notes; keep the guide domain-scoped.114115### 3. Add outbound links (guides and notes)1161171. While reading sections, identify concepts that already have a home in118 **`README/Guides/`** or **`README/Notes/`**.1192. Add **inline** markdown links on the first strong mention in each section (or120 a compact “Related Documentation” / “See also” list if inline would clutter).121 Use **repo-relative** paths from the new guide file.1223. Prefer linking to **one canonical** guide per topic rather than duplicating123 long explanations.1244. When local campaign decisions exist, link them as **related notes**, not as125 the guide’s thesis.126127### 4. Add inbound links (corpus updates)128129Goal: related docs **point back** to the new guide so agents discover it from130both directions.1311321. **Discover candidates**: search `README/Guides/` and `README/Notes/` for133 overlapping keywords, library names, and headings (e.g. ripgrep). Include files that already link to adjacent topics.1342. **Edit sparingly**: add a link in “Related”, “See also”, or the most135 relevant paragraph—**minimal** diff, no drive-by rewrites.1363. If a high-level notes file covers the same subsystem, add a short bullet or137 sentence there with a link to the new guide (see **`write-notes`** for138 consolidation habits).1394. Update [`README/Wiki/canonical-source-coverage.md`](../../../README/Wiki/canonical-source-coverage.md)140 (and [`README/Wiki/README.md`](../../../README/Wiki/README.md) when needed) when adding a new guide file.141142### 5. Close the loop1431441. Rely on the **`markdown`** skill for structure; run **`pytest`** only if the change overlaps Python/runtime code.1452. Give the user a **short summary**:146 - provenance path recorded147 - API/docs corrections (Context7 or primary)148 - firsthand contradiction annotations (and note links)149 - what was kept as unlabeled or labeled “worth trying”150 - inbound link files touched151152## Handoff Rules153154| Situation | Hand off to |155|-----------|-------------|156| Repo markdown rules, lint, structure | **`markdown`** |157| Campaign decision / measurement write-up | **`write-notes`** |158| Docstrings / inline code documentation | **`documentation`** |159| Need a new external synthesis run | **`create-guide`** |160| Advice / second opinion on what to do next | **`second-opinion`** |161162## References163164- [Markdown authoring guide](../../../README/Guides/content/markdown-authoring-guide.md)165- [Notes index (`README/Notes/README.md`)](../../../README/Notes/README.md)166- Sibling skills: [`create-guide`](../create-guide/SKILL.md), [`second-opinion`](../second-opinion/SKILL.md)