Intake

From mikeprasad/aria-knowledge · View interactive version

Intake is an AI agent skill from the GitHub repository mikeprasad/aria-knowledge. Capture knowledge from outside the conversation. A single URL or text snippet is clipped whole to intake/clippings/; files/directories/globs are bulk-scanned into the backlogs; `extract {source}` decomposes a source into backlog entries; `doc {source}` captures a structured 5-section reflection (cla

How to use this skill

Skill file

/intake — Bulk Knowledge Import + Doc-Anchored Capture

Two modes:

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):

  1. 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. extract is standalone — it does NOT combine with doc/thread (no /intake extract doc …); a doc to decompose is just /intake extract <doc-url> (extract fetches it). If the arg after extract is literally doc or thread, treat as malformed and prompt for clarification.
  2. First arg == doc → mode = doc. Jump to "Doc Mode Steps" (D1–D6), unchanged.
  3. First arg == thread → mode = thread. Jump to "Thread Mode Steps" (T1–T3) below.
  4. (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).
  5. (auto) Single arg matching ^https?:// OR free text (not an existing path) → mode = clip-whole. Jump to "Clip-Whole Steps" (C1–C3) below.
  6. (auto) Args are existing file paths / directories / globs, OR multiple sources → mode = bulk. Proceed to Step 1 (bulk scan, unchanged).
  7. 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).

Step D2: Read or Note Doc Content

Capture the following for D3:

Step D3: Populate Template

  1. Read ${CLAUDE_PLUGIN_ROOT}/template/intake/intake-doc.md to load the body template.
  2. Generate slug from source_title: lowercase, hyphenated, alphanumeric only, max ~60 chars. Example: "The Bitter Lesson" → the-bitter-lesson. If source_title is empty, use doc-{HHMMSS} as fallback.
  3. 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.
  4. Fill the frontmatter using captured fields from D2. Omit source_url if absent; omit source_author if absent. Always populate captured_at, read_at, type: intake-doc.
  5. Suggest 2-5 tags based on doc topic (cross-check existing index.md tags to prefer canonical names; new tags are fine but flag them).
  6. Suggest 2-4 semantic-hints: free-form phrases that match how a future query might reach this doc (per the convention in template/README.md).
  7. Pre-fill body sections from the D2 scan:

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

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 of text]

[Summary for URLs, full text for snippets]

Tag detection: if the user didn't provide tags, match title/content words against known tags in {knowledge_folder}/index.md (if it exists). Only high-confidence matches — don't guess.

C3: Confirm

Clipped to intake/clippings/{slug}.md
Tags: [tags or "none"]
Reviewed at the next /audit knowledge run (Step 2f).

Exit after C3.


Thread Mode Steps (mode = thread)

Pull a chat/email thread via a ~~chat (Slack/Teams) or ~~email (Gmail/MS365) MCP into one clipping. Runs T1–T3 and exits. (This mode absorbs the former standalone thread-capture skill, retired v2.33.0.)

T1: MCP availability check

If no ~~chat/~~email MCP is connected/authenticated, surface:

"thread mode needs a chat or email MCP connected. These are bundled with the plugin — run the MCP's authenticate flow (e.g. Slack auth), or connect it via your MCP config, then retry. (This is NOT Cowork-only — thread mode runs in Claude Code once the MCP is authed.)"

Then exit. Do NOT redirect to Cowork — the capability is Code-native once the MCP is authenticated. (The ADR-094 Bash-availability runtime gate is separate and only fires on a genuine runtime mismatch, not on an unauthenticated MCP.)

T2: Pull the thread

Fetch thread content + metadata (participants, timestamps, channel/subject) via the connected MCP.

T3: Write the clipping

Write to {knowledge_folder}/intake/clippings/{slug}.md with the same frontmatter shape as C2 (source = thread URL/id; body = thread metadata + messages). Confirm as in C3.

Exit after T3.


Step 1: Parse Sources

The user provides one or more sources as arguments. Each source can be:

For each source:

  1. Verify it exists (for paths) or is reachable (for URLs)
  2. Report what was found: "Found N files to scan" or "Fetched URL: [title]"
  3. If a directory, list the files that will be scanned and ask for confirmation before proceeding (directories could contain hundreds of files)

Limits:

If no argument is provided, ask: "What would you like to intake? Provide a file path, directory, glob pattern, or URL."

Step 2: Read Content

For each source file or URL:

  1. Read the content
  2. Note the source path/URL for attribution
  3. If the file is very large (>500 lines), scan in chunks — read the first 100 lines, last 50 lines, and any section headers to identify knowledge-dense areas, then read those areas selectively

For directories, process files in alphabetical order.

For multi-file sources (directory or glob), issue Read calls for all files in a single parallel tool-use block. Content scanning in Step 3 runs in the main thread after reads complete. Exception: URL sources are fetched individually via WebFetch since each request is a network operation.

Step 3: Scan for Knowledge

Review each source for the same five categories as /extract:

Insights

Decisions

Feedback / Conventions

Project Context

References

Be selective — not every paragraph is knowledge. Focus on content that would help future sessions: patterns, decisions, constraints, and non-obvious information. Skip boilerplate, auto-generated content, and implementation details that are better found by reading the code directly.

Step 4: Deduplicate

Issue Read calls for the three backlog files AND {knowledge_folder} scan targets in a single parallel tool-use block. Dedup comparison runs in the main thread after reads complete.

For each finding, check against:

  1. Existing entries in {knowledge_folder}/intake/insights-backlog.md
  2. Existing entries in {knowledge_folder}/intake/decisions-backlog.md
  3. Existing entries in {knowledge_folder}/intake/extraction-backlog.md
  4. CLAUDE.md files in the current working directory
  5. Existing knowledge files in {knowledge_folder}/

Skip anything already captured. Note skipped items in the preview.

Step 5: Preview Findings

Present all findings grouped by category before staging anything:

## Intake Preview

**Sources scanned:** N files from [path/URL summary]
**Findings:** N items (N insights, N decisions, N feedback, N project, N references)
**Skipped:** N duplicates

### Insights (N)
1. [brief description] — from [source file]
2. [brief description] — from [source file]

### Decisions (N)
1. [brief description] — from [source file]

### Feedback / Conventions (N)
1. [brief description] — from [source file]

### Project Context (N)
1. [brief description] — from [source file]

### References (N)
1. [brief description] — from [source file]

Stage all to backlogs? (all / numbers to exclude / none)

Step 6: Stage Approved Items

Based on user response:

Route each approved item to the appropriate backlog file using the same format as /extract:

Insights → `{knowledge_folder}/intake/insights-backlog.md`

### YYYY-MM-DD — [project or "intake"] — Imported from [source filename]
- Insight bullet 1
- Insight bullet 2

Decisions → `{knowledge_folder}/intake/decisions-backlog.md`

### YYYY-MM-DD — [project or "intake"] — Imported from [source filename]
**Decision:** What was decided
**Why:** Rationale (if documented in source)
**Alternatives considered:** (if documented in source, otherwise omit)

Feedback, Project Context, References → `{knowledge_folder}/intake/extraction-backlog.md`

### YYYY-MM-DD — [type: feedback|project|reference] — Imported from [source filename]
**Content:** What was captured
**Source:** [file path or URL]

Step 7: Report

## Intake Complete

- **Sources:** N files scanned
- **Insights:** N staged
- **Decisions:** N staged
- **Feedback:** N staged
- **Project context:** N staged
- **References:** N staged
- **Skipped:** N duplicates, N excluded by user

Knowledge staged in backlogs for next /audit knowledge to review and promote.

Rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.