Saltar al contenido
Skillpedia
Agentes18 mil · #10638

context-degradation

Qué hace

Esta skill explica las formas habituales en que el contexto de una IA puede fallar, como que se ignore la información del centro o que se propaguen detalles erróneos. Está pensada para personas que depuran agentes que empeoran en sesiones largas.

Cuándo usarla

  • ✓Cuando las respuestas de un agente empeoran cuanto más larga es la conversación.
  • ✓Cuando un agente ignora detalles colocados en medio de una entrada larga.
  • ✓Cuando información contradictoria o errónea en el contexto produce malos resultados.

Link de la skill

https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering/blob/main/skills/context-degradation/SKILL.md

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering/blob/main/skills/context-degradation/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“Mi agente de IA se confunde después de una sesión larga y olvida cosas que le dije antes. Ayúdame a entender por qué.”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

La skill nombra cinco patrones, como perdido en medio, envenenamiento y choque, y ofrece señales y soluciones para cada uno, para que puedas asociar el problema con su remedio.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de GitHub.

Context Degradation Patterns

Diagnose and fix context failures before they cascade. Context degradation is not binary — it is a continuum that manifests through five distinct, predictable patterns: lost-in-middle, poisoning, distraction, confusion, and clash. Each pattern has specific detection signals and mitigation strategies. Treat degradation as an engineering problem with measurable thresholds, not an unpredictable failure mode.

When to Activate

Activate this skill when:

  • Agent performance degrades unexpectedly during long conversations
  • Debugging cases where agents produce incorrect or irrelevant outputs
  • Designing systems that must handle large contexts reliably
  • Evaluating context engineering choices for production systems
  • Investigating "lost in middle" phenomena in agent outputs
  • Analyzing context-related failures in agent behavior

Do not activate this skill for adjacent work owned by other skills:

  • Explaining foundational context mechanics without an active failure: context-fundamentals.
  • Applying token-efficiency tactics after the failure pattern is known: context-optimization.
  • Designing a compression or handoff summary strategy: context-compression.
  • Persisting large outputs, logs, or scratch state outside the prompt: filesystem-context.

Core Concepts

Structure context placement around the attention U-curve: beginning and end positions receive reliable attention, while middle positions suffer materially reduced recall accuracy in long-context experiments (claim-context-degradation-lost-middle-ruler). This is not a model bug but a consequence of attention mechanics — the first token (often BOS) acts as an "attention sink" that absorbs disproportionate attention budget, leaving middle tokens under-attended as context grows.

Treat context poisoning as a circuit breaker problem. Once a hallucination, tool error, or incorrect retrieved fact enters context, it compounds through repeated self-reference. A poisoned goals section causes every downstream decision to reinforce incorrect assumptions. Detection requires tracking claim provenance; recovery requires truncating to before the poisoning point or restarting with verified-only context.

Filter aggressively before loading context — even a single irrelevant document measurably degrades performance on relevant tasks. Models cannot "skip" irrelevant context; they must attend to everything provided, creating attention competition between relevant and irrelevant content. Move information that might be needed but is not immediately relevant behind tool calls instead of pre-loading it.

Isolate task contexts to prevent confusion. When context contains multiple task types or switches between objectives, models incorporate constraints from the wrong task, call tools appropriate for a different context, or blend requirements from multiple sources. Explicit task segmentation with separate context windows eliminates cross-contamination.

Resolve context clash through priority rules, not accumulation. When multiple correct-but-contradictory sources appear in context (version conflicts, perspective conflicts, multi-source retrieval), models cannot determine which applies. Mark contradictions explicitly, establish source precedence, and filter outdated versions before they enter context.

Detailed Topics

Lost-in-Middle: Detection and Placement Strategy

Place critical information at the beginning and end of context, never in the middle. The U-shaped attention curve means middle-positioned information suffers 10-40% reduced recall accuracy. For contexts over 4K tokens, this effect becomes significant.

Use summary structures that surface key findings at attention-favored positions. Add explicit section headers and structural markers — these help models navigate long contexts by creating attention anchors. When a document must be included in full, prepend a summary of its key points and append the critical conclusions.

Monitor for lost-in-middle symptoms: correct information exists in context but the model ignores it, responses contradict provided data, or the model "forgets" instructions given earlier in a long prompt.

Context Poisoning: Prevention and Recovery

Validate all external inputs before they enter context. Tool outputs, retrieved documents, and model-generated summaries are the three primary poisoning vectors. Each introduces unverified claims that subsequent reasoning treats as ground truth.

Detect poisoning throu

Preguntas frecuentes

¿Qué significa perdido en medio?

El modelo presta menos atención a la información colocada en el centro de una entrada larga.

¿En qué se diferencia el envenenamiento del contexto?

Ocurre cuando un error entra en el contexto y se sigue reutilizando, empeorando las respuestas posteriores.

¿Dónde deben ir las instrucciones clave?

La skill sugiere colocar la información clave cerca del principio o del final, donde la atención es más fuerte.

Detalles

Descripción original del autor

This skill should be used for diagnosing and mitigating context degradation: lost-in-middle failures, context poisoning, context clash, context confusion, attention-pattern issues, and agent performance degradation caused by accumulated or conflicting context.

repo: muratcankoylan/Agent-Skills-for-Context-Engineering

Popularidad

Estrellas en GitHub
18 mil
Posición en el ranking
#10638
Licencia
MIT
Actualizada
11/10/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas