/java-spring:java-spring-aifrom java-spring
Adds AI features to Spring Boot projects using Spring AI or LangChain4J: chatbots, RAG, vector stores, streaming LLM responses, and AI tools/functions.
Ships in java-spring. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Detect the framework in use, then apply the correct patterns.
Check pom.xml or build.gradle:
spring-ai-* dependency → Spring AI (note version: 1.0.x GA or 0.8.x milestone)langchain4j-* dependency → LangChain4J (note version: 0.x or 1.x)Check Spring Boot version:
reviewUser asks to review existing AI code. Check for:
Spring AI:
ChatClient built via ChatClient.Builder (not raw ChatModel) for fluent APIPromptTemplate with variables — no string concatenationstream().content() or Flux<String> — not blocking .call() for real-time responses@Retryable or Spring AI retry config on ChatClient calls — LLMs are flakyspring.ai.openai.api-key) come from env vars or Vault, never hardcodedVectorStore queries use SearchRequest.query(text).withTopK(n) — not raw SQLQuestionAnswerAdvisor) attached to ChatClient — not manual context injectionLangChain4J:
@AiService interface — not ChatLanguageModel.generate() directly@SystemMessage annotation — not hardcoded stringsMessageWindowChatMemory or TokenWindowChatMemory — not unlimited historyStreamingChatLanguageModel with TokenStream — not blockingEmbeddingModel + EmbeddingStore for RAG — not in-memory list search@Tool on service methods — not manual function dispatch@Value("${langchain4j.openai.api-key}") — never literalchatUser asks to add a basic chatbot or chat endpoint.
references/patterns.md → Spring AI Setup)ChatClient.Builder, build a ChatClient beanChatController with @PostMapping("/chat")chatClient.prompt().user(message).call().content() for simple responseFlux<String> with chatClient.prompt().user(message).stream().content()ANTHROPIC_API_KEY / OPENAI_API_KEY to application.yml via ${env-var}langchain4j-spring-boot-starter + provider dependency@AiService interface with @SystemMessageAiServices.builder(MyAssistant.class).chatLanguageModel(model).build()@RestControllerragUser asks to implement RAG (chat over documents, knowledge base, semantic search).
references/patterns.md)spring-ai-{store}-store-spring-boot-starterDocumentReader (PDF, text, web) → TokenTextSplitter → VectorStore.add()ApplicationRunner or dedicated @PostMapping("/ingest")QuestionAnswerAdvisor(vectorStore) to ChatClientSearchRequest.withTopK(5).withSimilarityThreshold(0.7)EmbeddingStore (Chroma, Qdrant, in-memory for dev)EmbeddingStoreIngestor with DocumentSplitter and EmbeddingModelEmbeddingStoreContentRetriever → RetrievalAugmentor → AiServices buildertoolsUser asks to give the AI the ability to call Java methods (function/tool calling).
@Bean of type Function<Input, Output> — Spring AI auto-registers it@Description on a record parameter for rich schemaChatClient: .options(OpenAiChatOptions.builder().withFunction("myFunction").build())@Tool("description of what this tool does")AiServices.builder(...).tools(myToolService).build()memoryUser asks to add conversation memory / chat history.
MessageChatMemoryAdvisor with InMemoryChatMemory for single-instance appsJdbcChatMemory for persistent / multi-instance memory (requires spring-ai-jdbc store)conversationId (e.g., session ID or user ID) to scope memory per userMessageWindowChatMemory.withMaxMessages(20) — keeps last N messagesTokenWindowChatMemory — keeps messages within token budgetChatMemoryStore backed by Redis or JDBCFor review mode: list findings as [CRITICAL] / [HIGH] / [MEDIUM] / [LOW] with file:line references.
For implementation modes (chat, rag, tools, memory):
application.yml configurationAlways note version-specific differences:
AiServices API changed in 1.xWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub ducpm2303/claude-java-plugins --plugin java-spring9 skills in this plugin
/java-cacheUse when the user asks to add caching, configure Redis or Caffeine cache, use @Cacheable/@CacheEvict/@CachePut, optimize repeated database or API calls, or review existing Spring Boot cache configuration./java-crud/java-crud — Spring Boot CRUD GeneratorGenerates a complete Spring Boot CRUD feature (entity, repository, service, controller, DTOs, tests) in an existing project. Use when user asks to "add CRUD for", "generate entity", "create a feature for", "add REST endpoints for", "scaffold a feature", or "build CRUD for"./java-jpa/java-jpa — Spring Data JPA Deep ReviewReviews Spring Data JPA for N+1 queries, fetch strategies, projections, and Specifications. Use when user asks to "review JPA", "check for N+1", "JPA performance", "review my entities", "check fetch strategy", or "review my repositories"./java-logging/java-logging — Java Logging ReviewReviews Java logging for SLF4J best practices, MDC context, structured logging, and PII safety. Use when user asks to "review logging", "check my logs", "logging review", "is my logging correct", "MDC setup", or "check for PII in logs"./java-openapi/java-openapi — OpenAPI / Swagger DocumentationGenerates or reviews OpenAPI / Swagger documentation for Spring Boot REST APIs — adds @Operation, @Schema, @ApiResponse annotations and configures Swagger UI. Use when user asks to "add Swagger", "document this API", "generate OpenAPI spec", "add @Operation annotations", "set up Swagger UI", or "document endpoints"./java-resilienceUse when the user asks to add resilience patterns, handle service failures, implement circuit breaker, retry, rate limiter, bulkhead, or timeout in a Spring Boot project using Resilience4J.Other plugins' skills for the same job