This skill should be used when the user asks about "Python code style", "type hints", "structlog logging", "how to log", "code organization", "testing patterns", "error handling", or needs guidance on Python development best practices, project conventions, or coding standards for this project.
/plugin marketplace add WorldCentralKitchen/python-dev-framework/plugin install worldcentralkitchen-python-dev-framework@WorldCentralKitchen/python-dev-frameworkThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/logging-patterns.mdThis skill provides Python development standards enforced by the python-dev-framework plugin. Use these patterns when writing Python code in this project.
| Topic | Standard |
|---|---|
| Type hints | Required on all functions |
| Future imports | from __future__ import annotations required |
| Generics | Use list[str] not typing.List[str] |
| Logging | Use structlog, no print() in src/ |
| Testing | 75% coverage minimum, pytest |
| Layout | src/ layout with types/, models/, _internal/ |
Require type hints on all function parameters and return types:
from __future__ import annotations
def process_items(items: list[str], limit: int | None = None) -> dict[str, int]:
"""Process items and return counts."""
...
Key rules:
from __future__ import annotations at top of every modulelist, dict, set) not typing module equivalentsX | None instead of Optional[X]collections.abc not typingUse structlog for all logging. The print() function is banned in src/ (Ruff T201).
Basic usage:
import structlog
log = structlog.get_logger()
log.info("user_created", user_id=123, email="user@example.com")
log.error("payment_failed", order_id=456, reason="insufficient_funds")
For configuration and advanced patterns, see references/logging-patterns.md.
src/
├── package_name/
│ ├── __init__.py
│ ├── types/ # Type definitions
│ │ ├── __init__.py
│ │ └── _internal.py # Private types
│ ├── models/ # Data models
│ │ ├── __init__.py
│ │ └── api.py # Pydantic models (API boundaries only)
│ └── _internal/ # Private utilities (never import externally)
│ └── utils.py
Use Pydantic models only at API boundaries for validation:
from pydantic import BaseModel
class CreateUserRequest(BaseModel):
email: str
name: str
Use dataclasses for internal domain models.
Exceptionclass PaymentError(Exception):
"""Domain error for payment failures."""
def __init__(self, order_id: int, reason: str) -> None:
self.order_id = order_id
self.reason = reason
super().__init__(f"Payment failed for order {order_id}: {reason}")
Follow these testing standards:
@pytest.mark.parametrize for multiple test casesimport pytest
@pytest.mark.parametrize("input,expected", [
("hello", 5),
("", 0),
])
def test_string_length(input: str, expected: int) -> None:
# Arrange - done via parametrize
# Act
result = len(input)
# Assert
assert result == expected
Prefer immutable patterns to avoid subtle bugs:
| Prefer | Over | Why |
|---|---|---|
tuple(items) | list.append() loop | Immutable result |
@dataclass(frozen=True) | @dataclass | Immutable objects |
= None with or [] | = [] default | Mutable default bug |
field(default_factory=list) | = [] in dataclass | Mutable default bug |
For detailed patterns and configuration examples:
references/logging-patterns.md - Complete structlog configuration and advanced logging patternsCLAUDE.md - Complete project standards and enforcement rulesdocs/adr/ - Architecture Decision Recordsdocs/tdd/ - Technical Design DocumentsThis skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.