用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/jmagly/aiwg --skill memory-ingest命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | memory-ingest |
| description | Ingest a source into any consumer's semantic memory by reading the topology contract |
| namespace | aiwg |
| category | kernel |
| platforms | ["claude","copilot","cursor","factory","windsurf","warp","codex","opencode","openclaw","hermes"] |
| triggers | ["help my AI remember what we decided","help me preserve project decisions between sessions","choose memory KB or project artifact flow","memory ingest"] |
Ingest an external source into a consumer framework's semantic memory. Reads the consumer's memory.topology contract to know where pages live, then extracts, summarizes, integrates, and cross-references — all topology-agnostic.
When new knowledge (a document, paper, URL, config file, or directory of files) needs to enter a consumer's semantic memory. This is the primary write path for external information.
Path to the source material. Supports: markdown (.md), PDF (.pdf), HTML (.html), YAML (.yaml/.yml), JSON (.json), a directory of files, or a URL.
Consumer ID to ingest into. Resolved via ADR-021 D4 precedence:
--consumer research-complete.aiwg/frameworks/registry.jsonPreview what would be created/modified without writing any files. Outputs the planned page list, cross-references, and contradiction flags.
Skip the discussion step and proceed directly to extraction and page writing. Use for batch ingestion or CI pipelines.
Determine which consumer's memory to target using ADR-021 D4 precedence. Fail with a clear error if no consumer can be resolved.
Read memory.topology from the consumer's manifest.json. Extract:
rootDir — base path for all memory pagesderivedPages.summary — where summary pages are writtenpageTemplate — structure the summary must conform tocrossRefStyle — how cross-references are formatted (e.g., wiki-links, markdown links)indexPath — location of the consumer's memory indexlog — path to .log.jsonlingestRequires — optional list of required post-ingest actions (e.g., "provenance")Parse the source material based on type:
Default behavior (no --non-interactive flag):
This discussion-first pattern ensures the memory reflects human judgment, not just mechanical extraction.
Use LLM to produce a structured summary conforming to the consumer's pageTemplate. The summary captures:
derivedPages.summary pathcrossRefStyleCompare new claims against existing pages. When a contradiction is found:
> [!contradiction]
> Source "paper.pdf" (2026-04-14) claims X, but this page states Y.
> Ingested via memory-ingest — awaiting human resolution.
.log.jsonl with "contradictions" count and detailsRegenerate the entry for the new summary page in the consumer's index at indexPath. Include title, source reference, date, and cross-ref targets.
Call memory-log-append with:
--consumer <resolved> --op ingest --data '{"source":"<path>","pages_touched":[...],"contradictions":<n>,"cross_refs_added":<n>}'
If ingestRequires includes "provenance", create a W3C PROV record documenting:
prov:Entity — the new summary pageprov:Activity — the ingest operationprov:wasDerivedFrom — the source materialprov:wasGeneratedBy — this skill invocationprov:wasAttributedTo — the actor (model + user)Output a summary:
memory-lint to catch# Interactive ingest of a research paper
memory-ingest docs/papers/distributed-consensus.pdf --consumer research-complete
# Batch ingest a directory of meeting notes
memory-ingest .aiwg/working/meeting-notes/ --consumer sdlc-complete --non-interactive
# Dry run to preview what would change
memory-ingest https://example.com/api-spec.html --consumer sdlc-complete --dry-run
# Explicit consumer override
memory-ingest design-doc.md --consumer media-marketing-kit --non-interactive
memory-log-append — log write primitive (called in step 9)memory-lint — validates memory page structure and cross-ref integritymemory-query-capture — captures query patterns for memory optimizationprovenance-create — W3C PROV record creation (called in step 10 when required)This skill's persistence flows through resolveStorage('memory'). On the default fs backend the memory subsystem lives at .aiwg/memory/ and behavior is byte-identical to direct file writes. To redirect memory artifacts into Obsidian, Logseq, Fortemi, or another backend without changing this skill, configure .aiwg/storage.config (#934).
When this skill needs to read or write memory artifacts from a Bash step:
aiwg memory path # resolved root (fs only)
aiwg memory list --prefix research-complete/
aiwg memory get research-complete/index.md
echo "# index" | aiwg memory put research-complete/index.md
echo '{"op":"ingest","summary":"foo"}' | aiwg memory append-log research-complete/.log.jsonl
The aiwg memory append-log subcommand uses atomic O_APPEND (#976) on the fs backend — concurrent appenders don't race.