From spring
Build Spring AI application features with ChatClient, prompt templates, structured output, tool calling, advisors, chat memory, embeddings, vector stores, RAG, and MCP integration. Use this skill when building Spring AI application features with ChatClient, prompt templates, structured output, tool calling, advisors, chat memory, embeddings, vector stores, RAG, MCP, image or audio model flows, moderation, evaluation, or provider-neutral model integration in Spring.
npx claudepluginhub ririnto/sinon --plugin springThis skill uses the workspace's default tool permissions.
Use this skill when building Spring AI application features with `ChatClient`, prompt templates, structured output, tool calling, advisors, chat memory, embeddings, vector stores, retrieval-augmented generation, MCP, image or audio model flows, moderation, effective-agent workflows, or other provider-neutral model seams in Spring.
references/advanced-tool-orchestration.mdreferences/advisors-memory-and-conversation-state.mdreferences/audio-transcription-and-speech-output.mdreferences/chain-workflow.mdreferences/containerized-dev-environment.mdreferences/development-services-and-local-infra.mdreferences/image-generation-and-vision-inputs.mdreferences/image-generation.mdreferences/local-vector-store-dev.mdreferences/loop-bounds-and-iteration-control.mdreferences/mcp-client-server-boundaries.mdreferences/moderation-and-safety-gates.mdreferences/multiple-image-comparison.mdreferences/observability-and-production-debugging.mdreferences/planning-and-stepwise-execution.mdreferences/provider-selection-and-model-capability-fit.mdreferences/rag-pipeline-and-vector-store-decisions.mdreferences/routing-workflow.mdreferences/testing-and-evaluation-harnesses.mdreferences/tool-failure-and-fallback.mdMandates invoking relevant skills via tools before any response in coding sessions. Covers access, priorities, and adaptations for Claude Code, Copilot CLI, Gemini CLI.
Share bugs, ideas, or general feedback.
Use this skill when building Spring AI application features with ChatClient, prompt templates, structured output, tool calling, advisors, chat memory, embeddings, vector stores, retrieval-augmented generation, MCP, image or audio model flows, moderation, effective-agent workflows, or other provider-neutral model seams in Spring.
Use spring-ai for model-facing application seams, retrieval flow, Spring-managed AI integration, and provider-neutral model abstractions.
spring-integration for non-AI message routing, adapters, and Enterprise Integration Patterns.ChatClient, EmbeddingModel, VectorStore, ImageModel, TranscriptionModel, TextToSpeechModel, or ModerationModel.Use this map to keep the official Spring AI surface visible without pushing the common path into references/.
| Surface | Start here when | Open a reference when |
|---|---|---|
| Chat + prompt templates | The feature reads text and returns text or structured data | Provider fit or model capability is the blocker in references/provider-selection-and-model-capability-fit.md |
| Structured output | Downstream code needs fields, records, or typed objects | Upgrade or provider behavior changes the output contract in references/upgrade-notes-and-migration-branches.md |
| Tool calling | The model may request a narrow, side-effect-safe application capability | Sequential tool choreography is the blocker in references/advanced-tool-orchestration.md, tool-set curation is the blocker in references/tool-set-curation.md, or fallback policy is the blocker in references/tool-failure-and-fallback.md |
| Advisors + chat memory | Requests need prompt decoration, history, or token-window control | Advisor ordering or persistent memory is the blocker in references/advisors-memory-and-conversation-state.md |
| RAG + vector stores | The answer must use retrieved enterprise context | Ingestion, chunking, embeddings, or store choice is the blocker in references/rag-pipeline-and-vector-store-decisions.md |
| MCP | Tools or prompts cross a process or service boundary | Client/server choice or transport setup is the blocker in references/mcp-client-server-boundaries.md |
| Vision + image generation | The feature must inspect images or generate images from prompts | Vision payload shape is the blocker in references/image-generation-and-vision-inputs.md, multiple-image comparison is the blocker in references/multiple-image-comparison.md, or image-model output is the blocker in references/image-generation.md |
| Audio transcription + speech | The feature transcribes audio or returns synthesized speech | Transcription or TTS configuration is the blocker in references/audio-transcription-and-speech-output.md |
| Moderation | The application needs input or output safety gates | Moderation placement or category thresholds are the blocker in references/moderation-and-safety-gates.md |
| Effective agents | One bounded workflow must route, chain, plan, or iteratively refine work | Routing is the blocker in references/routing-workflow.md, chaining is the blocker in references/chain-workflow.md, stepwise planning is the blocker in references/planning-and-stepwise-execution.md, or loop bounds are the blocker in references/loop-bounds-and-iteration-control.md |
| Evaluation + testing | Prompt, retrieval, or tool behavior needs repeatable checks | Evaluation harness design is the blocker in references/testing-and-evaluation-harnesses.md |
| Usage + observability | You need token accounting, latency, tracing, or production debugging | Telemetry or incident diagnosis is the blocker in references/observability-and-production-debugging.md |
| Local development infra | You need local models, vector stores, or containerized dev services | Local model runtime is the blocker in references/development-services-and-local-infra.md, local vector-store provisioning is the blocker in references/local-vector-store-dev.md, or full containerized bootstrap is the blocker in references/containerized-dev-environment.md |
| Upgrade and migration | Version changes alter starters, APIs, defaults, or provider behavior | Upgrade mechanics are the blocker in references/upgrade-notes-and-migration-branches.md |
The ordinary Spring AI job is:
ChatClient seam around an application service.Import the Spring AI BOM and add only the starters needed for the current model and optional retrieval path.
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-bom</artifactId>
<version>1.1.4</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-starter-model-openai</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
</dependencies>
Add retrieval, image, audio, moderation, or MCP starters only when that surface is part of the current job. Open references/upgrade-notes-and-migration-branches.md when the target Spring AI version differs from the version pinned here.
spring:
ai:
openai:
api-key: ${OPENAI_API_KEY}
chat:
options:
model: gpt-4o-mini
Start with one provider, one model, and one environment-backed secret. Open references/provider-selection-and-model-capability-fit.md when model family, context window, latency, cost, or provider fit is still unclear.
ChatClient seam@Configuration
class AssistantAiConfiguration {
@Bean
ChatClient releaseChatClient(ChatClient.Builder builder) {
return builder.defaultSystem("You summarize release changes for backend engineers.").build();
}
}
Keep the application seam on ChatClient or another Spring AI abstraction. Do not let controllers or domain code depend directly on a provider SDK.
Use prompt templates before introducing tools, memory, or retrieval. Keep variables explicit and keep prompt text reviewable in code.
record ReleaseSummary(String version, List<String> breakingChanges, List<String> actions) {}
@Service
class ReleaseSummaryService {
private final ChatClient chatClient;
ReleaseSummaryService(ChatClient chatClient) {
this.chatClient = chatClient;
}
ReleaseSummary summarize(String releaseNotes) {
return chatClient.prompt()
.user(user -> user
.text("Summarize the release notes and list required migration actions. Notes: {notes}")
.param("notes", releaseNotes))
.call()
.entity(ReleaseSummary.class);
}
}
ChatClient builder or a dedicated service seam..entity(...) so the application stays on Spring AI's portable output contract instead of binding ordinary flows to one provider's JSON mode.Add tools only when the model genuinely needs a bounded application capability.
@Component
class InventoryTools {
private final InventoryRepository inventoryRepository;
InventoryTools(InventoryRepository inventoryRepository) {
this.inventoryRepository = inventoryRepository;
}
@Tool(description = "Look up available inventory for a SKU")
InventorySnapshot inventoryForSku(String sku) {
return inventoryRepository.findSnapshotBySku(sku);
}
}
@Service
class ShippingAssistantService {
private final ChatClient chatClient;
private final InventoryTools inventoryTools;
ShippingAssistantService(ChatClient chatClient, InventoryTools inventoryTools) {
this.chatClient = chatClient;
this.inventoryTools = inventoryTools;
}
String answer(String question) {
return chatClient.prompt()
.user(question)
.tools(inventoryTools)
.call()
.content();
}
}
record InventorySnapshot(String sku, int availableQuantity) {}
Use advisors when the request or response must be decorated around the model call. Use ChatMemory through an advisor instead of manually appending prior turns.
@Bean
ChatClient supportChatClient(ChatClient.Builder builder, ChatMemory chatMemory) {
return builder.defaultAdvisors(MessageChatMemoryAdvisor.builder(chatMemory).build()).build();
}
String answer(ChatClient chatClient, String conversationId, String question) {
return chatClient.prompt()
.advisors(advisors -> advisors.param(ChatMemory.CONVERSATION_ID, conversationId))
.user(question)
.call()
.content();
}
@Service
class KnowledgeSearchService {
private final VectorStore vectorStore;
KnowledgeSearchService(VectorStore vectorStore) {
this.vectorStore = vectorStore;
}
List<Document> search(String question) {
return vectorStore.similaritySearch(SearchRequest.builder()
.query(question)
.topK(4)
.similarityThreshold(0.75)
.build());
}
}
EmbeddingModel as the portable seam for vector generation and treat the concrete VectorStore implementation as a deployment decision.These surfaces are part of official Spring AI scope, but they are not on the ordinary path unless the use case requires them.
Treat token accounting as part of the application contract, not as an afterthought.
Usage from the final ChatResponse when cost, token budgets, or provider drift matter.Verify the first Spring AI path before expanding scope.
Open references/testing-and-evaluation-harnesses.md when the task needs repeatable evaluation datasets, regression checks, or infrastructure-backed integration tests. Open references/observability-and-production-debugging.md when adding usage accounting, tracing, or production incident diagnostics.