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

spreadsheet-validated-exec

하는 일

이 스킬은 AI 에이전트가 스프레드시트 작업을 Python으로 실행하기 전에 데이터 원본을 확인하도록 합니다. 접근할 수 없거나 불완전한 데이터 때문에 시간을 낭비하는 작업을 위한 스킬입니다.

사용하는 경우

  • ✓스프레드시트 작업이 여러 원본을 쓰고 그중 하나에 접근할 수 없을 때.
  • ✓시트가 여러 개 있는 복잡한 Excel 작업을 곧 실행하려 할 때.
  • ✓원본이 실패할 경우 명확한 오류 메시지와 대체 계획을 원할 때.

스킬 링크

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/spreadsheet-direct-python-enhanced-enhanced-f0b1db/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/spreadsheet-direct-python-enhanced-enhanced-f0b1db/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“요약을 만들기 전에 원본 시트에 접근할 수 있고 내용이 완전한지 확인해 주세요. 하나라도 실패하면 어떤 대체 방안을 쓸지 알려 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 처리 스크립트를 쓰기 전에 각 원본 파일이나 URL에 접근할 수 있고 예상 필드가 있는지 테스트합니다. 기본 원본에 접근할 수 없을 경우를 대비해 대체 원본을 적어 두고, 복잡한 작업은 저장된 파일로 실행합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Validated Python Execution for Spreadsheet Tasks

Overview

This skill extends direct Python execution for spreadsheet operations by adding a mandatory data validation phase before any processing begins. This prevents wasted iterations on inaccessible data sources and provides clear error documentation when data cannot be accessed.

When to Use This Skill

Use validated direct run_shell with Python scripts for spreadsheet operations when:

  • Reading or writing complex Excel files with multiple sheets
  • Data sources have already been validated as accessible
  • You have fallback sources identified in case of access failures
  • Applying formulas, formatting, or data transformations
  • Working with openpyxl, pandas, or similar libraries
  • The operation involves multiple steps that could exceed agent step limits
  • You need precise control over error handling and debugging
  • Complex scripts benefit from file-based execution for better reliability

Why Validated Direct Execution?

Beyond standard shell_agent limitations, unvalidated data access causes:

  • Wasted iterations attempting to process non-existent data
  • Unclear error messages when source files are inaccessible
  • No graceful degradation when primary sources fail
  • Missing documentation of why data operations couldn't complete

Direct run_shell with Python validation is more reliable because it:

  • Executes validation in a single step with no iteration limits
  • Provides clearer, immediate error messages for access failures
  • Handles complex operations without step constraints
  • Gives full control over library imports and execution flow
  • Writing scripts to .py files first avoids shell_agent parsing issues with heredocs
  • Documents all access failures for troubleshooting and reporting

Phase 0: Data Source Validation (REQUIRED)

Before writing any spreadsheet processing code, verify your data sources are accessible:

Step 0.1: Verify Data Availability

import os
import requests
from pathlib import Path

# For local files
def verify_local_file(file_path):
    path = Path(file_path)
    if not path.exists():
        raise FileNotFoundError(f"Data file not found: {file_path}")
    if not path.is_file():
        raise ValueError(f"Path is not a file: {file_path}")
    if path.stat().st_size == 0:
        raise ValueError(f"Data file is empty: {file_path}")
    print(f"✓ Local file verified: {file_path} ({path.stat().st_size} bytes)")
    return True

# For remote URLs
def verify_remote_url(url, timeout=30):
    try:
        # Try HEAD request first (lighter than GET)
        response = requests.head(url, timeout=timeout, allow_redirects=True)
        if response.status_code == 405:  # HEAD not allowed, try GET
            response = requests.get(url, timeout=timeout, stream=True)
        response.raise_for_status()
        
        # Check content type if available
        content_type = response.headers.get('Content-Type', '')
        if 'text/html' in content_type and 'excel' not in url.lower():
            print(f"⚠ Warning: URL may return HTML, not data file")
        
        print(f"✓ Remote URL verified: {url} (Status: {response.status_code})")
        return True
    except requests.exceptions.SSLError as e:
        print(f"✗ SSL Error: {str(e)}")
        return False
    except requests.exceptions.ConnectionError as e:
        print(f"✗ Connection Error: {str(e)}")
        return False
    except requests.exceptions.Timeout as e:
        print(f"✗ Timeout Error: {str(e)}")
        return False
    except Exception as e:
        print(f"✗ Verification Failed: {str(e)}")
        return False

Step 0.2: Handle Inaccessible Sources

If primary data source is unavailable:

  1. Check alternative locations:

    • Is data available from a backup URL?
    • Is there a cached/local copy available?
    • Can data be obtained from an API instead of web scraping?
    • Is there an alternative data provider?
  2. Document the failure:

    def log_access_failure(source, error_type, timestamp=None):
        from datetime import datetime
        if not timestamp:
            timestamp = datetime.now().isoformat()
        
        error_log = {
            'timestamp': timestamp,
            'source': source,
            'error_type': error_type,
            'alternatives_attempted': [],
            'resolution': 'pending'
        }
        
        # Save to error log file
        import json
        with open('data_acce
    
자주 묻는 질문

원본이 없으면 어떻게 하나요?

스킬은 오류를 분명히 알리고, 목록에 대체 원본이 있으면 그것을 사용하라고 안내합니다.

처리 전에 확인하는 이유는 무엇인가요?

먼저 확인하면 데이터가 없는 상태에서 시도하느라 낭비되는 노력을 줄일 수 있다고 스킬은 설명합니다.

수식과 서식도 다루나요?

네, 데이터가 검증되면 수식, 서식, 변환 작업을 다룬다고 스킬은 설명합니다.

상세 정보

작성자의 원본 설명

Execute Python scripts for spreadsheets with prerequisite data validation and source accessibility checks

repo: HKUDS/AgentPilot

인기도

GitHub 스타
7.8k
순위
#13009
라이선스
MIT
업데이트
2026. 11. 1.

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