Infrastructure Skill
Infrastructure scaffolding for Java projects – framework-agnostic, reads project configuration to generate the right artifacts.
Philosophy: Always read existing project files (pom.xml, application.properties) first – never guess the framework, services, or configuration.
What This Skill Does
- Reads project configuration – detects framework (Spring Boot / Quarkus), services, health endpoints
- Generates Dockerfiles – multi-stage builds with health checks, non-root user
- Generates docker-compose – all required services with health checks and volumes
- Generates Helm Charts (future) – Kubernetes deployment manifests
- Generates CI/CD pipelines (future) – GitHub Actions, GitLab CI
How to Use
Create a Dockerfile for this project
Generate docker-compose with PostgreSQL and RabbitMQ
Create infrastructure for the order-service
Instructions
Before every generation:
- Read
pom.xmlto detect framework, dependencies, and artifactId- Read
application.properties/application.ymlto detect configured services- Check
.claude/lessons-learned.mdfor infrastructure-related findings
Step 1 – Detect Project Configuration
Read the project files and determine:
| What | How to detect |
|---|---|
| Framework | spring-boot-starter-parent in pom.xml → Spring Boot; quarkus-bom → Quarkus |
| artifactId | <artifactId> in pom.xml |
| PostgreSQL | postgresql or quarkus-jdbc-postgresql dependency |
| RabbitMQ | spring-boot-starter-amqp or quarkus-messaging-rabbitmq dependency |
| Keycloak | spring-boot-starter-oauth2-resource-server or quarkus-oidc dependency |
| AI / PgVector | quarkus-langchain4j-pgvector dependency → use pgvector/pgvector:pg17 image |
| Health endpoint | Spring Boot: /actuator/health; Quarkus: /q/health/live |
Never ask what the user already has in their project files. Only ask if files are missing or ambiguous.
Step 2 – Generate Dockerfile
Dockerfile Conventions
| Framework | Location | Base image |
|---|---|---|
| Spring Boot | ./Dockerfile (project root) |
eclipse-temurin:25-jdk-alpine (build) + eclipse-temurin:25-jre-alpine (runtime) |
| Quarkus JVM | src/main/docker/Dockerfile.jvm |
eclipse-temurin:25-jre-alpine |
| Quarkus Native | src/main/docker/Dockerfile.native-micro |
quay.io/quarkus/quarkus-micro-image:2.0 |
Mandatory Dockerfile rules:
- Multi-stage build for Spring Boot (build + runtime)
- Non-root user (
appuser/appgroup) HEALTHCHECKusing the framework's health endpointEXPOSE 8080
Use templates in templates/ as reference.
Step 3 – Generate docker-compose
Mandatory docker-compose rules:
- Only include services that the project actually uses (detected in Step 1)
- Every service must have a
healthcheck - Application service uses
depends_onwithcondition: service_healthy - Use named volumes for data persistence
- Keycloak:
start-devmode for development, comment pointing to production setup - AI projects with PgVector: use
pgvector/pgvector:pg17instead ofpostgres:17-alpine
Step 4 – Generate Helm Chart (future)
Reserved for Kubernetes deployment manifests. Not yet implemented.
Step 5 – Generate CI/CD Pipeline (future)
Reserved for GitHub Actions / GitLab CI pipelines. Not yet implemented.
References
| File | Description |
|---|---|
.claude/lessons-learned.md |
Findings and corrections – check before every generation |
| templates/spring/ | Spring Boot templates (Dockerfile, docker-compose) |
| templates/quarkus/ | Quarkus templates (Dockerfile.jvm, Dockerfile.native-micro, docker-compose) |
| templates/quarkus/ai/ | AI docker-compose with PgVector and optional Ollama |
Placeholders
| Placeholder | Example |
|---|---|
{{ARTIFACT_ID}} |
order-service |
Conventions
- Language: English in comments
- Commits: Conventional Commits (
chore:for infrastructure changes) - Co-Author:
# Co-Author: Claude (claude-sonnet-4-6, Anthropic) – generated via infrastructure
Position in Workflow
[java-scaffold-skill] application code, pom.xml, BCE, Flyway
|
[infrastructure] Dockerfile, docker-compose, Helm, CI/CD
|
[review-skill] code review
|
[doc-skill] project documentation