SkillAgentSearch skills...

Context Engineering

[WIP] Context engineering: the art and science of shaping context-aware AI systems

Install / Use

/learn @bonigarcia/Context Engineering

README

Context engineering

Context engineering can be defined as the practice of designing systems that provide a Large Language Model (LLM) 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 system 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 engineering discipline. Since then, I've been working on a book entitled Context engineering: the art and science of shaping context-aware AI systems, to be published by Manning in 2026.

This GitHub repository is intended to be a companion resource for this book and a go-to reference for practitioners looking to understand and adopt the context engineering principles.

Warning: This repository is a work in progress, so content and structure may change.

Table of contents

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:

  1. Introduction to context engineering
  2. System instructions and user prompts
  3. Retrieval and external knowledge
  4. Tools and memory for AI agents
  5. State and multi-agent systems
  6. Context management and evaluation
  7. Context in AI frameworks
  8. Context engineering in real-world environments
  9. Context engineering through the software development lifecycle
  10. State of the art on context engineering
    Appendix A. The AI ecosystem
    Appendix B. References and further reading

Each chapter of this book starts by explaining the underlying principles and patterns of each thematic block. Then, the final part of each chapter is devoted to presenting specific examples. This GitHub repository contains all these examples. Moreover, I will include new examples and maintain the existing ones even after the book is published. The goal is to provide an open-source, updated reference for everyone interested in context engineering.

Online tool

This repo also hosts the context-aware prompt builder, an online tool presented in chapter 2 for designing, comparing, and reusing structured prompts across multiple frameworks and AI models.

Resources

Although the concept of context engineering is new, the underlying technologies (LLMs, AI agents, prompt engineering, RAG, MCP, memory management, etc.) have been developed over the years. Nevertheless, summarizing all these converging technologies and tools in a single book is a very challenging task. As you know, nowadays there is more information than ever, and it is very easy to get lost with so many sources. This section summarizes some of the most relevant references and resources I found during my journey to unravel the essence of context engineering.

Context Engineering

Prompt Engineering

  • Prompt Engineering (Lee Boonstra, 2025) Overview of prompt engineering principles and methods aimed at helping developers construct effective prompts for LLMs.
  • Prompt Engineering Guide (PromptingGuide.ai, 2025) Guide that defines prompt engineering as a discipline for designing and optimizing prompts to make LLMs perform better on diverse tasks, offering techniques, references, and best practices.
  • The Prompt Engineering Playbook for Programmers (Addy Osmani, 2025) Practical playbook targeting programmers, giving structured guidelines and patterns for writing prompts that yield consistent and reliable outputs from AI.
  • Anthropic's Prompt Engineering Interactive Tutorial (Anthropic, 2025) Hands-on tutorial that walks users step-by-step through designing and refining prompts (with exercises and example-based practice) to get better results from their models.
  • Meta's prompt engineering guide (Meta, 2025) Guide describing how to craft prompts for their models, covering best practices to structure instructions, context, and examples for improved performance.
  • Google's Gemini prompt engineering guide (Google, 2025) How to write effective prompts for Google's Gemini (or related models), emphasizing clarity, context, and structured prompting for reliable responses.
  • Prompt examples, by OpenAI (OpenAI, 2025) Collection of sample prompts illustrating good practices and giving real-world examples to help users understand how to frame prompts effectively for best results.
  • Prompt Library, by Anthropic (Anthropic, 2025) Repository of tested prompt templates and examples, serving as a practical library for users to build on and adapt for their own AI tasks.

AI Agents

  • Introduction to Agents, by Alan Blount et al. (Alan Blount et al., 2025) Definition of agent as a complete application, combining LLM reasoning, tooling and orchestration that plans and acts autonomously rather than just responding to single prompts.
  • What are AI Agents? Why do they matter? (Addy Osmani, 2025) Explanation that AI agents are programs that use language models and tools to perform goal-driven tasks, emphasizing their importance for automating complex workflows.
  • Agents Companion, by Antonio Gulli et al. (Antonio Gulli et al., 2025) Whitepaper presenting production-grade considerations for agents: orchestration, memory, evaluation,
View on GitHub
GitHub Stars37
CategoryDevelopment
Updated13h ago
Forks5

Languages

Python

Security Score

95/100

Audited on Mar 27, 2026

No findings