Communityコーディング&開発github.com

コンテキストエンジニアリングコレクション

コンテキストエンジニアリング、ハーネスエンジニアリング、マルチエージェントアーキテクチャ、プロダクションエージェントシステムに関するエージェントスキルの包括的なコレクション。効果的なコンテキスト管理と信頼性の高い動作ループを必要とするエージェントシステムの構築、最適化、評価、デバッグ時に使用します。

コンテキストエンジニアリングコレクション とは?

このスキルコレクションは、プロダクショングレードのAIエージェントシステムを構築するための構造化されたガイダンスを提供します。コンテキストの基礎(注意メカニズム、劣化パターン)から、マルチエージェントアーキテクチャ、長期計画プロンプティング、メモリシステム設計、ツール設計原則までをカバーしています。特に注目すべきは、ファイルシステムをコンテキストストレージとして活用するパターンや、モデル自身がコンテキストを管理する自己管理型コンテキスト、オーケストレーターとワーカー間でKVキャッシュを共有する潜在ブリーフィングなどの高度な最適化技術です。また、ハーネスエンジニアリング、評価フレームワーク、自己改善ループといった運用面も網羅しており、Claude Code、Cursor、その他のカスタム命令をサポートするエージェントフレームワークと互換性があります。

対応✓Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering/tree/main

Installed? Explore more コーディング&開発 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

コンテキストエンジニアリングのためのエージェントスキル

このコレクションは、効果的なコンテキストエンジニアリングを通じてプロダクショングレードのAIエージェントシステムを構築するための構造化されたガイダンスを提供します。

アクティブ化のタイミング

以下の場合にこれらのスキルをアクティブ化してください:

  • 新しいエージェントシステムをゼロから構築する場合
  • 既存のエージェントパフォーマンスを最適化する場合
  • コンテキスト関連の障害をデバッグする場合
  • マルチエージェントアーキテクチャを設計する場合
  • エージェント用のツールを作成または評価する場合
  • メモリおよび永続化レイヤーを実装する場合
  • 自律型リサーチまたは評価ハーネスを設計する場合

スキルマップ

基礎的なコンテキストエンジニアリング

コンテキストの基礎を理解する コンテキストとは単なるプロンプトテキストではなく、推論時に言語モデルが利用できる完全な状態、すなわちシステム命令、ツール定義、取得されたドキュメント、メッセージ履歴、ツール出力を含みます。効果的なコンテキストエンジニアリングとは、目の前のタスクに本当に重要な情報を理解し、その情報を信号対雑音比が最大になるようにキュレーションすることを意味します。

コンテキストの劣化を認識する 言語モデルは、コンテキストが長くなるにつれて予測可能な劣化パターンを示します:コンテキスト中央の情報が注目を集めにくくなる「lost-in-middle」現象、先頭と末尾を優先するU字型の注意曲線、エラーが連鎖するコンテキスト汚染、そして無関係な情報が関連コンテンツを圧倒するコンテキスト分散です。

アーキテクチャパターン

マルチエージェント連携 プロダクションマルチエージェントシステムは、中央制御を持つスーパーバイザー/オーケストレーターアーキテクチャ、柔軟なハンドオフのためのピアツーピアスウォームアーキテクチャ、複雑なタスク分解のための階層構造という3つの支配的なパターンに収束します。重要な洞察は、サブエージェントは主に組織的な役割をシミュレートするためではなく、コンテキストを分離するために存在するということです。

長期計画プロンプティング 長時間実行される自律エージェントと並列オーケストレーションは、開始プロンプトで成功が決まります。擬似形式のタスクブリーフは、成功述語、非カウントアウトカム、監査ゲート付き戻り条件を持つ永続化ルール、努力の下限、並列ポートフォリオのための多様性ポリシー、汚染ガードを指定し、機械で確認可能な成功条件がない問題に対して、言語的に形式検証の規律を適用します。オーケストレーション実行では、各ワーカーは名前付きチェックを持つ出力契約を返し、証拠のある違反のみが戻りをブロックします。

メモリシステム設計 メモリアーキテクチャは、単純なスクラッチパッドから洗練された時系列ナレッジグラフまで多岐にわたります。ベクトルRAGはセマンティック検索を提供しますが、関係情報を失います。ナレッジグラフは構造を保持しますが、より多くのエンジニアリング投資を必要とします。ファイルシステムをメモリとして使用するパターンは、コンテキストウィンドウを詰め込むことなく、ジャストインタイムのコンテキストローディングを可能にします。

