resource-ingestlisted
Install: claude install-skill Kucell/cortex-agent
# Resource Ingest
## Goal
Adapt OpenViking's auto-`add_resource` to cortex-agent: external knowledge (API docs, RFCs, vendor READMEs) is no longer hand-pasted. Each resource gets a deterministic source + slug path, automatic L0/L1, and a manifest entry.
## Three Entry Points
```bash
# 1) URL — fetch HTML, strip, markdown
node .agent/skills/resource-ingest/scripts/ingest.js \
--url https://example.com/api-docs \
--source example --slug api-docs --write
# 2) Local file — copy
node .agent/skills/resource-ingest/scripts/ingest.js \
--file ./external-doc.md \
--source vendor-x --slug doc --write
# 3) git repo — requires pre-clone into .agent/resources/_cache/{source}_{slug}/
git clone --depth 1 https://github.com/foo/bar .agent/resources/_cache/foo_bar
node .agent/skills/resource-ingest/scripts/ingest.js \
--git https://github.com/foo/bar \
--source github --slug foo-bar --write
```
## Layout
```text
.agent/resources/
├── MANIFEST.json # append-only ingest log
├── external/
│ └── {source}/
│ └── {slug}.md # one file per resource
└── _cache/
└── {source}_{slug}/ # git clone cache (rebuildable)
```
Each resource file contains:
```yaml
---
name: api-docs
source: example
uri: cortex://resources/example/api-docs
content_hash: db91b93ab1bb13aa # SHA-256 first 16 chars
ingested_at: 2026-07-24T05:42:11.952Z
origin: https://example.com/api-docs
---
# ... content ...
```
## Side Effects