python-qualitylisted
Install: claude install-skill ebibibi/ebi-agent-chat-relay
# Python Quality — Patterns & Standards
Coding standards and Pythonic patterns for claude-code-discord-bridge development. Based on PEP 8, modern Python 3.12+ idioms, and project conventions.
## When to Activate
- Writing new Python code in this project
- Reviewing code for quality
- Refactoring existing code
## Project-Specific Standards
### Type Hints (Mandatory)
```python
from __future__ import annotations # Required in EVERY file
# Good: Full type annotations
async def run_claude_in_thread(
thread: discord.Thread,
runner: ClaudeRunner,
repo: SessionRepository,
prompt: str,
session_id: str | None,
) -> str | None:
...
# Bad: Missing annotations
async def run_claude_in_thread(thread, runner, repo, prompt, session_id):
...
```
### Union Types (3.12+ Syntax)
```python
# Good: Modern syntax
def process(value: str | None) -> dict[str, list[int]]:
...
# Bad: Old-style typing
from typing import Optional, Dict, List
def process(value: Optional[str]) -> Dict[str, List[int]]:
...
```
### Dataclasses for State
```python
from dataclasses import dataclass, field
@dataclass
class SessionState:
session_id: str | None = None
thread_id: int = 0
accumulated_text: str = ""
active_tools: dict[str, discord.Message] = field(default_factory=dict)
```
### Error Handling
```python
import contextlib
# Discord API calls that may fail: suppress gracefully
with contextlib.suppress(discord.HTTPException):
await message.add_reacti