python-spreadsheet-debug
Fungsinya
Skill ini memberi agent AI serangkaian pemeriksaan berurutan untuk tugas spreadsheet dengan Python. Skill ini ditujukan untuk orang yang skrip spreadsheet-nya gagal dan perlu mengetahui apakah masalahnya ada di pengaturan atau di skrip.
Kapan dipakai
- βSaat skrip spreadsheet gagal dan output shell sulit dibaca.
- βSaat Anda menduga Python atau pustakanya tidak terpasang atau versinya salah.
- βSaat Anda ingin menjalankan tes kecil untuk memastikan file bisa dibaca sebelum pekerjaan penuh.
Link skill
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/python-spreadsheet-debug/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βSkrip spreadsheet saya gagal tanpa alasan yang jelas. Periksa apakah Python dan pandas berfungsi, lalu tes membaca file.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent memeriksa Python mana yang digunakan dan versinya, lalu mengimpor setiap pustaka yang dibutuhkan secara terpisah. Setelah itu agent menjalankan skrip tes singkat yang membaca file dan menampilkan ringkasan sebelum pekerjaan penuh dijalankan.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Python Spreadsheet Debugging Workflow
When executing Python scripts for spreadsheet/data processing tasks, use this systematic debugging approach to efficiently isolate environment configuration issues from script logic errors, especially when run_shell returns opaque errors.
Step 1: Verify Python Environment
First, confirm the Python interpreter path and version to ensure you're working in the expected environment:
which python python3
python --version
python3 --version
This identifies whether Python is available and which version is being used.
Step 2: Test Library Imports in Isolation
Before running your full script, verify that required libraries can be imported successfully. Test each critical import individually:
python -c "import pandas; print('pandas:', pandas.__version__)"
python -c "import openpyxl; print('openpyxl:', openpyxl.__version__)"
python -c "import xlrd; print('xlrd:', xlrd.__version__)"
Replace library names based on your script's requirements. This identifies missing dependencies or version conflicts early.
Step 3: Run Minimal Test Script
Create and execute a minimal script that exercises only the core functionality without full business logic:
# test_minimal.py
import pandas as pd
# Test 1: Can we read a file?
try:
df = pd.read_excel('sample.xlsx')
print(f"β File read successful: {len(df)} rows")
except Exception as e:
print(f"β File read failed: {e}")
# Test 2: Can we perform basic operations?
try:
result = df.groupby('category')['amount'].sum()
print(f"β GroupBy operation successful")
except Exception as e:
print(f"β Operation failed: {e}")
Run this with: python test_minimal.py
Purpose: This isolates whether the issue is with file access, library functionality, or specific script logic.
Step 4: Execute Full Script
Once the minimal test passes, run the complete script:
python your_script.py
If errors occur now, you know the environment is correctly configured and can focus on debugging the specific logic.
Quick Diagnostic Command
For rapid diagnosis, run all checks in sequence:
echo "=== Python Version ===" && python --version && \
echo "=== Key Imports ===" && python -c "import pandas, openpyxl; print('OK')" && \
echo "=== Ready for full script ==="
Common Issues and Resolutions
| Symptom | Likely Cause | Resolution |
|---|---|---|
ModuleNotFoundError |
Missing package | pip install <package-name> |
ImportError with version |
Version conflict | Check pip list, reinstall specific version |
FileNotFoundError |
Wrong path/context | Verify working directory with pwd |
PermissionError |
File access | Check file permissions or path |
When to Use This Pattern
run_shellreturns cryptic or truncated error messages- Script worked previously but suddenly fails
- Deploying to a new environment or container
- Debugging spreadsheet processing with pandas, openpyxl, xlrd, etc.
Benefits
- Fast isolation: Identifies environment vs. logic issues within seconds
- Incremental confidence: Each passing step narrows the problem space
- Reusable pattern: Apply consistently across all Python spreadsheet tasks
Pertanyaan umum
Mengapa impor diuji satu per satu?
Cara ini menunjukkan dengan tepat pustaka mana yang hilang atau rusak, sehingga perbaikannya lebih cepat.
Apa yang dilakukan skrip tes minimal?
Skrip mencoba membaca spreadsheet dan menampilkan jumlah baris, yang memastikan dasar-dasarnya berfungsi.
Apakah ini hanya berlaku untuk file Excel?
Tidak. Langkah-langkahnya juga berlaku untuk file CSV dan data tabular lainnya.
Detail
Deskripsi asli dari pembuat
Systematic Python debugging workflow for spreadsheet tasks to isolate environment issues from script logic
repo: HKUDS/AgentPilot
Popularitas
- Bintang GitHub
- 7.8k
- Peringkat
- #12963
- Lisensi
- MIT
- Diperbarui
- 1/11/2026
Komentar
- β¦
Skill lain dari repositori ini
agentpilot
7.8kMembantu agent Anda meningkatkan proyek langkah demi langkah dengan menyiapkan tugas dan menjalankan loop AgentPilot yang mengusulkan, menguji, dan memberi skor pada perubahan.
openspace
7.8kMembantu agent Anda menyiapkan OpenSpace, alat yang menyimpan dan mengambil skill agent, lalu menghubungkannya ke aplikasi AI Anda melalui MCP.
rsi-arena
7.8kMembantu agent Anda menyiapkan dan menjalankan tes benchmark AI standar, seperti AIME dan Terminal-Bench, untuk membandingkan berbagai metode perbaikan.
experiment-guide
7.8kMembantu agent Anda merencanakan eksperimen kecil, membaca hasilnya, dan mencatat temuan saat menyelidiki cara memperbaiki sebuah program.
Skill serupa
gitcrawl
394kMemungkinkan agent Anda mencari arsip issue dan pull request GitHub yang tersimpan, mengelompokkan yang duplikat, dan memeriksa status terkininya di GitHub.
slacrawl
394kMemungkinkan agent Anda mencari dan menghitung pesan di arsip Slack lokal, memeriksa seberapa baru arsip itu, dan menyegarkannya bila diperlukan.
goplaces
394kMembantu agent Anda mencari tempat, mendapatkan detail dan ulasannya, serta menentukan nama tempat memakai Google Places, dengan keluaran JSON untuk skrip.