Help us improve
Share bugs, ideas, or general feedback.
From pysmith
Copy-paste ready code patterns for Python backend development. Includes Repository, Service, Middleware, Caching, Retry, Rate Limiter, Error Handling, Background Task, and Dependency Injection patterns. Use when implementing common architectural patterns or looking for production-ready code snippets.
npx claudepluginhub jugrajsingh/skillgarden --plugin pysmithHow this skill is triggered — by the user, by Claude, or both
Slash command
/pysmith:browsing-patternsThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Copy-paste ready implementations for common backend patterns.
Provides expert Python backend patterns for Django, FastAPI, Flask: Pydantic models, dependency injection, background tasks, exception handling, lifespan events, async programming.
Provides Python backend patterns for FastAPI, Django, SQLAlchemy, async code, and Pydantic v2. Covers principles like async usage, lifespan managers, and type annotations; includes references and stack detection script.
Provides backend patterns for layered architecture, error handling, logging, caching in services and APIs. Loads language-specific practices for Python, Node.js, Java, Go, C#, Rust.
Share bugs, ideas, or general feedback.
Copy-paste ready implementations for common backend patterns.
| Pattern | Use Case |
|---|---|
| Repository | Data access abstraction |
| Service Layer | Business logic encapsulation |
| Middleware | Request/response processing |
| Caching | Redis-based caching with decorator |
| Retry | Exponential backoff for external calls |
| Rate Limiter | Token bucket rate limiting |
| Error Handling | Structured application errors |
| Background Task | Graceful async task management |
| Dependency Injection | FastAPI DI patterns |
Read references/patterns.md for complete implementations.
Each pattern includes:
class BaseRepository(ABC, Generic[T]):
async def get(self, id: str) -> T | None: ...
async def create(self, entity: T) -> T: ...
async def list(self, limit: int = 100) -> list[T]: ...
@dataclass
class ServiceResult(Generic[T]):
success: bool
data: T | None = None
error: str | None = None
@classmethod
def ok(cls, data: T) -> "ServiceResult[T]": ...
@classmethod
def fail(cls, error: str) -> "ServiceResult[T]": ...
@retry(max_attempts=3, delay=1.0, exceptions=(ConnectionError,))
async def fetch_external_api(url: str) -> dict: ...
def get_user_service(
repo: Annotated[UserRepository, Depends(get_user_repo)],
) -> UserService:
return UserService(repo)
For complete implementations, read references/patterns.md.