From ai-skills
Infrastructure-layer rules for Clean Architecture backend services. Use when implementing persistence, external clients, messaging, cache, or framework adapters.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ai-skills:clean-architecture-infrastructureThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill converts `backend-engineer/clean-architecture/infrastructure-rule.md` into Claude Code plugin skill guidance while preserving the source rules for production fintech development.
This skill converts backend-engineer/clean-architecture/infrastructure-rule.md into Claude Code plugin skill guidance while preserving the source rules for production fintech development.
Infrastructure layer handles all technical details and external systems.
It implements ports defined by inner layers.
Goals:
Rule:
Infrastructure serves the business. Business must not depend on infrastructure.
Infrastructure layer may contain:
Infrastructure must NOT contain:
Bad Example:
if(amount >1000000)
approveAutomatically();
Correct direction:
Infrastructure -> Application Port / Domain Model
Wrong:
Application -> JpaRepositoryImpl
Domain -> KafkaProducer
Infrastructure implements interfaces from inner layers.
Use persistence adapters.
Example:
@RequiredArgsConstructor
public class WalletRepositoryAdapter implements WalletRepositoryPort {
private final WalletJpaRepository repo;
private final WalletEntityMapper mapper;
}
Responsibilities:
Never expose JPA entity upward.
Examples:
Use:
Handle:
Kafka / RabbitMQ adapters:
Producer responsibilities:
Consumer responsibilities:
No business logic inside consumer listener.
Use Redis adapters for:
Cache policy belongs in application/domain decision, not Redis class itself.
Infrastructure may implement:
Never store secrets in source code.
@Component
@RequiredArgsConstructor
public class PaymentGatewayAdapter implements PaymentGatewayPort {
private final WebClient client;
public PaymentGatewayResult charge(PaymentRequest request) {
return client.post()
.uri("/charge")
.retrieve()
.bodyToMono(PaymentGatewayResult.class)
.block();
}
}
Infrastructure requires integration tests.
Examples:
Validate:
Infrastructure adapters:
Avoid:
When generating infrastructure layer:
npx claudepluginhub silverpham08091998/ai-skills --plugin ai-skillsCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.