agent-comms
SendMessage recipient validation and worktreePath safety (CWE-59). TRIGGER when: validating a SendMessage `to:` recipient against…
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
Claude Code
$ npx -y skills add komluk/scaffolding --skill python-patterns --agent claude-code
Codex
$ npx skills add komluk/scaffolding --skill python-patterns -a codex -y
Cursor
$ npx skills add komluk/scaffolding --skill python-patterns -a cursor -y
Gemini CLI
$ npx skills add komluk/scaffolding --skill python-patterns -a gemini-cli -y
GitHub Copilot
$ npx skills add komluk/scaffolding --skill python-patterns -a github-copilot -y
OpenCode
$ npx skills add komluk/scaffolding --skill python-patterns -a opencode -y
Windsurf
$ npx skills add komluk/scaffolding --skill python-patterns -a windsurf -y
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, 39 skills, 21 commands, 20 hooks, per-phase model tiers, opt-in lifecycle hooks, optional cross-device semantic memory.
SendMessage recipient validation and worktreePath safety (CWE-59). TRIGGER when: validating a SendMessage `to:` recipient against…
Repo-local file memory under .scaffolding/ (shared/agent/conversation tiers). TRIGGER when: reading or writing .scaffolding/…
RESTful API design standards: resource naming, HTTP methods, status codes, pagination, versioning. TRIGGER when: designing new…
Optimize Claude Code context-window usage for accuracy and cost. TRIGGER when: hitting context limits, structuring prompts for an…
Schema design, index strategy, migration safety, and query analysis. TRIGGER when: designing tables or indexes, writing a…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.