मुख्य सामग्री पर जाएँ
Skillpedia
PDF, Word और स्लाइड7.8k · #12872

excel-creation-fallback

यह क्या करती है

यह स्किल openpyxl से .xlsx फ़ाइल बनाने और कोड सैंडबॉक्स उसे न चला पाए तो क्या करें, यह बताती है। यह उन लोगों के लिए है जिन्हें खास कॉलम, फ़ॉर्मेटिंग या सारांश वाली स्प्रेडशीट चाहिए।

कब इस्तेमाल करें

  • ✓जब openpyxl के इम्पोर्ट एरर की वजह से कोड सैंडबॉक्स विफल हो।
  • ✓जब मुझे हेडर, फ़ॉर्मेटिंग और कुल योग वाली स्प्रेडशीट चाहिए।
  • ✓जब स्प्रेडशीट सहेजने की बार-बार की सैंडबॉक्स कोशिशें विफल हों।

Skill का लिंक

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/excel-creation-fallback/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/excel-creation-fallback/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“मुझे date, metric और value कॉलम वाली एक Excel फ़ाइल बना दीजिए, जिसमें हेडर बोल्ड हों और नीचे कुल योग की पंक्ति हो।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

AI पहले सैंडबॉक्स में 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_sandbox fails 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:

  1. Be more specific - Include exact column names, data types, and formatting requirements
  2. Provide sample data - Include example rows to clarify expected output
  3. Break it down - For complex files, request creation in stages
  4. Check permissions - Ensure the target directory is writable

Alternative Approaches

If shell_agent is unavailable or unsuitable:

  • Use run_shell with 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 क्या है?

यह Excel फ़ाइलें बनाने और बदलने की Python लाइब्रेरी है।

गायब पैकेज कौन इंस्टॉल करता है?

शेल सहायक ज़रूरत होने पर 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

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills