← ClaudeAtlas

java-spring-ailisted

Use when the user asks to add AI features, integrate Spring AI or LangChain4J, build a chatbot, implement RAG (retrieval-augmented generation), use vector stores, stream LLM responses, or call AI tools/functions in a Spring Boot project.
limited-grisaille833/claude-java-plugins · ★ 0 · AI & Automation · score 68
Install: claude install-skill limited-grisaille833/claude-java-plugins
# Spring AI / LangChain4J Skill Detect the framework in use, then apply the correct patterns. ## Step 1 — Detect framework and version 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) - Neither present → offer to add one (recommend Spring AI for Spring Boot 3.x, LangChain4J for Boot 2.x) Check Spring Boot version: - Boot 3.x → Spring AI 1.x preferred, LangChain4J 0.35+ - Boot 2.x → LangChain4J 0.30.x (Spring AI requires Boot 3.x) --- ## Mode: `review` User asks to review existing AI code. Check for: **Spring AI:** - [ ] `ChatClient` built via `ChatClient.Builder` (not raw `ChatModel`) for fluent API - [ ] Prompt templates use `PromptTemplate` with variables — no string concatenation - [ ] Streaming uses `stream().content()` or `Flux<String>` — not blocking `.call()` for real-time responses - [ ] `@Retryable` or Spring AI retry config on ChatClient calls — LLMs are flaky - [ ] Secrets (`spring.ai.openai.api-key`) come from env vars or Vault, never hardcoded - [ ] `VectorStore` queries use `SearchRequest.query(text).withTopK(n)` — not raw SQL - [ ] RAG advisor (`QuestionAnswerAdvisor`) attached to ChatClient — not manual context injection - [ ] Token usage logged at DEBUG, not INFO (avoid log noise) **LangChain4J:** - [ ] AI services use `@AiService` interface — not `ChatLanguageModel.generate()` directly - [ ] System prompt