python-project-setup
Sets up modern Python projects with uv tooling, src layout, and PEP8 standards. Handles both new and existing projects, presents interactive library selection for CLI/TUI apps, generates pyproject.toml, and provides complete scaffolding with type hints and proper structure.
What this skill does
# Python Project Setup Skill
A specialized skill for setting up modern Python projects using uv tooling, best practices, and standardized project structures.
## Overview
This skill enables Claude to autonomously set up Python projects following modern best practices. It promotes the use of `uv` (the fast Python package manager), enforces PEP8 standards, type hints, and proper project structure with `src` layout.
## Capabilities
When activated, this skill provides:
1. **Modern Tooling with uv**
- Use `uv` instead of pip/python directly
- Initialize virtual environments: `uv venv`
- Manage dependencies: `uv add`, `uv remove`
- Sync dependencies: `uv sync`
- Run scripts: `uv run`
2. **Project Structure Detection & Setup**
- Detect if project is new or existing
- Analyze current structure and adapt recommendations
- Promote `src/package_name` layout
- Create proper `__init__.py` files
- Setup `__main__.py` entry points
3. **pyproject.toml Management**
- Generate modern pyproject.toml
- Configure project metadata
- Setup dependencies and dev dependencies
- Include tool configurations (ruff, mypy, pytest)
- Define entry points for CLI applications
4. **Library Selection**
- Present interactive menu for library choices
- **CLI applications**: click (commands), rich (output), inquirer (interactive prompts)
- **TUI applications**: textual (framework), rich (rendering)
- **Pure libraries**: minimal dependencies
- Smart recommendations based on project type
5. **Standards Enforcement**
- PEP8 compliance via ruff
- Type hints for all functions/methods
- Proper docstring formats (Google/NumPy style)
- Follow PEP8 and modern Python standards
## Usage
This skill activates automatically when:
- User requests: "Create a new Python project"
- User asks: "Setup Python project structure"
- User mentions: "Initialize Python package"
- User wants to: "Migrate to uv"
- Claude detects Python project initialization
- pyproject.toml creation or modification is discussed
**Automatic Defaults**:
- Uses current directory as project root
- Derives package name from directory name
- Detects and uses current Python version
- No tests (user can add later)
- Minimal dependencies by default
**Only ONE Question**:
- Project type + libraries combined (default: minimal)
## Project Setup Approach
### For New Projects
**IMPORTANT**: Always work in the current directory as the project root.
1. **Gather Requirements**
- Package name (derive from current directory name by default)
- **Ask ONE merged question**: Project type + libraries combined:
```
What type of project? (press Enter for CLI with click+rich)
[1] CLI with click+rich (default)
[2] CLI with argparse
[3] CLI with typer
[4] TUI with textual
[5] Generic Python Project
```
- **Don't ask about tests** - skip by default
2. **Assume Current Directory & Python Version**
- **Use current folder as project root** (don't create new directory)
- Derive package name from current folder name (convert to valid Python identifier)
- Example: `my-awesome-app/` → package name: `my_awesome_app`
- **Detect current Python version** and use as project requirement
- Example: `python --version` → `Python 3.11.5` → `requires-python = ">=3.11"`
3. **Check Environment**
```bash
# Detect current Python version
python --version # Use this as the project's Python requirement
# Verify uv is installed
uv --version
# If not installed, provide instructions:
# macOS/Linux: curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows: powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
```
4. **Create Minimal Project Structure in Current Directory**
```
./ # Current directory (project root)
├── src/
│ └── package_name/
│ ├── __init__.py
│ └── __main__.py # Entry point
├── pyproject.toml # Minimal config
├── README.md
└── .gitignore
```
**Note**: No tests/, no .python-version - keep it minimal!
5. **Skip Tests by Default**
- Do NOT ask about tests
- Do NOT create tests/ directory
- Do NOT include pytest in dev dependencies
- User can add tests later if needed
6. **Generate Minimal pyproject.toml**
```toml
[project]
name = "package-name"
version = "0.1.0"
description = "Project description"
authors = [
{name = "Author Name", email = "[email protected]"}
]
readme = "README.md"
requires-python = ">=3.11" # Use detected Python version (e.g., 3.11, 3.12, etc.)
dependencies = [
# Based on library selection
]
[project.optional-dependencies]
dev = [
"ruff>=0.1.0",
"mypy>=1.8.0",
]
# Note: No pytest by default - add when needed
[project.scripts]
package-name = "package_name.__main__:main"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.ruff]
line-length = 88
target-version = "py311"
select = ["E", "F", "I", "N", "W", "UP"]
[tool.mypy]
python_version = "3.11"
strict = true
warn_return_any = true
warn_unused_configs = true
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
```
8. **Initialize with uv in Current Directory**
```bash
# Already in project directory (current folder)
# Create virtual environment
uv venv
# Sync dependencies from pyproject.toml
uv sync
# Add project in editable mode
uv pip install -e .
# Add development dependencies (includes pytest if tests opted in)
uv sync --group dev
```
9. **Create Entry Point Examples**
For `src/package_name/__main__.py`:
```python
"""Main entry point for package_name."""
def main() -> None:
"""Execute the main program."""
print("Hello from package_name!")
if __name__ == "__main__":
main()
```
For CLI apps with click:
```python
"""Main entry point for package_name CLI."""
import click
from rich.console import Console
console = Console()
@click.group()
@click.version_option()
def main() -> None:
"""Package name CLI application."""
pass
@main.command()
@click.option("--name", default="World", help="Name to greet")
def hello(name: str) -> None:
"""Greet someone."""
console.print(f"[bold green]Hello, {name}![/bold green]")
if __name__ == "__main__":
main()
```
### For Existing Projects
**IMPORTANT**: Always work in the current directory, don't create subdirectories.
1. **Analyze Current Directory Structure**
- Check for setup.py, requirements.txt, or pyproject.toml
- Identify current package structure
- Assess if src layout is used
- **Detect existing tests/** directory
2. **Detect Context**
- Is uv already being used?
- What's the current dependency management approach?
- Are there existing entry points?
- **Are tests already present?** (skip test skeleton question if yes)
3. **Skip Tests Question**
- Do NOT ask about tests for existing projects
- User can add tests manually if needed
4. **Provide Migration Path**
```bash
# Already in project directory (current folder)
# Convert requirements.txt to pyproject.toml
# Create pyproject.toml with [project.dependencies]
# Initialize uv for existing project
uv venv
# Import existing requirements
uv pip install -r requirements.txt
# Generate lock file
uv sync
```
5. **Recommend Structure Improvements**
- Suggest moving to src layout if not present
- Identify missing __init__.py files
- Recommend adding __main__.py if needed
- Suggest adding type hints if missing
6. **Adapt, Don't Force**
- Respect existing conventions if reasonable
- Provide gradual migration suggestions
- Explain benefits of each recommendation
## Output Format
Provide setup results inRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.