Model or dataset
WakeUp-Jin/Practical-Guide-to-Context-Engineering avatar
WakeUp-Jin/Practical-Guide-to-Context-Engineering

Practical Guide to Context Engineering: a Chinese documentation set on agent harness design

大模型应用开发 -上下文工程与运行空间实践指南,上下文工程是设计原则,Agent Harness 是构建目标,本项目的目标,是为开发者和研究者提供一份大模型应用开发的骨架思路

845 stars68 forksUnknownLicense varies

At a glance

What is it?
This repository is a VitePress documentation site that argues context engineering is a design principle and the agent harness is the build target, with chapters on RAG strategy, tool management, memory, session storage, structured output, context compression and multi-agent forms. It is written in Chinese, with an English version linked, and ships no runnable code.
Who is it for?
The Practical Guide fits a developer or researcher who wants a Chinese-language map of how context engineering and agent harness design fit together, particularly if you are working on a TypeScript agent stack and want chapter references on tool scheduling, Bash sandboxing, Grep and Glob, or context compression rather than reinventing those designs. It does not fit an engineer who needs a library, a working reference implementation, or English documentation.
Can I use it commercially?
Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
Is it still maintained?
Yes. The repository last received commits 100 days ago.
What is it written in?
GitHub does not report a main language for this repository.

Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.

Editorial analysis

The one distinction the whole guide is built around

The guide's central claim is a distinction between a principle and a target. Context engineering is defined as selecting, organising and injecting information highly relevant to a user input or task within a limited context window, so that a large language model can reason and execute within reasonable bounds. Harness engineering goes further and is defined as building a running space for an agent, designing its capability structure, its collaboration mechanisms and its feedback loops, so that it produces high quality results reliably in a specific domain.

The relationship between the two is described in two ways. Conceptually, context engineering is a subset of harness engineering: within the harness, some modules serve context directly, such as RAG, memory and the system prompt, some serve it indirectly, such as context management and agent evaluation, and some serve the agent's stable operation more generally. The closer a module sits to the centre, the more directly it operates on context, and the further out it leans towards infrastructure.

The other way of describing it is historical. The path runs from context, to context engineering, to harness engineering. The earliest stage was simply deciding what content to hand the model. As requirements grew more complex, the construction of that content began to be managed systematically, which is context engineering. When agents took on harder tasks, managing context alone stopped being enough, and a full operating environment became necessary. The guide is careful that this is an extension rather than a replacement, with each stage wrapping one more layer around the previous one.

Where context engineering sits against RAG and prompt engineering

Two boundaries are drawn explicitly, and both are useful because they are the two comparisons people usually get wrong.

The first is with RAG. The guide states that RAG is a subset of context engineering, which reframes retrieval as one technique among several ways of filling the context window rather than as the approach to context management. The RAG chapter in the contents is described as running from the retrieval augmented generation flow through to optimisation methods, covering index construction, retrieval strategy and fusion methods.

The second is with prompt engineering. Prompt engineering is described as the art of crafting the correct instruction at the very front of the model, mainly a matter of designing a perfect instruction set inside a single text string. Context engineering is the wider discipline of deciding what goes into the window at all.

The guide leans on Andrej Karpathy for the framing, quoting his summary that in every industrial LLM application context engineering is a subtle art and science, filling the context window with just the right information for the next step, through task descriptions and explanations, few-shot examples, RAG, relevant and possibly multimodal data, tools, state and history, and compression. Too little or badly formed and the model lacks the context to optimise performance; too much or too irrelevant and cost rises and performance falls. The guide's own emphasis falls on the entry point of the system: finding the most relevant information for a user input, and treating that relevance as the core metric for the whole system, while noting that it does not happen by itself and depends on developers designing, building and optimising the system.

The seven context types and the modules hanging off them

The body of the guide is organised around seven types of context, with each type producing its own set of engineering modules. The contents list the system prompt as still to be filled in, which is worth noting because it means the guide is a work in progress rather than a finished reference.

Tool management is the largest cluster. There is an overview chapter, then chapters on developing the tool scheduling and permission module, on the Bash tool implementation and its security and permission design, on engineering the Bash tool for background execution and sandbox permissions, on the Grep and Glob file retrieval core, on the Write and Edit tool implementation details, and on the tool definitions and management in a reverse engineering study of Claude Code written in TypeScript. The Bash chapters are described in detail, with background running and sandbox permission design treated as first class topics.

User memory has its own chapter on designing the assistant agent's memory module. Session storage has two, one on a Redis cache backend with read-through and write-through behaviour, and one on a multi-backend storage design with backup and degradation strategy. Structured output has a chapter on methods for JSON structured output and another on why JSON output costs more than TSV. The LLM module collects a design study, a service layer implementation design, and an analysis of another project's LLM service architecture.

The breadth is the point. The guide's stated goal is to give developers and researchers a skeleton way of thinking about LLM application development, with context composition as the core, so that the technical pieces of LLM application development can be connected to each other.

Context management as a cross-cutting policy

Context management is presented separately from the context types because it is a global strategy that spans modules. The chapters cover trimming, compression, deduplication and isolation, followed by a chapter on compression scheduling for tool results and conversation history, and one that parses the actual compression prompts used by Claude Code and Gemini. A further chapter compares token compression strategies, including summarisation, vector aggregation and sentence window retrieval.

That the guide parses the compression instructions of two shipping products is a useful signal about the level it works at. The subject is not what compression is in the abstract but what specific systems do, which is the level at which you have to operate if you are building something similar.

