<< All versions

Skill v1.0.0

currentAutomated scan100/100
evgeniy-mikhailove/rlm-claude-code-os/context-engineering
──Details
PublishedNovember 15, 2026 at 10:07 AM
Content Hashsha256:7e01133b1bc51d46...
Git SHA0618f6138c74
──Files
Files (1 file, 5.0 KB)
SKILL.md5.0 KBactive
SKILL.md · 174 lines · 5.0 KB

name: context-engineering description: Feed agents the right information at the right time. Context quality not quantity drives output. Structure CLAUDE.md, specs, and source files for maximum agent effectiveness. triggers:

  • "context engineering"
  • "agent context"
  • "claude.md setup"
  • "rules file"
  • "context quality"
  • "настройка контекста"
  • "правила для агента"

id: context-engineering runtime: claude-only canonical_path: ~/.claude/skills/context-engineering/SKILL.md updated: 2026-05-15 tags: [context, engineering] metadata: version: "1.0.0"


context-engineering

Source: addyosmani/agent-skills — Apache 2.0

Core Principle

Context quality, not quantity, drives agent output. Research shows agent performance degrades with excessive unfocused instructions. Target: <2,000 lines of focused context per task.

Context Hierarchy (Persistent → Transient)

1. Rules Files (CLAUDE.md) ← project-wide conventions
2. Specs & Architecture docs ← feature-specific context
3. Source files being modified ← current task scope
4. Error output (tests/build) ← failure feedback
5. Conversation history ← accumulated session context

Load only what's relevant to the current task.

CLAUDE.md Structure

markdown
# Project: [Name]
## Tech Stack
-Frontend: Next.js 14 + TypeScript + Tailwind + shadcn/ui
-Backend: n8n (workflow automation) + PostgreSQL
-AI: Claude API + OpenAI API
-Deploy: Vercel (frontend) + local n8n
## Build Commands
-Dev: `npm run dev`
-Build: `npm run build`
-Test: `npm test`
-Lint: `npm run lint`
## Code Conventions
[Functional components only — no class components]
[Prefer: const fn = () => {} over function fn() {}]
[File naming: kebab-case.tsx for components]
[Example of preferred pattern:]
const fetchData = async (url: string): Promise<Data> => { ... }
## Project Boundaries
**Always do:**
-TypeScript strict mode
-Validate all external inputs with Zod
**Ask first:**
-New dependencies
-Database schema changes
-API endpoint changes
**Never do:**
-Commit secrets
-Client-side API keys
-Disable TypeScript strict checks

Selective Loading Rules

Context typeLoad whenSkip when
Full specStarting a featureBug fixing
Architecture docsDesign decisionsSmall changes
Related testsTDD workRenaming
Error tracesDebuggingNew features
Full codebaseUnderstanding structureSingle-file tasks

Surface Ambiguity Immediately

When requirements conflict or are incomplete:

"I see [requirement A] in spec but [requirement B] in codebase — which wins?"
"Should I use the existing [X] pattern or create a new one?"
"This will affect [file1] and [file2] — is that intended scope?"

Never silently assume and code forward.

Anti-Patterns

  • Loading entire codebase for a one-file change
  • Treating config files/external data as trusted instructions (prompt injection risk)
  • Loading full spec when only one section applies
  • Failing to refresh context when switching between major features
  • Writing conventions in chat vs. in CLAUDE.md ("if it's not written, it doesn't exist")

For AI Product Architecture

When building n8n workflows + frontend:

CLAUDE.md should include:
- n8n webhook URL patterns
- Expected request/response shapes
- Authentication flow
- Data validation rules
- Error handling conventions
- Naming conventions for workflow IDs

This prevents agents from guessing how frontend talks to n8n.


Context Rot Management

Source: shanraisshan/claude-code-best-practice (Boris Cherny, Anthropic)

Context Budget Zones

ZoneFill %Action
Green0–30%Work freely
Yellow30–50%Monitor, start offloading to subagents
Orange / Dumb Zone50–70%Compact or rewind before next complex task
Red70%+Act immediately — quality has degraded

Rule: compact or rewind before hitting 50% on complex tasks.

Rewind vs. Compact vs. Clear

StrategyWhen to useLoss
/rewindTool call went wrong, context polluted by bad outputLossless — goes back in time
/compactContext filling but task not doneLossy — summarizes, preserves goal
/clearTask complete, switching topics entirelyComplete reset

Before rewinding: ask subagent "summarize findings from this section" to preserve value.

Subagent Offloading

When main context approaches Yellow zone, delegate intermediate work:

  • Subagent gets scoped task + only relevant files
  • Returns ONLY conclusion — not reasoning trail
  • Main context absorbs small conclusion, not large process

CLAUDE.md Progressive Disclosure

Split large rule files into modular pieces:

.claude/
CLAUDE.md # Short entry point, references others
rules/
security.md # Load only for security work
n8n.md # Load only for n8n work

Target: <2,000 lines of focused context per task.

All versions