infra-logic-extraction

Extract infrastructure-specific logic from orchestration code into ports and adapters.

Updated Apr 9, 2026
One-click install
npx skills add https://github.com/SergeuMatyasov/dotnet-shared-skills --skill infra-logic-extraction
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: infra-logic-extraction
Source: https://github.com/SergeuMatyasov/dotnet-shared-skills/tree/main/infra-logic-extraction
Command: npx skills add https://github.com/SergeuMatyasov/dotnet-shared-skills --skill infra-logic-extraction

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides a guided approach to safely extract infra- or framework-specific logic from an orchestration or use-case file into a proper technical layer using ports and adapters, preserving behavior.

Core Features & Use Cases

  • Identify the smallest framework-specific block that can be moved without altering observable behavior.
  • Introduce an inward-facing port and an adapter that encapsulates technical dependencies.
  • Offer stepwise migration guidance with tests, naming, and contract considerations.

Quick Start

Apply this skill to extract infra-logic from a target file and place the new port/adapter in the correct internal layers without changing observable behavior.

Frequently Asked Questions about infra-logic-extraction

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the best way to extract infrastructure logic from orchestration code?

Extracting infrastructure logic is best achieved by identifying the smallest framework-specific block to move into a port/adapter layer, preserving observable behavior while enforcing neutral contracts and disciplined naming across layers.

How do I safely migrate EF Core dependencies out of my use-case code?

Safely migrate EF Core dependencies by introducing an inward-facing port and an adapter that encapsulates the technical dependency, applying stepwise migration with tests to ensure behavior remains completely intact.

When do I need to use port/adapter architecture for infrastructure refactoring?

You need port/adapter architecture for infrastructure refactoring when orchestration code tightly couples to framework-specific concerns like Http clients, messaging, or provider APIs, requiring verifiable migration steps to decouple technical dependencies.

Can I use this approach to move Http client and messaging logic without changing behavior?

Yes, you can use this approach to move Http client, messaging, and provider API logic by encapsulating them in a dedicated adapter behind a neutral port contract, ensuring the extraction does not alter observable behavior.

How do I introduce neutral contracts and naming conventions during architecture migration?

Introduce neutral contracts by defining an inward-facing port that isolates infrastructure concerns, then implement an adapter with disciplined naming conventions across layers to enforce a proper technical layer separation.

What are the limitations of stepwise migration for infra-architecture refactoring?

Limitations of stepwise migration include the necessity of identifying the smallest extractable block and maintaining rigorous test coverage, as skipping verifiable migration steps risks altering observable behavior during the port/adapter separation.