Dev & Engineering context-managementlost-in-the-middlecontext-poisoningretrieval-filteringmulti-agent-systemsagent-debugging

Context Degradation Diagnosis

Identify and mitigate lost attention, poisoning, distraction, confusion, and conflict in long agent contexts.

FollowSkills review · FSRS-2.0
Not recommended
51/ 100 5-point scale 2.6 / 5
Trust14 / 25 · 2.8/5

The skill mainly provides diagnostic, filtering, isolation, and truncation guidance, with no credential access, external writes, or destructive defaults, so permission risk is relatively low; however, sensitive-data handling, user confirmation, rollback boundaries, and full data-flow disclosure are not specified, while attribution is mostly limited to author metadata and broad research references, so points are deducted.

Reliability7 / 20 · 1.8/5

The SKILL.md, reference material, and script are broadly conceptually consistent and include abnormal-condition guidance; however, the script uses random.random and is nondeterministic, attention values are simulated, some reference examples depend on undefined functions, and no dedicated key-path tests are shown, so the static score is conservatively limited.

Adaptability10 / 15 · 3.3/5

Activation scenarios, non-fit ranges, five degradation patterns, and the four-bucket mitigation framework are reasonably clear for long-context agent diagnosis; nevertheless, input/output contracts, model-specific boundaries, Chinese usage guidance, and mainland-China environment fit are not explicit, and several thresholds are presented with limited qualification, so points are deducted.

Convention10 / 15 · 3.3/5

The documentation has useful layering and includes activation criteria, detailed topics, practical guidance, examples, gotchas, integration notes, scripts, and version dates; however, installation/dependency instructions, script usage, limitation disclosure, changelog, and maintenance ownership are incomplete, with some risk of mismatch between referenced paths and published structure, so it does not receive full marks.

Effectiveness6 / 15 · 2.0/5

The skill offers actionable diagnostic procedures, recovery steps, and example code that can complete the core educational task; however, its script relies on heuristic and random simulation and cannot reliably represent actual model attention or poisoning, leaving substantial production validation and adaptation work, so the static score remains moderate.

Verifiability4 / 10 · 2.0/5

The supplied material includes reference documentation, scripts, repository-level CI, and named research sources, providing limited auditability; however, the CI shown does not cover the selected skill's key script paths, no dedicated tests or fixed outputs are provided, and claims lack itemized, directly verifiable citations, so points are deducted.

Evidence confidence:Low Reviewed Jul 20, 2026 Reviewed revision c578e85e40fe
Before you use it
  • The script simulates attention with randomness and should not be treated as a measurement of real model attention.
  • The analyzer samples only the first 1,000 tokens while callers may provide positions from a longer context, which can distort diagnoses.
  • Poisoning detection is based mainly on keywords and simple contradiction patterns, creating substantial false-positive and false-negative risk.
  • Research claims and thresholds should be rebenchmarked for the specific model, workload, and model version.
  • Publisher identity is not verified by the FollowSkills enterprise registry; maintenance ownership and update paths should be confirmed separately.
See the full review method →

What does this skill do, and when should you use it?

This Agent Skill helps diagnose and mitigate context degradation in agent systems. It covers five patterns: lost-in-the-middle, context poisoning, distraction, confusion, and clash, with detection signals, recovery procedures, and architectural countermeasures. It treats degradation as an engineering problem that should be measured through workload-specific thresholds and progressive context testing. It fits agents that must reliably handle long conversations, retrieved documents, and tool outputs.

It maps symptoms such as declining output quality, incorrect tool calls, ignored facts, mixed task requirements, and contradictory sources to specific degradation patterns. It recommends placing critical information at context edges, filtering irrelevant documents, tracking claim provenance, removing poisoned content, annotating conflicts, and defining source precedence. It also presents four mitigation strategies—Write, Select, Compress, and Isolate—and recommends progressive context benchmarks and pre-threshold compaction.

  1. Use it when an agent in a long conversation ignores earlier instructions or contradicts facts already present in context.
  2. Use it when an agent keeps citing an incorrect retrieved fact or tool result even after correction.
  3. Use it when a RAG workflow performs worse after loading many candidate documents and needs relevance filtering.
  4. Use it when task switching causes an agent to mix constraints or call tools intended for another objective.
  5. Use it when different document versions or sources are individually credible but mutually contradictory.
  6. Use it when a production agent needs workload-specific context degradation thresholds.

What are this skill's strengths and limitations?

Pros
  • Distinguishes five concrete degradation patterns and gives detection signals and recovery guidance for each.
  • Provides practical guidance for context placement, provenance tracking, relevance filtering, conflict resolution, and task isolation.
  • Covers engineering caveats around model-specific thresholds, distractors, and the limits of needle-in-a-haystack testing.
  • The supplied SKILL.md uses generic Agent Skills instructions without platform-specific frontmatter extensions.
