context-engineering
できること
このスキルは、AIエージェントが作業中に見る情報を整理する方法を説明します。忘れたり繰り返したりするエージェントの設定を作る、または直す人向けです。これは2024年と2025年時点のスナップショットなので、現在のモデルに照らして助言を確認してください。
使う場面
- ✓作業の途中で、エージェントが方向を外れたり、同じことを繰り返したり、大事な制限を忘れたりするとき。
- ✓開始時に読み込む指示と、必要なときだけ読み込む指示を決めるとき。
- ✓あるエージェントから別のエージェントへ、作業をどう渡すかを計画するとき。
スキルのリンク
https://github.com/mvschwarz/openrig/blob/main/packages/daemon/specs/agents/shared/skills/process/context-engineering/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私のAIエージェントが、長い作業の途中で私のルールを忘れてしまいます。どのようにコンテキストを設定すべきですか?”
毎週5つの新しいスキル。1分で読めます。
仕組み
このスキルは、エージェントのウィンドウに入る情報が、どのように選ばれ、削られ、共有されるかを説明します。2024年と2025年の実践のスナップショットなので、エージェントは頼る前に助言を確認するようにとしています。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Traditional Context Engineering — 2024–2025 Snapshot
Status: provisional historical research snapshot
This skill is a provisional historical research snapshot of context-engineering practice as published in 2024–2025. It is NOT normative. Do not apply it prescriptively to current frontier models without re-verification. On any conflict, OpenRig current skills, explicit user rulings, and directly measured OpenRig practice PREVAIL over this document. Treat these areas as particularly suspect pending re-verification: compaction/summarization guidance, minimal-upfront versus broad orientation, just-in-time lookup assumptions, fixed context ceilings, and single-agent versus multi-agent advice.
Curated distillation of the best publicly available expertise on context engineering for coding agents, drawn from primary sources at Anthropic, OpenAI, and leading practitioners (Manus, Cognition, Chroma, LangChain, Drew Breunig, and others). Load on the moments the description names; it is deliberately not part of any base walk.
1. The mental model: what context engineering is
Definition. Context engineering is "the set of strategies for curating and maintaining the optimal set of tokens (information) during LLM inference" — everything that lands in the window: system instructions, tool definitions, retrieved data, message history, and tool outputs, not just the prompt text (Anthropic, Effective context engineering for AI agents). Andrej Karpathy's framing, popularized via LangChain: "the delicate art and science of filling the context window with just the right information for the next step" — the LLM is a CPU and the context window is its RAM, and your job is deciding what gets loaded into RAM at each step (LangChain, Context Engineering for Agents).
Why it superseded prompt engineering. A chatbot answers one question with whatever fits in one turn. An agent runs in a loop, accumulating tool results, file contents, and history across dozens or hundreds of steps. The improvements stop coming from rewording instructions and start coming from rewiring — what the agent retrieves, in what order, and what gets evicted when the window fills (Anthropic, ibid.). Philipp Schmid's formulation of the practical consequence: "Agent failures aren't only model failures; they are context failures." Most of the time when a capable model does something dumb, the context it was given made the dumb thing likely (Schmid, The New Skill in AI is Context Engineering).
The physical constraint: attention is a budget, not a bucket. Three mechanisms make context a scarce resource rather than free storage:
- Quadratic attention. In a transformer, every token attends to every other token — n² pairwise relationships. Longer sequences stretch the model's ability to capture them, and models are trained on distributions where short sequences dominate, so they have fewer specialized parameters for context-wide dependencies. The result is "a performance gradient rather than a hard cliff" (Anthropic, Effective context engineering).
- Context rot. Chroma's study of 18 frontier models showed reliability degrades as input length grows even on trivially simple tasks like retrieval and text replication — and degradation starts well before the window is full. What matters is not just length: distractor presence, needle–question similarity, and haystack structure all change how fast performance collapses (Chroma, Context Rot).
- Position effects. Models exhibit a U-shaped attention curve: information at the beginning or end of a long context is used far better than information in the middle (Liu et al., Lost in the Middle).
The one-sentence discipline. From Anthropic: "Find the smallest set of high-signal tokens that maximize the likelihood of some desired outcome." Everything else in this pack is a technique in service of that sentence.
The components you are engineering. Schmid's inventory is a useful checklist of what actually occupies the window: (1) system instructions, (2) the user's immediate request, (3) state/history of the current session, (4) long-term memory, (5) retrieved external information, (6) tool definitions, (7) output-format specifications (Schmid, ibid.). Each is a separate dial. When an agent misbehaves, walk this list asking "which of these is missing, stale, bloated, or contradictory?"
2. Core principles (and the why behind each)
**
よくある質問
この助言は今でも有効ですか?
2024年と2025年の実践のスナップショットで、頼る前に確認するようスキルは述べています。
単独のエージェントだけに当てはまりますか?
いいえ。サブエージェントを使うべきときや、エージェント同士で作業を渡す方法も扱います。
コンテキストとは何ですか?
指示、ツールの定義、取得したデータ、過去のメッセージなど、エージェントが見るすべてのものです。
詳細
作者による元の説明
Use when designing, reviewing, or debugging how an agent's context window gets filled, pruned, or shared — choosing what loads at boot versus on demand, sizing an install or an always-loaded file, fixing an agent that drifts, repeats itself, or forgets constraints mid-task, planning compaction or summarization, deciding single-agent versus subagents, engineering handoffs between agents, or picking a tool loadout. NOT for rewording a prompt's tone, choosing which model to pin, or debugging business logic — those are adjacent moments this skill does not serve. Historical 2024–2025 snapshot; not
repo: mvschwarz/openrig
人気
- GitHubのスター
- 8.6k
- ランキング
- #12423
- ライセンス
- Apache-2.0
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
agent-operated-software
8.6kエージェントが、AIエージェントを稼働中のバックエンドに含む継続的なアプリを設計、構築、デバッグできるよう支援します。MarkdownやJSONのエージェント制御層を含みます。
agent-operated-workflows
8.6kエージェントが、限定された定型の手順をAIエージェントが動かすべきか通常のコードが動かすべきかを判断し、検証済みの証拠から再開する方法を決められるよう支援します。
applying-a-permission-policy
8.6kエージェントが、チームの設定時に使うコマンドの許可を設定し、通常のコマンドが承認の確認を何度も求めないよう支援します。
claude-compaction-restore
8.6kClaude Codeのエージェントが、コンテキストが圧縮された後に、保存された復元用のマップ、トランスクリプト、触れたファイルを使い、作業の全体像を組み直せるよう支援します。
似ているスキル
writing-skills
311k新しいスキルを書き、それぞれをまず試すようエージェントに教えます。そのスキルが実際にエージェントの動作を変えることを確認します。
writing-for-agents
310kスキル、AGENTS.md、CLAUDE.mdを含め、AIエージェントのための明確な指示の書き方を説明し、エージェントが予測可能に動くようにします。
bengali-nlp
280kエージェントがベンガル語のテキストを処理できるようにします。テキストの正規化など、ベンガル語特有の性質に対応しながら、言語を理解して扱えるようにします。