haddock-development/python-project-creator
> Creates Python projects with proper structure, virtual environments, and dependency management. Use when users request to create a new Python project, set up a Python development environment, or initialize a Python application with standard tooling.
npx skills add https://github.com/haddock-development/claude-reflect-system --skill python-project-creator
Use 'uv' instead of 'pip'
Always use pytest, never unittest
This skill creates well-structured Python projects with best practices for dependency management,
testing, and code organization. It sets up virtual environments, installs dependencies, and
configures common development tools.
Ask the user about:
Standard Python project structure:
project-name/
├── src/
│ └── project_name/
│ ├── __init__.py
│ └── main.py
├── tests/
│ ├── __init__.py
│ └── test_main.py
├── .gitignore
├── README.md
├── requirements.txt
└── setup.py (optional, for libraries)
Create and activate virtual environment:
# Create virtual environment
python3 -m venv venv
# Activate (instructions for user)
# macOS/Linux: source venv/bin/activate
# Windows: venv\Scripts\activate
Install packages using uv:
uv pip install <package-name>
uv pip freeze > requirements.txt
For development dependencies:
uv pip install pytest black flake8 mypy
git init
git add .
git commit -m "Initial commit: project setup"
argparse or click for command-line argumentsmain.py with proper entry pointif __name__ == "__main__": guardsetup.py for packagingnotebooks/ directory for Jupyter notebooksdata/ directory (with .gitignore)Always use pytest for testing:
uv pip install pytest pytest-cov
Example test file:
# tests/test_main.py
import pytest
from src.project_name.main import my_function
def test_my_function():
assert my_function(2, 3) == 5
Run tests:
pytest
pytest --cov=src # with coverage
uv pip install black
black src/ tests/
uv pip install flake8
flake8 src/ tests/
uv pip install mypy
mypy src/
# src/project_name/main.py
def main():
"""Main application entry point."""
print("Hello, World!")
if __name__ == "__main__":
main()
# src/project_name/config.py
import os
from pathlib import Path
# Project root directory
PROJECT_ROOT = Path(__file__).parent.parent.parent
# Load environment variables
DEBUG = os.getenv("DEBUG", "False") == "True"
class ProjectError(Exception):
"""Base exception for this project."""
pass
class ConfigError(ProjectError):
"""Configuration-related errors."""
pass
# Virtual environment
venv/
env/
.venv/
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
*.egg-info/
dist/
build/
# IDE
.vscode/
.idea/
*.swp
*.swo
# Environment
.env
.env.local
# Testing
.pytest_cache/
.coverage
htmlcov/
# OS
.DS_Store
Thumbs.db
package==1.2.3package>=1.2,<2.0src/ layout to avoid import issuesmkdir my-cli-tool && cd my-cli-tool
python3 -m venv venv
source venv/bin/activate
uv pip install click
# Create main.py, tests, etc.
mkdir my-api && cd my-api
python3 -m venv venv
source venv/bin/activate
uv pip install fastapi uvicorn
# Create app structure
mkdir my-analysis && cd my-analysis
python3 -m venv venv
source venv/bin/activate
uv pip install pandas numpy matplotlib jupyter
# Create notebooks/, data/, src/
This skill includes examples in the bundled directories:
example.py - Template Python script with best practicesapi_reference.md - Common library documentation referencesTake haddock-development/python-project-creator from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference pip, uv.
Without those the skill loads but fails at the first command.