resilient-data-gathering
하는 일
이 스킬은 여러 도구가 연달아 실패할 때 AI 에이전트를 위한 대체 방법입니다. 평소 도구가 응답하지 않아도 나중에 확인할 수 있는 결과가 필요한 사람에게 맞습니다.
사용하는 경우
- ✓검색, 도우미 에이전트, 코드 샌드박스가 두세 번 시도한 뒤 모두 실패할 때.
- ✓필요한 데이터를 이미 알고 있거나 대화에서 합리적으로 추정할 수 있는 경우.
- ✓나중에 확인하거나 복구할 수 있도록 중간 결과를 저장해야 할 때.
스킬 링크
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/resilient-data-gathering/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“검색과 코드 도구가 계속 실패합니다. 제가 준 제품 가격을 사용해서 스크립트에 넣고, 결과를 JSON 파일로 저장해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 가진 데이터를 모아 셸 Python 스크립트에 넣고, 각 단계를 JSON 파일로 저장합니다. 이 파일로 작업을 감사하고 멈춘 곳에서 다시 이어 갈 수 있습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Resilient Data Gathering Workflow
Purpose
When search_web, shell_agent, and execute_code_sandbox all fail repeatedly with 'unknown error' or similar tool execution failures, fall back to embedding known domain data directly into run_shell Python scripts and persisting intermediate data to JSON files for auditability and recovery.
When to Use This Pattern
Apply this pattern when:
- Trigger condition: 2-3 consecutive failures across multiple tools (
search_web,shell_agent,execute_code_sandbox) with 'unknown error' messages - You have domain knowledge: The required data is known or can be reasonably estimated from context
- Auditability needed: Intermediate results must be preserved for verification or rollback
Step-by-Step Instructions
Step 1: Recognize Tool Failure Pattern
Monitor for repeated failures across multiple execution tools:
search_webreturns errors or empty resultsshell_agentfails to complete autonomous tasksexecute_code_sandboxthrows 'unknown error' repeatedly
Decision point: After 2-3 failures, switch to the fallback pattern rather than continuing to retry failing tools.
Step 2: Gather Known Domain Data
Collect all data you already know or can reasonably infer:
- Product specifications, prices, SKUs
- Competitor information from context
- Business rules and constraints
- Historical data from previous task phases
Document this data in a structured format before embedding.
Step 3: Embed Data in run_shell Python Script
Create a Python script that embeds the known data directly as literals or constants:
import json
import os
from datetime import datetime
# ============================================
# EMBEDDED DOMAIN DATA (known from context)
# ============================================
PRODUCT_DATA = {
"sku_001": {
"name": "Product A",
"competitor_price": 29.99,
"weight_oz": 12,
"category": "beverage"
},
"sku_002": {
"name": "Product B",
"competitor_price": 34.99,
"weight_oz": 16,
"category": "snack"
}
}
BUSINESS_RULES = {
"margin_target": 0.25,
"price_floor": 19.99,
"price_ceiling": 99.99
}
# ============================================
# ANALYSIS LOGIC
# ============================================
def analyze_products(products, rules):
results = {}
for sku, data in products.items():
price_per_oz = data["competitor_price"] / data["weight_oz"]
recommended_price = data["competitor_price"] * (1 + rules["margin_target"])
recommended_price = max(rules["price_floor"], min(rules["price_ceiling"], recommended_price))
results[sku] = {
**data,
"price_per_oz": round(price_per_oz, 2),
"recommended_price": round(recommended_price, 2),
"analysis_timestamp": datetime.now().isoformat()
}
return results
# Execute analysis
analysis_results = analyze_products(PRODUCT_DATA, BUSINESS_RULES)
# ============================================
# PERSIST INTERMEDIATE DATA (audit trail)
# ============================================
output_file = "intermediate_analysis.json"
with open(output_file, "w") as f:
json.dump({
"metadata": {
"generated_at": datetime.now().isoformat(),
"source": "embedded_domain_data",
"fallback_reason": "tool_execution_failures"
},
"results": analysis_results
}, f, indent=2)
# Signal artifact location for downstream tools
print(f"ARTIFACT_PATH:{os.path.abspath(output_file)}")
# Output results for immediate consumption
print("\n=== ANALYSIS RESULTS ===")
print(json.dumps(analysis_results, indent=2))
Step 4: Execute via run_shell
Run the embedded script using run_shell:
python3 << 'EOF'
[paste the full script from Step 3]
EOF
Or save to a file first:
cat > analysis_script.py << 'SCRIPT'
[paste script content]
SCRIPT
python3 analysis_script.py
Step 5: Persist and Verify Intermediate Results
Ensure JSON files are created and contain valid data:
import json
# Verify persistence
with open("intermediate_analysis.json", "r") as f:
验证数据 = json.load(f)
assert "results" in 验证数据
assert "metadata" in 验证数据
print(f"✓ Persisted {len(验证数据['results'])} records")
Step 6: Chain Subsequent Operations
Use persisted JSON as input for downstream operations:
import json
자주 묻는 질문
에이전트는 언제 이 방법으로 바꾸나요?
검색, 도우미, 샌드박스 도구에서 두세 번 실패한 뒤 바꾸라고 스킬이 말합니다.
결과를 JSON 파일로 저장하는 이유는 무엇인가요?
저장된 파일은 결과를 쉽게 확인하게 하고, 무엇인가 잘못되었을 때 작업을 이어 가게 합니다.
에이전트가 빠진 숫자를 지어낼 수 있나요?
스킬은 알려졌거나 합리적으로 추론된 데이터를 바탕으로 하므로, 사용 전에 추정치를 확인해야 합니다.
상세 정보
작성자의 원본 설명
Fallback pattern when primary tools fail - embed known data in scripts and persist to JSON for auditability
repo: HKUDS/AgentPilot
인기도
- GitHub 스타
- 7.8k
- 순위
- #12973
- 라이선스
- MIT
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
agentpilot
7.8k작업을 준비하고 AgentPilot 루프를 실행해 변경을 제안, 테스트, 점수화하면서 프로젝트를 단계적으로 개선하도록 돕습니다.
openspace
7.8k에이전트 스킬을 저장하고 가져오는 도구인 OpenSpace를 설정하고, MCP를 통해 AI 앱에 연결하도록 돕습니다.
rsi-arena
7.8kAIME나 Terminal-Bench 같은 표준 AI 벤치마크 테스트를 설정하고 실행해 서로 다른 개선 방법을 비교하도록 돕습니다.
experiment-guide
7.8k프로그램을 개선하는 방법을 조사하면서 작은 실험을 계획하고, 결과를 읽고, 발견 사항을 기록하도록 돕습니다.
비슷한 스킬
gitcrawl
394k에이전트가 저장된 GitHub 이슈와 풀 리퀘스트 보관본을 검색하고, 중복 항목을 묶고, GitHub에서 현재 상태를 확인하도록 돕습니다.
slacrawl
394k에이전트가 로컬 Slack 보관본에서 메시지를 검색하고 개수를 세며, 보관본이 얼마나 최신인지 확인하고 필요할 때 새로 고치도록 돕습니다.
goplaces
394k에이전트가 Google Places로 장소를 검색하고, 세부 정보와 리뷰를 가져오고, 장소 이름을 확인하며, 스크립트용 JSON을 출력하도록 돕습니다.