← 返回 Skills 市场
wudi488

Context Assembler

作者 wudi488 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
101
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install context-assembler
功能描述
Dynamic context preprocessor for OpenClaw agents. Selects relevant memory, collapses timelines, detects forbidden patterns, and injects task-specific context...
使用说明 (SKILL.md)

Context Assembler

Not a tool for agents — a preprocessor for their context window.

OpenClaw injects ~3700 tokens of static bootstrap context into every session, regardless of the task. Context Assembler reduces that to ~400 tokens of task-relevant information, achieving 89% context compression without quality loss.

What It Does

Task arrives → Classify → Semantic Projection → Timeline Collapse → Forbidden Patterns → Pack → Agent reasons
  1. Classifies the task type (nas_ops, coding, research, evolution_check, etc.)
  2. Semantically projects relevant memory from MEMORY.md and daily notes — only what matters
  3. Collapses timelines — repeated failures become single entries, noise gets filtered
  4. Detects forbidden patterns — paths that failed ≥2 times get marked "do not retry"
  5. Packs everything into a compact context block within token budget

Why This Matters

Karpathy's "Context Engineering > Prompt Engineering" principle applied to OpenClaw. The quality bottleneck isn't how you write prompts — it's what the agent sees in its context window before reasoning.

Quick Start

Manual invocation (agent calls it)

python3 scripts/assembler.py --task "check NAS disk health" --max-tokens 1500

Cron pre-turn hook

In your OpenClaw cron job, run assembler first:

# The agent's first action: get optimized context
python3 skills/context-assembler/scripts/assembler.py \
  --task "daily evolution check" \
  --max-tokens 1800

Agent-assisted mode

Tell your agent: "optimize my context" — it will call assembler and use the output.

Configuration

Edit genome.yml to customize:

  • Source weights: which memory sources matter most
  • Task profiles: per-task token budgets and source preferences
  • Synonym map: lightweight semantic expansion (e.g., "shrimp" → "aquaculture, water quality")
  • Noise patterns: timeline events to filter out
  • Staleness decay: how fast old information loses relevance

The genome.yml is the "mutable kernel" — you tune it, the assembler engine stays fixed.

Requirements

  • Python 3.8+
  • PyYAML (pip install pyyaml)
  • Read access to OpenClaw workspace (MEMORY.md, memory/*.md)

Architecture

skills/context-assembler/
├── SKILL.md              # This file
├── genome.yml            # ★ Mutable kernel (tune this)
├── scripts/
│   └── assembler.py      # Fixed engine (~510 lines)
├── index/                # Future: pre-built search indices
└── feedback/             # Selection → outcome log

Design Principles

  1. Offload decisions: don't teach the agent to judge — encode judgment as a checklist
  2. Compress output space: templates > free-form writing
  3. Absence as signal: tell the agent what NOT to include
  4. Embed domain knowledge: your expertise encoded as correlation rules
  5. Graceful degradation: missing data is normal, not an error

Notes

  • Phase 1 uses keyword matching with synonym expansion (zero-latency, zero-extra-memory)
  • Phase 2+ will add embedding-based semantic search as memory corpus grows
  • The genome is designed to be optimizable — feedback logging enables self-tuning
  • Does NOT modify OpenClaw core — installs as a regular skill
  • Contains no credentials, tokens, or personal identifiers — safe to publish
安全使用建议
Treat this result as inconclusive: rerun the review where metadata.json and artifact files can be read before installing or trusting the skill.
能力评估
Purpose & Capability
Local artifact inspection failed before SKILL.md or metadata could be read, so purpose-capability coherence could not be verified.
Instruction Scope
No artifact instructions were available to assess scope or user-control boundaries.
Install Mechanism
No install specification or package contents were available to assess install behavior.
Credentials
No file manifest or capability evidence was available to assess environmental access.
Persistence & Privilege
No persistence, credential, or privilege evidence was available to assess.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install context-assembler
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /context-assembler 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
v1.0.0: Initial release
元数据
Slug context-assembler
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Context Assembler 是什么?

Dynamic context preprocessor for OpenClaw agents. Selects relevant memory, collapses timelines, detects forbidden patterns, and injects task-specific context... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 101 次。

如何安装 Context Assembler?

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

Context Assembler 是免费的吗?

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

Context Assembler 支持哪些平台?

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

谁开发了 Context Assembler?

由 wudi488(@wudi488)开发并维护,当前版本 v1.0.0。

💬 留言讨论