ファイルシステムベースのコンテキスト ファイルシステムは、事実上無制限のコンテキストを保存、取得、更新するための単一のインターフェースを提供します。主要なパターンには、ツール出力のオフロード用スクラッチパッド、長期タスク用の計画永続化、共有ファイルを介したサブエージェント間通信、動的スキルローディングが含まれます。エージェントは、対象を絞ったコンテキスト発見のために ls、glob、grep、read_file を使用し、構造的なクエリではセマンティック検索よりも優れたパフォーマンスを発揮することがよくあります。

ホステッドエージェントインフラストラクチャ バックグラウンドコーディングエージェントは、ローカルマシンではなくリモートのサンドボックス環境で実行されます。主要なパターンには、定期的にリフレッシュされるプリビルド環境イメージ、インスタントセッション開始のためのウォームサンドボックスプール、セッション永続化のためのファイルシステムスナップショット、協調エージェントセッションのためのマルチプレイヤーサポートが含まれます。重要な最適化として、git同期が完了する前のファイル読み取りの許可(書き込みのみをブロック)、ユーザーが入力を開始したときの予測的サンドボックスウォーミング、並列タスク実行のための自己スポーンエージェントが挙げられます。

ツール設計原則 ツールは、決定論的システムと非決定論的エージェント間の契約です。効果的なツール設計は、統合の原則(複数の狭いツールよりも単一の包括的なツールを優先)、エラーへのコンテキスト情報の返却、トークン効率のための応答フォーマットオプションのサポート、明確な名前空間の使用に従います。

運用の卓越性

コンテキスト圧縮 エージェントセッションがメモリを使い果たした場合、圧縮が必須になります。正しい最適化ターゲットは、リクエストあたりのトークンではなく、タスクあたりのトークンです。ファイル、決定、次のステップのための明示的なセクションを持つ構造化された要約は、積極的な圧縮よりも多くの有用な情報を保持します。成果物トレイルの整合性は、すべての圧縮方法において最も弱い次元のままです。

コンテキスト最適化 手法には、圧縮(限界に近いコンテキストの要約)、観測マスキング(冗長なツール出力を参照に置き換え)、プレフィックスキャッシング(リクエスト間でKVブロックを再利用)、戦略的コンテキスト分割(分離されたコンテキストを持つサブエージェント間での作業分割)が含まれます。

自己管理型コンテキスト モデル自身が(ハーネスではなく)ライブコンテキストに何を残すかを決定します:編集可能な領域はファイルとして公開され、モデルはコードツールで書き換え、ターンごとにパースし直します。ハーネスは不変条件(固定されたシステムおよびタスクプレフィックス、ロール折りたたみ、編集ゲート、レシート、決定論的バジェット読み出し、オーバーフロー時のロールバック)を維持します。編集コストは、プレフィックスキャッシングの下で編集後のテキストに比例するため、編集はバッチ化され、末尾を考慮して配置されます;戦略は指示によって導かれ、スキルとして進化させ、または成功ゲート付き効率報酬でトレーニングすることができます。

潜在ブリーフィング(KVメモリ共有) オーケストレーター・ワーカーシステムでは、スーパーバイザーが長い軌跡を蓄積する一方で、ワーカーは狭いテキスト部分のみを参照する場合にトークンが複合的に増加する可能性があります。潜在ブリーフィングは、タスク誘導型注意(Attention Matchingスタイルの圧縮)を使用して、ワーカーモデルのKVキャッシュ内でオーケストレーターの軌跡を圧縮し、スタックがワーカーのKV状態を公開しモデルが互換性がある場合に、ワーカーが全文再生なしで関連する潜在状態を受け取れるようにします。

評価フレームワーク プロダクションエージェントの評価には、決定論的チェックと、事実の正確性、完全性、ツール効率、プロセス品質をカバーする多次元ルーブリックが必要です。構造、証拠、ルーブリックの計算が有効になった後にのみ、モデルジャッジを使用してください;ジャッジ設計、ペアワイズ比較、バイアス軽減は高度な評価にルーティングしてください。

ハーネスエンジニアリング 信頼性の高い自律エージェントには、モデルの周りに明示的な動作ループが必要です:ロックされたメトリクス、編集可能なサーフェス、耐久性のあるログ、新規性チェック、ロールバックルール、人間による承認境界。ハーネスは、エージェントが評価者を弱体化させたり、圧縮によって状態を失ったり、あいまいな目標をレビュー不可能な変更に変えたりするのを防ぎます。

自己改善ループ ハーネス自体が最適化ターゲットになると、別の規律が適用されます:再帰的自己改善、メタハーネス検索、失敗駆動型の自己編集バウンド、進化的スキャフォールド検索、コンテキストメカニズムの進化です。制御制約は、経験的な2分割受理ゲート、生のトレースを含むファイルシステム経験アーカイブ、すべての編集可能なサーフェス外の実行時強制制約、そして崩壊を防ぐための多様性の維持です。

