Not loaded · from fastmcp-engineering
Evidence-first database and SQLAlchemy 2.x engineering for production FastMCP systems, including async ORM, transactions, repositories, migrations, concurrency, pooling, query performance and real database verification.
Claude Code won't load this skill
It ships in fastmcp-engineering at skills/, but Claude Code only loads skills/<name>/SKILL.md and folders listed under skills in plugin.json. Installing the plugin doesn't add it.
Treat persistence as a deliberate architectural boundary. Keep domain/application logic independent from ORM details while preserving correct transaction, concurrency and database semantics.
Scope / When to use: database and SQLAlchemy 2.x engineering for production FastMCP systems, including async ORM, transactions, repositories, migrations, concurrency, pooling, query performance and real database verification. Trigger: designing or changing persistence, sessions, transactions, repositories, ORM mapping, migrations, pooling, or database concurrency behavior. Upstream / Prerequisite: AGENTS.md and repository architecture/data-access contracts read; identified exact versions; evidence recorded. Mission / Goal: treat persistence as a deliberate architectural boundary; keep domain/application logic independent from ORM details while preserving correct transaction, concurrency and database semantics. Research / Evidence: read official SQLAlchemy 2.x ORM, Session, transactions, asyncio, relationship/loading, querying, connection pooling and performance documentation for the exact version; read official migration-tool and target-database documentation; read relevant FastMCP lifecycle/context documentation before deciding how DB sessions enter tool execution; inspect official examples/source/tests where semantics are ambiguous; record evidence before coding. Decision / Selection rules: keep MCP handlers free of SQL/transaction choreography; establish an explicit session ownership/lifetime policy with a short request/use-case/task-scoped lifetime; define who owns begin/commit/rollback/retry; use repositories for meaningful domain persistence boundaries and Unit of Work only when it clarifies coordination; use SQLAlchemy 2.x typed declarative mapping and explicit relationship semantics; enforce important invariants at the database layer; version all migrations; use SQLAlchemy async APIs consistently at async boundaries; configure pooling from deployment constraints. Version / Compatibility: identify exact Python, SQLAlchemy, asyncio extension, database, driver and migration-tool versions; verify exact SQLAlchemy behavior for the target version rather than assuming it.
Deliverables / Artifacts: database architecture, transaction/session policy, domain persistence ports, ORM mapping strategy, repository/UoW policy, query/performance plan, migration strategy, concurrency model, security controls, integration-test strategy and architecture re-check. Verification / Testing: use real supported database integration tests for transaction, constraint, migration, query, isolation and locking semantics; unit-test pure policies without a database; verify migration from clean and representative previous states; include rollback/failure tests and concurrency tests for critical invariants. Failure / Stop conditions: reject if session ownership is ambiguous, repositories commit unexpectedly, ORM details leak across all layers, critical invariants exist only in Python, migrations are not authoritative, async sessions are shared concurrently, N+1 behavior is unexamined, or production correctness depends on SQLite/mock behavior that differs from the target database. Positive scenario: persistence is a clean architectural boundary with real-database verification of transactions, migrations and concurrency. Negative scenario: session ownership is ambiguous and repositories commit unexpectedly, breaking atomicity.
Before implementation:
Preferred dependency direction:
MCP adapter/tool
↓
Application use case
↓
Domain model / policies
↓
Repository / Unit of Work port
↓
SQLAlchemy infrastructure
↓
Database
MCP handlers must not contain SQL queries, transaction choreography or ORM graph manipulation. Domain objects should not depend on SQLAlchemy where a clean boundary is practical.
A Session/AsyncSession is mutable, stateful and transaction-oriented. Do not share one instance concurrently across asyncio tasks. Establish an explicit session ownership/lifetime policy. Prefer a short, request/use-case/task-scoped lifetime and make transaction boundaries explicit. Verify exact SQLAlchemy behavior for the target version rather than assuming it.
Define who owns begin, commit, rollback, savepoints and retry behavior. A use case that performs multiple writes should have one explicit transaction boundary unless there is a documented reason otherwise. Never let repository methods unexpectedly commit application work. Handle failures so the session is left in a known state.
Be explicit about transaction isolation when correctness depends on it. For race-sensitive invariants, use database constraints, appropriate locking/isolation and deterministic conflict handling rather than application-level check-then-insert logic alone.
Use repositories for meaningful domain persistence boundaries, not generic CRUD wrappers that leak ORM semantics everywhere. Use a Unit of Work only when it clarifies transaction coordination; avoid ceremony for simple read-only queries.
Repository interfaces belong to the application/domain boundary when they are actual ports. SQLAlchemy implementations belong to infrastructure. Do not create abstractions that merely rename session.execute() without providing a useful boundary.
Use SQLAlchemy 2.x typed declarative mapping and explicit relationship semantics. Define primary keys, foreign keys, uniqueness, nullability, check constraints and indexes based on invariants. Do not rely on Python validation alone for invariants that must survive concurrent writers.
Avoid accidental bidirectional cascades and uncontrolled relationship graphs. Understand delete/update cascades, orphan behavior and loading semantics before configuring them.
Prefer SQLAlchemy 2.x select() and explicit result handling. Measure query behavior rather than guessing. Detect N+1 queries. Choose selectinload, joinedload, lazy strategies and explicit loading based on access patterns and cardinality. Avoid loading large graphs when projections/aggregates are sufficient.
Pagination must be deterministic. Prefer keyset/seek pagination for large mutable datasets when requirements permit; use offset pagination only when its trade-offs are acceptable. Define stable ordering and indexes that support the access path.
Every important uniqueness, referential-integrity and state invariant must be enforced at the database layer when appropriate. Index based on real query predicates, joins and ordering. Avoid speculative indexes. Verify query plans for critical paths against realistic data volumes.
Schema changes are versioned artifacts. Migrations must be deterministic, reviewable, reversible where practical, and safe for the deployment strategy. Consider expand/contract for incompatible changes and large-table operations. Never treat create_all() as a production migration strategy.
Use SQLAlchemy async APIs consistently at async boundaries. Prevent accidental implicit IO from ORM attribute access where async behavior forbids it. Do not call blocking DB APIs from async tool execution. Verify driver support and pool configuration for the exact database.
Configure engine and pool according to deployment concurrency, database limits and workload. Account for pool timeout, recycle/pre-ping behavior, transaction leaks and graceful shutdown. Never solve connection exhaustion by blindly increasing pool size.
Model concurrent writes explicitly. Test lost-update, uniqueness races, optimistic/pessimistic locking and retry behavior when relevant. Application-level mutexes are not a substitute for database concurrency guarantees across processes/instances.
Use least-privilege DB credentials, parameterized SQL, safe identifier handling and tenant isolation. Never construct SQL from untrusted strings. If row-level security is used, verify session identity propagation and fail-closed behavior.
Use real supported database integration tests for transaction, constraint, migration, query, isolation and locking semantics. Unit-test pure policies without a database. Verify migration from clean and representative previous states. Include rollback/failure tests and concurrency tests for critical invariants.
What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (evgenygurin/fastmcp-engineering) — no native marketplace selected
npx claudepluginhub p/evgenygurin-fastmcp-engineering58 skills in this plugin
/pydantic-ai-agent-integrationEngineer PydanticAI agents behind explicit application boundaries and integrate them with FastMCP without leaking agent state, prompts, model concerns, or provider details into domain logic./api-contract-schema-engineeringEvidence-first API and MCP contract engineering with Pydantic v2 and JSON Schema./api-lifecycle-versioningEvidence-first API lifecycle, schema evolution and compatibility engineering for FastMCP/MCP servers.Other plugins' skills for the same job