context-engineering
Skill này làm gì
Skill này giải thích cách sắp xếp thông tin mà một agent AI thấy khi làm việc. Skill dành cho người xây dựng hoặc sửa thiết lập agent hay quên chi tiết hoặc lặp lại chính mình. Đây là bản chụp cũ, nên hãy kiểm tra lời khuyên của nó với các mô hình hiện tại.
Khi nào nên dùng
- ✓Khi một agent đi lệch, lặp lại chính mình hoặc quên các giới hạn quan trọng giữa một tác vụ.
- ✓Khi bạn quyết định hướng dẫn nào nên tải ngay từ đầu và hướng dẫn nào chỉ tải khi cần.
- ✓Khi bạn lên kế hoạch cho cách một agent chuyển công việc cho agent khác.
Liên kết skill
https://github.com/mvschwarz/openrig/blob/main/packages/daemon/specs/agents/shared/skills/process/context-engineering/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Agent AI của tôi cứ quên quy tắc của tôi giữa chừng một tác vụ dài. Tôi nên thiết lập ngữ cảnh của nó thế nào?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill mô tả cách thông tin trong cửa sổ của agent được chọn, cắt bớt và chia sẻ. Đây là bản chụp các thực hành của năm 2024 và 2025, nên agent cần kiểm tra lời khuyên trước khi dựa vào nó.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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)
**
Câu hỏi thường gặp
Lời khuyên này còn đúng không?
Đó là bản chụp thực hành năm 2024 và 2025, và skill nói hãy kiểm chứng trước khi dựa vào.
Nó chỉ áp dụng cho một agent đơn lẻ à?
Không. Nó cũng bao quát khi nào dùng subagent và cách chuyển công việc giữa các agent.
Ngữ cảnh gồm những gì?
Mọi thứ agent thấy, như hướng dẫn, định nghĩa công cụ, dữ liệu truy xuất và các tin nhắn trước đó.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 8.6k
- Vị trí xếp hạng
- #12423
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
agent-operated-software
8.6kGiúp agent của bạn thiết kế, xây dựng hoặc gỡ lỗi một ứng dụng đang chạy có backend là agent AI, như một lớp điều khiển agent bằng Markdown hoặc JSON.
agent-operated-workflows
8.6kGiúp agent của bạn quyết định một quy trình có ranh giới nên do agent AI hay code thông thường điều khiển, và cách tiếp tục từ bằng chứng đã xác minh.
applying-a-permission-policy
8.6kGiúp agent của bạn thiết lập quyền lệnh mà agent lập trình AI dùng khi cài đặt đội, để các lệnh thông thường chạy với ít lần xác nhận hơn.
claude-compaction-restore
8.6kGiúp agent Claude Code dựng lại bức tranh làm việc sau khi ngữ cảnh bị nén, bằng một bản đồ khôi phục đã lưu, transcript và các file nó đã chạm vào.
Skill tương tự
writing-skills
311kDạy agent của bạn viết skill mới và kiểm thử từng skill trước, kiểm tra xem skill có thực sự thay đổi cách agent hành xử hay không.
writing-for-agents
310kGiải thích cách viết hướng dẫn rõ ràng cho agent AI, gồm skill, tệp AGENTS.md và CLAUDE.md, để agent cư xử nhất quán.
bengali-nlp
280kGiúp agent của bạn xử lý văn bản tiếng Bengali, hỗ trợ hiểu ngôn ngữ này, chuẩn hóa văn bản và xử lý các đặc điểm riêng của nó.