Capture — Universal Source Intake
Purpose
Ingest one source into raw/<type>/<slug>.<ext> (immutable, SHA-256 hashed) and create wiki/sources/<slug>.md (source-summary with key_claims[]).
Used by wiki-scribe (primary, passive intake) and wiki-researcher (via research workflow).
Trigger phrases (agent perspective)
- "capture this URL"
- "save this PDF"
- "intake source"
- "file clipboard"
- "hash and store this"
- "wiki-scribe should ingest X"
Inputs
One of:
- URL (any https://)
- YouTube link
- GitHub link (issue / PR / repo)
- PDF (path or URL)
- Raw text (clipboard, session log, transcript)
Outputs
Two files per capture:
raw/<type>/<slug>.<ext>— immutable, SHA-256 in frontmatter, full contentwiki/sources/<slug>.md— source-summary withkey_claims: [{quote, anchor, confidence}],quality,captured_by
Workflow
- Detect source type from URL or path:
*.pdf→ capture-pdf.shyoutube.com/*oryoutu.be/*→ capture-youtube.shgithub.com/*/issues/*or*/pull/*→ capture-github.shgithub.com/*/pulls→ capture-prs.sh- text without URL → capture-text.sh
- other URL → capture-url.sh
- Invoke the appropriate script with
--vault $VAULT_PATHand--source $INPUT. Scripts handle SHA-256 and frontmatter.
- Extract
key_claimsfor source-summary:
- If source <500 words: preserve full content as single claim
- If 500–5000 words: top-5 verbatim quotes with anchors (paragraph index)
- If >5000 words: top-10 quotes with anchors
- Set
qualityfield in source-summary:
highif extraction succeeded with >500 charsmediumif 200-500 chars (paywall preview, partial)lowif <200 chars or extraction errors
- Set
captured_byto invoking agent name (wiki-scribeorwiki-researcher).
Web→MD stack (for capture-url.sh)
The script tries three extractors in order:
defuddle(Node CLI, MIT, local) — primarytrafilatura(Python CLI, Apache-2.0, local) — fallback if defuddle fails OR content <500 charsr.jina.ai(cloud) — opt-in via envWIKI_ALLOW_CLOUD=1
If all three fail, exit 3 and tell user to provide content via capture-text.sh (manual clipboard).
Quality gate
- Every output has SHA-256 in frontmatter
wiki/sources/<slug>.mdis in tier 4key_claimsis never empty for sources >500 words (if empty, log warning)captured_byis set
Scripts used
${CLAUDE_PLUGIN_ROOT}/scripts/capture-url.sh${CLAUDE_PLUGIN_ROOT}/scripts/capture-youtube.sh${CLAUDE_PLUGIN_ROOT}/scripts/capture-github.sh${CLAUDE_PLUGIN_ROOT}/scripts/capture-prs.sh${CLAUDE_PLUGIN_ROOT}/scripts/capture-pdf.sh${CLAUDE_PLUGIN_ROOT}/scripts/capture-text.sh${CLAUDE_PLUGIN_ROOT}/scripts/capture-git-log.sh
Anti-patterns
- DO NOT interpret content during capture (preserve verbatim)
- DO NOT synthesize across sources (that's research's job)
- DO NOT edit existing wiki pages (only create raw/ + wiki/sources/)