wiki-ingest
When This Skill Activates
- User shares a URL, paste, or local file to capture in the vault.
- The output target is
entities/, concepts/, comparisons/, or queries/.
- A vault is resolvable (see step 0).
Output language
Run skillwiki lang at the start. Generate page-body prose, narrative sections, and --human summaries in the resolved language. Frontmatter keys, file names, schema headers, index/log structural lines, citation markers, and wikilink slugs MUST stay English.
Pre-orientation reads (mandatory before any write)
SCHEMA.md
index.md
- Last 20–30 entries of
log.md
- (Project context only)
projects/{slug}/README.md and last ~5 work-item logs.
Steps (in order — deterministic raw capture and shared publication)
- Resolve vault and language. Run
skillwiki path (fail if NO_VAULT_CONFIGURED) and skillwiki lang. Use the resolved vault path for all writes; use the canonical language for all generated prose.
- Guard. For each URL: run
skillwiki fetch-guard <url>. If exit ≠ 0, STOP and surface the error. Do not retry.
- Fetch. Use
web_fetch (or read local file) under Layer 2 controls (the CLI Layer 2 fetcher applies in tests; in skill runtime use web_fetch directly and treat any error as STOP).
- Portable local-source rule: follow
using-skillwiki → Portable Source References. Do not use source_url: file:///... as the canonical durable reference; prefer commit-pinned GitHub blob/<commit>/<path> when resolvable, else empty source_url plus portable repo-relative prose.
- Stage pasted text as a file source.
skillwiki ingest accepts a readable local source file or HTTP(S) URL; it does not accept literal pasted text. For a paste, stage the exact text in a temporary file outside the vault, then pass its path to the normal command:skillwiki ingest <staged-paste-path> \
--vault <resolved-vault> \
--type <entity|concept|comparison|query> \
--title "<title>" \
--tags "<tag1,tag2>" \
--provenance <research|project>
Record the staged path and exact command inputs before execution. If ingestion or typed-page publication fails, retain the staged source and exact command inputs for retry. Remove the staged file only after skillwiki ingest exits 0 after typed-page publication; confirm the non-dry-run result reports its raw path, typed path, and publisher operation. Do not stage pasted text inside the vault.
- Identity guard. Before writing raw files, ensure the target raw filename/title,
source_url, fetched H1/title, and early body subject agree. If skillwiki ingest reports INGEST_VALIDATION_FAILED with source identity conflict, STOP. Do not fix by renaming after the fact; choose the correct title/source pair or ask the user.
- Sensitive content guard. Before writing or filing any vault page, scan the source and generated body for live credentials, access keys, tokens, passwords, cookies, bearer headers, or private keys. Redact generated prose before writing. If the source itself must remain raw and contains a live secret, STOP instead of preserving it.
- Feature-detect publication. Run
skillwiki page publish --help. If unavailable, fail closed and leave typed output unpublished; update the active SkillWiki CLI/plugin channel first.
- Ingest and publish. Use
skillwiki ingest for deterministic source capture and typed-page publication. The command writes an immutable raw source first and delegates the typed page, taxonomy, index, and structural log entry to the shared page publisher. Supply the resolved vault, type, title, tags, and provenance through the command options.
- Recovery. Never create the final typed page or edit index.md/log.md directly. A raw-only result after publication failure is valid recovery state. Keep the exact command inputs and retry; do not delete or overwrite the raw source.
- Pending-compile path (raw already exists; clipper /
sources pending). Do not run skillwiki ingest again — that would create a second raw object. Interactive sessions only:
skillwiki sources pending [vault]
skillwiki sources compile claim <raw-path> [vault] --reason "<why>" then the same command with --write --approve <token>
- Read the raw; compose unpublished drafts outside the vault
skillwiki page publish each typed page
skillwiki sources compile published <raw-path> [vault] --pages "<typed/a.md,typed/b.md>" --reason "<why>" then --write --approve <token>
- Leave the review
open unless the human resolves it with skillwiki sources review <raw-path> --status accepted|needs-fix|dismissed --reason "<why>"
Goal, satellite, and headless sessions may list pending / compile status / reviews but must not claim or publish compile turns.
Provenance defaults
- Default
provenance: research.
- If cwd is inside
projects/{slug}/, set provenance: project and add provenance_projects: ["[[slug]]"].
Raw Data Locality
Raw ephemeral data (market feeds, logs, transient JSON) must be written to the project local raw/ directory, NOT the cloud-mounted wiki path. See references/raw-data-locality.md for the full pattern.
Quick rule:
- Transient data →
~/projects/{slug}/raw/ (local, git-tracked)
- Compound pages →
~/wiki/projects/{slug}/compound/ (cloud, durable)
Stop conditions
fetch-guard non-zero.
- Fetch timeout / size limit exceeded.
INGEST_VALIDATION_FAILED with source identity conflict.
- Source or generated content contains unredacted live credentials or other authenticating secrets.
skillwiki page publish --help is unavailable.
skillwiki ingest returns nonzero; retain any raw-only result for retry.
- sha256 already exists in vault for the same source.
Forbidden
- Skipping
fetch-guard.
- Creating a final typed page or editing
index.md/log.md directly.
- Modifying any existing file in
raw/.
- Writing raw ephemeral data directly to cloud-mounted wiki paths (
~/wiki/).
- Writing host-local absolute paths as canonical durable source references (see
using-skillwiki → Portable Source References).
- Writing
[[wikilinks]] to pages that don't exist in the vault. Before linking, verify the target exists: check index.md or ls the target directory. If the target doesn't exist yet, use plain text instead of a wikilink.
- Indexing
raw/assets/ binaries with only a .txt sidecar. Write a sibling Markdown note that embeds each file with ![[ ]].
Batch Mode
When the user provides multiple sources (a directory of files, a list of URLs, or a multi-document input):
- Loop per source. Execute steps 1–8 for each source individually, using one
skillwiki ingest command per source.
- Fail fast. If an ingest command returns nonzero, STOP and report the retained raw-only state, if any, with its exact retry inputs.
- Deduplication. Let
skillwiki ingest preserve immutable raw capture and skip sources whose content is already present.
- Progress. After each source completes, report the raw path, typed path or recovery state, and publisher operation ID.
1---2name: wiki-ingest3description: Convert URLs, files, or pasted text into typed-knowledge pages with raw provenance. Supports single and batch mode.4---5# wiki-ingest6## When This Skill Activates7- User shares a URL, paste, or local file to capture in the vault.8- The output target is `entities/`, `concepts/`, `comparisons/`, or `queries/`.9- A vault is resolvable (see step 0).10## Output language11Run `skillwiki lang` at the start. Generate page-body prose, narrative sections, and `--human` summaries in the resolved language. Frontmatter keys, file names, schema headers, index/log structural lines, citation markers, and wikilink slugs MUST stay English.12## Pre-orientation reads (mandatory before any write)131. `SCHEMA.md`142. `index.md`153. Last 20–30 entries of `log.md`164. (Project context only) `projects/{slug}/README.md` and last ~5 work-item logs.17## Steps (in order — deterministic raw capture and shared publication)180. **Resolve vault and language.** Run `skillwiki path` (fail if NO_VAULT_CONFIGURED) and `skillwiki lang`. Use the resolved vault path for all writes; use the canonical language for all generated prose.191. **Guard.** For each URL: run `skillwiki fetch-guard <url>`. If exit ≠ 0, STOP and surface the error. Do not retry.202. **Fetch.** Use `web_fetch` (or read local file) under Layer 2 controls (the CLI Layer 2 fetcher applies in tests; in skill runtime use `web_fetch` directly and treat any error as STOP).21 - **Portable local-source rule:** follow `using-skillwiki` → Portable Source References. Do not use `source_url: file:///...` as the canonical durable reference; prefer commit-pinned GitHub `blob/<commit>/<path>` when resolvable, else empty `source_url` plus portable repo-relative prose.223. **Stage pasted text as a file source.** `skillwiki ingest` accepts a readable local source file or HTTP(S) URL; it does **not** accept literal pasted text. For a paste, stage the exact text in a temporary file outside the vault, then pass its path to the normal command:23 ```bash24 skillwiki ingest <staged-paste-path> \25 --vault <resolved-vault> \26 --type <entity|concept|comparison|query> \27 --title "<title>" \28 --tags "<tag1,tag2>" \29 --provenance <research|project>30 ```31 Record the staged path and exact command inputs before execution. If ingestion or typed-page publication fails, retain the staged source and exact command inputs for retry. Remove the staged file only after `skillwiki ingest` exits 0 after typed-page publication; confirm the non-dry-run result reports its raw path, typed path, and publisher operation. Do not stage pasted text inside the vault.324. **Identity guard.** Before writing raw files, ensure the target raw filename/title, `source_url`, fetched H1/title, and early body subject agree. If `skillwiki ingest` reports `INGEST_VALIDATION_FAILED` with `source identity conflict`, STOP. Do not fix by renaming after the fact; choose the correct title/source pair or ask the user.335. **Sensitive content guard.** Before writing or filing any vault page, scan the source and generated body for live credentials, access keys, tokens, passwords, cookies, bearer headers, or private keys. Redact generated prose before writing. If the source itself must remain raw and contains a live secret, STOP instead of preserving it.346. **Feature-detect publication.** Run `skillwiki page publish --help`. If unavailable, fail closed and leave typed output unpublished; update the active SkillWiki CLI/plugin channel first.357. **Ingest and publish.** Use `skillwiki ingest` for deterministic source capture and typed-page publication. The command writes an immutable raw source first and delegates the typed page, taxonomy, index, and structural log entry to the shared page publisher. Supply the resolved vault, type, title, tags, and provenance through the command options.368. **Recovery.** Never create the final typed page or edit index.md/log.md directly. A raw-only result after publication failure is valid recovery state. Keep the exact command inputs and retry; do not delete or overwrite the raw source.379. **Pending-compile path** (raw already exists; clipper / `sources pending`). Do **not** run `skillwiki ingest` again — that would create a second raw object. Interactive sessions only:38 1. `skillwiki sources pending [vault]`39 2. `skillwiki sources compile claim <raw-path> [vault] --reason "<why>"` then the same command with `--write --approve <token>`40 3. Read the raw; compose unpublished drafts **outside** the vault41 4. `skillwiki page publish` each typed page42 5. `skillwiki sources compile published <raw-path> [vault] --pages "<typed/a.md,typed/b.md>" --reason "<why>"` then `--write --approve <token>`43 6. Leave the review `open` unless the human resolves it with `skillwiki sources review <raw-path> --status accepted|needs-fix|dismissed --reason "<why>"`44 Goal, satellite, and headless sessions may list pending / compile status / reviews but must not claim or publish compile turns.45## Provenance defaults46- Default `provenance: research`.47- If cwd is inside `projects/{slug}/`, set `provenance: project` and add `provenance_projects: ["[[slug]]"]`.48## Raw Data Locality49Raw ephemeral data (market feeds, logs, transient JSON) must be written to the **project local** `raw/` directory, NOT the cloud-mounted wiki path. See `references/raw-data-locality.md` for the full pattern.50**Quick rule:**51- Transient data → `~/projects/{slug}/raw/` (local, git-tracked)52- Compound pages → `~/wiki/projects/{slug}/compound/` (cloud, durable)53## Stop conditions54- `fetch-guard` non-zero.55- Fetch timeout / size limit exceeded.56- `INGEST_VALIDATION_FAILED` with `source identity conflict`.57- Source or generated content contains unredacted live credentials or other authenticating secrets.58- `skillwiki page publish --help` is unavailable.59- `skillwiki ingest` returns nonzero; retain any raw-only result for retry.60- sha256 already exists in vault for the same source.61## Forbidden62- Skipping `fetch-guard`.63- Creating a final typed page or editing `index.md`/`log.md` directly.64- Modifying any existing file in `raw/`.65- Writing raw ephemeral data directly to cloud-mounted wiki paths (`~/wiki/`).66- Writing host-local absolute paths as canonical durable source references (see `using-skillwiki` → Portable Source References).67- Writing `[[wikilinks]]` to pages that don't exist in the vault. Before linking, verify the target exists: check `index.md` or `ls` the target directory. If the target doesn't exist yet, use plain text instead of a wikilink.68- Indexing `raw/assets/` binaries with only a `.txt` sidecar. Write a sibling Markdown note that embeds each file with `![[ ]]`.69## Batch Mode70When the user provides multiple sources (a directory of files, a list of URLs, or a multi-document input):711. **Loop per source.** Execute steps 1–8 for each source individually, using one `skillwiki ingest` command per source.722. **Fail fast.** If an ingest command returns nonzero, STOP and report the retained raw-only state, if any, with its exact retry inputs.733. **Deduplication.** Let `skillwiki ingest` preserve immutable raw capture and skip sources whose content is already present.744. **Progress.** After each source completes, report the raw path, typed path or recovery state, and publisher operation ID.