Skip to content
OpenAgentSkill
Browsing is open · Catalog captured 2026-11-21 · Automatic updates and account services are paused.
Development

adapter

Creates or modifies infrastructure adapters in src/infrastructure/adapters/ and their corresponding port interfaces in src/domain/ports/. Use when adding a new I/O boundary (file system, HTTP, git, npm, OS), changing how an existing adapter translates errors, or wiring a new adapter into createDeps. Do NOT use for business orchestration — use `use-case` instead. Do NOT use for creating domain types — use `domain-model` instead.

ai-driven-dev · AI review on file

Installation

Read the source and dependencies before running a command. Copying does not install or execute anything.

npx skills add ai-driven-dev/framework --skill adapter

About this skill


name: adapter description: > Creates or modifies infrastructure adapters in src/infrastructure/adapters/ and their corresponding port interfaces in src/domain/ports/. Use when adding a new I/O boundary (file system, HTTP, git, npm, OS), changing how an existing adapter translates errors, or wiring a new adapter into createDeps. Do NOT use for business orchestration — use use-case instead. Do NOT use for creating domain types — use domain-model instead.

Adapter

Builds the I/O translation layer: port interfaces that describe what the application needs, and adapter classes that fulfill those contracts by talking to the real world (filesystem, git, HTTP, npm, OS). Adapters own all technical constants; domain errors never cross the port boundary raw.

Available actions

#ActionRoleInput
01define-portWrite the port interface in src/domain/ports/port name + method list
02implement-adapterWrite the *Adapter class implementing the portport interface from 01
03wire-depsRegister the adapter in createDeps / createMenuDepsadapter class from 02
04testWrite infrastructure integration testscompleted adapter from 02

Default flow

01 → 02 → 03 → 04

Skip 01 when the port already exists; start at 02.

Transversal rules

  • Adapter class name ends in Adapter, implements exactly one port interface.
  • Port: interface only, no classes, ≤5 methods, all I/O methods async, no null returns.
  • No business logic in adapters — I/O and format translation only.
  • Throw typed domain exceptions; never let raw third-party errors cross the port boundary.
  • Never instantiate adapters directly in commands or cli.ts — all wiring via createDeps.
  • Named export only.
  • File name is <concept>-adapter.ts.

References

  • references/adapter-rules.md — adapter class conventions and technical-constants ownership
  • references/port-design.md — port interface contract: ≤5 methods, async, no null, intent naming

Invariant rules

  • references/adapter-rules.md — authoritative adapter rules
  • references/port-design.md — authoritative port design rules