x-new-adapter

Create a Go infrastructure adapter package with public contract and scaffolding.

2|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/pure-golang/level85 --skill x-new-adapter
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: x-new-adapter
Source: https://github.com/pure-golang/level85/tree/main/.agents/skills/x-new-adapter
Command: npx skills add https://github.com/pure-golang/level85 --skill x-new-adapter

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes assets (resource) components.

What problem does it solve?

Устраняет хаос при добавлении нового инфраструктурного adapter package в Go-проект: от выбора места в дереве до оформления public contract, lifecycle и observability, чтобы адаптер был воспроизводимым и тестируемым.

Core Features & Use Cases

  • Adapter workflow по шагам: ведёт через выбор места в package tree, оформление doc.go, Config и lifecycle-контракта, а также через observability и стратегию тестов.
  • Контракт вместо дублирования: объясняет, как использовать типы внешней библиотеки как реальный контракт адаптера и его потребителей.
  • Связность со смежными skills: вместо пересказа опирается на x-doc-go, x-env-config, x-log, x-observability, x-testcontainers-go и x-unit-test-partial-interface для корректной связки практик.

Quick Start

Попроси агента составить план создания adapter package для S3-compatible storage с явным Config, конструктором без I/O, lifecycle и тестами.

Frequently Asked Questions about x-new-adapter

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

FAQPage Schema
How do I structure a new Go adapter package for an external system?

A Go adapter package requires defining its position in the package tree and establishing a public contract. This scaffolding approach ensures integrations for storage, queues, or databases remain reproducible and testable.

What is the correct way to configure a Go infrastructure adapter?

Configuring a Go infrastructure adapter requires building Config via an environment workflow. Constructors must remain free of I/O operations to maintain a clean lifecycle and ensure the adapter is easily testable.

How do I wire observability into a Go adapter package?

Wiring observability into a Go adapter package is a core scaffolding decision guided by the adapter's lifecycle. It connects the public contract to observability practices, ensuring external system integrations are properly monitored.

What testing strategy should I use for a Go adapter integration?

Selecting unit and integration tests is a key step in adapter creation. The strategy involves choosing appropriate tests to validate the public contract and ensure the infrastructure adapter behaves correctly with external systems.

Should my Go adapter define custom types or use the external library's types?

Your Go adapter should use the external library's types as the real public contract. This approach prevents duplication and clearly defines the contract for both the adapter and its consumers.

When do I need to create an adapter package in Go?

You need an adapter package when integrating external systems like queues, storage, databases, or executors. It eliminates architectural chaos by defining a clear public contract, lifecycle, and observability wiring.