resilient-context-extraction
Qué hace
Esta skill indica al agente de IA que lea los archivos adjuntos y los trate como la fuente principal de hechos. Está pensada para quienes dan a la IA archivos de referencia para trabajar.
Cuándo usarla
- ✓Cuando adjuntas una hoja de cálculo, un PDF o un archivo de datos y pides a la IA que construya algo a partir de él.
- ✓Cuando la respuesta de la IA parece ignorar el archivo que le diste.
- ✓Cuando la lectura de un archivo parece incompleta y quieres que la IA pruebe otras formas de abrirlo.
Link de la skill
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/prioritize-context-data-enhanced/SKILL.mdCó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
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Usa las cifras del archivo de ventas que adjunté para mi informe, y no busques esas cifras en la web.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
El agente enumera todos los archivos que le diste, comprueba cuáles encajan con la tarea y los lee antes de buscar en otro sitio. Si una lectura parece incompleta, prueba otro método.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
Resilient Context Extraction
Objective
Prevent data hallucination and inefficiency by mandating that agents inspect, validate, and fully extract data from provided reference files before attempting web searches or generating synthetic data. When extraction is incomplete, use fallback strategies before making assumptions.
Critical Rule
If a reference file is provided in the task context, it is the source of truth. Do not fabricate data or search the web for information that may exist within the provided attachments. If extraction appears incomplete, attempt alternative methods before proceeding.
Workflow Steps
1. Scan Context for Attachments
At the start of every task, explicitly list all files provided in the context window or attachment panel.
- Check for spreadsheets (
.xlsx,.csv), documents (.pdf,.docx,.pptx), or data dumps (.json,.txt,.xml,.yaml). - Note the filename, file size (if available), and inferred content type.
- Record this list for later verification.
2. Evaluate Relevance
Determine if any provided file contains the data required to complete the task.
- Match Keywords: Do filenames or expected column headers match task requirements?
- Check Scope: Does the data cover the necessary timeframe or region?
- Prioritize: Rank files by likelihood of containing required data.
3. Extract Data with Validation
If relevant files are found:
- Read the file content using appropriate tools (e.g.,
read_file,pandas,pdf_reader). - Validate Extraction Completeness (NEW CRITICAL STEP):
- Check if output appears truncated (e.g., sudden cutoff mid-sentence, character limits hit).
- Compare expected data points vs. extracted data points (e.g., "Task mentions pricing tiers; did extraction include pricing numbers?").
- Look for structural indicators of incompleteness (e.g., unclosed tables, missing document endings).
- If extraction is incomplete or suspicious, proceed to Step 4 (Fallback Strategies) before using the data.
4. Apply Fallback Extraction Strategies
When initial extraction is incomplete or critical data is missing, attempt these strategies in order before making assumptions:
4a. Alternative Library/Tool Approach
- For
.docx: Trypython-docxdirectly viaexecute_code_sandboxifread_filewas truncated. - For
.xlsx/.csv: Trypandaswith explicit sheet selection oropenpyxldirectly. - For
.pdf: Trypdfplumber,PyPDF2, or shell-basedpdftotextif available. - For any format: Try reading as raw bytes/text via shell commands (
cat,xxd,strings).
4b. Shell-Based Extraction
- Use
shell_agentorrun_shellfor format-specific tools:unzip -p file.docx word/document.xml | xmllint --format -(extract raw docx XML)in2csv file.xlsx(convert Excel to CSV via shell)pdftotext file.pdf -(extract PDF text via command line)
- This bypasses potential sandbox or library limitations in
read_file.
4c. Targeted Re-Reading
- If specific sections are missing (e.g., "pricing table on page 3"), attempt to re-read with focus on that region.
- Use tools that support page/section ranges if available.
4d. Document What's Missing
- Before any assumptions or external searches, explicitly document:
- What data was expected but not found.
- What extraction methods were attempted.
- Why each method failed or what portions remain unavailable.
- Example: "Attempted
read_fileonPricing_email.docx(truncated at 980 chars). Attemptedpython-docxextraction via sandbox—pricing table in section 2 not present in file. Pricing numbers unavailable from provided context."
5. Cite Source Explicitly
When presenting data in the final output:
- Explicitly state which file the data came from.
- Example: "According to
Massabama_active_listings.xlsx..." - If fallback methods were used, note this: "Extracted via shell-based
pdftotextfromreport.pdf..." - This verifies to the user that real data was used, not hallucinated.
6. Fallback to Search (Last Resort Only)
If all extraction strategies fail to provide the specific data needed:
- State clearly what was missing from the files.
- Document all extraction methods attempted and why they failed.
- Then proceed with web search or estimation.
- Mark any non-file data clearly as "External Search" or "Estimated (file data unavailable)".
- Never present estimated data as if it came from the file.
Che
Preguntas frecuentes
¿Seguirá el agente buscando en la web si falta un dato en mi archivo?
La skill pide al agente que confirme antes que el archivo realmente no contiene el dato. Solo entonces debería buscar en otro lugar.
¿Qué tipos de archivo cubre esta skill?
Menciona hojas de cálculo, PDF, archivos Word, CSV, JSON y archivos de texto como tipos de archivo que hay que revisar.
¿Qué pasa si el agente sigue ignorando mi archivo?
Pídele que enumere los archivos que puede ver y que lea el que necesitas antes de continuar.
Detalles
Descripción original del autor
Ensures agents extract data from context files with validation and fallback strategies before resorting to assumptions or external searches.
repo: HKUDS/AgentPilot
Popularidad
- Estrellas en GitHub
- 7,8 mil
- Posición en el ranking
- #12951
- Licencia
- MIT
- Actualizada
- 1/11/2026
Comentarios
- …
Más skills de este repositorio
agentpilot
7,8 milAyuda a tu agente a mejorar un proyecto paso a paso, preparando una tarea y ejecutando el bucle de AgentPilot que propone, prueba y puntúa cambios.
openspace
7,8 milAyuda a tu agente a configurar OpenSpace, una herramienta que guarda y recupera skills de agentes, y a conectarla a tu app de IA mediante MCP.
rsi-arena
7,8 milAyuda a tu agente a configurar y ejecutar pruebas de referencia de IA conocidas, como AIME y Terminal-Bench, para comparar distintos métodos de mejora.
experiment-guide
7,8 milAyuda a tu agente a planificar experimentos pequeños, leer sus resultados y anotar conclusiones mientras investiga cómo mejorar un programa.
Skills parecidas
add-model-provider
394 milPermite que tu agente conecte un nuevo proveedor de modelos de IA a OpenClaw con comandos de configuración seguros, mantenga las claves API fuera del texto plano y haga una prueba en vivo.
acp-router
394 milAyuda a tu agente a enviar una tarea a un asistente de programación como Claude Code o Cursor a través de OpenClaw, para que el trabajo se ejecute en esa herramienta.
browser-automation
394 milEnseña a tu agente a controlar páginas web paso a paso, incluidos los inicios de sesión, las pestañas y la recuperación cuando una página deja de responder.