adapter

An infrastructure adapter guide for connecting application code to outside systems such as files, Git, HTTP, npm, and the operating system. It separates those technical details from the rest of the application.

In plain words
What is it for?
Use it to define an interface, build the matching adapter, register it in the dependency setup, and write integration tests for the connection.
Why use it?
It prevents outside-system errors and implementation details from spreading through the application. It also gives each connection a defined interface that can be tested and replaced.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/ai-driven-dev/framework/adapter
Any agent
npx skills add ai-driven-dev/framework --skill adapter
Clone the repo
git clone --depth 1 https://github.com/ai-driven-dev/framework

Made for: Claude Code, Codex.

Per session 92 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 530 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00092 $0.00530
Opus 5 $0.00046 $0.00265
Sonnet 5 $0.00018 $0.00106
Haiku 4.5 $0.00009 $0.00053

Measured yesterday against content hash f46a58b410fa, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

adapter scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

cli/.claude/skills/adapter/SKILL.md · 51 lines

How it starts

The opening of the file, as written. The whole thing — 51 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

# Action Role Input
01 define-port Write the port interface in src/domain/ports/ port name + method list
02 implement-adapter Write the *Adapter class implementing the port port interface from 01
03 wire-deps Register the adapter in createDeps / createMenuDeps adapter class from 02
04 test Write infrastructure integration tests completed 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

Read the full file on GitHub · 51 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 51 lines · 92 tokens per session scan A f46a58b410fa

Subscribe to this mod's changes

adapter is a skill published in the GitHub repository ai-driven-dev/framework (445 stars, last pushed 2d ago), licensed MIT. It adds 92 tokens to every session and 530 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

openai-whisper

Local speech-to-text with the Whisper CLI (no API key).

the-open-agent/openagent · 18 tokens

akirule

Aki's contextual rule router — invoke BEFORE acting whenever the task touches any of - .md/.vue/.css/.tsx/.rs/.sql files; docs, plan, README, CHANGELOG; UI, component, CSS, tailwind; SEO, schema, sitemap; release, version, commit, push, deploy; DB schema, migration; Tauri; i18n, UI copy; pricing, biz; UX review…

lacvietanh/akidevrule · 137 tokens

Stable Diffusion

State-of-the-art text-to-image generation with Stable Diffusion models via HuggingFace Diffusers. Use when generating images from text prompts, performing image-to-image translation, inpainting, or building custom diffusion pipelines.

agentic-in/elephant-agent · 47 tokens

Whisper

OpenAI's general-purpose speech recognition model. Supports 99 languages, transcription, translation to English, and language identification. Six model sizes from tiny (39M params) to large (1550M params). Use for speech-to-text, podcast transcription, or multilingual audio processing. Best for robust, multilingual…

agentic-in/elephant-agent · 67 tokens

apple-design

Apple's approach to interface design and fluid, physical motion, translated for the web. Use when building or reviewing gesture-driven UI, spring animations, drag/swipe/sheet interactions, momentum and interruptible transitions, translucent materials and depth, typography (optical sizing, tracking, leading)…

OWWZO/ai-agent · 80 tokens

i18n-localization

Internationalization and localization patterns. Detecting hardcoded strings, managing translations, locale files, RTL support.

diillson/chatcli · 27 tokens