跳到主要内容
知仓学习社ZHICANG

context-engineering

>-

不碰外部(只输出文字)无严重或高危命中mrgoonie/claudekit-skills

它会碰到什么

扫了多少17 个文本文件,49 KB
它会碰到什么不碰外部(只输出文字)
命中总数0 处
命中统计严重 0 · 高 0 · 中 0 · 低 0

这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。

技能内容

Context Engineering

Context engineering curates the smallest high-signal token set for LLM tasks. The goal: maximize reasoning quality while minimizing token usage.

When to Activate

  • Designing/debugging agent systems
  • Context limits constrain performance
  • Optimizing cost/latency
  • Building multi-agent coordination
  • Implementing memory systems
  • Evaluating agent performance
  • Developing LLM-powered pipelines

Core Principles

  1. Context quality > quantity - High-signal tokens beat exhaustive content
  2. Attention is finite - U-shaped curve favors beginning/end positions
  3. Progressive disclosure - Load information just-in-time
  4. Isolation prevents degradation - Partition work across sub-agents
  5. Measure before optimizing - Know your baseline

Quick Reference

| Topic | When to Use | Reference |

|-------|-------------|-----------|

| Fundamentals | Understanding context anatomy, attention mechanics | [context-fundamentals.md](./references/context-fundamentals.md) |

| Degradation | Debugging failures, lost-in-middle, poisoning | [context-degradation.md](./references/context-degradation.md) |

| Optimization | Compaction, masking, caching, partitioning | [context-optimization.md](./references/context-optimization.md) |

| Compression | Long sessions, summarization strategies | [context-compression.md](./references/context-compression.md) |

| Memory | Cross-session persistence, knowledge graphs | [memory-systems.md](./references/memory-systems.md) |

| Multi-Agent | Coordination patterns, context isolation | [multi-agent-patterns.md](./references/multi-agent-patterns.md) |

| Evaluation | Testing agents, LLM-as-Judge, metrics | [evaluation.md](./references/evaluation.md) |

| Tool Design | Tool consolidation, description engineering | [tool-design.md](./references/tool-design.md) |

| Pipelines | Project development, batch processing | [project-development.md](./references/project-development.md) |

Key Metrics

  • Token utilization: Warning at 70%, trigger optimization at 80%
  • Token variance: Explains 80% of agent performance variance
  • Multi-agent cost: ~15x single agent baseline
  • Compaction target: 50-70% reduction, <5% quality loss
  • Cache hit target: 70%+ for stable workloads

Four-Bucket Strategy

  1. Write: Save context externally (scratchpads, files)
  2. Select: Pull only relevant context (retrieval, filtering)
  3. Compress: Reduce tokens while preserving info (summarization)
  4. Isolate: Split across sub-agents (partitioning)

Anti-Patterns

  • Exhaustive context over curated context
  • Critical info in middle positions
  • No compaction triggers before limits
  • Single agent for parallelizable tasks
  • Tools without clear descriptions

Guidelines

  1. Place critical info at beginning/end of context
  2. Implement compaction at 70-80% utilization
  3. Use sub-agents for context isolation, not role-play
  4. Design tools with 4-question framework (what, when, inputs, returns)
  5. Optimize for tokens-per-task, not tokens-per-request
  6. Validate with probe-based evaluation
  7. Monitor KV-cache hit rates in production
  8. Start minimal, add complexity only when proven necessary

Scripts

  • [context_analyzer.py](./scripts/context_analyzer.py) - Context health analysis, degradation detection
  • [compression_evaluator.py](./scripts/compression_evaluator.py) - Compression quality evaluation

想直接用这个技能?

本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。

它属于哪个仓库

星标★ 2,216
本站分层T1
该仓技能数45
原文件路径.claude/skills/context-engineering/SKILL.md

同一个仓库里的其他技能

看这个仓库的全部 45 个技能