Agent Skill
2/7/2026

infra-system-gateway-generator

Generates system-first external integration: client/dto/gateway impl under infra.gateway.<system> and error translation rules.

R
ryan
0GitHub Stars
1Views
npx skills add ryan-alexander-zhang/persimmon

SKILL.md

Nameinfra-system-gateway-generator
DescriptionGenerates system-first external integration: client/dto/gateway impl under infra.gateway.<system> and error translation rules.

name: infra-system-gateway-generator description: "Generates system-first external integration: client/dto/gateway impl under infra.gateway.<system> and error translation rules."

Infra System Gateway Generator

Follow .codex/skills/GENERATOR_SKILL_STRUCTURE.md.

Templates: See references/templates.md.

Use For

  • External integrations organized by remote system name under:
    • {{basePackage}}.infra.gateway.<system>.client
    • {{basePackage}}.infra.gateway.<system>.dto
    • {{basePackage}}.infra.gateway.<system>.impl
  • Implementing domain gateway ports:
    • {{basePackage}}.domain.{{bcName}}.gateway.*

Inputs Required

  • System name (<system>), e.g. kubernetes, harbor, payment
  • Protocol (HTTP/RPC/SDK) and client choice
  • Domain gateway port interface to implement
  • Error model:
    • which failures are retryable vs non-retryable
    • what information must be preserved (codes, requestId, etc.)

Outputs

  • Client:
    • .../infra/gateway/<system>/client/<XxxClient>.java
  • Integration DTOs:
    • .../infra/gateway/<system>/dto/<XxxRequest>.java
    • .../infra/gateway/<system>/dto/<XxxResponse>.java
  • Gateway implementation:
    • .../infra/gateway/<system>/impl/<XxxGatewayImpl>.java
  • Start wiring + config keys (if needed):
    • .../start/config/bean/<System>GatewayWiringConfig.java
    • YAML updates via start-yaml-config-generator

Naming & Packaging

  • System-first organization is mandatory (per package-info.java).
  • Separate concerns:
    • client: protocol details (timeouts, retries, auth, serialization)
    • dto: integration request/response models
    • impl: domain port implementation and error translation

Implementation Rules

  • Domain-facing interface must stay business-oriented; do not leak protocol DTOs upward.
  • Put retries/timeouts in client (policy belongs there), not in domain.
  • Translate protocol errors in impl into domain/app meaningful failures.

Reference Implementations

  • Package rules:
    • {{infraModuleDir}}/src/main/java/{{basePackagePath}}/infra/gateway/package-info.java
    • {{infraModuleDir}}/src/main/java/{{basePackagePath}}/infra/gateway/system/impl/package-info.java

Tests

  • Unit tests for error translation rules are recommended.

Pitfalls

  • Letting client exceptions propagate to app/domain (breaks retry classification).
  • Mixing DTOs and domain models in the same package.
Skills Info
Original Name:infra-system-gateway-generatorAuthor:ryan