Declarative .mdcCursor/Claude/Windsurf Rules & n8n WorkflowsIDE RuleZero-Secret Leak Audited
Python 3.12 + Astral uv + FastAPI Async Agent Service Rules
Declarative Cursor/Claude/Windsurf rule standardizing uv.lock reproducible environments, Ruff lints, Pydantic v2 strict models, and bounded httpx timeouts.
Declarative Agent & IDE Rule Files
---
description: Astral uv dependency locking, Pydantic v2 validation, and non-blocking FastAPI async handlers
globs: **/*.py,pyproject.toml
alwaysApply: false
---
# Python 3.12 + uv + FastAPI Production Standards
- Manage dependencies exclusively via `pyproject.toml` and `uv.lock` (`uv add`, `uv run`); never invoke global `pip install` without version pins.
- Define all FastAPI request/response and MCP tool payloads with Pydantic v2 `BaseModel` (`model_config = ConfigDict(extra='forbid')`).
- Never call blocking `requests.*`, `time.sleep()`, or synchronous subprocesses inside `async def` endpoints; use `httpx.AsyncClient(timeout=10.0)`.
- Reuse a shared `httpx.AsyncClient` and database pool inside FastAPI `lifespan` context managers to prevent socket exhaustion.
- Format and lint all Python modules cleanly with `ruff check --fix` and `ruff format` before committing.
## Verification Check
```bash
uv run ruff check . && uv run pytest -q
```Community Setup Notes & Production Reviews (0)
No community notes yet. Share your production configuration tip below.
Exposed MCP Tools & Resource Schema Inspector
| Tool / Resource Identifier | Input Parameters | Execution Behavior |
|---|---|---|
| uv_reproducible_lockfile | pyproject.toml, uv.lock | Mandates uv run / uv sync --frozen and forbids unpinned global pip installs. |