setup-skill
Initialize Python project structure with proper directory layout, configuration files, and best practices. Use when creating new projects or restructuring existing ones.
When & Why to Use This Skill
The Setup Skill for Claude is a specialized developer utility designed to automate the initialization of Python projects. It streamlines the creation of standardized directory layouts (src-layout) and essential configuration files like pyproject.toml, .gitignore, and README.md. By enforcing industry best practices from the start, it helps developers eliminate repetitive boilerplate tasks and ensures a consistent, production-ready architecture for any new Python application.
Use Cases
- New Project Scaffolding: Instantly generate a professional Python project structure with dedicated directories for models, services, and tests, ensuring a clean separation of concerns.
- Legacy Code Restructuring: Transform disorganized single-file scripts into modular, distributable packages by applying modern directory standards and build configurations.
- Standardized Environment Setup: Automatically create optimized .gitignore and pyproject.toml files tailored for modern Python workflows (e.g., using 'uv' or 'hatch'), reducing manual configuration errors.
- Team Workflow Alignment: Ensure all team members start new microservices or tools with the same architectural foundation and best practices, improving long-term maintainability.
| name | setup-skill |
|---|---|
| description | Initialize Python project structure with proper directory layout, configuration files, and best practices. Use when creating new projects or restructuring existing ones. |
| allowed-tools | Bash, Write, Read, Glob |
Setup Skill
Purpose
Create and configure Python project structures following modern best practices.
Instructions
Create Directory Structure
mkdir -p src/package_name/{models,database,services,ui,utils} mkdir -p tests touch src/package_name/__init__.py touch src/package_name/main.pyCreate pyproject.toml
[project] name = "project-name" version = "0.1.0" description = "Project description" requires-python = ">=3.11" dependencies = [] [project.scripts] app = "package_name.main:app" [build-system] requires = ["hatchling"] build-backend = "hatchling.build"Create .gitignore
__pycache__/ *.py[cod] .venv/ .env *.json !package.json .pytest_cache/ .coverage htmlcov/ dist/ build/ *.egg-info/Create README.md
# Project Name ## Installation ```bash uv syncUsage
uv run app
Examples
Create a new todo app structure
mkdir -p retro_todo/{models,database,services,ui,utils}
mkdir -p tests
touch retro_todo/__init__.py
touch retro_todo/main.py
Best Practices
- Use
srclayout for packages that will be distributed - Keep flat layout for internal tools
- Always include
__init__.pyfiles - Create separate directories for different concerns
- Include proper configuration files from start