/spicy-skills:python-developmentfrom spicy-skills
Enforces Python best practices for typing, structure, and tooling during planning and implementation. Covers project setup, type system, Pydantic/dataclass patterns, testing, and error handling.
Ships in spicy-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Detect existing package manager first:
ls -la pyproject.toml poetry.lock uv.lock Pipfile* requirements.txt .venv/ 2>/dev/null
| Found | Use |
|---|---|
poetry.lock | poetry install && poetry run pytest |
uv.lock | uv sync && uv run pytest |
requirements.txt | source .venv/bin/activate && pip install -r requirements.txt |
| Nothing | uv init && uv venv && source .venv/bin/activate |
Never switch package managers. Never install globally.
When using uv, avoid uv pip install and use commands like uv add and uv sync instead.
Avoid Any and generic dicts. Use structured types.
from __future__ import annotations
# ✗ AVOID
def process(data: dict[str, Any]) -> dict[str, Any]: ...
# ✓ PREFER
@dataclass(frozen=True, slots=True)
class User:
id: int
email: str
name: str
def process(user: User) -> User: ...
| Data Origin | Use |
|---|---|
| API input/output | Pydantic BaseModel |
| Internal objects | @dataclass(frozen=True, slots=True) |
| External JSON you don't control | TypedDict |
| Interface contracts | Protocol |
Details: type-system.md
Pydantic for validation:
class CreateUserRequest(BaseModel):
email: EmailStr
name: str = Field(min_length=1, max_length=100)
Dataclass for domain objects:
@dataclass(frozen=True, slots=True)
class UserId:
value: int
Protocol for DI:
class UserRepository(Protocol):
def get(self, id: UserId) -> User | None: ...
def save(self, user: User) -> None: ...
Error handling — preserve chain, never swallow:
except httpx.HTTPError as e:
raise ServiceError("API failed") from e
# ✗ NEVER: except Exception: pass
Details: patterns.md
Fixtures over setup, parametrize for variants:
@pytest.fixture
def user_service(mock_repo: Mock) -> UserService:
return UserService(repo=mock_repo)
@pytest.mark.parametrize("email,valid", [
("[email protected]", True),
("invalid", False),
])
def test_email_validation(email: str, valid: bool) -> None:
assert validate_email(email) == valid
Details: testing.md
Naming: snake_case functions/variables, PascalCase classes, SCREAMING_SNAKE constants
Imports: stdlib → third-party → local
Tooling: ruff for linting + formatting
Anti-patterns: anti-patterns.md
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub d-mariano/spicyclaude --plugin spicy-skills3 skills in this plugin
/terraform-developmentGuides Terraform/HCL configuration structure, module design, state management, and provider usage during both planning and implementation. Use when designing infrastructure, planning Terraform architecture, or writing .tf files. Triggers: 'terraform', 'tofu', 'HCL', '.tf', 'tfvars', 'terraform plan', 'terraform apply', 'terraform module', 'provider', 'resource block', infrastructure as code design. Does not apply to Pulumi, CDK, CloudFormation, Ansible, Kubernetes manifests, or Helm charts.
/test-driven-developmentEnforces test-driven development via RED-GREEN-REFACTOR when writing code. Use when implementing features, fixing bugs, refactoring, or writing any functional code. Triggers: 'write tests first', 'TDD', 'test-driven', 'red-green-refactor', new feature, bug fix, refactor. Does not apply to pure config files (JSON, YAML, .env), type-only definitions, or documentation.