spreadsheet-validated-execution
यह क्या करती है
यह स्किल AI एजेंट को बताती है कि openpyxl या pandas से Python चलाने से पहले अपना स्रोत डेटा कैसे जाँचे। यह उन लोगों के लिए है जिनके पास कई चरणों वाले जटिल Excel काम होते हैं।
कब इस्तेमाल करें
- ✓जब कोई स्प्रेडशीट काम कई शीट वाली जटिल Excel फ़ाइलें पढ़ता या लिखता है।
- ✓जब वर्कबुक पर फ़ॉर्मूला, फ़ॉर्मेटिंग या बदलाव लागू करने होते हैं।
- ✓जब कोई लंबा काम एजेंट की स्टेप सीमा पार कर सकता है और उसे स्क्रिप्ट के रूप में सेव करना चाहिए।
Skill का लिंक
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/spreadsheet-direct-python-enhanced-enhanced/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरी सेल्स वर्कबुक पर फ़ॉर्मेटिंग और फ़ॉर्मूला लगा दीजिए, पर पहले पक्का कीजिए कि स्रोत फ़ाइल मौजूद और पूरी है।”
हर हफ़्ते 5 नई skills, 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
- Verify source accessibility: Test connection to data URLs/files before building processing scripts
- Confirm data format: Ensure source data matches expected structure (columns, sheets, file type)
- Check data completeness: Validate required fields/rows are present
- 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:
- Report clearly: Document the specific error (SSL, timeout, file not found)
- 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
- Graceful degradation: If partial data is available, document what's missing
- 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
- अपडेट की गई
- 1/11/2026
कमेंट
- …
इस repository की और skills
agentpilot
7.8kआपके एजेंट को AgentPilot से प्रोजेक्ट को चरण-दर-चरण सुधारने में मदद करती है, जिसमें बदलाव सुझाए, परखे और स्कोर किए जाते हैं।
openspace
7.8kआपके एजेंट को OpenSpace सेट करने में मदद करती है, जो एजेंट स्किल्स सहेजता और वापस लाता है, और MCP के ज़रिए आपके AI ऐप से जुड़ता है।
rsi-arena
7.8kआपके एजेंट को AIME और Terminal-Bench जैसे मानक AI बेंचमार्क टेस्ट सेट करने और चलाने में मदद करती है, ताकि सुधार के तरीकों की तुलना हो सके।
experiment-guide
7.8kआपके एजेंट को छोटे प्रयोग बनाने, उनके नतीजे पढ़ने और जाँच के दौरान उपयोगी निष्कर्ष लिखने में मदद करती है।
मिलती-जुलती skills
gitcrawl
394kयह आपके एजेंट को GitHub issues और pull requests के सेव आर्काइव में खोजने, मिलते-जुलते मामलों को समूह में रखने और लाइव स्थिति जांचने देती है।
slacrawl
394kयह आपके एजेंट को स्थानीय Slack आर्काइव में संदेश खोजने और गिनने, उसकी ताज़गी जांचने और ज़रूरत पड़ने पर उसे ताज़ा करने देती है।
goplaces
394kयह आपके एजेंट को Google Places से जगहें खोजने, उनका विवरण और समीक्षाएं पाने, और जगह के नाम हल करने में मदद करती है, स्क्रिप्ट के लिए JSON आउटपुट के साथ।