본문으로 건너뛰기
Skillpedia
분석 및 스프레드시트7.8k · #12973

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/resilient-data-gathering/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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:

  1. Trigger condition: 2-3 consecutive failures across multiple tools (search_web, shell_agent, execute_code_sandbox) with 'unknown error' messages
  2. You have domain knowledge: The required data is known or can be reasonably estimated from context
  3. 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_web returns errors or empty results
  • shell_agent fails to complete autonomous tasks
  • execute_code_sandbox throws '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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