python-project-setuplisted
Install: claude install-skill timwukp/agent-skills-best-practice
# Python Project Setup
## Instructions
### Step 1: Gather Requirements
Ask:
1. What type of project? (library/package, web app, CLI tool, data pipeline)
2. Minimum Python version? (default: 3.11+)
3. Package manager preference? (pip, uv, poetry, pdm)
4. Layout preference? (src-layout or flat-layout)
5. What frameworks? (FastAPI, Django, Flask, Click, Typer)
6. CI platform? (GitHub Actions, GitLab CI)
### Step 2: Project Structure
**src-layout (recommended for libraries):**
```
my-project/
src/
my_package/
__init__.py
main.py
models.py
tests/
__init__.py
conftest.py
test_main.py
pyproject.toml
README.md
.pre-commit-config.yaml
.github/
workflows/
ci.yml
```
**flat-layout (simpler, for apps):**
```
my-project/
my_package/
__init__.py
main.py
tests/
conftest.py
test_main.py
pyproject.toml
README.md
```
Use src-layout by default. It prevents accidental imports of the source during testing.
### Step 3: Generate pyproject.toml
```toml
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "my-package"
version = "0.1.0"
description = "A brief description of the project"
readme = "README.md"
license = "MIT"
requires-python = ">=3.11"
authors = [
{ name = "Your Name", email = "you@example.com" },
]
dependencies = []
[project.optional-dependencies]
dev = [
"pytest>=8.0",
"pytest-cov>=5.0",
"ruff>=0.4",
"mypy>=1.10",
"pre-commit>=3.7",
]