# python-guide > Provides guidelines for Python development. Invoke when writing, refactoring, or reviewing Python code. - Author: jobslee0 - Repository: jobslee1024/Learn-AI-with-AI - Version: 20260128231541 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/jobslee1024/Learn-AI-with-AI - Web: https://mule.run/skillshub/@@jobslee1024/Learn-AI-with-AI~python-guide:20260128231541 --- --- name: "python-guide" description: "Provides guidelines for Python development. Invoke when writing, refactoring, or reviewing Python code." --- # Python Development Guide When writing Python code in this project, please follow these guidelines: 1. **Type Hinting**: Always use type hints for function arguments and return values. 2. **Docstrings**: Include a docstring for every function and class using the Google style. 3. **PEP 8**: Follow PEP 8 style guide (4 spaces for indentation). 4. **Error Handling**: Use specific exception handling instead of bare `except:`. ## Directory Specific Rules - **`tests/`**: Unit tests must use `pytest`. Test functions should start with `test_`. - **`src/legacy/`**: Do not refactor code in this directory unless explicitly requested. - **`api/v1/`**: All API handlers must include a `doc_url` parameter.