excel-creation-fallback
ما الذي تفعله
تصف هذه المهارة إنشاء ملف .xlsx باستخدام openpyxl، وما يُفعل عندما لا تستطيع بيئة الشيفرة تشغيله. وهي مناسبة لمن يحتاج إلى جدول بأعمدة محددة أو تنسيق أو ملخصات.
متى تستخدمها
- ✓عندما تفشل بيئة الشيفرة بأخطاء استيراد لمكتبة openpyxl.
- ✓عندما أحتاج إلى جدول فيه عناوين وتنسيق ومجاميع.
- ✓عندما تستمر المحاولات المتكررة لحفظ جدول في الفشل داخل بيئة الشيفرة.
رابط المهارة
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/excel-creation-fallback/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“أنشئ لي ملف Excel فيه أعمدة التاريخ والمؤشر والقيمة، مع عناوين بخط عريض وصف للمجاميع.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يحاول الذكاء الاصطناعي أولًا بناء الملف باستخدام openpyxl داخل بيئة الشيفرة. إذا فشل، يسلّم وصفًا واضحًا إلى مساعد في الطرفية يستطيع تثبيت المكتبات المطلوبة وحفظ الملف.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
Excel File Creation Fallback
When execute_code_sandbox fails for openpyxl or Excel operations, delegate to shell_agent which can autonomously handle dependency and environment issues.
When to Use
execute_code_sandboxfails with import errors for openpyxl or related libraries- The sandbox environment lacks required dependencies
- You need to create or modify Excel files with complex requirements
- Repeated sandbox execution failures for file I/O operations
Steps
Step 1: Attempt with execute_code_sandbox first
Try creating the Excel file using Python's openpyxl library in the code sandbox:
from openpyxl import Workbook
wb = Workbook()
ws = wb.active
ws.append(['Column1', 'Column2', 'Column3'])
wb.save('output.xlsx')
Step 2: If it fails, switch to shell_agent
Delegate the task to shell_agent with a clear, comprehensive task description:
Create an Excel file named 'output.xlsx' with the following structure:
- Sheet 1: Data with columns [Date, Metric, Value]
- Include sample data rows with realistic values
- Apply basic formatting (bold headers, cell borders)
- Add a summary section with totals or averages
- Save the file in the current directory
Step 3: Let shell_agent handle the environment
The shell_agent will:
- Decide whether to use Python or Bash
- Install dependencies if needed (e.g.,
pip install openpyxl) - Write and execute the code
- Automatically retry and fix errors (up to several rounds)
- Confirm the file was created successfully
Example Task Descriptions
Basic Excel file:
Create an Excel file named 'sales_report.xlsx' with headers: Date, Product, Quantity, Price, Total. Add 10 sample rows of data and a formula column for Total (Quantity * Price).
Complex Excel with formatting:
Create an Excel file with multiple sheets:
- Sheet 'Summary': Key metrics and totals
- Sheet 'Details': Full transaction data with columns [ID, Date, Customer, Amount, Status]
- Apply conditional formatting to highlight amounts over 1000
- Add borders to all cells and bold headers
Tiered pricing structure:
Create an Excel file with a tiered pricing table:
- Column A: Quantity thresholds (0, 100, 500, 1000)
- Column B: Unit price at each tier
- Column C: Discount percentage (e.g., 15% discount over 1000 units)
- Include a financial summary section with projections
Why This Pattern Works
shell_agent has several advantages over execute_code_sandbox for file creation tasks:
| Feature | execute_code_sandbox | shell_agent |
|---|---|---|
| Dependency installation | Manual/preset only | Autonomous |
| Error recovery | Returns error | Auto-retries and fixes |
| Tool selection | Python only | Python, Bash, or other |
| Filesystem access | Sandbox-limited | Full workspace access |
| Verification | None | Can verify file creation |
Troubleshooting
If shell_agent also struggles:
- Be more specific - Include exact column names, data types, and formatting requirements
- Provide sample data - Include example rows to clarify expected output
- Break it down - For complex files, request creation in stages
- Check permissions - Ensure the target directory is writable
Alternative Approaches
If shell_agent is unavailable or unsuitable:
- Use
run_shellwith explicit commands (if you know the exact syntax) - Check for alternative libraries (xlsxwriter, pandas with openpyxl engine)
- Use CSV as intermediate format, then convert to Excel
الأسئلة الشائعة
ما هي openpyxl؟
مكتبة Python تنشئ ملفات Excel وتعدّلها.
من يثبّت الحزم الناقصة؟
يستطيع المساعد في الطرفية تثبيت المتطلبات، مثل openpyxl، إذا كانت ناقصة.
ماذا يجب أن يتضمن الطلب؟
وصفًا واضحًا للأوراق والأعمدة وصفوف النموذج والتنسيق ومكان حفظ الملف.
التفاصيل
الوصف الأصلي من المؤلف
Use shell_agent as fallback when execute_code_sandbox fails for Excel file operations
repo: HKUDS/AgentPilot
الشعبية
- نجوم GitHub
- 7.8k
- الترتيب
- #12872
- الترخيص
- MIT
- آخر تحديث
- 1/11/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
agentpilot
7.8kيساعد وكيلك على تحسين مشروع خطوة بخطوة، بتجهيز مهمة وتشغيل حلقة AgentPilot التي تقترح التغييرات وتختبرها وتقيّمها.
openspace
7.8kيساعد وكيلك على إعداد OpenSpace، وهو أداة تخزن مهارات الوكلاء وتسترجعها، وربطه بتطبيق الذكاء الاصطناعي عبر MCP.
rsi-arena
7.8kيساعد وكيلك على إعداد اختبارات معيارية مثل AIME وTerminal-Bench وتشغيلها، لمقارنة طرق التحسين المختلفة.
experiment-guide
7.8kيساعد وكيلك على تخطيط تجارب صغيرة وقراءة نتائجها وتسجيل ما يتعلمه أثناء التحقيق في طرق تحسين برنامج.
مهارات مشابهة
feishu-doc
394kيساعد وكيلك على قراءة مستندات Feishu السحابية وإنشائها وتعديلها، بما فيها النصوص والصور والجداول، باستخدام أداة المستندات.
feishu-drive
394kيتيح لوكيلك تصفح الملفات في مجلد سحابي على Feishu شاركته مع البوت، وتنظيمها، والتعليق عليها.
feishu-perm
394kيساعد وكيلك على معرفة من يستطيع الوصول إلى ملف Feishu وتغيير ذلك، مع اختيار أدنى صلاحية تلبي طلبك.