← 返回 Skills 市场
daniel-refahi-ikara

dr-context-pipeline

作者 Daniel Refahi · GitHub ↗ · v1.8.0 · MIT-0
cross-platform ✓ 安全检测通过
398
总下载
0
收藏
2
当前安装
12
版本数
在 OpenClaw 中安装
/install dr-context-pipeline
功能描述
Deterministic memory/context pipeline for agents: route a user message, retrieve relevant memory snippets, compress into a cited Context Pack (sources are sn...
使用说明 (SKILL.md)

DR Context Pipeline (retrieval + compression + lint)

Use this skill to standardize how an agent loads memory into its prompt for correctness.

Prerequisites

  • A file-based memory layout that includes memory/always_on.md (policy header + topic catalog) and topic files under memory/topics/.
  • Recommended: install dr-memory-foundation (or implement an equivalent structure).

Quick install commands (copy/paste)

These commands work from anywhere because they set $WORKSPACE (defaults to ~/.openclaw/workspace). Rerun them whenever you need to re-apply the pipeline:

export WORKSPACE=${WORKSPACE:-~/.openclaw/workspace}
cd "$WORKSPACE"
clawhub install dr-context-pipeline --version X.Y.Z --dir skills
python3 ./skills/dr-context-pipeline/scripts/install_pipeline.py --target "$WORKSPACE/context_pipeline"
ls -1 "$WORKSPACE/context_pipeline"
git -C "$WORKSPACE" diff -U20 AGENTS.md | cat
python3 ./skills/dr-context-pipeline/scripts/validate_pipeline.py --context-root "$WORKSPACE/context_pipeline"
python3 ./skills/dr-context-pipeline/scripts/memory_watchdog.py --freshness-minutes 240 --min-bytes 200
git -C "$WORKSPACE" status -sb context_pipeline AGENTS.md
echo "CONTEXT PIPELINE APPLY COMPLETE"

Paste every command’s output. If any step fails or the watchdog reports a gap, stop and reply NOT EXECUTED: \x3Creason>.

Apply to this workspace

When the user asks to apply this skill (for example: Apply dr-context-pipeline as default behavior), follow this exact order and paste the evidence for every step: All commands assume you’ve set WORKSPACE=${WORKSPACE:-~/.openclaw/workspace} and are running from that directory.

  1. Lay down the files — run python3 ./skills/dr-context-pipeline/scripts/install_pipeline.py --target context_pipeline (adds/updates the workspace copy from assets/context_pipeline/). Keep the script output in the transcript (hash summary + file count).
  2. Show the treels -1 context_pipeline so the user sees which files are now present.
  3. Patch AGENTS.md — read the file, insert/refresh the “Context Pipeline” instructions, and include a git diff -U20 AGENTS.md (or equivalent) snippet in your reply. Preserve everything else.
  4. Validate — run python3 ./skills/dr-context-pipeline/scripts/validate_pipeline.py --context-root context_pipeline and paste the PASS/FAIL summary. If it fails, stop and report NOT EXECUTED with the error.
  5. Run the memory watchdogpython3 ./skills/dr-context-pipeline/scripts/memory_watchdog.py --freshness-minutes 240 --min-bytes 200 (tune as needed). Paste the JSON output; if status ≠ OK, stop and reply NOT EXECUTED: memory gap after quoting the issues.
  6. Final state — show git status -sb context_pipeline AGENTS.md (or git status -sb if cleaner) so the user can see what changed.
  7. Success bannerecho "CONTEXT PIPELINE APPLY COMPLETE" so the transcript clearly shows the run finished cleanly.

This apply flow must be idempotent: if the files already match and AGENTS.md already contains the section, the diff should be empty but you still run the installer + validator and show their outputs.

Memory commit / continue workflow

  • When Daniel says “memorize this” (or similar), run the checklist in references/MEMORY_COMMIT.md (daily log, now, open-loops, topic file, MEMORY.md) and confirm which files changed.
  • When he says “let’s continue” after a reset, reload memory/now.md, open-loops, and the relevant topic files so you can summarize where things left off before acting.

Runtime evidence contract (non-optional)

Every single task must follow the Runtime Evidence Checklist in references/RUNTIME_CHECKLIST.md:

  • Emit the Retrieval Bundle JSON that conforms to references/schemas/retrieval_bundle.schema.json.
  • Emit the Context Pack JSON that conforms to references/schemas/context_pack.schema.json (or explicitly state the lint failure and fall back to raw snippets).
  • List which snippet IDs are being passed forward.
  • Only then provide the user-facing reasoning/result.
  • If any step fails, reply NOT EXECUTED: \x3Creason> and stop.

Casual prompts (“go for it”, “review it”, etc.) do not suspend this contract. If the user wants a lighter interaction they can explicitly waive it.

Operating procedure (default)

  1. Load the always-on policy + topic catalog (your memory/always_on.md).
  2. Route the message deterministically (task type + caps) using references/router.yml.
  3. Retrieve top relevant snippets from your memory store; emit a Retrieval Bundle JSON (see schema).
  4. Compress Retrieval Bundle → Context Pack JSON using references/compressor_prompt.txt.
    • IMPORTANT: Context Pack sources MUST be snippet IDs only (S1, S2, …).
  5. Lint the Context Pack. If lint fails, skip compression and fall back to raw retrieved snippets.
  6. Call the main reasoning model with: always-on policy header + Context Pack (+ raw snippets for high-stakes tasks) + user message.

What to read / use

  • Router + caps: references/router.yml
  • Compressor prompt: references/compressor_prompt.txt
  • Retrieval Bundle schema: references/schemas/retrieval_bundle.schema.json
  • Context Pack schema: references/schemas/context_pack.schema.json
  • Runtime checklist: references/RUNTIME_CHECKLIST.md
  • Golden tests starter suite: references/tests/golden.json
  • Installer/validator/watchdog scripts: scripts/install_pipeline.py, scripts/validate_pipeline.py, scripts/memory_watchdog.py

Notes

  • Keep “always-on policy header” tiny (invariants only). Put everything else behind retrieval.
  • If you need deterministic snippet IDs, follow the stable ordering guidance in references/deterministic_ids.md.
安全使用建议
This skill appears to do what it says: it installs a local context_pipeline, validates it, and enforces an evidence contract that makes the agent emit Retrieval Bundle and Context Pack JSON objects built from your local memory files. Before installing: (1) review the included scripts (install_pipeline.py, validate_pipeline.py, memory_watchdog.py) — they operate only on local files and do not contact external services; (2) back up AGENTS.md and any existing context_pipeline directory because the installer copies/overwrites files in workspace/context_pipeline; (3) inspect your memory files for any sensitive data you do not want pasted into transcripts (the skill requires emitting snippet contents and diffs); and (4) if you plan to allow autonomous agent runs, be aware the evidence contract will cause the agent to include local memory artifacts in its outputs unless you explicitly waive that behavior per the skill's instructions.
功能分析
Type: OpenClaw Skill Name: dr-context-pipeline Version: 1.8.0 The dr-context-pipeline skill bundle is a framework designed to standardize and verify how an agent retrieves and processes memory snippets. It includes Python scripts for installation (install_pipeline.py), integrity validation (validate_pipeline.py), and memory freshness monitoring (memory_watchdog.py), all of which perform local file operations without suspicious network activity or obfuscation. The instructions in SKILL.md and the references/ directory establish a 'Runtime Evidence Contract' that forces the agent to provide structured JSON logs of its internal retrieval logic, which is a defensive architectural pattern for improving transparency and reducing hallucinations in LLM agents.
能力评估
Purpose & Capability
Name/description (deterministic retrieval, compression, lint, evidence contract) match the included assets and scripts. The router, schemas, compressor prompts, validator, installer, and watchdog all relate directly to a file-based memory pipeline; there are no unrelated env vars, binaries, or external credentials requested.
Instruction Scope
Runtime instructions explicitly require reading the workspace memory files (memory/always_on.md, memory/topics/*, daily logs), producing and pasting full Retrieval Bundle and Context Pack JSON objects, and editing AGENTS.md with a git diff in the transcript. This is consistent with the stated goal but has privacy implications: the skill mandates emitting local memory contents in the agent transcript for every (non-waived) interaction, which may expose sensitive data if the transcript is shared or logged. The instruction set is prescriptive and non-optional (NOT EXECUTED contract).
Install Mechanism
No external install spec; the included install script copies bundled asset files from the skill into the user's workspace using shutil.copytree. There are no network downloads, installers, or third-party package pulls. Note: copytree with dirs_exist_ok will write into the target directory and can add/overwrite files under workspace/context_pipeline — expected for this skill but worth reviewing.
Credentials
The skill requires no environment variables or external credentials, which is proportionate. However, it does require read access to the user's workspace memory files and write access to the workspace (it installs files and the workflow asks the agent to patch AGENTS.md). Those file accesses are necessary for a file-based memory pipeline but mean the skill will touch and publish local files and diffs — back up any important files before applying.
Persistence & Privilege
always:false and no special platform privileges. The skill does not request to be force-enabled or modify other skills. Autonomous invocation is allowed by default (normal for skills); combined with the mandatory evidence contract this could cause the agent to repeatedly publish local memory when run autonomously, but that behavior follows the skill's purpose rather than being an unexplained privilege escalation.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install dr-context-pipeline
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /dr-context-pipeline 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.8.0
Adds memory commit workflow + continue instructions
v1.7.0
Adds explicit success banner (echo CONTEXT PIPELINE APPLY COMPLETE) after git status
v1.6.0
Switches quick-install commands to python3 ./skills/... so execute bits aren’t required
v1.5.0
Adds WORKSPACE-aware install instructions and ./skills paths
v1.4.0
Adds quick-install command block so new users see every apply step
v1.3.0
Drops the _v1 suffix everywhere (folder now context_pipeline)
v1.2.0
Adds memory_watchdog apply step + evidence updates
v1.1.0
Adds installer/validator scripts, runtime evidence contract, and bundled context_pipeline_v1 assets
v2.0.0
dr-context-pipeline 2.0.0 - Added metadata file (_meta.json) to the project. - No changes to the SKILL.md or behavior; functionality remains the same.
v1.0.2
Renamed the skill from dr-context-pipeline-v1 to dr-context-pipeline. Added a simpler install + apply activation flow. Added Apply dr-context-pipeline as default behavior as the preferred activation phrase. Added references/APPLY.md with an idempotent apply checklist. Updated the skill docs so configure_prompt.md is now a fallback, not the primary activation path. Improved the default-activation guidance so the skill focuses on patching AGENTS.md and enabling the context pipeline more reliably.
v1.0.1
dr-context-pipeline v1.0.2 **Configuration** references/configure_prompt.md provides guidance on configuring prompts. Run the prompt on your agent after installing the skill. - No changes to existing functionality or procedures. - Improves onboarding and usability with extra configuration instructions.
v1.0.0
# Release notes — dr-context-pipeline-v1 v1.0.0 ## What this is **DR Context Pipeline v1** is a deterministic, correctness-first context-loading protocol for agents: route → retrieve → compress → lint → fallback. It standardizes how agents decide what memory to load and how to pass only the required, cited context into the main reasoning model. ## Prerequisite Designed to work out-of-the-box with **dr-memory-foundation** (or any equivalent file-based memory layout that provides `memory/always_on.md` and topic files under `memory/topics/`). ## Included components - Deterministic router + retrieval caps (`references/router.yml`) - Compressor prompt enforcing **snippet-ID-only sources** (`references/compressor_prompt.txt`) - JSON Schemas: - Retrieval Bundle (`references/schemas/retrieval_bundle.schema.json`) - Context Pack (`references/schemas/context_pack.schema.json`) - Deterministic snippet ID guidance (`references/deterministic_ids.md`) - Starter golden regression tests (`references/tests/golden.json`) ## Key behaviors - Context Pack `sources` are **snippet IDs only** (e.g., `S1`, `S2`) for strict mechanical linting. - If compression output fails lint, the system **falls back to raw retrieved snippets** (correctness over compactness). - Router supports derived queries and task-type caps to avoid noisy daily-log retrieval.
元数据
Slug dr-context-pipeline
版本 1.8.0
许可证 MIT-0
累计安装 2
当前安装数 2
历史版本数 12
常见问题

dr-context-pipeline 是什么?

Deterministic memory/context pipeline for agents: route a user message, retrieve relevant memory snippets, compress into a cited Context Pack (sources are sn... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 398 次。

如何安装 dr-context-pipeline?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install dr-context-pipeline」即可一键安装,无需额外配置。

dr-context-pipeline 是免费的吗?

是的,dr-context-pipeline 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

dr-context-pipeline 支持哪些平台?

dr-context-pipeline 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 dr-context-pipeline?

由 Daniel Refahi(@daniel-refahi-ikara)开发并维护,当前版本 v1.8.0。

💬 留言讨论