Zum Inhalt springen
Skillpedia
Analyse & Tabellen7.8k · #13009

spreadsheet-validated-exec

Was er macht

Dieser Skill lässt den KI-Agenten seine Datenquellen prüfen, bevor er Tabellenarbeit in Python ausführt. Er richtet sich an Personen, deren Jobs Zeit verlieren, weil Daten nicht erreichbar oder unvollständig sind.

Wann du ihn nutzt

  • ✓Wenn ein Tabellenjob mehrere Quellen nutzt und eine davon nicht erreichbar sein könnte.
  • ✓Wenn ein komplexer Excel-Job mit mehreren Blättern gleich laufen soll.
  • ✓Wenn du eine klare Fehlermeldung und einen Ausweichplan willst, falls eine Quelle ausfällt.

Link zum Skill

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/spreadsheet-direct-python-enhanced-enhanced-f0b1db/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/spreadsheet-direct-python-enhanced-enhanced-f0b1db/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Prüfe, ob meine Quellblätter erreichbar und vollständig sind, bevor du die Zusammenfassung baust. Wenn eine ausfällt, sag mir, welche Ausweichquelle du nehmen würdest.”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Der Agent testet, ob jede Quelldatei oder URL erreichbar ist und die erwarteten Felder enthält, bevor er das Verarbeitungsskript schreibt. Er vermerkt Ausweichquellen, falls die Hauptquelle nicht erreichbar ist, und führt komplexe Jobs aus einer gespeicherten Datei aus.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von 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
    
Häufige Fragen

Was passiert, wenn eine Quelle fehlt?

Der Skill sagt, den Fehler klar zu melden und eine aufgelistete Ausweichquelle zu nutzen, falls es eine gibt.

Warum vorher prüfen?

Der Skill merkt an, dass eine vorherige Prüfung verschwendete Versuche auf fehlenden Daten vermeidet.

Behandelt er Formeln und Formatierung?

Ja. Der Skill deckt Formeln, Formatierung und Transformationen ab, sobald die Daten geprüft sind.

Details

Originalbeschreibung des Autors

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

repo: HKUDS/AgentPilot

Beliebtheit

GitHub-Sterne
7.8k
Platz im Ranking
#13009
Lizenz
MIT
Aktualisiert
1.11.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills