[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74EFTSC9D1PBKV9P47Y6BH0":3,"skill-same:01M74EFTSC9D1PBKV9P47Y6BH0":45},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M74EFTSC9D1PBKV9P47Y6BH0","python-coding",null,"Apply when writing or editing Python (.py) files. Behavioral corrections for error handling, resource management, async patterns, data modeling, type safety, security defaults, and common antipatterns. Project conventions always override these defaults.","tamarillo-ai\u002Ftheta","tamarillo-ai","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F264659913?v=4","01M732W8TW61PS979NJ2W4Z6XZ","tamarillo.ai","01M732W8VRBBGT4F0Q3B2HNGTQ",15,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Ftamarillo-ai\u002Ftheta\u002Fblob\u002Fmain\u002Ftest\u002Fcast-fixtures\u002Fcodex-cli\u002Fregression\u002Fjust-works\u002F.codex\u002Fskills\u002Fpython-coding\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: python-coding\ndescription: Apply when writing or editing Python (.py) files. Behavioral corrections for error handling, resource management, async patterns, data modeling, type safety, security defaults, and common antipatterns. Project conventions always override these defaults.\n---\n\n# Python Coding\n\nMatch the project's existing conventions. When uncertain, read 2-3 existing modules to infer the local style. Check `pyproject.toml` for Python version target, linter config, and tooling. These defaults apply only when the project has no established convention.\n\n## Never rules\n\nThese are unconditional. They prevent bugs and vulnerabilities regardless of project style.\n\n- **Never `except: pass`** or bare `except Exception` without re-raise. Catch specific exception types. Broad catches silently swallow bugs — a `KeyError` from a typo looks the same as a network failure, and you'll spend hours debugging something the traceback would have told you instantly.\n- **Never `datetime.now()` or `datetime.utcnow()`** -- both produce naive datetimes that lose timezone info. Naive datetimes cause subtle bugs when code crosses timezone boundaries (servers, users, DST). Use `datetime.now(tz=timezone.utc)`. Use `zoneinfo.ZoneInfo` for other timezones, not `pytz`.\n- **Never `random` for security** -- `random` uses a predictable PRNG; an attacker who observes a few outputs can predict future ones. Use `secrets.token_hex()`, `secrets.token_urlsafe()`, or `secrets.token_bytes()` for tokens, keys, session IDs.\n- **Never `shell=True` in `subprocess`** -- shell interpretation enables command injection if any argument contains user input. Use argument lists: `subprocess.run([\"cmd\", arg1, arg2])`.\n- **Never string formatting in SQL** -- SQL injection is one of the most exploited vulnerabilities. Use parameterized queries only. `f\"SELECT * FROM users WHERE id = {uid}\"` is always a defect.\n- **Never `yaml.load()`** without `SafeLoader` -- use `yaml.safe_load()`. Unsafe YAML loading deserializes arbitrary Python objects, enabling remote code execution from a crafted YAML file.\n- **Never `pickle.load()` on untrusted data** -- pickle executes arbitrary code during deserialization by design. Use JSON, MessagePack, or Protocol Buffers for data interchange.\n- **Never `eval()` or `exec()` on external input** -- use `ast.literal_eval()` for safe evaluation of literals.\n- **Never mutable default arguments** -- `def f(items=[])` shares one list across all calls. Appending in one call mutates the default for every subsequent call. Use `None` sentinel: `def f(items: list[str] | None = None)` then `items = items or []`.\n- **Never shadow builtins** -- don't use `list`, `dict`, `id`, `type`, `input`, `hash`, `map`, `set`, `filter` as variable names. Shadowing causes confusing errors when you later need the builtin in the same scope.\n- **Never blocking calls in async** -- no `time.sleep()`, bare `open()`, or `requests.get()` inside `async def`. These block the entire event loop, freezing all concurrent tasks. Use `asyncio.sleep()`, `aiofiles`, `httpx`.\n- **Never `+=` string concatenation in loops** -- use `\"\".join(parts)`. Python strings are immutable, so each `+=` allocates a new string and copies all previous content — O(n²) at scale. At 10k iterations this turns milliseconds into seconds.\n\n## Error handling\n\nAlways use `raise ... from e` when re-raising at I\u002FO boundaries. This preserves the original traceback -- essential for production debugging. Use `raise ... from None` only when the original exception is genuinely irrelevant to the caller.\n\n```python\nasync def get_user(user_id: int) -> User:\n    try:\n        result = await db.fetchrow(\"SELECT * FROM users WHERE id = $1\", user_id)\n    except asyncpg.PostgresError as e:\n        raise DatabaseError(f\"Failed to query user {user_id}\") from e\n    if result is None:\n        raise UserNotFoundError(user_id)\n    return User(**result)\n```\n\nCreate custom exception types when callers need to distinguish failure modes:\n\n```python\nclass AppError(Exception):\n    \"\"\"Base exception.\"\"\"\n\nclass NotFoundError(AppError):\n    def __init__(self, resource: str, id: Any) -> None:\n        self.resource = resource\n        self.id = id\n        super().__init__(f\"{resource} not found: {id}\")\n```\n\nWhen logging a caught exception, always preserve the traceback:\n\n```python\n# Wrong: traceback lost\nexcept httpx.HTTPStatusError as e:\n    logger.error(f\"API call failed: {e}\")\n    raise\n\n# Correct: logger.exception() includes full traceback\nexcept httpx.HTTPStatusError:\n    logger.exception(\"API call failed\")\n    raise\n```\n\nUse `exc_info=True` for non-error log levels: `logger.warning(\"retrying\", exc_info=True)`.\n\n## Resource cleanup\n\nUse context managers for anything that needs cleanup -- clients, connections, file handles. Never instantiate `httpx.AsyncClient()`, database pools, or similar without a context manager or explicit `finally` cleanup.\n\nFor managing multiple async resources, use `AsyncExitStack`:\n\n```python\nfrom contextlib import AsyncExitStack\n\nasync def setup_resources() -> AsyncIterator[Resources]:\n    async with AsyncExitStack() as stack:\n        db = await stack.enter_async_context(create_pool(dsn))\n        cache = await stack.enter_async_context(create_redis(url))\n        yield Resources(db=db, cache=cache)\n```\n\nFor custom resource lifecycles where no built-in context manager exists:\n\n```python\nfrom contextlib import asynccontextmanager\n\n@asynccontextmanager\nasync def managed_session(config: Config) -> AsyncIterator[Session]:\n    session = await Session.connect(config)\n    try:\n        yield session\n    finally:\n        await session.disconnect()\n```\n\n## Async patterns\n\n**Prefer `TaskGroup` (3.11+) over `gather` for most concurrent work.** TaskGroup enforces structured concurrency: if one task fails, siblings are cancelled and errors are raised as `ExceptionGroup`. `gather(return_exceptions=True)` silently mixes exceptions into results, which is error-prone. Use `gather` when you genuinely need partial results despite failures, or when targeting Python \u003C 3.11.\n\n```python\nasync with asyncio.TaskGroup() as tg:\n    task1 = tg.create_task(fetch_users())\n    task2 = tg.create_task(fetch_orders())\n# Both guaranteed complete here. If either failed, ExceptionGroup is raised.\n\n# Handle multiple failure types with except*\ntry:\n    async with asyncio.TaskGroup() as tg:\n        tg.create_task(operation_a())\n        tg.create_task(operation_b())\nexcept* ConnectionError as eg:\n    for exc in eg.exceptions:\n        logger.error(f\"Connection failed: {exc}\")\nexcept* ValueError as eg:\n    for exc in eg.exceptions:\n        logger.error(f\"Validation failed: {exc}\")\n```\n\nShare a single `AsyncClient` across concurrent requests -- don't create one per call. Configure timeouts explicitly:\n\n```python\nasync with httpx.AsyncClient(base_url=\"https:\u002F\u002Fapi.example.com\", timeout=30.0) as client:\n    async with asyncio.TaskGroup() as tg:\n        task1 = tg.create_task(client.get(\"\u002Fusers\"))\n        task2 = tg.create_task(client.get(\"\u002Forders\"))\n```\n\n## Type hints\n\nUse modern syntax: `list[str]`, `dict[str, Any]`, `X | None`. Use native type parameter syntax when the project targets 3.12+; fall back to `TypeVar` for older targets.\n\n```python\nclass Repository[T]:\n    def __init__(self, model_class: type[T]) -> None:\n        self._model_class = model_class\n        self._items: dict[int, T] = {}\n\n    def get(self, id: int) -> T | None:\n        return self._items.get(id)\n```\n\n**Use `object` instead of `Any`** when you mean \"accepts anything.\" `Any` silently disables type checking -- it's a hole in type safety. Reserve `Any` for when the type system genuinely cannot express something.\n\n**Covariant inputs, concrete outputs.** Function parameters should accept abstract types (`Sequence`, `Mapping`, `Iterable`); return types should be concrete (`list`, `dict`):\n\n```python\nfrom collections.abc import Sequence, Mapping\n\ndef process_items(items: Sequence[str]) -> list[str]:  # accepts tuple, list, etc.\n    return [item.upper() for item in items]\n\ndef merge_configs(base: Mapping[str, Any], override: Mapping[str, Any]) -> dict[str, Any]:\n    return {**base, **override}\n```\n\n**Use `TYPE_CHECKING` for import-only types.** When a type is only needed for annotations (not at runtime), import it under `TYPE_CHECKING` to avoid circular imports and reduce startup cost:\n\n```python\nfrom __future__ import annotations\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n    from myapp.services import PaymentService\n\nclass OrderProcessor:\n    def __init__(self, payments: PaymentService) -> None:\n        self._payments = payments\n```\n\n## Pattern matching\n\nUse `match`\u002F`case` (3.10+) when branching on structure — it's clearer than if\u002Felif chains for destructuring dicts, tuples, or typed objects. Don't use it as a substitute for simple value comparisons where `if\u002Felif` reads fine.\n\n```python\nmatch event:\n    case {\"type\": \"click\", \"target\": target}:\n        handle_click(target)\n    case {\"type\": \"scroll\", \"offset\": int(offset)} if offset > 0:\n        handle_scroll(offset)\n    case _:\n        logger.warning(\"Unhandled event: %s\", event.get(\"type\"))\n```\n\n## Data modeling\n\n| Use Case | Choice | Reason |\n|----------|--------|--------|\n| API request\u002Fresponse | Pydantic | Validation, serialization, OpenAPI |\n| Config from env\u002Ffiles | Pydantic | Built-in settings management |\n| Internal data transfer | dataclass | Lighter weight, no runtime validation |\n| Simple value objects | dataclass | Minimal boilerplate |\n\nPydantic at system boundaries:\n\n```python\nclass UserCreate(BaseModel):\n    email: str = Field(..., min_length=5)\n    name: str = Field(..., min_length=1, max_length=100)\n\nclass UserResponse(BaseModel):\n    id: int\n    email: str\n    model_config = {\"from_attributes\": True}\n```\n\nDataclasses internally. Use `frozen=True` for value objects, `slots=True` when you have many instances:\n\n```python\n@dataclass(frozen=True, slots=True)\nclass CacheKey:\n    namespace: str\n    id: str\n```\n\n## Dependency injection\n\nConstructor injection. Dependencies are explicit, testable, and swappable.\n\n```python\nclass UserService:\n    def __init__(self, repository: UserRepository, email_client: EmailClient) -> None:\n        self._repository = repository\n        self._email_client = email_client\n```\n\n## Protocol\n\nUse Protocol for structural interfaces -- duck typing with full type safety, no inheritance required.\n\n```python\nfrom typing import Protocol, runtime_checkable\n\n@runtime_checkable\nclass Serializable(Protocol):\n    def to_dict(self) -> dict[str, Any]: ...\n```\n\n## Enums\n\nUse `StrEnum` instead of raw string literals for known value sets. Catches typos at type-check time. Use `IntEnum` only when interfacing with systems that require integer codes.\n\n```python\nfrom enum import StrEnum, unique\n\n@unique\nclass OrderStatus(StrEnum):\n    PENDING = \"pending\"\n    CONFIRMED = \"confirmed\"\n    SHIPPED = \"shipped\"\n```\n\n## Imports\n\nImport order: standard library, third-party, local. Define `__all__` if the project convention uses it. Use `pathlib.Path` over `os.path`. No import-time side effects -- don't connect to databases, read files, or run computations at module level. Defer to first use.\n\n## Retry logic\n\nUse tenacity for transient errors: network failures, rate limits, 5xx responses. Let 4xx errors propagate -- they indicate a request problem, not a transient failure.\n\n```python\n@retry(\n    retry=retry_if_exception_type((httpx.RequestError, httpx.HTTPStatusError)),\n    stop=stop_after_attempt(3),\n    wait=wait_exponential(multiplier=1, min=2, max=10),\n    before_sleep=before_sleep_log(logger, logging.WARNING),\n    reraise=True,\n)\nasync def fetch_with_retry(url: str) -> dict[str, Any]:\n    async with httpx.AsyncClient() as client:\n        response = await client.get(url, timeout=30.0)\n        response.raise_for_status()\n        return response.json()\n```\n\n## Logging\n\nMatch the project's logging library (stdlib `logging`, `structlog`, etc.). With stdlib, use `__name__` and pass structured data via `extra`:\n\n```python\nlogger = logging.getLogger(__name__)\nlogger.info(\"User created\", extra={\"user_id\": user.id})\n```\n\n## Testing\n\nMatch the project's test runner and async plugin. Check for `pytest-asyncio` `mode = \"auto\"` (no manual `@pytest.mark.asyncio` needed) or `anyio`-based setup.\n\nWhen to mock: external APIs with rate limits\u002Fcosts, error paths, deterministic results. When to use real services: verifying actual integration behavior, sandbox\u002Ftest modes available. Test behavior, not implementation -- test what a function returns, not how it does it internally.\n","# Python Coding\n\nMatch the project's existing conventions. When uncertain, read 2-3 existing modules to infer the local style. Check `pyproject.toml` for Python version target, linter config, and tooling. These defaults apply only when the project has no established convention.\n\n## Never rules\n\nThese are unconditional. They prevent bugs and vulnerabilities regardless of project style.\n\n- **Never `except: pass`** or bare `except Exception` without re-raise. Catch specific exception types. Broad catches silently swallow bugs — a `KeyError` from a typo looks the same as a network failure, and you'll spend hours debugging something the traceback would have told you instantly.\n- **Never `datetime.now()` or `datetime.utcnow()`** -- both produce naive datetimes that lose timezone info. Naive datetimes cause subtle bugs when code crosses timezone boundaries (servers, users, DST). Use `datetime.now(tz=timezone.utc)`. Use `zoneinfo.ZoneInfo` for other timezones, not `pytz`.\n- **Never `random` for security** -- `random` uses a predictable PRNG; an attacker who observes a few outputs can predict future ones. Use `secrets.token_hex()`, `secrets.token_urlsafe()`, or `secrets.token_bytes()` for tokens, keys, session IDs.\n- **Never `shell=True` in `subprocess`** -- shell interpretation enables command injection if any argument contains user input. Use argument lists: `subprocess.run([\"cmd\", arg1, arg2])`.\n- **Never string formatting in SQL** -- SQL injection is one of the most exploited vulnerabilities. Use parameterized queries only. `f\"SELECT * FROM users WHERE id = {uid}\"` is always a defect.\n- **Never `yaml.load()`** without `SafeLoader` -- use `yaml.safe_load()`. Unsafe YAML loading deserializes arbitrary Python objects, enabling remote code execution from a crafted YAML file.\n- **Never `pickle.load()` on untrusted data** -- pickle executes arbitrary code during deserialization by design. Use JSON, MessagePack, or Protocol Buffers for data interchange.\n- **Never `eval()` or `exec()` on external input** -- use `ast.literal_eval()` for safe evaluation of literals.\n- **Never mutable default arguments** -- `def f(items=[])` shares one list across all calls. Appending in one call mutates the default for every subsequent call. Use `None` sentinel: `def f(items: list[str] | None = None)` then `items = items or []`.\n- **Never shadow builtins** -- don't use `list`, `dict`, `id`, `type`, `input`, `hash`, `map`, `set`, `filter` as variable names. Shadowing causes confusing errors when you later need the builtin in the same scope.\n- **Never blocking calls in async** -- no `time.sleep()`, bare `open()`, or `requests.get()` inside `async def`. These block the entire event loop, freezing all concurrent tasks. Use `asyncio.sleep()`, `aiofiles`, `httpx`.\n- **Never `+=` string concatenation in loops** -- use `\"\".join(parts)`. Python strings are immutable, so each `+=` allocates a new string and copies all previous content — O(n²) at scale. At 10k iterations this turns milliseconds into seconds.\n\n## Error handling\n\nAlways use `raise ... from e` when re-raising at I\u002FO boundaries. This preserves the original traceback -- essential for production debugging. Use `raise ... from None` only when the original exception is genuinely irrelevant to the caller.\n\n```python\nasync def get_user(user_id: int) -> User:\n    try:\n        result = await db.fetchrow(\"SELECT * FROM users WHERE id = $1\", user_id)\n    except asyncpg.PostgresError as e:\n        raise DatabaseError(f\"Failed to query user {user_id}\") from e\n    if result is None:\n        raise UserNotFoundError(user_id)\n    return User(**result)\n```\n\nCreate custom exception types when callers need to distinguish failure modes:\n\n```python\nclass AppError(Exception):\n    \"\"\"Base exception.\"\"\"\n\nclass NotFoundError(AppError):\n    def __init__(self, resource: str, id: Any) -> None:\n        self.resource = resource\n        self.id = id\n        super().__init__(f\"{resource} not found: {id}\")\n```\n\nWhen logging a caught exception, always preserve the traceback:\n\n```python\n# Wrong: traceback lost\nexcept httpx.HTTPStatusError as e:\n    logger.error(f\"API call failed: {e}\")\n    raise\n\n# Correct: logger.exception() includes full traceback\nexcept httpx.HTTPStatusError:\n    logger.exception(\"API call failed\")\n    raise\n```\n\nUse `exc_info=True` for non-error log levels: `logger.warning(\"retrying\", exc_info=True)`.\n\n## Resource cleanup\n\nUse context managers for anything that needs cleanup -- clients, connections, file handles. Never instantiate `httpx.AsyncClient()`, database pools, or similar without a context manager or explicit `finally` cleanup.\n\nFor managing multiple async resources, use `AsyncExitStack`:\n\n```python\nfrom contextlib import AsyncExitStack\n\nasync def setup_resources() -> AsyncIterator[Resources]:\n    async with AsyncExitStack() as stack:\n        db = await stack.enter_async_context(create_pool(dsn))\n        cache = await stack.enter_async_context(create_redis(url))\n        yield Resources(db=db, cache=cache)\n```\n\nFor custom resource lifecycles where no built-in context manager exists:\n\n```python\nfrom contextlib import asynccontextmanager\n\n@asynccontextmanager\nasync def managed_session(config: Config) -> AsyncIterator[Session]:\n    session = await Session.connect(config)\n    try:\n        yield session\n    finally:\n        await session.disconnect()\n```\n\n## Async patterns\n\n**Prefer `TaskGroup` (3.11+) over `gather` for most concurrent work.** TaskGroup enforces structured concurrency: if one task fails, siblings are cancelled and errors are raised as `ExceptionGroup`. `gather(return_exceptions=True)` silently mixes exceptions into results, which is error-prone. Use `gather` when you genuinely need partial results despite failures, or when targeting Python \u003C 3.11.\n\n```python\nasync with asyncio.TaskGroup() as tg:\n    task1 = tg.create_task(fetch_users())\n    task2 = tg.create_task(fetch_orders())\n# Both guaranteed complete here. If either failed, ExceptionGroup is raised.\n\n# Handle multiple failure types with except*\ntry:\n    async with asyncio.TaskGroup() as tg:\n        tg.create_task(operation_a())\n        tg.create_task(operation_b())\nexcept* ConnectionError as eg:\n    for exc in eg.exceptions:\n        logger.error(f\"Connection failed: {exc}\")\nexcept* ValueError as eg:\n    for exc in eg.exceptions:\n        logger.error(f\"Validation failed: {exc}\")\n```\n\nShare a single `AsyncClient` across concurrent requests -- don't create one per call. Configure timeouts explicitly:\n\n```python\nasync with httpx.AsyncClient(base_url=\"https:\u002F\u002Fapi.example.com\", timeout=30.0) as client:\n    async with asyncio.TaskGroup() as tg:\n        task1 = tg.create_task(client.get(\"\u002Fusers\"))\n        task2 = tg.create_task(client.get(\"\u002Forders\"))\n```\n\n## Type hints\n\nUse modern syntax: `list[str]`, `dict[str, Any]`, `X | None`. Use native type parameter syntax when the project targets 3.12+; fall back to `TypeVar` for older targets.\n\n```python\nclass Repository[T]:\n    def __init__(self, model_class: type[T]) -> None:\n        self._model_class = model_class\n        self._items: dict[int, T] = {}\n\n    def get(self, id: int) -> T | None:\n        return self._items.get(id)\n```\n\n**Use `object` instead of `Any`** when you mean \"accepts anything.\" `Any` silently disables type checking -- it's a hole in type safety. Reserve `Any` for when the type system genuinely cannot express something.\n\n**Covariant inputs, concrete outputs.** Function parameters should accept abstract types (`Sequence`, `Mapping`, `Iterable`); return types should be concrete (`list`, `dict`):\n\n```python\nfrom collections.abc import Sequence, Mapping\n\ndef process_items(items: Sequence[str]) -> list[str]:  # accepts tuple, list, etc.\n    return [item.upper() for item in items]\n\ndef merge_configs(base: Mapping[str, Any], override: Mapping[str, Any]) -> dict[str, Any]:\n    return {**base, **override}\n```\n\n**Use `TYPE_CHECKING` for import-only types.** When a type is only needed for annotations (not at runtime), import it under `TYPE_CHECKING` to avoid circular imports and reduce startup cost:\n\n```python\nfrom __future__ import annotations\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n    from myapp.services import PaymentService\n\nclass OrderProcessor:\n    def __init__(self, payments: PaymentService) -> None:\n        self._payments = payments\n```\n\n## Pattern matching\n\nUse `match`\u002F`case` (3.10+) when branching on structure — it's clearer than if\u002Felif chains for destructuring dicts, tuples, or typed objects. Don't use it as a substitute for simple value comparisons where `if\u002Felif` reads fine.\n\n```python\nmatch event:\n    case {\"type\": \"click\", \"target\": target}:\n        handle_click(target)\n    case {\"type\": \"scroll\", \"offset\": int(offset)} if offset > 0:\n        handle_scroll(offset)\n    case _:\n        logger.warning(\"Unhandled event: %s\", event.get(\"type\"))\n```\n\n## Data modeling\n\n| Use Case | Choice | Reason |\n|----------|--------|--------|\n| API request\u002Fresponse | Pydantic | Validation, serialization, OpenAPI |\n| Config from env\u002Ffiles | Pydantic | Built-in settings management |\n| Internal data transfer | dataclass | Lighter weight, no runtime validation |\n| Simple value objects | dataclass | Minimal boilerplate |\n\nPydantic at system boundaries:\n\n```python\nclass UserCreate(BaseModel):\n    email: str = Field(..., min_length=5)\n    name: str = Field(..., min_length=1, max_length=100)\n\nclass UserResponse(BaseModel):\n    id: int\n    email: str\n    model_config = {\"from_attributes\": True}\n```\n\nDataclasses internally. Use `frozen=True` for value objects, `slots=True` when you have many instances:\n\n```python\n@dataclass(frozen=True, slots=True)\nclass CacheKey:\n    namespace: str\n    id: str\n```\n\n## Dependency injection\n\nConstructor injection. Dependencies are explicit, testable, and swappable.\n\n```python\nclass UserService:\n    def __init__(self, repository: UserRepository, email_client: EmailClient) -> None:\n        self._repository = repository\n        self._email_client = email_client\n```\n\n## Protocol\n\nUse Protocol for structural interfaces -- duck typing with full type safety, no inheritance required.\n\n```python\nfrom typing import Protocol, runtime_checkable\n\n@runtime_checkable\nclass Serializable(Protocol):\n    def to_dict(self) -> dict[str, Any]: ...\n```\n\n## Enums\n\nUse `StrEnum` instead of raw string literals for known value sets. Catches typos at type-check time. Use `IntEnum` only when interfacing with systems that require integer codes.\n\n```python\nfrom enum import StrEnum, unique\n\n@unique\nclass OrderStatus(StrEnum):\n    PENDING = \"pending\"\n    CONFIRMED = \"confirmed\"\n    SHIPPED = \"shipped\"\n```\n\n## Imports\n\nImport order: standard library, third-party, local. Define `__all__` if the project convention uses it. Use `pathlib.Path` over `os.path`. No import-time side effects -- don't connect to databases, read files, or run computations at module level. Defer to first use.\n\n## Retry logic\n\nUse tenacity for transient errors: network failures, rate limits, 5xx responses. Let 4xx errors propagate -- they indicate a request problem, not a transient failure.\n\n```python\n@retry(\n    retry=retry_if_exception_type((httpx.RequestError, httpx.HTTPStatusError)),\n    stop=stop_after_attempt(3),\n    wait=wait_exponential(multiplier=1, min=2, max=10),\n    before_sleep=before_sleep_log(logger, logging.WARNING),\n    reraise=True,\n)\nasync def fetch_with_retry(url: str) -> dict[str, Any]:\n    async with httpx.AsyncClient() as client:\n        response = await client.get(url, timeout=30.0)\n        response.raise_for_status()\n        return response.json()\n```\n\n## Logging\n\nMatch the project's logging library (stdlib `logging`, `structlog`, etc.). With stdlib, use `__name__` and pass structured data via `extra`:\n\n```python\nlogger = logging.getLogger(__name__)\nlogger.info(\"User created\", extra={\"user_id\": user.id})\n```\n\n## Testing\n\nMatch the project's test runner and async plugin. Check for `pytest-asyncio` `mode = \"auto\"` (no manual `@pytest.mark.asyncio` needed) or `anyio`-based setup.\n\nWhen to mock: external APIs with rate limits\u002Fcosts, error paths, deterministic results. When to use real services: verifying actual integration behavior, sandbox\u002Ftest modes available. Test behavior, not implementation -- test what a function returns, not how it does it internally.\n",{"name":5,"description":7},"main","08c084f718b2b842cd53622ce0b1a1fb2888ccef","test\u002Fcast-fixtures\u002Fcodex-cli\u002Fregression\u002Fjust-works\u002F.codex\u002Fskills\u002Fpython-coding",1,"https:\u002F\u002Fgithub.com\u002Ftamarillo-ai\u002Ftheta","https:\u002F\u002Fgithub.com\u002Ftamarillo-ai","2026-07-15 23:48:12",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add tamarillo-ai\u002Ftheta --skill python-coding",{"tool":37,"command":38},"bunx","bunx skills add tamarillo-ai\u002Ftheta --skill python-coding",{"tool":40,"command":41},"pnpm","pnpm dlx skills add tamarillo-ai\u002Ftheta --skill python-coding","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Ftamarillo-ai\u002Ftheta\u002Fblob\u002Fmain\u002Ftest\u002Fcast-fixtures\u002Fcodex-cli\u002Fregression\u002Fjust-works\u002F.codex\u002Fskills\u002Fpython-coding\u002FSKILL.md",true,[],[46,53,60,68,75,82],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":19},"01M74FCAJ0RRFRJRQES26329E7","deploy-app","Deploy the application to staging or production environments.","https:\u002F\u002Fgithub.com\u002Ftamarillo-ai\u002Ftheta\u002Fblob\u002Fmain\u002Ftest\u002Fcast-fixtures\u002Fcursor\u002Fskills\u002Fbasic\u002F.cursor\u002Fskills\u002Fdeploy-app\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M74FC8GPJGCS0KTGKS1CJZZS","deploy","Deploy the application to environments.","https:\u002F\u002Fgithub.com\u002Ftamarillo-ai\u002Ftheta\u002Fblob\u002Fmain\u002Ftest\u002Fcast-fixtures\u002Fcursor\u002Fcombined\u002Ffull-config\u002F.cursor\u002Fskills\u002Fdeploy\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":64,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M74FC5RT3VTNZEK1F7NX5380","building-native-ui","Complete guide for building beautiful apps with Expo Router. Covers fundamentals, styling, components, navigation, animations, patterns, and native tabs.","MIT","https:\u002F\u002Fgithub.com\u002Ftamarillo-ai\u002Ftheta\u002Fblob\u002Fmain\u002Ftest\u002Fcast-fixtures\u002Fcopilot\u002Fskills\u002Fwith-references\u002F.github\u002Fskills\u002Fbuilding-native-ui\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M74FC1ZGP5R44HPGWWSW6P3B","create-section","Use when creating a new section for the AI Workshop presentation. Guides through title slide setup, layout choices, and content gathering. Activates when user wants to add a new topic section to the slideshow.","https:\u002F\u002Fgithub.com\u002Ftamarillo-ai\u002Ftheta\u002Fblob\u002Fmain\u002Ftest\u002Fcast-fixtures\u002Fcopilot\u002Fskills\u002Fbasic\u002F.github\u002Fskills\u002Fcreate-section\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M74FBZXSZ7GVP0HCGNR1BVNH","ship-checker","Run a full pre-ship review for this repo. Use when asked if a change is ready to deploy, publish, or ship.","https:\u002F\u002Fgithub.com\u002Ftamarillo-ai\u002Ftheta\u002Fblob\u002Fmain\u002Ftest\u002Fcast-fixtures\u002Fcopilot\u002Fcombined\u002Feverything\u002F.github\u002Fskills\u002Fship-checker\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M74FBY4N2E3ZERWBRM4S3DE6","lint-check","Run repository linters and report failures.","https:\u002F\u002Fgithub.com\u002Ftamarillo-ai\u002Ftheta\u002Fblob\u002Fmain\u002Ftest\u002Fcast-fixtures\u002Fcodex-cli\u002Fskills\u002Fagents-path\u002F.agents\u002Fskills\u002Flint-check\u002FSKILL.md",[],[]]