Not loaded · from fastmcp-engineering
Evidence-first design of layered Python application/domain architecture for FastMCP and PydanticAI systems, with explicit use cases, ports, adapters, policies, transaction ownership and dependency direction.
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.
Keep MCP, agent, transport, persistence and external integrations at the edges. Business rules and application workflows must remain deterministic, testable and independent of FastMCP/PydanticAI/SQLAlchemy whenever practical.
Scope / When to use: layered Python application/domain architecture for FastMCP and PydanticAI systems with explicit use cases, ports, adapters, policies, transaction ownership and dependency direction. Trigger: designing or restructuring layers, use cases, ports, adapters, policies, transaction ownership, or dependency direction. Upstream / Prerequisite: AGENTS.md and all repository architecture/security/testing contracts read; existing skills and research packages read; identified exact versions; repository structure and conventions inspected. Mission / Goal: keep MCP, agent, transport, persistence and external integrations at the edges; business rules and application workflows must remain deterministic, testable and independent of FastMCP/PydanticAI/SQLAlchemy whenever practical. Research / Evidence: identify exact versions and verify framework lifecycle/DI semantics from official documentation; research Clean Architecture, Hexagonal Architecture/Ports & Adapters, dependency inversion, domain modeling and transaction boundaries using authoritative sources; inspect official FastMCP/PydanticAI examples; inspect repository structure and existing conventions; record evidence, alternatives and unresolved questions. Decision / Selection rules: dependencies point inward toward stable policies; use cases orchestrate a single business purpose; define ports only at meaningful boundaries; prefer explicit constructor/function dependencies assembled in a composition root; transaction ownership belongs to the application/use-case boundary; use Repository and Unit of Work only when semantics are meaningful. Version / Compatibility: identify exact versions and verify framework lifecycle/DI semantics from official documentation.
Deliverables / Artifacts: architecture diagram, responsibility matrix, dependency rule, use-case catalog, port/adapter matrix, transaction policy, error taxonomy, composition-root design, rejected alternatives, architecture tests, implementation and verification report. Verification / Testing: domain tests are pure and fast; application tests use deterministic ports/fakes; adapter tests verify framework/protocol behavior; persistence tests use the real DB for DB semantics; architecture tests may enforce dependency direction and forbidden imports. Failure / Stop conditions: reject god services, anemic-but-overabstracted domains, generic repositories, interface-per-class designs, service locators, circular dependencies, framework imports in domain policy, transaction commits in adapters, duplicated authorization, and abstractions without a demonstrated change/testing boundary. Positive scenario: a layered service with inward dependency direction passes its architecture, domain, and adapter tests. Negative scenario: domain policy imports a framework and a service locator hides dependencies, violating dependency direction.
Before implementation:
Do not cargo-cult Clean Architecture. Layers are justified by independent responsibilities and change boundaries, not by file-count targets.
Transport / MCP / CLI / HTTP
│
▼
Interface Adapters
│
▼
Application Use Cases
│
┌──────────┴──────────┐
▼ ▼
Domain Output Ports
▲ │
│ ▼
└──────────── Infrastructure Adapters
Dependencies point inward toward stable policies. Infrastructure implements ports; domain does not import FastMCP, PydanticAI, SQLAlchemy sessions or provider SDKs merely to express business rules.
Domain contains business concepts, invariants, policies and domain services that are genuinely domain-level. Keep it framework-light. Do not create an anemic domain merely to satisfy a folder structure, and do not create domain abstractions for CRUD with no domain behavior.
Domain invariants must be deterministic. Authorization policy that determines whether an operation is allowed must not depend on an LLM response.
Application use cases orchestrate a business operation: load required state through ports, enforce application policy, invoke domain behavior, coordinate external capabilities and define transaction ownership. Application code should not know MCP transport details.
One use case should have one coherent business purpose. Avoid god services and generic Manager/Helper classes.
Define ports only at meaningful architectural boundaries. Input ports represent application use cases; output ports represent dependencies such as repositories, external services, clocks, event publishers or model gateways when those dependencies need substitution or isolation.
Do not create an interface for every class. A port must protect a change boundary, testing boundary or dependency direction.
MCP/FastMCP handlers are input adapters. PydanticAI agents are orchestration adapters/capabilities. SQLAlchemy repositories are output adapters. Provider SDK clients and HTTP clients remain infrastructure. Mapping between transport schemas and application/domain types belongs at the boundary.
Prefer explicit constructor/function dependencies. Composition roots assemble concrete implementations. Avoid service locators, module-level mutable singletons and hidden imports. Request-scoped resources must follow their documented lifecycle.
Transaction ownership belongs to the application/use-case boundary or an explicitly documented unit-of-work abstraction. MCP handlers and domain entities must not independently commit arbitrary transactions. Domain code must not depend on a live SQLAlchemy session.
Use Repository when persistence semantics are meaningful to the domain/application boundary. Use Unit of Work when a use case needs atomic coordination across multiple persistence operations. Do not introduce these patterns merely because they are conventional.
Keep external/ORM representations from leaking inward when doing so protects a real boundary. Avoid excessive DTO/entity duplication when the boundary is not independently evolving. Mapping code must be explicit about identity, nullability, ownership and collections.
Define a stable application/domain error taxonomy. Translate infrastructure/provider/MCP errors at the adapter boundary. Never expose raw database exceptions, provider errors or internal stack traces as an application contract.
Inject clocks/randomness/external effect ports when deterministic behavior matters. Keep side effects at explicit boundaries. Use idempotency for operations that can be retried or replayed.
PydanticAI may reason and orchestrate tools, but application/domain policy remains authoritative. Agent tools call application capabilities; they do not bypass repositories, authorization or transaction ownership.
FastMCP tools/resources/prompts are protocol adapters. They validate transport input, resolve request context, call an application use case and map the result to the MCP contract. Do not place domain workflows inside decorators.
Reject god services, anemic-but-overabstracted domains, generic repositories, interface-per-class designs, service locators, circular dependencies, framework imports in domain policy, transaction commits in adapters, duplicated authorization, and abstractions without a demonstrated change/testing boundary.
Domain tests are pure and fast. Application tests use deterministic ports/fakes where appropriate. Adapter tests verify framework/protocol behavior. Persistence tests use the real DB for DB semantics. Architecture tests may enforce dependency direction and forbidden imports. Do not make every layer require an end-to-end test.
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