開発方法論

プロジェクト開発 効果的なLLMプロジェクト開発は、タスク・モデル適合分析から始まります:自動化を構築する前に、タスクがLLM処理に適していることを手動プロトタイピングを通じて検証します。プロダクションパイプラインは、段階的で冪等なアーキテクチャ(取得、準備、処理、パース、レンダリング)に従い、デバッグとキャッシングのためにファイルシステム状態管理を利用します。明示的なフォーマット仕様を持つ構造化出力設計により、信頼性の高いパースが可能になります。最小限のアーキテクチャから始め、必要であることが証明された場合にのみ複雑さを追加します。

認知アーキテクチャ

BDIメンタルステート 信念-欲求-意図モデリングは、構造化された外部コンテキストをエージェントのメンタルステートに変換する形式的な方法を提供します。合理的エージェンシー、説明可能性、そして信念、目標、選択された行動の間の監査可能なリンクを必要とするシステムに使用します。

コアコンセプト

このコレクションは4つのコアテーマを中心に構成されています。第一に、コンテキストの基礎は、コンテキストとは何か、注意メカニズムがどのように機能するか、なぜコンテキストの質が量よりも重要なのかを確立します。第二に、アーキテクチャパターンは、効果的なエージェントシステムを可能にする構造と連携メカニズムをカバーします。第三に、運用の卓越性は、最適化、評価、ハーネスの信頼性に対処します。第四に、開発方法論と認知アーキテクチャは、プロジェクトの実行と形式的なメンタルステートモデリングをカバーします。

実践的なガイダンス

各スキルは独立して、または組み合わせて使用できます。基礎から始めて、コンテキスト管理のメンタルモデルを確立してください。システム要件に基づいてアーキテクチャパターンに分岐してください。プロダクションシステムを最適化する際には、運用スキルを参照してください。

これらのスキルはプラットフォームに依存せず、Claude Code、Cursor、またはカスタム命令やスキル的な構造をサポートする任意のエージェントフレームワークで動作します。

統合

このコレクションはそれ自体と統合します——スキルは相互に参照し、共有されたコンセプトに基づいて構築されます。基礎スキルは、他のすべてのスキルにコンテキストを提供します。アーキテクチャスキル(マルチエージェント、メモリ、ツール)は、複雑なシステムのために組み合わせることができます。運用スキル(最適化、評価)は、基礎スキルとアーキテクチャスキルを使用して構築されたあらゆるシステムに適用できます。

参考文献

このコレクション内の内部スキル:

コンテキストエンジニアリングに関する外部リソース:

  • 注意メカニズムとコンテキストウィンドウの制限に関する研究
  • 主要なAIラボによるエージェントシステム設計に関するプロダクション経験
  • LangGraph、AutoGen、CrewAIのフレームワークドキュメント

スキルメタデータ

作成日: 2025-12-20 最終更新日: 2026-10-01 作成者: Agent Skills for Context Engineering Contributors バージョン: 2.6.0

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

advanced-evaluation

This skill should be used for advanced LLM evaluation: LLM-as-judge systems, direct scoring, pairwise comparison, rubric calibration, evaluator bias mitigation, confidence scoring, and automated quality assessment.

bdi-mental-states

This skill should be used when modeling agent mental states with BDI concepts: beliefs, desires, intentions, RDF-to-belief transformations, rational agency traces, cognitive agents, BDI ontologies, and neuro-symbolic AI integration.

book-sft-pipeline

This skill should be used for book-to-SFT pipelines: ePub extraction, literary segmentation, author-voice dataset construction, style-transfer training, LoRA workflows, and model evaluation for voice replication.

comprehensive-research-agent

Ensure thorough validation, error recovery, and transparent reasoning in research tasks with multiple tool calls

context-compression

This skill should be used when long-running agent sessions need context compression, structured summarization, compaction, token-per-task optimization, or durable handoff summaries that preserve decisions, files, risks, and next actions.

context-degradation

This skill should be used for diagnosing and mitigating context degradation: lost-in-middle failures, context poisoning, context clash, context confusion, attention-pattern issues, and agent performance degradation caused by accumulated or conflicting context.

context-fundamentals

This skill should be used to explain or reason about the foundational concepts of context engineering: what context is, the anatomy of a context window, how attention mechanics work, the U-shaped attention curve, why context quality matters more than quantity, and the mental models needed to interpret every other context-engineering decision. Use this for conceptual explanation, onboarding, and background reading. Route operational work to the specialized skills: debugging attention failures goes to context-degradation, token-efficiency work goes to context-optimization, conversation summarization goes to context-compression, and project-shape decisions go to project-development.

context-optimization

