name: spring-ai-boot4-project-starter description: Bootstrap and standardize Spring Boot 4.0.3 + Spring AI backend projects for new implementations. Use when Codex needs to initialize a project, set Maven dependencies/BOM, define package and module layout, configure environment profiles, or create baseline API/AI/database scaffolding.
Spring AI Boot4 Project Starter
Workflow
- Confirm baseline inputs before coding:
groupId,artifactId, Java version (default 21), build tool (default Maven), and deployment target.
- Initialize project skeleton:
- Run
scripts/create_project.sh <groupId> <artifactId> [outputDir]. - If Spring Initializr is unavailable, create the same structure manually with
pom.xml,src/main,src/test, and profile-specific config files.
- Apply dependency baseline:
- Read
references/dependency-baseline.mdand add the Spring AI BOM plus required starters. - Keep dependencies minimal first; add vector-store provider and crawler libraries only when needed.
- Apply directory and package standards:
- Read
references/project-layout.md. - Create
app(application services),domain(entities/rules),infra(DB/search/model providers), andinterfaces(REST/scheduled jobs).
- Configure runtime baseline:
- Create
application.yml,application-local.yml,application-prod.yml. - Wire DB migration (Flyway) and health checks (
/actuator/health, readiness/liveness).
- Add smoke tests:
- Add one context-load test and one API contract test.
- Ensure project builds with
./mvnw -q testbefore adding feature code.
Guardrails
- Keep Spring AI provider and embedding model IDs externalized in config.
- Keep feature modules independent from provider SDK classes; isolate provider binding in
infra. - Generate deterministic prompts from templates; do not hard-code prompt text in controllers.
- Version SQL changes through Flyway migration files only.
Resources
scripts/create_project.sh: Boot 4.0.3 skeleton generator.references/dependency-baseline.md: Maven dependency and BOM baseline.references/project-layout.md: package/module conventions.