Context Degradation Diagnosis
Identify and mitigate lost attention, poisoning, distraction, confusion, and conflict in long agent contexts.
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.
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.
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.
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.
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.
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.
- 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.
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.
- Use it when an agent in a long conversation ignores earlier instructions or contradicts facts already present in context.
- Use it when an agent keeps citing an incorrect retrieved fact or tool result even after correction.
- Use it when a RAG workflow performs worse after loading many candidate documents and needs relevance filtering.
- Use it when task switching causes an agent to mix constraints or call tools intended for another objective.
- Use it when different document versions or sources are individually credible but mutually contradictory.
- Use it when a production agent needs workload-specific context degradation thresholds.
What are this skill's strengths and limitations?
- 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.
- 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.