Python Auto Dev

👤 aptjason 📦 v1.0.0 ⭐ 4.1 ⬇️ 1.1K 下載
💻 開發程式設計 免費

📖 技能介紹


name: python-auto-dev description: Automated Python code generation, testing, debugging, and optimization with integrated conda environment management. Uses default conda path "C:\anaconda3\condabin\conda.bat" and environment "py311". Project files are stored at H:\code\Daily. Use when Codex needs to: (1) Generate Python code from specifications, (2) Create and run automated tests, (3) Debug code with interactive tools, (4) Optimize performance and code quality, (5) Manage conda environments for Python projects. This skill bundles executable scripts that handle the entire Python development workflow end-to-end.


Python Auto-Dev Skill

Complete automation for Python development: generate code from specs, add tests, debug, and optimize—all with the configured conda environment.

Quick Start

When a user provides a coding task:

  1. Generate Python code based on their requirements
  2. Write unit tests using pytest or unittest
  3. Run tests and capture output
  4. Debug failures automatically

    7w4.net小蔥技能。

  5. Optimize with profiling and linting
  6. Deliver final code with test report

All operations use the py311 conda environment at C:\anaconda3\condabin\conda.bat and store files under H:\code\Daily.

Workflow

Phase 1: Code Generation

Use scripts/generate_code.py to create Python code from a specification. The script accepts: - spec: Natural language description of what the code should do - output_path: Where to save the generated file (default: H:\code\Daily\generated_<timestamp>.py)

The generated code should include: - Type hints - Docstrings - Basic error handling - Modular design

Phase 2: Test Creation

After code is generated, use scripts/create_tests.py to produce comprehensive unit tests: - Tests edge cases - Tests error conditions - Uses pytest fixtures where appropriate - Outputs to H:\code\Daily\tests\

Phase 3: Test Execution & Debugging

Run tests with scripts/run_tests.py: - Activates the conda environment - Executes pytest with verbose output - Captures results in a report file

If tests fail, invoke scripts/debug_code.py: - Analyzes traceback - Suggests fixes - Can patch the code automatically (with confirmation)

Phase 4: Optimization

Once tests pass, use scripts/optimize_code.py: - Runs profiling (cProfile) - Checks code quality (pylint/flake8) - Suggests optimizations - Can apply safe optimizations automatically

Scripts Reference

All scripts are designed to be called directly by Codex. They handle conda activation internally.

  • scripts/generate_code.py - Generate Python from spec
  • scripts/create_tests.py - Create pytest/unittest suite
  • scripts/run_tests.py - Execute tests and report
  • scripts/debug_code.py - Analyze failures and suggest/patch
  • scripts/optimize_code.py - Profile and improve code quality

See references/script-usage.md for detailed parameter descriptions and examples.

Integration Notes

  • Default conda path is hard-coded for this setup; modify scripts if path changes.
  • All project files are isolated to H:\code\Daily to keep workspace clean.
  • Scripts assume Windows environment (conda .bat activation).
  • Output reports are saved as JSON and plain text for further processing.

When to Use This Skill

Use this skill when the task involves creating new Python code with a complete development pipeline. It's ideal for: - Rapid prototyping - Educational examples - Automated script generation - Refactoring tasks with test coverage - Optimization of existing code

Do not use for non-Python languages or when conda environment is unavailable.

🤖 AI 評測

這個技能提供了從寫程式碼到測試、除錯、最佳化的一整套自動化流程,文件寫得清楚明白,上手還算容易。但它的問題比較明顯:只針對 Windows 系統,路徑都是寫死的,換臺電腦或 Linux/Mac 系統就用不了;程式碼生成功能比較基礎,更像是模板填充而非真正的智慧生成;自動生成的測試也需要人工補全。總體來說,適合在特定 Windows 環境下快速搭建開發流水線使用,但通用性和智慧化程度還有較大提升空間。

📊 多維度評分

適應性4.5
規範性4.3
有效性3.9
可靠性3.8
可信度4.5

📁 包含檔案 (8 個)

📄 SKILL.md 3.5 KB
📄 _meta.json 134 B
📄 references/script-usage.md 5 KB
📄 scripts/create_tests.py 7.9 KB
📄 scripts/debug_code.py 10.8 KB
📄 scripts/generate_code.py 3.7 KB
📄 scripts/optimize_code.py 10.8 KB
📄 scripts/run_tests.py 4.5 KB