📦 Agent Skills For Context Engineering — 用于上下文工程的Agent Skills
v1.0.0A comprehensive collection of 代理 技能s for 上下文 engineering, multi-代理 architectures, and production 代理 系统s. Use when building, optimizing, o...
运行时依赖
安装命令
点击复制技能文档
代理 技能s for 上下文 Engineering
This collection provides structured 图形界面dance for building production-grade AI 代理 系统s through effective 上下文 engineering.
When to Activate
Activate these 技能s when:
Building new 代理 系统s from scratch Optimizing existing 代理 performance 调试ging 上下文-related 失败s De签名ing multi-代理 architectures Creating or evaluating 工具s for 代理s Implementing memory and persistence layers 技能 Map Foundational 上下文 Engineering
Understanding 上下文 Fundamentals 上下文 is not just prompt text—it is the complete 状态 avAIlable to the language 模型 at inference time, including 系统 instructions, 工具 definitions, retrieved documents, message 历史, and 工具 输出s. Effective 上下文 engineering means understanding what in格式化ion truly matters for the task at hand and curating that in格式化ion for maximum 签名al-to-noise ratio.
Recognizing 上下文 Degradation Language 模型s exhibit predictable degradation patterns as 上下文 grows: the "lost-in-middle" phenomenon where in格式化ion in the center of 上下文 接收s less attention; U-shaped attention curves that prioritize beginning and end; 上下文 poisoning when errors compound; and 上下文 distraction when irrelevant in格式化ion overwhelms relevant content.
Architectural Patterns
Multi-代理 Coordination Production multi-代理 系统s converge on three dominant patterns: supervisor/编排器 architectures with centralized control, peer-to-peer swarm architectures for flexible handoffs, and hierarchical structures for complex task decomposition. The critical insight is that sub-代理s exist primarily to isolate 上下文 rather than to simulate organizational 角色s.
Memory 系统 De签名 Memory architectures range from simple scratchpads to sophisticated temporal knowledge graphs. Vector RAG provides semantic retrieval but loses relationship in格式化ion. Knowledge graphs preserve structure but require more engineering investment. The file-系统-as-memory pattern enables just-in-time 上下文 loading without stuffing 上下文 windows.
File系统-Based 上下文 The file系统 provides a single interface for storing, retrieving, and updating effectively unlimited 上下文. Key patterns include scratch pads for 工具 输出 offloading, plan persistence for long-horizon tasks, sub-代理 communication via 分享d files, and dynamic 技能 loading. 代理s use ls, glob, grep, and read_file for tar获取ed 上下文 discovery, often outperforming semantic 搜索 for structural queries.
Hosted 代理 Infrastructure Background coding 代理s 运行 in remote sandboxed 环境s rather than on local machines. Key patterns include pre-built 环境 images refreshed on regular cadence, warm sandbox pools for instant 会话 启动s, file系统 snapshots for 会话 persistence, and multiplayer support for collaborative 代理 会话s. Critical optimizations include allowing file reads before git 同步 completes (blocking only writes), predictive sandbox warming when users 启动 typing, and self-spawning 代理s for parallel task execution.
工具 De签名 Principles 工具s are contracts between deterministic 系统s and non-deterministic 代理s. Effective 工具 de签名 follows the consolidation principle (prefer single comprehensive 工具s over multiple narrow ones), returns 上下文ual in格式化ion in errors, supports 响应 格式化 options for 令牌 efficiency, and uses clear namespacing.
Operational Excellence
上下文 压缩ion When 代理 会话s exhaust memory, 压缩ion becomes mandatory. The correct optimization tar获取 is 令牌s-per-task, not 令牌s-per-请求. Structured summarization with explicit sections for files, decisions, and next steps preserves more useful in格式化ion than aggressive 压缩ion. Artifact trAIl integrity remAIns the weakest dimension across all 压缩ion methods.
上下文 Optimization Techniques include compaction (summarizing 上下文 near limits), observation masking (replacing verbose 工具 输出s with references), prefix caching (reusing KV blocks across 请求s), and strategic 上下文 partitioning (splitting work across sub-代理s with isolated 上下文s).
Evaluation 框架s Production 代理 evaluation requires multi-dimensional rubrics covering factual accuracy, completeness, 工具 efficiency, and process 质量. Effective patterns include LLM-as-judge for scalability, human evaluation for edge cases, and end-状态 evaluation for 代理s that mutate persistent 状态.
Development Methodo记录y
Project Development Effective LLM project development begins with task-模型 fit analysis: validating through manual prototyping that a task is well-suited for LLM processing before building 自动化. Production 流水线s follow staged, idempotent architectures (acquire, prepare, process, 解析, render) with file 系统 状态 management for 调试ging and caching. Structured 输出 de签名 with explicit 格式化 specifications enables reliable parsing. 启动 with minimal architect