context-engineering

Configures rules files and curates context layers to improve AI agent output quality.

1|Updated May 29, 2026
One-click install
npx skills add https://github.com/memasanz/agent-harness --skill context-engineering-memasanz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-engineering
Source: https://github.com/memasanz/agent-harness/tree/main/.github/skills/context-engineering
Command: npx skills add https://github.com/memasanz/agent-harness --skill context-engineering-memasanz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI coding agents hallucinate APIs, ignore project conventions, and degrade in quality when they receive too little context, too much context, or stale context. This Skill provides a structured method for curating exactly what the agent sees at each stage of a session. ## Core Features & Use Cases - Five-Level Context Hierarchy: Organizes context from persistent rules files (CLAUDE.md, .cursorrules, copilot-instructions.md) down to per-iteration error output and conversation history. - Context Packing Strategies: Provides the Brain Dump, Selective Include, and Hierarchical Summary patterns for loading task-relevant files, specs, and examples without flooding the agent. - Confusion Management: Defines explicit patterns for surfacing spec-versus-code conflicts and missing requirements instead of silently guessing. - Use Case: When starting a new feature, you load only the relevant spec section, the files to modify, one existing pattern example, and project conventions — keeping context under 2,000 focused lines so the agent follows your codebase style instead of inventing its own. ## Quick Start Ask the agent to create a project rules file covering the tech stack, commands, conventions, and boundaries, then load only the files relevant to the current task.

Frequently Asked Questions about context-engineering

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

FAQPage Schema
How do I set up a rules file for AI coding agents?

Create a CLAUDE.md or equivalent file covering tech stack, build and test commands, code conventions, and boundaries. Include one short example of a well-written component in your style so the agent follows your patterns.

How much context should I give an AI coding agent?

Aim for under 2,000 lines of focused, task-relevant context per task. Loading more than 5,000 lines of non-specific context causes the agent to lose focus; more files does not mean better output.

Why does my AI agent ignore project conventions?

The agent cannot follow rules that are not written down. Conventions must live in a persistent rules file like CLAUDE.md, .cursorrules, or .github/copilot-instructions.md, plus one example of the pattern to follow.

What should I do when agent output quality degrades mid-session?

Start a fresh session when switching major features, summarize progress when context grows long, and compact the conversation before critical work. Stale accumulated context causes the agent to reference outdated patterns.

How do I handle conflicts between a spec and existing code?

Surface the conflict explicitly instead of silently picking one interpretation. Present the options — follow the spec, follow existing patterns, or ask — and let the human decide before building on an assumption.