aoa-port-adapter-refactor

Refactor core modules by extracting concrete dependencies into narrow ports and adapters.

4|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/8Dionysus/aoa-skills --skill aoa-port-adapter-refactor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aoa-port-adapter-refactor
Source: https://github.com/8Dionysus/aoa-skills/tree/main/.agents/skills/aoa-port-adapter-refactor
Command: npx skills add https://github.com/8Dionysus/aoa-skills --skill aoa-port-adapter-refactor

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Tight coupling of core business logic to concrete infrastructure makes testing hard, hinders clarity, and limits future changes.

Core Features & Use Cases

  • Port Identification: Detects concrete dependencies that leak into core modules.
  • Adapter Creation: Generates adapters to isolate infrastructure concerns behind narrow ports.
  • Bounded Refactor: Keeps changes limited to the targeted area and validates behavior stability. Use case: When a service layer directly accesses a database driver, this skill introduces a repository port and an adapter to decouple them.

Quick Start

Ask the agent to refactor the target module by extracting its concrete dependency into a clean port and adapter.

Frequently Asked Questions about aoa-port-adapter-refactor

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

FAQPage Schema
How do I decouple domain logic from infrastructure dependencies to improve testing?

To decouple domain logic from infrastructure dependencies, you extract concrete dependencies into narrow ports and corresponding adapters. This approach isolates external services behind boundaries, preserving behavior while making the architecture clearer and testing easier.

What is the best way to refactor a service layer directly accessing a database driver?

The best way to refactor a service layer directly accessing a database driver is to extract the concrete dependency into a clean repository port and an adapter. This separates the domain logic from the infrastructure concern, decoupling the modules effectively.

Why does tight coupling between core business logic and external services make testing difficult?

Tight coupling makes testing difficult because core modules directly depend on concrete infrastructure, preventing isolated unit testing. When external services leak into core logic, you cannot verify behavior without spinning up the actual dependencies, hindering clarity and limiting changes.

How do I identify ports and adapters during a bounded architecture refactor?

To identify ports and adapters during a bounded refactor, you detect concrete dependencies that leak into core modules. You then generate adapters to isolate these infrastructure concerns behind narrow ports while keeping changes limited to the targeted area.

Can I isolate external dependencies without breaking existing application behavior?

Yes, you can isolate external dependencies without breaking behavior by applying a bounded refactor. This approach keeps changes limited to the targeted area and validates behavior stability, ensuring the refactor remains bounded while introducing clean ports and adapters.