hex-generate

Generate hexagonal adapter implementations with TDD tests across TypeScript, Go, or Rust.

4|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/gaberger/hex --skill hex-generate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hex-generate
Source: https://github.com/gaberger/hex/tree/main/.claude/skills/hex-generate
Command: npx skills add https://github.com/gaberger/hex --skill hex-generate

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

hex-generate automates the end-to-end creation of a hexagonal adapter implementation within a codebase, streamlining how developers add new adapters while preserving architectural boundaries.

Core Features & Use Cases

  • Resolve the target port from the adapter path and infer required interfaces.
  • Scaffold and implement an adapter across language targets (typescript, go, rust) with accompanying unit tests and test-driven workflow.
  • Validate architectural boundaries via hex analyze and compile gates, ensuring correctness before integration.
  • Use case: a developer wants to add a new secondary/git-adapter, implement IGitPort and IWorktreePort, and verify code compiles and passes tests automatically.

Quick Start

Ask the assistant to generate an adapter by specifying the adapter path under src/adapters, the target port, language, test style, and max iterations.

Frequently Asked Questions about hex-generate

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

FAQPage Schema
How do I generate a hexagonal adapter and scaffold tests via TDD?

To generate a hexagonal adapter via TDD, specify the adapter path under src/adapters, the target port interface, language, test style, and max iterations. The workflow then resolves the port, writes failing tests first, implements the adapter, and runs compile gates.

What is the process for resolving a port interface from an adapter path?

Resolving a port interface from an adapter path involves loading contextual AST and domain information to infer required interfaces. This mechanism ensures the generated adapter correctly implements the target port before any test scaffolding or architectural validation begins.

Does hexagonal architecture code generation support TypeScript, Go, and Rust?

Hexagonal architecture code generation supports TypeScript, Go, and Rust. It scaffolds the adapter implementation and accompanying unit tests across these language targets while enforcing compile-time and architectural boundaries specific to each environment.

How do I validate architectural boundaries after implementing a new adapter?

To validate architectural boundaries after implementing an adapter, run hex analyze and compile gates. This enforces hexagonal boundaries and verifies code correctness through lint checks before the adapter is integrated into the main codebase.

Can I implement multiple port interfaces like IGitPort and IWorktreePort in one adapter?

You can implement multiple port interfaces like IGitPort and IWorktreePort within a single adapter. The generation workflow resolves each target port from the adapter path and ensures both interfaces are implemented and pass the required architectural tests.

What are the limitations of automating hexagonal adapter creation?

Automating hexagonal adapter creation requires an existing port interface and a specified adapter path. It is limited to TypeScript, Go, and Rust, and depends on contextual AST and domain information to correctly infer the required interfaces before generating code.