Limitations
  • The supplied SKILL.md includes no automated diagnostic scripts, monitoring implementation, or test suite.
  • Threshold guidance depends on model versions and workloads and must be re-benchmarked rather than treated as universal guarantees.
  • The skill references an internal patterns.md file and external research; availability of those materials depends on how the repository is installed.
  • It focuses on diagnosis and mitigation decisions; concrete compression, filesystem, evaluation, and multi-agent implementations belong to adjacent skills.

How do you install this skill?

Copy the complete skill directory from the repository rather than flattening SKILL.md:

mkdir -p .codex/skills
cp -R skills/context-degradation .codex/skills/

The directory may also be copied to .claude/skills/ or .agents/skills/. The repository specifies that the directory layout should be preserved so relative references/ paths continue to work.

How do you use this skill?

In an Agent Skills-compatible client, prompt the agent with a context-degradation task such as:

“Analyze why this agent ignores facts from earlier in a long conversation, determine whether this is lost-in-the-middle, and propose detection and mitigation steps.”

Use the repository’s adjacent skills instead for context fundamentals, post-diagnosis token optimization, compression and handoff design, filesystem offloading, or production evaluation implementation.

FAQ

Does this skill automatically fix context problems?
No. It supplies a diagnostic framework, symptoms, and mitigation procedures, but the provided SKILL.md does not include an automated diagnosis or repair program.
Does it require a specific model, runtime, or external service?
The supplied material specifies no model, shell command, network service, MCP server, or other runtime dependency. Its threshold recommendations still need validation against the target model and workload.
When should I use another skill instead?
Use the repository’s adjacent skills for foundational context concepts, token optimization after a pattern is identified, compression and handoff design, filesystem offloading, or evaluation and monitoring implementation.

More skills from this repository

All from muratcankoylan/Agent-Skills-for-Context-Engineering

Dev & Engineering

BDI Mental State Modeling

Turn RDF context into explainable belief, desire, and intention chains.

Dev & Engineering

Context Engineering for Production Agents

A structured guide to designing, optimizing, and evaluating production agent systems with reliable context management.

Dev & Engineering

Latent Briefing

Share task-relevant orchestrator state with workers through task-guided KV-cache compaction when the inference runtime is controllable.

Dev & Engineering

Multi-Agent Architecture Patterns

Design multi-agent systems with context isolation, explicit handoffs, coordinated execution, and controlled failure handling.

Dev & Engineering

Filesystem Context Engineering

Move large, durable, or shared agent context into files and retrieve it selectively when needed.

Dev & Engineering

Long-Horizon Prompting

Designs auditable launch briefs for autonomous agents and parallel multi-agent work on difficult, long-running tasks.

Dev & Engineering

Context Engineering Fundamentals

Understand and shape reliable agent context through attention budgets, context-window mechanics, and signal-density principles.

Dev & Engineering

Context Compression Strategies

Compress long-running agent sessions while preserving files, decisions, risks, and next actions.

Dev & Engineering

Project Development Methodology

Decide whether an LLM fits the job, then design a staged agent pipeline with predictable parsing, iteration, and cost control.

Dev & Engineering

Agent Evaluation Methods

Build repeatable evaluation, regression detection, and quality gates for agent pipelines.

Dev & Engineering

Context Efficiency Optimizer

Reduce context cost with caching, masking, compaction, and partitioning while preserving answer quality.

Dev & Engineering

Reasoning Trace Optimizer

Diagnose context, tool, and instruction failures by analyzing agent traces and iteratively improving prompts.

Dev & Engineering

Self-Improvement Loops

Evolve agent harnesses, workflows, and context mechanisms under bounded, evidence-based evaluation.

Dev & Engineering

Persistent Semantic Memory Design

Design durable, retrievable agent memory that scales from simple files to temporal knowledge graphs.

Dev & Engineering

Agent Skill Blueprint

A reusable structure for authoring well-scoped context-engineering skills.

Productivity & Collaboration

Digital Brain Personal OS

Manage content, relationships, knowledge, and goals through structured files and AI.

Dev & Engineering

Advanced LLM Evaluation

Build auditable, calibrated LLM-output evaluations with explicit rubrics, confidence scoring, and bias controls.

Dev & Engineering

Agent Tool Design Guide

Design tool interfaces agents can route, call, and recover from reliably.

Dev & Engineering

Autonomous Agent Harness

Designs autonomous agent loops that remain controlled, recoverable, and auditable.

Dev & Engineering

Rigorous Research Agent

A validation, recovery, and source-tracking protocol for multi-step research.

Related skills