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.
Provides copy-paste ready Python backend patterns including Repository, Service, Middleware, Caching, and Dependency Injection.
npx claudepluginhub jugrajsingh/skillgardenThis skill is limited to using the following tools:
references/patterns.mdCopy-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.
Expert guidance for Next.js Cache Components and Partial Prerendering (PPR). **PROACTIVE ACTIVATION**: Use this skill automatically when working in Next.js projects that have `cacheComponents: true` in their next.config.ts/next.config.js. When this config is detected, proactively apply Cache Components patterns and best practices to all React Server Component implementations. **DETECTION**: At the start of a session in a Next.js project, check for `cacheComponents: true` in next.config. If enabled, this skill's patterns should guide all component authoring, data fetching, and caching decisions. **USE CASES**: Implementing 'use cache' directive, configuring cache lifetimes with cacheLife(), tagging cached data with cacheTag(), invalidating caches with updateTag()/revalidateTag(), optimizing static vs dynamic content boundaries, debugging cache issues, and reviewing Cache Component implementations.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.