/intake — Bulk Knowledge Import + Doc-Anchored Capture
Two modes:
- Bulk mode (default) — Scan files, directories, or URLs for knowledge-worthy content and stage findings to the existing backlogs (insights / decisions / extraction). Multi-source, category-based, dedup-aware. Same surface as prior /intake versions.
- Doc mode (
/intake doc) — Capture a single doc as a structured intake entry atintake/docs/{YYYY-MM-DD}-{slug}.mdwith a 5-section body: what the doc claims / worth keeping / contested or unclear / action implied / my reaction. For when you're reading something and want a thoughtful capture rather than a bulk scan.
Step 0: Resolve Config + Mode Detection
Read ~/.gemini/antigravity/aria-knowledge.local.md and extract knowledge_folder. If the file doesn't exist, stop: "aria-knowledge is not configured. Run /setup to get started."
Use {knowledge_folder} as the base path for all file operations in subsequent steps.
Mode detection (first match wins):
- First arg
== extract(case-insensitive) →mode = extract. The remaining arg is ONE source (URL / file / dir / doc-URL); decompose it into backlog entries by running the bulk-scan logic (Step 1 onward) on that single source.extractis standalone — it does NOT combine withdoc/thread(no/intake extract doc …); a doc to decompose is just/intake extract <doc-url>(extract fetches it). If the arg afterextractis literallydocorthread, treat as malformed and prompt for clarification. - First arg
== doc→mode = doc. Jump to "Doc Mode Steps" (D1–D6), unchanged. - First arg
== thread→mode = thread. Jump to "Thread Mode Steps" (T1–T3) below. - (auto) Single arg whose host is a chat/email service (
slack.com,teams.microsoft.com,mail.google.com, outlook/office) →mode = thread(no keyword needed). - (auto) Single arg matching
^https?://OR free text (not an existing path) →mode = clip-whole. Jump to "Clip-Whole Steps" (C1–C3) below. - (auto) Args are existing file paths / directories / globs, OR multiple sources →
mode = bulk. Proceed to Step 1 (bulk scan, unchanged). - No args → ask: "What would you like to intake? (a URL, text, file/dir/glob; or
extract <src>to decompose,doc <src>for a reflection capture,thread <id>for a chat/email thread)".
The mental model: default = capture this whole; extract = decompose it; doc = reflect on it (5-section); thread = the one source that needs naming (or auto-detected from a chat URL). Note (behavior change from prior versions): a bare URL now CLIPS WHOLE — it no longer auto-mines into backlogs. To mine a single URL, use /intake extract <url> (or let /audit-knowledge Step 2f decompose the clipping later).
Doc Mode Steps (mode = doc only)
Doc mode runs steps D1 → D6 to completion and exits. Do not run any bulk-mode step (Step 1 onward) in doc mode.
Step D1: Acquire Doc Source
The source can be a URL, file path, or just a title (when capturing notes on a doc you read elsewhere).
- If args after
doccontain a URL: use assource_url; attempt WebFetch in D2 to extract title/author/content - If args after
doccontain a file path: use assource_path; Read in D2 - If args after
docare plain text (no URL/path detected): treat assource_title; no content fetch — user fills body manually in D3 - If no args after
doc: prompt: "What doc are you capturing? Paste a URL, file path, or title."
Step D2: Read or Note Doc Content
- URL source: WebFetch the URL. Extract title, author (if discoverable from byline/meta), and key content. Respect copyright — capture summary and key claims for downstream synthesis, not full page text.
- File path source: Read the file. If very large (>500 lines), use the same chunked-scan strategy as bulk mode (first 100, last 50, section headers, then targeted areas).
- Title-only source: No content fetch. User will fill body sections manually in D3.
Capture the following for D3:
source_title(from page title, file frontmatter, or user-provided string)source_url(if URL; else omit)source_author(if discoverable; else omit per #28a-5)captured_at(current ISO 8601 timestamp)read_at(defaults tocaptured_at— D4 preview lets user adjust if they read the doc earlier)- Summarized claims, candidate "worth keeping" items, and any contested or action-implied content noticed during the scan
Step D3: Populate Template
- Read
${CLAUDE_PLUGIN_ROOT}/template/intake/intake-doc.mdto load the body template. - Generate slug from
source_title: lowercase, hyphenated, alphanumeric only, max ~60 chars. Example:"The Bitter Lesson"→the-bitter-lesson. Ifsource_titleis empty, usedoc-{HHMMSS}as fallback. - Resolve target path:
{knowledge_folder}/intake/docs/{YYYY-MM-DD}-{slug}.md. If file already exists at that path, append-2,-3, etc. to slug until unique. - Fill the frontmatter using captured fields from D2. Omit
source_urlif absent; omitsource_authorif absent. Always populatecaptured_at,read_at,type: intake-doc. - Suggest 2-5 tags based on doc topic (cross-check existing
index.mdtags to prefer canonical names; new tags are fine but flag them). - Suggest 2-4
semantic-hints:free-form phrases that match how a future query might reach this doc (per the convention intemplate/README.md). - Pre-fill body sections from the D2 scan:
- What the doc claims — 2-4 sentence summary in your own words
- Worth keeping — bullet list of insights/quotes/data points worth durable storage; aim for 2-6 bullets
- Contested or unclear — populate if the scan surfaced anything debatable; leave empty (or omit the section) if nothing flagged
- Action implied — populate if the doc suggests a decision or next step relevant to ongoing work; omit if N/A
- My reaction — leave as a single-line placeholder (
{Your reaction — 1-3 sentences. This section is yours, not the doc's.}) for the user to fill, since "reaction" is the user's voice not Claude's
Step D4: Preview
Show the populated entry before writing. Format:
## Doc Intake Preview
**Target:** {knowledge_folder}/intake/docs/{YYYY-MM-DD}-{slug}.md
[full populated entry: frontmatter + body]
---
Save to intake/docs/?
- `yes` — write the file as shown
- `edit {section}` — revise a specific section (claims / keeping / contested / action / reaction / tags / hints / title / slug)
- `skip` — abort, write nothing
Wait for explicit response. Allow multiple edit directives in sequence (re-show preview after each revision).
Step D5: Write
On yes, write the entry to {knowledge_folder}/intake/docs/{YYYY-MM-DD}-{slug}.md. Create the intake/docs/ subfolder if it doesn't exist (this is the first doc-mode capture).
Step D6: Report
## Doc Intake Complete
- **Source:** {source_title or source_url or "untitled"}
- **Path:** {knowledge_folder}/intake/docs/{YYYY-MM-DD}-{slug}.md
- **Tags:** {tag list}
Entry staged in intake/docs/ for next /audit-knowledge to review and promote.
Exit after report. Doc mode runs D1 → D6 only; bulk-mode steps (Step 1 onward) are not executed.
Clip-Whole Steps (mode = clip-whole)
Capture the source whole as one clipping for later review at /audit-knowledge Step 2f. Runs C1–C3 and exits. (Absorbs the retired /clip.)
C1: Acquire content
- URL: WebFetch; extract the page title + a summary (do NOT copy full page content — respect copyright). Capture the URL as
source. - Text snippet: use the provided text verbatim as the body; title = first line.
C2: Write the clipping
Resolve target {knowledge_folder}/intake/clippings/{slug}.md (slug from title; append -2/-3 until unique). Write:
---
source: [URL or "manual"]
date: YYYY-MM-DD
tags: [user-provided tags, or auto-detected from index.md, or empty array]
---
# [Title or first line o