spreadsheet-validated-execution
ما الذي تفعله
توجّه هذه المهارة وكيل الذكاء الاصطناعي إلى فحص بيانات مصدره، ثم تشغيل Python لأعمال الجداول باستخدام openpyxl أو pandas. وهي مناسبة لمن لديهم مهام Excel متعددة الخطوات تحتاج إلى فحص دقيق للمدخلات.
متى تستخدمها
- ✓عندما تقرأ مهمة جداول ملفات Excel معقدة تضم عدة أوراق أو تكتب فيها.
- ✓عندما يجب تطبيق تنسيق أو صيغ أو تحويلات على مصنف.
- ✓عندما قد تتجاوز مهمة متعددة الخطوات حد الخطوات لدى الوكيل، فيجب حفظها كبرنامج.
رابط المهارة
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/spreadsheet-direct-python-enhanced-enhanced/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“طبّق التنسيق والصيغ على مصنف المبيعات الخاص بي، لكن تأكد أولًا من أن ملف المصدر موجود وكامل.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يتأكد الوكيل من أن المصدر متاح ويحتوي على البنية المتوقعة. ثم يكتب المعالجة بلغة 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
التعليقات
- …
المزيد من المهارات من هذا المستودع
agentpilot
7.8kيساعد وكيلك على تحسين مشروع خطوة بخطوة، بتجهيز مهمة وتشغيل حلقة AgentPilot التي تقترح التغييرات وتختبرها وتقيّمها.
openspace
7.8kيساعد وكيلك على إعداد OpenSpace، وهو أداة تخزن مهارات الوكلاء وتسترجعها، وربطه بتطبيق الذكاء الاصطناعي عبر MCP.
rsi-arena
7.8kيساعد وكيلك على إعداد اختبارات معيارية مثل AIME وTerminal-Bench وتشغيلها، لمقارنة طرق التحسين المختلفة.
experiment-guide
7.8kيساعد وكيلك على تخطيط تجارب صغيرة وقراءة نتائجها وتسجيل ما يتعلمه أثناء التحقيق في طرق تحسين برنامج.
مهارات مشابهة
gitcrawl
394kيتيح لوكيلك البحث في أرشيف محفوظ لمشكلات GitHub وطلبات السحب، وتجميع المكرر منها، والتحقق من حالتها الحالية على GitHub.
slacrawl
394kيتيح لوكيلك البحث في رسائل Slack داخل أرشيف محلي وعدّها، والتحقق من مدى حداثة الأرشيف، وتحديثه عند الحاجة.
goplaces
394kيساعد وكيلك على البحث عن الأماكن وعرض تفاصيلها وتقييماتها وتحديد أسمائها عبر Google Places، مع مخرجات JSON للسكربتات.