/unicorn-team:pythonfrom unicorn-team
Guides Python development with modern idioms, tooling, and project structure. Covers type hints, pytest patterns, ruff/mypy/poetry config, and async programming.
Ships in unicorn-team. 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.
# Union with | operator
def process(value: int | str | None) -> dict[str, int]: ...
# Type aliases
type UserID = int
type Config = dict[str, str | int | bool]
# See references/type-hints-advanced.md for:
# - Generics and TypeVars
# - Protocols (structural typing)
# - Function overloading
# Fixtures
@pytest.fixture
def sample_user():
return {"name": "Alice", "email": "[email protected]"}
# Parametrize
@pytest.mark.parametrize("input,expected", [
(0, 0), (1, 1), (2, 4),
])
def test_square(input, expected):
assert input ** 2 == expected
# Mock with pytest-mock
def test_api(mocker):
mock_get = mocker.patch("requests.get")
mock_get.return_value.json.return_value = {"status": "ok"}
result = fetch_data()
assert result["status"] == "ok"
Coverage target: 80%+
pytest --cov=myapp --cov-report=term-missing --cov-fail-under=80
See references/testing-pytest.md for advanced fixtures, mocking patterns, markers, plugins.
Replaces Black, isort, flake8, pyupgrade.
ruff check --fix . && ruff format .
# pyproject.toml
[tool.ruff]
line-length = 88
target-version = "py310"
[tool.ruff.lint]
select = ["E", "W", "F", "I", "N", "UP", "B", "C4", "SIM"]
ignore = ["E501"]
[tool.ruff.format]
quote-style = "double"
[tool.mypy]
python_version = "3.10"
strict = true
warn_return_any = true
disallow_untyped_defs = true
poetry init
poetry add requests
poetry add --group dev pytest pytest-cov ruff mypy
poetry install
poetry run pytest
See references/tooling-config.md for complete ruff rule sets, mypy options, pre-commit hooks, CI/CD.
# Concurrent execution
async def fetch_all(urls: list[str]) -> list[dict]:
return await asyncio.gather(*[fetch_data(url) for url in urls])
# Async context manager
class AsyncDatabase:
async def __aenter__(self):
self.connection = await connect()
return self
async def __aexit__(self, *args):
await self.connection.close()
See references/async-patterns.md for task management, semaphores, queues, error handling, pitfalls.
| Use case | Choose | Why |
|---|---|---|
| Internal data, simple containers | @dataclass | Stdlib, fast, no deps |
| Performance-critical, immutable | @dataclass(frozen=True, slots=True) | Minimal overhead |
| External/untrusted data, APIs | pydantic.BaseModel | Auto-validation, serialization |
| Config from environment | pydantic_settings.BaseSettings | Env var parsing, type coercion |
# Dataclass: internal data
@dataclass(frozen=True)
class Point:
x: float
y: float
# Pydantic: external data with validation
class UserCreate(BaseModel):
name: str = Field(..., min_length=1, max_length=100)
email: EmailStr
age: int = Field(..., ge=0, le=150)
@field_validator("email")
@classmethod
def normalize_email(cls, v: str) -> str:
return v.lower().strip()
See references/dataclasses-pydantic.md for advanced features, nested models, settings, JSON schema.
| Anti-pattern | Fix |
|---|---|
Mutable default def f(x=[]) | def f(x=None) then x = x or [] |
Bare except: | except SpecificError as e: |
== None / == True | is None / is True |
| Modify list while iterating | List comprehension filter |
f = open() without with | with open() as f: |
String concat in loop += | "".join(...) |
| Manual index counter | enumerate() |
type(x) == list | isinstance(x, list) |
print() debugging | logging.getLogger(__name__) |
Star imports from x import * | Explicit imports |
# 1. Initialize
poetry init
poetry add <dependencies>
poetry add --group dev pytest pytest-cov ruff mypy pre-commit
# 2. Configure pyproject.toml
# [tool.ruff], [tool.mypy], [tool.pytest.ini_options]
# 3. Install hooks
pre-commit install
# 4. Full quality check
ruff check --fix . && ruff format . && mypy . && pytest --cov=myapp --cov-fail-under=80
ruff format . && ruff check --fix . # Format + lint
mypy . # Type check
pytest --cov=myapp --cov-report=term-missing --cov-fail-under=80 # Test + coverage
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub aj-geddes/unicorn-team --plugin unicorn-team15 skills in this plugin
/code-readingStrategic code comprehension protocol for navigating existing codebases. ALWAYS trigger on "understand this code", "how does this work", "refactor", "before changing", "legacy code", "code review", "what does this do", "explain this codebase", "walk me through", "unfamiliar code", "read through". Use when exploring unfamiliar code, preparing to modify legacy systems, debugging complex issues, or conducting code reviews. Different from pattern-transfer which maps known solutions across domains -- this skill builds accurate mental models of existing code./domain-devopsGuides the user through containerization, CI/CD pipelines, Kubernetes deployments, observability, and infrastructure management. ALWAYS trigger on "dockerize", "CI/CD", "kubernetes", "deploy", "monitoring", "logging", "metrics", "helm", "infrastructure", "observability", "rollback", "scaling", "pipeline", "container", "k8s", "GitOps", "Dockerfile", "health check", "troubleshoot deployment". Use when containerizing applications, building pipelines, deploying services, setting up monitoring, or debugging infrastructure issues. Different from the DevOps agent (agents/devops.md) which handles orchestration and runbook execution rather than pattern guidance./estimationGuides the user through risk-based task estimation using decomposition, three-point estimates, and PERT formula. ALWAYS trigger on "estimate", "how long will this take", "time to complete", "sizing", "scope this", "effort estimate", "how many hours", "story points", "project timeline", "when will this be done", "cost estimate", "level of effort". Use when sizing any work item, feature, or project./goGuides Go development with idiomatic patterns, tooling, and project structure. ALWAYS trigger on "go project", "go module", "go mod", "goroutine", "channel", "go test", "go build", "golangci-lint", "go interface", "go error handling", "go concurrency", "go struct", "go anti-pattern", "go best practices", "go tooling", "go lint". Use when setting up Go projects, writing idiomatic Go, choosing concurrency patterns, or configuring tooling. Different from testing skill which covers general test strategy; this covers Go-specific testing patterns and tooling configs./hvs-skill-buddyHVS Skill Buddy is the meta-skill for the entire HVS skill ecosystem. It keeps skills current with the latest Anthropic patterns, audits the skill library for drift and inconsistency, and creates new skills that fit the HVS system standard. ALWAYS trigger when the user mentions "skill buddy", "audit my skills", "skill drift", "create a new skill", "build a skill", "update my skills", "skill system", "are my skills consistent", "hvs skill", "skill conflicts", "skill overlap", "new skill for", or any request to inspect, improve, create, or manage skills in the HVS library. Also trigger when someone asks Claude to "make a skill like my other ones" or "keep this consistent with my existing skills."/javascriptGuides JavaScript and TypeScript development with modern tooling and patterns. ALWAYS trigger on "typescript", "javascript", "tsconfig", "eslint", "prettier", "vitest", "jest", "react", "node.js", "express", "npm", "package.json", "type error", "ts error", "js project setup", "frontend testing", "react hooks", "discriminated union", "type guard". Use when configuring TS/JS tooling, writing tests, structuring React or Node apps, or debugging type issues. Different from testing skill which covers general strategy; this covers JS/TS-specific test patterns and framework configs.Other plugins' skills for the same job