cp-skill-ingest
Use when asked to ingest one URL or local snapshot into a tracked .ingest.md source analysis, or to execute a bounded re-ingest request. Retaining quotes in an existing ingest is cp-skill-ground's job, not this skill's.
zby · 已有 AI 审核记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add zby/commonplace --skill cp-skill-ingest技能说明
name: cp-skill-ingest description: Use when asked to ingest one URL or local snapshot into a tracked .ingest.md source analysis, or to execute a bounded re-ingest request. Retaining quotes in an existing ingest is cp-skill-ground's job, not this skill's. type: kb/types/instruction.md user-invocable: true allowed-tools: Read, Write, Grep, Glob, Bash, Skill, Task context: fork model: opus argument-hint: "[url-or-file | re_ingest_request] — URL, snapshot path, or structured re-ingest request. No argument lists recent snapshots."
Ingest source
Ingest one URL-backed primary source into a tracked
kb/sources/*.ingest.md report. The reading copy may already exist as a
Markdown snapshot under kb/sources/.snapshots/.
Contract
Target: $ARGUMENTS
The direct output is the .ingest.md report in kb/sources/, with the local
snapshot's slug. URL snapshotting and connection discovery may write their own
local or generated artifacts. Do not directly write any other library
artifacts.
The parent agent owns target resolution, snapshotting, checksum guards,
connection discovery, drafting-worker dispatch, handoff verification, final
validation, and user reporting. One primary fresh drafting worker owns the
ingest analysis and writes the .ingest.md report; at most one fresh
replacement worker may repair that report after a failed handoff. Use only a
harness-provided sub-agent or worker mechanism; never launch codex, codex exec, claude, or another agent CLI from the shell. If the harness cannot
launch a fresh worker without carrying the parent's conversation history, stop
after connection discovery and report that isolated drafting is unavailable.
Do not draft locally unless the user explicitly authorizes a local fallback
for that run. If authorized, execute the same standalone drafting instruction
with the same fixed inputs and report drafting was local, not delegated as a
workflow exception.
The drafting worker executes the standalone draft-ingest-report.md
instruction. That instruction owns report analysis, writing, and worker-side
verification; this skill owns only the surrounding orchestration.
The caller may supply an occasion: the question or job that brought the
source in. It is the one task-specific input the worker receives beyond the
fixed paths. It must be stated before the source is read and must not carry
the parent's reading of the source; the worker records it and lets it govern
only the report's selection sections. An occasion that is already an exact
source-side claim is cp-skill-ground's job once the ingest exists; pass the
broader question here, or none.
The canonical empty Quotes block is the following complete Markdown section, including the blank line after its sentence:
## Quotes
No source quotes have been retained yet.
A re-ingest caller supplies this structured request instead of an ordinary URL-or-file target:
re_ingest_request:
ingest_path: <exact ingest path>
snapshot_path: <name-paired snapshot path>
occasion: <optional; omitted keeps the incumbent's occasion field>
Steps
- Resolve the target and replacement policy.
- If the target is a
re_ingest_request, require exactly one existingkb/sources/<slug>.ingest.mdand its exact name-pairedkb/sources/.snapshots/<slug>.md. Reject a differentsnapshot_path; do not search for a snapshot by checksum. Read the ingest'ssourceandsnapshot_sha256, reject the retiredsource_snapshotandcode_revisionsfields, and require the snapshot's frontmattersourceto equal the ingest's canonicalsource. Compute lowercase SHA-256 from the exact snapshot bytes.- Require zero or one incumbent Quotes block; stop before mutation if more
than one exists. The block starts at the exact
## Quotesheading and includes every byte through the byte immediately before the next level-two heading. If the section is absent, use the canonical empty Quotes block; do not infer quotes from any other section. Treat Quotes as empty only when the section is absent or is exactly the canonical empty block. Any other present Quotes block is populated. - If the snapshot checksum equals the incumbent
snapshot_sha256, setretained_quotesto the extracted block and continue. Do not rewrite, normalize, or reformat it. - If the checksums differ, stop before connection discovery, backup
creation, worker dispatch, or output mutation. Report both checksums,
both paired paths, and the canonical source. An ingest's
snapshot_sha256is immutable because a note marked(snapshot required)may depend on those exact bytes even when Quotes is empty. A changed observation requires a distinct snapshot basename and ingest; re-ingest never changes the incumbent observation. - Set
occasionto the request's value when supplied, else to the incumbent's frontmatteroccasionverbatim, elsenone. - Set
output_pathto the suppliedingest_path, retain whether it existed at the start of the run, and skip the remaining Step 1 bullets.
- Require zero or one incumbent Quotes block; stop before mutation if more
than one exists. The block starts at the exact
- If
$ARGUMENTSis empty, list recentkb/sources/.snapshots/*.mdfiles, then ask which one to ingest. - For a URL target, first search tracked
kb/sources/*.ingest.mdfiles for an exact frontmattersourcematch. If several match, stop and report the duplicate ingests. If one matches, resolve only its name-paired snapshot. If that file is missing, capture the ingest's canonicalsourceand continue only if the adapter returns that exact name-paired path. Do not search other snapshots for the incumbent checksum. - If the target is a
paperswithcode.co/paper/URL, or it is an arXiv paper and the user explicitly requested code grounding, read and follow the conditional procedureingest-paper-with-code.md. In an i
- If the target is a