This skill should be used for improving context efficiency: context budgeting, observation masking, prefix or KV-cache strategy, partitioning, token-cost reduction, retrieval scoping, and extending effective context capacity without lowering answer quality.

evaluation

This skill should be used when building agent evaluation systems: deterministic checks, regression suites, multi-dimensional rubrics, quality gates, production monitoring, baseline comparison, and outcome measurement for agent pipelines.

filesystem-context

This skill should be used when agent work needs file-backed context: durable scratchpads, tool-output offloading, just-in-time discovery, cross-agent handoff files, filesystem memory, or cleanup policies for context stored outside the prompt.

harness-engineering

This skill should be used when designing autonomous agent harnesses: research loops, evaluation scaffolds, locked and editable surfaces, durable logs, novelty gates, pruning, rollback, PR preparation, and human approval boundaries.

hosted-agents

This skill should be used when designing hosted or background agent infrastructure: sandboxed execution, remote coding environments, warm pools, session persistence, multiplayer collaboration, self-spawning agents, or Modal-style sandboxes.

latent-briefing

This skill should be used when the user asks to "share memory between agents", "KV cache compaction for multi-agent", "orchestrator worker context", "latent briefing", "reduce worker tokens", "cross-agent memory without summarization", or discusses Attention Matching compaction, recursive language models with workers, or token explosion in hierarchical agents.

long-horizon-prompting

This skill should be used when writing, enhancing, or evaluating the launch prompt for a long-running autonomous agent or a parallel multi-agent orchestration attacking a hard problem: pseudo-formal task briefs that define terms and an exact success predicate linguistically, enumerate non-counting outcomes, set persistence rules with explicit stop and return conditions and effort floors, manage a diverse portfolio of parallel approaches with an approach registry and blocked-route bookkeeping, and gate the return on adversarial audit. Route agent topology and coordination protocols to multi-agent-patterns, runtime control surfaces and loop governance to harness-engineering, evaluator and quality-gate construction to evaluation, judge design to advanced-evaluation, and compaction or memory mechanics to context-compression and memory-systems.

memory-systems

This skill should be used for persistent semantic memory in agent systems: cross-session knowledge retention, entity tracking, temporal validity, graph or vector retrieval, memory consolidation, and memory benchmark selection. Route file-backed scratchpads to filesystem-context, handoff summaries to context-compression, and token-efficiency tactics to context-optimization.

multi-agent-patterns

This skill should be used when designing multi-agent systems that need context isolation, supervisor or swarm coordination, explicit handoffs, parallel execution, or a decision on whether multiple agents are justified.

project-development

This skill should be used for project-level decisions about LLM-powered systems: whether an LLM is the right primitive for the task at hand, the shape of a multi-stage batch or agent pipeline, token and cost estimation, choosing between single-agent and multi-agent at the project level, structured output design for downstream parsing, and structuring agent-assisted iteration. Use this when the unit of work is a whole project or a multi-stage pipeline. Route individual tool design to tool-design and individual skill-loading or context-budget tactics to context-optimization.

self-improvement-loops

This skill should be used when the harness, scaffold, workflow, or optimizer itself is the optimization target: recursive self-improvement (RSI) loops, meta-harnesses, self-improving harnesses that mine their own failures and propose bounded edits, evolutionary or population-based search over agent scaffolds, acceptance gates for self-modifying systems, and agentic context evolution where the mechanism that produces context is versioned and evolved. Route governance of a single autonomous loop (locked surfaces, durable logs, rollback, novelty gates, approval boundaries) to harness-engineering, measurement and quality-gate design to evaluation, judge design to advanced-evaluation, and remote sandbox infrastructure to hosted-agents.

self-managed-context

This skill should be used when a model gets read-write control over its own live context window instead of a harness-scheduled compaction policy: the context exposed as an editable file the model rewrites with code tools, model-driven eviction and in-place updates, the harness invariants that keep self-editing safe (pinned prefix, edit gate, edit receipts, budget readouts, rollback on overflow), the prefix-cache cost of mid-context edits, and steering or training the model's own context-editing strategy. Route note content and fixed-threshold summarization to context-compression, cache-stable layout under harness control to context-optimization, file offloading to filesystem-context, and loop governance to self-improvement-loops.

tool-design

This skill should be used for the tool-interface layer of an agent system specifically: writing tool descriptions agents can route on, designing tool schemas and response formats, naming conventions, actionable error recovery messages, MCP server design, tool-set consolidation, and deciding when to add or remove an individual tool. Use this when the unit of work is a single tool or a set of tools. Route project-shape, pipeline architecture, and task-model-fit decisions to project-development; route deciding whether to introduce sub-agents to multi-agent-patterns.

関連スキル