by bonigarcia
Context Engineering: Build Consistent, Accurate, Predictable AI Systems
# Add to your Claude Code skills
git clone https://github.com/bonigarcia/context-engineeringGuides for using ai agents skills like context-engineering.
Last scanned: 7/20/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-07-20T06:45:00.736Z",
"npmAuditRan": true,
"pipAuditRan": true,
"promptInjectionRan": true
}
Context engineering can be defined as the practice of designing systems that provide a Large Language Model (LLM) and AI agents with all the necessary information to complete a task effectively. It goes beyond prompt engineering since it focuses on building a comprehensive and structured context from various sources like instructions, external knowledge, memory, tools, and state. The central idea is that the success of a complex LLM-based system depends more on the quality and completeness of the context provided than on the specific wording of the prompt itself.
Tobi Lütke, the CEO of Shopify, coined the term context engineering in a tweet on June 19, 2025. He defined context engineering as the art of providing all the context for the task to be plausibly solvable by the LLM. This novel concept captures the essence of the current evolution of LLM-based systems, inspiring others (like me) to understand and define this emerging discipline. Since then, I've been working on a book entitled Context Engineering: Build Consistent, Accurate, Predictable AI Systems, published by Manning. Currently, the early access version of the book is available, and you can get it here.
This GitHub repository is intended to be a companion resource for this book and a reference for practitioners looking to understand and adopt the context engineering principles.
This book aims to provide a strong, general-purpose theoretical foundation for context engineering, supported by hands-on examples. Its table of contents is the following:
Each chapter of this book begins by explaining the underlying principles and patterns of each thematic block. The final part of each chapter then presents specific examples, all of which are available in this GitHub repository. New examples will continue to be added, and existing ones maintained, even after the book is published. The goal is to provide an open-source, up-to-date reference for everyone interested in context engineering.
This repository organizes examples by chapter to help you explore context engineering concepts in practice.
This chapter provides the foundations for interacting with different model providers:
This chapter covers the definition and usage of instructions (system prompts, agent skills, instructions artifacts) as a foundation layer to shape the model behavior:
This chapter explores different patterns for providing external knowledge to a model:
This chapter focuses on extending the capabilities of AI agents through tools:
This chapter explores how to maintain information across interactions using memory and state:
This chapter focuses on the design and optimization of user prompts, including techniques like few-shot prompting, prompt chaining, Chain-of-Thought, or ReAct:
This chapter focuses on managing and orchestrating context in complex agentic systems, including context compression, hierarchical context, or multi-agent patterns:
This chapter covers evaluation and observability for context-aware systems:
This chapter covers governance, human oversight, and operational patterns for context-aware systems:
context-engineering is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by bonigarcia. Context Engineering: Build Consistent, Accurate, Predictable AI Systems. It has 100 GitHub stars.
Yes. context-engineering passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/bonigarcia/context-engineering" and add it to your Claude Code skills directory (see the Installation section above).
context-engineering is primarily written in Python. It is open-source under bonigarcia on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh context-engineering against similar tools.
No comments yet. Be the first to share your thoughts!