context-engineering

Configures rules files, context hierarchy, and budget management for AI coding agents.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI coding agents produce inconsistent or hallucinated output when they receive too little context, too much context, or stale context. This Skill provides a structured methodology for curating what an agent sees at each stage of a session so output follows project conventions instead of inventing APIs. ## Core Features & Use Cases - Five-Level Context Hierarchy: Structures context from persistent rules files (CLAUDE.md, .cursorrules, AGENTS.md) down through specs, source files, error output, and conversation history. - Context Budget Management: Trims failed attempts and verbose tool output starting at 75% window capacity, compresses exploration into summaries, and positions task-critical content last to counter the lost-in-the-middle effect. - Confusion Management: Surfaces spec-versus-code conflicts and missing requirements as explicit options instead of silently guessing, with an inline planning pattern for multi-step tasks. - Use Case: When an agent starts ignoring your naming conventions mid-project, apply this Skill to write a rules file, restart the session at a task boundary, and reload only the relevant spec section and source files. ## Quick Start Ask the agent to audit the current session context and create a CLAUDE.md rules file covering the tech stack, commands, conventions, and boundaries for this project.

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 CLAUDE.md rules file for my project?

Create a CLAUDE.md at the project root covering tech stack, build and test commands, code conventions, and boundaries such as never committing secrets. Include one short example of a well-written component so the agent follows your style.

How to fix AI agent output quality degrading mid-session?

Degrading output usually means stale or bloated context. Start trimming at 75% window capacity by removing failed attempts and verbose tool output, compress old exploration into one-line summaries, and restart the session at a completed task boundary if drift continues.

What is the equivalent of CLAUDE.md for Cursor and Copilot?

Cursor uses .cursorrules or .cursor/rules/*.md files, GitHub Copilot uses .github/copilot-instructions.md, Windsurf uses .windsurfrules, and OpenAI Codex uses AGENTS.md. All serve the same purpose of persistent project-wide rules.

How much context should I give an AI coding agent per task?

Aim for under 2,000 lines of focused context per task. Loading more than roughly 5,000 lines of non-task-specific material causes the agent to lose focus, so include only the files being modified, related tests, and one pattern example.

When should I start a fresh agent session instead of continuing?

Start fresh when switching between major features or when context has drifted from current code. Before leaving, persist the accepted scope, task status, changed files, verification results, and open questions so the new session can resume from artifacts rather than conversation history.