context-engineering-collection by muratcankoylan/agent-skills-for-context-engineering
npx skills add https://github.com/muratcankoylan/agent-skills-for-context-engineering --skill context-engineering-collection本技能集通过有效的上下文工程,为构建生产级 AI 智能体系统提供结构化指导。
在以下情况下启用这些技能:
理解上下文基础 上下文不仅仅是提示文本——它是推理时语言模型可用的完整状态,包括系统指令、工具定义、检索到的文档、消息历史记录和工具输出。有效的上下文工程意味着理解哪些信息对当前任务真正重要,并精心编排这些信息以实现最高的信噪比。
识别上下文退化 随着上下文增长,语言模型会表现出可预测的退化模式:"中间迷失"现象,即位于上下文中间部分的信息获得的注意力较少;U 形注意力曲线,优先关注开头和结尾;错误累积导致的上下文污染;以及无关信息淹没相关内容导致的上下文注意力分散。
多智能体协调 生产级多智能体系统主要采用三种主导模式:具有集中控制功能的监督者/编排器架构、用于灵活交接的对等群组架构,以及用于复杂任务分解的层次结构。关键洞察在于,子智能体的存在主要是为了隔离上下文,而非模拟组织角色。
记忆系统设计 记忆架构范围从简单的便笺到复杂的时间知识图谱。向量 RAG 提供语义检索但会丢失关系信息。知识图谱保留结构但需要更多的工程投入。文件系统即记忆模式支持即时上下文加载,而无需塞满上下文窗口。
基于文件系统的上下文 文件系统为存储、检索和更新几乎无限的上下文提供了一个统一的接口。关键模式包括:用于卸载工具输出的便笺、用于长期任务的计划持久化、通过共享文件进行的子智能体通信,以及动态技能加载。智能体使用 ls、glob、grep 和 read_file 进行有针对性的上下文发现,对于结构化查询,其性能通常优于语义搜索。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
托管智能体基础设施 后台编码智能体在远程沙盒环境中运行,而非本地机器。关键模式包括:定期刷新的预构建环境镜像、用于即时会话启动的热沙盒池、用于会话持久化的文件系统快照,以及用于协作智能体会话的多玩家支持。关键优化包括:允许在 git 同步完成前进行文件读取(仅阻止写入)、用户开始输入时预测性预热沙盒,以及用于并行任务执行的自生成智能体。
工具设计原则 工具是确定性系统与非确定性智能体之间的契约。有效的工具设计遵循整合原则(优先选择单一综合性工具而非多个狭窄工具)、在错误中返回上下文信息、支持响应格式选项以提高令牌效率,并使用清晰的命名空间。
上下文压缩 当智能体会话耗尽内存时,压缩变得必不可少。正确的优化目标是每任务令牌数,而非每请求令牌数。采用明确划分文件、决策和后续步骤的结构化摘要,比激进压缩能保留更多有用信息。在所有压缩方法中,工件轨迹完整性仍然是最薄弱的维度。
上下文优化 技术包括:压缩(在接近限制时总结上下文)、观察屏蔽(用引用替换冗长的工具输出)、前缀缓存(跨请求重用 KV 块)以及策略性上下文分区(将工作拆分给具有隔离上下文的子智能体)。
评估框架 生产级智能体评估需要多维度的评估标准,涵盖事实准确性、完整性、工具效率和流程质量。有效模式包括:用于可扩展性的 LLM 即评判者、用于边缘案例的人工评估,以及用于改变持久状态的智能体的终态评估。
项目开发 有效的 LLM 项目开发始于任务-模型匹配分析:在构建自动化之前,通过手动原型验证任务是否适合 LLM 处理。生产流水线遵循分阶段、幂等的架构(获取、准备、处理、解析、渲染),并采用文件系统状态管理以进行调试和缓存。具有明确格式规范的结构化输出设计可实现可靠的解析。从最小架构开始,仅在证明有必要时增加复杂性。
本技能集围绕三个核心主题组织。首先,上下文基础阐述了什么是上下文、注意力机制如何工作,以及为什么上下文质量比数量更重要。其次,架构模式涵盖了实现有效智能体系统的结构和协调机制。第三,卓越运维涉及优化和评估生产系统的持续工作。
每个技能可以独立使用,也可以组合使用。从基础开始,建立上下文管理的思维模型。根据您的系统需求,深入探索架构模式。在优化生产系统时,参考运维技能。
这些技能是平台无关的,可与 Claude Code、Cursor 或任何支持自定义指令或类似技能构造的智能体框架配合使用。
本技能集内部相互集成——技能之间相互引用并建立在共享概念之上。基础技能为所有其他技能提供上下文。架构技能(多智能体、记忆、工具)可以组合用于构建复杂系统。运维技能(优化、评估)适用于使用基础和架构技能构建的任何系统。
本技能集内部技能:
关于上下文工程的外部资源:
创建时间 : 2025-12-20 最后更新 : 2025-12-25 作者 : Agent Skills for Context Engineering Contributors 版本 : 1.2.0
每周安装量
608
代码仓库
GitHub 星标数
14.2K
首次出现
2026年1月20日
安全审计
安装于
opencode520
gemini-cli508
codex498
cursor478
github-copilot468
amp419
This collection provides structured guidance for building production-grade AI agent systems through effective context engineering.
Activate these skills when:
Understanding Context Fundamentals Context is not just prompt text—it is the complete state available to the language model at inference time, including system instructions, tool definitions, retrieved documents, message history, and tool outputs. Effective context engineering means understanding what information truly matters for the task at hand and curating that information for maximum signal-to-noise ratio.
Recognizing Context Degradation Language models exhibit predictable degradation patterns as context grows: the "lost-in-middle" phenomenon where information in the center of context receives less attention; U-shaped attention curves that prioritize beginning and end; context poisoning when errors compound; and context distraction when irrelevant information overwhelms relevant content.
Multi-Agent Coordination Production multi-agent systems converge on three dominant patterns: supervisor/orchestrator 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-agents exist primarily to isolate context rather than to simulate organizational roles.
Memory System Design Memory architectures range from simple scratchpads to sophisticated temporal knowledge graphs. Vector RAG provides semantic retrieval but loses relationship information. Knowledge graphs preserve structure but require more engineering investment. The file-system-as-memory pattern enables just-in-time context loading without stuffing context windows.
Filesystem-Based Context The filesystem provides a single interface for storing, retrieving, and updating effectively unlimited context. Key patterns include scratch pads for tool output offloading, plan persistence for long-horizon tasks, sub-agent communication via shared files, and dynamic skill loading. Agents use ls, glob, grep, and read_file for targeted context discovery, often outperforming semantic search for structural queries.
Hosted Agent Infrastructure Background coding agents run in remote sandboxed environments rather than on local machines. Key patterns include pre-built environment images refreshed on regular cadence, warm sandbox pools for instant session starts, filesystem snapshots for session persistence, and multiplayer support for collaborative agent sessions. Critical optimizations include allowing file reads before git sync completes (blocking only writes), predictive sandbox warming when users start typing, and self-spawning agents for parallel task execution.
Tool Design Principles Tools are contracts between deterministic systems and non-deterministic agents. Effective tool design follows the consolidation principle (prefer single comprehensive tools over multiple narrow ones), returns contextual information in errors, supports response format options for token efficiency, and uses clear namespacing.
Context Compression When agent sessions exhaust memory, compression becomes mandatory. The correct optimization target is tokens-per-task, not tokens-per-request. Structured summarization with explicit sections for files, decisions, and next steps preserves more useful information than aggressive compression. Artifact trail integrity remains the weakest dimension across all compression methods.
Context Optimization Techniques include compaction (summarizing context near limits), observation masking (replacing verbose tool outputs with references), prefix caching (reusing KV blocks across requests), and strategic context partitioning (splitting work across sub-agents with isolated contexts).
Evaluation Frameworks Production agent evaluation requires multi-dimensional rubrics covering factual accuracy, completeness, tool efficiency, and process quality. Effective patterns include LLM-as-judge for scalability, human evaluation for edge cases, and end-state evaluation for agents that mutate persistent state.
Project Development Effective LLM project development begins with task-model fit analysis: validating through manual prototyping that a task is well-suited for LLM processing before building automation. Production pipelines follow staged, idempotent architectures (acquire, prepare, process, parse, render) with file system state management for debugging and caching. Structured output design with explicit format specifications enables reliable parsing. Start with minimal architecture and add complexity only when proven necessary.
The collection is organized around three core themes. First, context fundamentals establish what context is, how attention mechanisms work, and why context quality matters more than quantity. Second, architectural patterns cover the structures and coordination mechanisms that enable effective agent systems. Third, operational excellence addresses the ongoing work of optimizing and evaluating production systems.
Each skill can be used independently or in combination. Start with fundamentals to establish context management mental models. Branch into architectural patterns based on your system requirements. Reference operational skills when optimizing production systems.
The skills are platform-agnostic and work with Claude Code, Cursor, or any agent framework that supports custom instructions or skill-like constructs.
This collection integrates with itself—skills reference each other and build on shared concepts. The fundamentals skill provides context for all other skills. Architectural skills (multi-agent, memory, tools) can be combined for complex systems. Operational skills (optimization, evaluation) apply to any system built using the foundational and architectural skills.
Internal skills in this collection:
External resources on context engineering:
Created : 2025-12-20 Last Updated : 2025-12-25 Author : Agent Skills for Context Engineering Contributors Version : 1.2.0
Weekly Installs
608
Repository
GitHub Stars
14.2K
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubPassSocketFailSnykPass
Installed on
opencode520
gemini-cli508
codex498
cursor478
github-copilot468
amp419
AI 代码实施计划编写技能 | 自动化开发任务分解与 TDD 流程规划工具
41,400 周安装