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

spreadsheet-validated-execution

하는 일

이 스킬은 AI 에이전트가 원본 데이터를 확인한 뒤 openpyxl이나 pandas로 스프레드시트 작업을 위해 Python을 실행하도록 안내합니다. 입력을 신중하게 점검해야 하는 여러 단계 Excel 작업을 하는 사람을 위한 스킬입니다.

사용하는 경우

  • ✓시트가 여러 개 있는 복잡한 Excel 파일을 읽거나 쓰는 스프레드시트 작업을 할 때.
  • ✓통합 문서에 수식, 서식 또는 데이터 변환을 적용해야 할 때.
  • ✓여러 단계 작업이 에이전트의 단계 제한을 넘을 수 있어 스크립트로 저장해야 하는 경우.

스킬 링크

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/spreadsheet-direct-python-enhanced-enhanced/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/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분.

작동 방식

에이전트는 원본에 접근할 수 있고 예상한 구조를 갖췄는지 확인합니다. 그다음 Python 처리 과정을 스크립트 파일로 쓰고 실행하며, 기본 원본이 실패하면 지정된 대체 원본을 사용합니다.

기술 내용 (원본 SKILL.md)

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

Direct Python Execution for Spreadsheet Tasks

When to Use This Skill

Use this skill for spreadsheet operations that require verified source data:

  • Before processing: Verify data sources are accessible and contain expected data
  • Reading or writing complex Excel files with multiple sheets
  • 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

Critical: Data Source Validation First

Always validate data availability before attempting spreadsheet operations. This prevents wasted iterations on unavailable data.

Pre-Execution Validation Checklist

  1. Verify source accessibility: Test connection to data URLs/files before building processing scripts
  2. Confirm data format: Ensure source data matches expected structure (columns, sheets, file type)
  3. Check data completeness: Validate required fields/rows are present
  4. Identify fallback sources: Document alternative data sources if primary is unavailable

Validation Script Pattern

import sys
import os
from pathlib import Path

def validate_source(source_path, required_fields=None):
    """Validate data source before processing"""
    if not Path(source_path).exists():
        return False, f"Source file not found: {source_path}"
    
    try:
        # Check file is readable and non-empty
        if os.path.getsize(source_path) == 0:
            return False, "Source file is empty"
        
        if required_fields:
            # Validate structure using pandas
            import pandas as pd
            df = pd.read_excel(source_path, nrows=1)
            missing = set(required_fields) - set(df.columns)
            if missing:
                return False, f"Missing required columns: {missing}"
        
        return True, "Source validated"
    except Exception as e:
        return False, f"Validation error: {str(e)}"

# Usage
valid, message = validate_source('input.xlsx', ['ID', 'Date', 'Value'])
if not valid:
    print(f"ABORT: {message}", file=sys.stderr)
    sys.exit(1)
print(f"OK: {message}")

Handling Inaccessible Data Sources

When primary data sources are unavailable:

  1. Report clearly: Document the specific error (SSL, timeout, file not found)
  2. Attempt fallbacks: Check alternative sources in priority order:
    • Local cached copies of the data
    • Alternative API endpoints or URLs
    • Different file formats from the same source
    • Contact information for data provider
  3. Graceful degradation: If partial data is available, document what's missing
  4. Escalation protocol: For persistent failures, provide:
    • Exact error messages and timestamps
    • URLs/paths that were attempted
    • Workarounds already tried
    • Recommended next steps for human intervention

Example: Multi-Source Fallback Pattern

import sys
from pathlib import Path

sources = [
    'data/wells_current.xlsx',           # Primary: latest data
    'data/wells_backup.xlsx',            # Fallback 1: backup copy
    'data/wells_archive.xlsx',           # Fallback 2: archived version
    '/cached/wells_data.xlsx',           # Fallback 3: system cache
]

selected_source = None
for source in sources:
    if Path(source).exists():
        selected_source = source
        print(f"Using fallback source: {source}")
        break

if not selected_source:
    print("CRITICAL: No data sources available", file=sys.stderr)
    print("Attempted sources:", file=sys.stderr)
    for s in sources:
        print(f"  - {s}", file=sys.stderr)
    sys.exit(1)

# Proceed with selected_source
  • Reading or writing complex Excel files with multiple sheets
  • 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 Direct Execution?

The shell_agent tool can:

  • Hit maximum step limits on complex multi-step operations
  • Produce unexplained errors on formatting operations
  • Fail on intricate spreadsheet reads/writes due to iterative parsing
  • Fail to parse heredoc syntax correctly,
자주 묻는 질문

작업을 왜 스크립트로 저장하나요?

스킬은 파일 기반 스크립트가 복잡한 여러 단계 작업에서 더 안정적이라고 설명합니다.

어떤 라이브러리를 사용하나요?

스프레드시트 작업의 주요 라이브러리로 openpyxl과 pandas를 듭니다.

원본에 접근할 수 없으면 어떻게 하나요?

에이전트는 실패를 기록하고, 미리 정해 둔 대체 원본이 있으면 그것을 사용합니다.

상세 정보

작성자의 원본 설명

Execute Python scripts with prerequisite data validation and fallback strategies for inaccessible sources

repo: HKUDS/AgentPilot

인기도

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

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