The agent runtime space chapter covers the shape of the agent, with a chapter contrasting collaborative agents with autonomous agents, one on single agent versus multi-agent strategy, and one on multi-agent collaboration patterns named Agent Team and Agent Room. Agent evaluation gets three chapters, covering the evaluation plan and method, a TypeScript implementation of an evaluator, and a survey of evaluation methods for different kinds of agent. The runtime space also includes scheduled tasks and a KAIROS pattern for making an agent proactive rather than reactive, and a design note on wiring in Browser Use.

A separate practice section collects case studies, including a project introduction document, a write-up of Claude Code configuration from an Anthropic hackathon winner, notes on engineering practice for coding agents drawn from OpenAI and Anthropic experience, and lessons from building Claude Code including how skills are run.

A documentation site with almost no code

The repository is a VitePress site, and the package manifest makes that explicit. The scripts are a development server, a build and a preview:

json
    "docs:dev": "vitepress dev docs",
    "docs:build": "vitepress build docs",
    "docs:preview": "vitepress preview docs"

The only dependency is medium-zoom, for image zoom in the documentation, and the only dev dependency is vitepress at an alpha version, 2.0.0-alpha.12. The package is named Practical Guide to Context Engineering, version 1.0.0, and the manifest declares ISC as its licence while the repository itself carries a NOTICE.txt file and no LICENSE file, and the licence field on the repository is unknown.

The top-level entries show the same shape. There is a docs directory holding the chapters, a docs.json file which is the VitePress configuration, a record directory, a Chinese named contribution guide, and a pnpm lock file. The docs directory is organised into Chinese named subfolders covering the overview, RAG technique, search agents, tool management, the memory module, session storage, structured output, the LLM module, context management, agent forms, agent evaluation, the agent runtime space, and case studies, plus an update diary appendix.

The site is published at wakeup-jin.github.io, and the README links an English version at README_en.md. The primary language of the repository is recorded as unknown, and the topic tags are simply javascript and typescript, which reflects that the codebase is the documentation site rather than the subject matter.

Where this guide is the wrong choice

The first limitation is the language. The chapter titles, the body text and even the directory names are Chinese. There is a link to an English README, but the contents navigation in the repository lists every chapter with a Chinese filename, and it is not stated which chapters have English counterparts or whether the English version covers the same chapters. For a reader who does not read Chinese, this is a partial document at best.

The second is that there is no code. The repository ships no library, no reference implementation and no runnable example. Every design is described in prose and diagrams, and the single TypeScript implementation chapter is one chapter rather than a codebase you can depend on. If your goal is to build an agent, this is a reading list and a set of design positions, and the engineering work is still yours. The package.json test script is a placeholder that echoes an error, which is another way of saying the repository has no test suite.

The third is staleness in a fast field. The last push to the repository was on 2026-07-15, more than three months before today, and the guide covers products that move quickly, including the compression prompts of Claude Code and Gemini, the WebRTC and browser-use integration designs, and multi-agent collaboration patterns. Those chapters are snapshots of behaviour that changes between model releases.

The fairest comparison is with vendor documentation and with a good blog series. A guide like this has the value that it is a coherent position rather than a set of recipes, and it names the distinctions that matter, subset versus discipline, principle versus target, extension rather than replacement. What it cannot be is a dependency. Read it for the framing, and take the implementation decisions to the primary sources it points at.

Editorial conclusion

The Practical Guide fits a developer or researcher who wants a Chinese-language map of how context engineering and agent harness design fit together, particularly if you are working on a TypeScript agent stack and want chapter references on tool scheduling, Bash sandboxing, Grep and Glob, or context compression rather than reinventing those designs. It does not fit an engineer who needs a library, a working reference implementation, or English documentation. Before relying on it, check the language situation yourself, since the site links an English version while the chapter filenames and body text in the repository are Chinese, confirm the parts you care about have been written rather than left as placeholders, and treat the Reverse Engineering chapter on Claude Code as analysis of someone else's implementation rather than a specification.

Frequently asked questions

What is the Practical Guide to Context Engineering?

It is a Chinese-language VitePress documentation set that argues context engineering is a design principle and the agent harness is the build target. It is aimed at developers and researchers who want a skeleton way of thinking about LLM application development with context composition at the centre.

How does context engineering differ from RAG according to the guide?

The guide states that RAG is a subset of context engineering. Context engineering is defined as selecting, organising and injecting task-relevant information within a limited context window, of which retrieval is one technique among several.

What topics does the guide cover in depth?

Tool management, including tool scheduling and permissions, Bash sandboxing and background execution, Grep and Glob, Write and Edit, and a reverse engineering study of Claude Code tool definitions. Also user memory, session storage with Redis, structured output and JSON cost, the LLM service layer, context trimming and compression, agent evaluation, single and multi-agent forms, and scheduled task patterns.

How do I run the documentation site locally?

The site is a VitePress project, so the manifest defines a development server script, `vitepress dev docs`, plus a build script, `vitepress build docs`, and a preview script, `vitepress preview docs`. The only dev dependency is vitepress at 2.0.0-alpha.12, with medium-zoom as the runtime dependency.

Is there an English version of the guide?

The README links an English version at README_en.md, and the published site is at wakeup-jin.github.io. The chapter files and navigation in the repository are in Chinese, so check which chapters have English counterparts before relying on them.

Official sources

  1. Issues
  2. Project website
  3. README
  4. WakeUp-Jin/Practical-Guide-to-Context-Engineering on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/wakeup-jin-practical-guide-to-context-engineering.svg)](https://hysenlabs.com/projects/wakeup-jin-practical-guide-to-context-engineering)

Was this useful?