context-engineering

Manage agent context with layered rules, specs, and selective source loading.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/chenxingqiang/tdd-agent-skills --skill context-engineering-chenxingqiang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-engineering
Source: https://github.com/chenxingqiang/tdd-agent-skills/tree/main/skills/context-engineering
Command: npx skills add https://github.com/chenxingqiang/tdd-agent-skills --skill context-engineering-chenxingqiang

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Optimizes the way you provide context to AI agents, ensuring the right information is available at the right time while avoiding context overload and drift.

Core Features & Use Cases

  • Context layering: centralizes rules files, specs, and source files to load per task.
  • Selective context packing: apply brain-dump, selective include, and hierarchical summary strategies to tailor context per task.
  • Stability and guardrails: maintain project conventions, prevent leakage of secrets, and refresh context when switching major tasks.

Quick Start

Create a rules file that persists across sessions (e.g., CLAUDE.md) with project-wide conventions, then load only the relevant spec and source files before starting.

Frequently Asked Questions about context-engineering

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize agent context to prevent output drift and improve quality?

To optimize agent context, load only relevant spec and source files before starting tasks. This prevents context overload and drift by ensuring the right information is available at the right time.

How do I maintain project conventions when switching between major tasks?

Maintain project conventions during task switching by creating a persistent rules file like CLAUDE.md. This centralizes project-wide rules and applies guardrails to refresh context and prevent leakage.

What is context layering and how does it work for AI agents?

Context layering centralizes rules files, specs, and source files to load per task. It uses selective context packing strategies like brain-dump and hierarchical summaries to tailor context for focused outputs.

How to set up a new session for AI agents without context overload?

Set up new sessions by creating a persistent rules file for conventions, then selectively loading only relevant spec and source files. This selective context packing avoids overload and maintains focused relevance.

Can I prevent secrets leakage when managing conversation context?

Yes, you can prevent secrets leakage by applying stability guardrails during context management. These guardrails maintain project conventions and ensure context is refreshed when switching major tasks.

Best way to pack selective context for feature-specific specs?

The best way to pack selective context is applying brain-dump, selective include, and hierarchical summary strategies. This tailors feature-specific specs and source files to maintain focused, relevant context.