agent-comms
SendMessage recipient validation and worktreePath safety (CWE-59). TRIGGER when: validating a SendMessage `to:` recipient against the agent whitelist, or a…
Python backend patterns: layered architecture, async I/O, dependency injection, repository/service separation. TRIGGER when: creating routes, models, schemas, or services in a Python backend. SKIP: REST contract design (use api-design); schema/index tuning (use
$ npx -y skills add komluk/scaffolding --skill python-patterns --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/python-patternsContext preview
The summary Claude sees to decide when to auto-load this skill.
Python backend patterns: layered architecture, async I/O, dependency injection, repository/service separation. TRIGGER when: creating routes, models, schemas, or services in a Python backend. SKIP: REST contract design (use api-design); schema/index tuning (use
name: python-patterns description: "Python backend patterns: layered architecture, async I/O, dependency injection, repository/service separation. TRIGGER when: creating routes, models, schemas, or services in a Python backend. SKIP: REST contract design (use api-design); schema/index tuning (use database-optimization). (Examples: FastAPI + SQLAlchemy + Pydantic.)"
Best practices for Python backend development: layered architecture, async I/O, dependency injection, and clear separation between HTTP handling, business logic, and data access. The concrete examples below use FastAPI, SQLAlchemy, and Pydantic, but the patterns apply to any Python web framework, ORM, and validation library.
---
| Layer | Responsibility | |-------|----------------| | **Endpoints** | HTTP handling, request/response | | **Services** | Business logic, orchestration | | **Repositories** | Data access, queries | | **Models** | Database schema | | **Schemas** | Data validation, serialization |
These layers are framework-agnostic — keep HTTP concerns, business rules, and data access in separate modules regardless of which framework/ORM you use.
---
> Illustrative — this is one concrete stack shown as an example. Substitute your > framework's equivalents (any ASGI/WSGI framework, ORM, and validation library). > The layering and separation-of-concerns patterns above are the reusable part.
app/
└── backend/
├── app/
│ ├── main.py # FastAPI app initialization
│ ├── config.py # Settings (pydantic-settings)
│ ├── api/v1/endpoints/ # Route handlers
│ ├── core/ # Security, exceptions
│ ├── models/ # SQLAlchemy models
│ ├── schemas/ # Pydantic schemas
│ ├── services/ # Business logic
│ ├── repositories/ # Data access
│ └── db/session.py # Database session
├── tests/
├── alembic.ini
└── requirements.txt---
---
| Type | Purpose | Example | |------|---------|---------| | Base | Shared fields | `UserBase(email, username)` | | Create | POST request | `UserCreate(Base + password)` | | Update | PATCH request | `UserUpdate(all optional)` | | Response | API response | `UserResponse(Base + id, created_at)` | | InDB | Internal with secrets | `UserInDB(Response + hashed_password)` |
---
---
---
# Endpoint receives dependencies, passes to service
async def create_user(
data: UserCreate,
session: AsyncSession = Depends(get_db)
):
service = UserService(session)
return await service.create(data)---
---
---
---
| Tool | Purpose | |------|---------| | black | Code formatting | | ruff | Linting | | mypy | Type checking | | pytest | Testing | | pytest-cov | Coverage |
Spec-driven multi-agent orchestration for Claude Code — pure markdown, zero backend, runs on the stock runtime. 13 agents, 36 skills, 19 commands, 15 hooks, per-phase model tiers, opt-in lifecycle hooks, optional cross-device semantic memory.
Repo: komluk/scaffolding
SendMessage recipient validation and worktreePath safety (CWE-59). TRIGGER when: validating a SendMessage `to:` recipient against the agent whitelist, or a…
3-tier markdown memory protocol (shared/agent/conversation) for cross-session knowledge. TRIGGER when: reading or writing agent memory files, choosing which…
RESTful API design standards: resource naming, HTTP methods, status codes, pagination, versioning. TRIGGER when: designing new API endpoints, defining error…
Optimize Claude Code context-window usage for accuracy and cost. TRIGGER when: hitting context limits, structuring prompts for an agent, or trimming what gets…
Schema design, index strategy, migration safety, and query analysis. TRIGGER when: designing tables or indexes, writing a migration, or diagnosing a slow…