One-click install
npx skills add https://github.com/jacob-balslev/skill-graph --skill context-engineering-jacob-balslev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-engineering
Source: https://github.com/jacob-balslev/skill-graph/tree/main/marketplace/skills/context-engineering
Command: npx skills add https://github.com/jacob-balslev/skill-graph --skill context-engineering-jacob-balslev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you identify why an LLM agent succeeds or fails by diagnosing context problems like missing, stale, wrong, or overwhelming information that the model uses to reason.

Core Features & Use Cases

  • Five-layer context stack guidance: Clarifies what each layer (system prompt, persistent memory, always-loaded rules, injected skills, and the agent prompt) does and how it fails.
  • Failure-mode diagnosis: Provides a structured decision tree and symptom tables to pinpoint whether the root cause is missing, stale, wrong, or overwhelming context.
  • Context quality metrics: Defines measurable targets for injection precision, injection recall, context utilization, and freshness score to track health over time.
  • Compaction and delegation patterns: Explains Frequent Intentional Compaction (FIC) and when to delegate context-heavy investigation to a subagent for cleaner main-agent context.
  • Debugging and verification checklists: Offers practical review gates to ensure the context pipeline is reliable and not drifting.

Quick Start

Ask your agent to diagnose the failure as a context-engineering issue by walking the Missing vs Stale vs Wrong vs Overwhelming decision tree and then listing the exact context layer and fix to apply.

Frequently Asked Questions about context-engineering

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

FAQPage Schema
Why does my LLM agent fail or hallucinate during long-running sessions?

Agent failures frequently originate from incorrect information in the model context, specifically missing, stale, wrong, or overwhelming data. Diagnosing these context problems requires analyzing the prompt stack and tool-result lifecycle to pinpoint the root cause.

How do I debug missing or stale context in an agent prompt stack?

Debug missing or stale context by walking the Missing vs Stale vs Wrong vs Overwhelming decision tree to isolate the failure mode. Then identify the exact context layer—system prompt, persistent memory, or injected skills—and apply the targeted fix to restore context freshness.

What is the best way to measure LLM context quality and utilization?

Measure LLM context quality by tracking injection precision, injection recall, context utilization, and a freshness score. These metrics quantify the health of your context payload and help prevent context pollution across agent sessions.

When should I use subagent delegation to manage agent context?

Use subagent delegation to manage agent context when you need cleaner main-agent context during heavy investigations. Delegating context-heavy research to a subagent prevents overwhelming information from polluting the primary prompt stack and maintains reasoning accuracy.

How do I prevent context pollution when injecting skills into an agent?

Prevent context pollution when injecting skills by applying frequent intentional compaction and validating the context pipeline against a debugging checklist. This ensures injection precision and stops stale or wrong information from overwhelming the agent prompt stack.

Does context engineering work for troubleshooting persistent memory in AI agents?

Yes, context engineering works for troubleshooting persistent memory by applying a five-layer context stack model. It specifies how always-loaded rules and persistent memory fail over time, providing validation checklists to ensure memory freshness and reduce drift.