/evaluate-spring-ai:evaluate-spring-aifrom evaluate-spring-ai
Sets up evaluation of Spring AI applications using Dokimos for testing ChatClient, RAG pipelines, and advisor chains. Useful for benchmarking LLM responses.
Ships in evaluate-spring-ai. 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.
None: SKILL.md is the whole skill.
Set up Dokimos evaluation for a Spring AI application. The user will describe their application and evaluation goals via $ARGUMENTS.
dokimos-spring-ai/src/main/java/dev/dokimos/springai/SpringAiSupport.javadokimos-examples/src/main/java/dev/dokimos/examples/springai/dokimos-examples/src/main/java/dev/dokimos/examples/springai/tutorial/dev.dokimos:dokimos-spring-aiBefore writing code, read SpringAiSupport.java to understand the available utilities.
SpringAiSupport provides:
asJudge(ChatClient.Builder) — wraps a Spring AI ChatClient.Builder into a JudgeLMasJudge(ChatModel) — wraps a ChatModel directly into a JudgeLMtoTestCase(EvaluationRequest) — converts Spring AI's EvaluationRequest to Dokimos EvalTestCasetoEvaluationResponse(EvalResult) — converts Dokimos EvalResult back to Spring AI EvaluationResponse@SpringBootTest
class MyChatEvaluationTest {
@Autowired
private ChatClient.Builder chatClientBuilder;
@Test
void evaluateChatbot() {
ChatClient chatClient = chatClientBuilder.build();
Task task = example -> {
String response = chatClient.prompt()
.user(example.input())
.call()
.content();
return Map.of("output", response);
};
JudgeLM judge = SpringAiSupport.asJudge(chatClientBuilder);
ExperimentResult result = Experiment.builder()
.name("Chatbot Evaluation")
.dataset(Dataset.fromJson(Path.of("src/test/resources/datasets/qa.json")))
.task(task)
.evaluator(LLMJudgeEvaluator.builder()
.name("answer-quality")
.judge(judge)
.criteria("Is the response helpful and accurate?")
.evaluationParams(List.of(
EvalTestCaseParam.INPUT,
EvalTestCaseParam.ACTUAL_OUTPUT,
EvalTestCaseParam.EXPECTED_OUTPUT))
.threshold(0.7)
.build())
.build()
.run();
}
}
Task task = example -> {
String input = example.input();
ChatClient.ChatClientRequestSpec request = chatClient.prompt().user(input);
request.advisors(new QuestionAnswerAdvisor(vectorStore));
String response = request.call().content();
List<Document> docs = vectorStore.similaritySearch(input);
List<String> context = docs.stream().map(Document::getText).toList();
return Map.of("output", response, "context", context);
};
EvaluationRequest request = new EvaluationRequest(userText, documents, responseContent);
EvalTestCase testCase = SpringAiSupport.toTestCase(request);
EvalResult result = evaluator.evaluate(testCase);
EvaluationResponse response = SpringAiSupport.toEvaluationResponse(result);
<dependency>
<groupId>dev.dokimos</groupId>
<artifactId>dokimos-spring-ai</artifactId>
<version>${dokimos.version}</version>
</dependency>
Spring AI itself is a provided-scope dependency — the user must bring their own version.
If the Spring AI app calls tools, evaluate its tool calls with the agent evaluators. An AssistantMessage carries the tool calls the model made; the results come back in the ToolResponseMessages. SpringAiSupport.toAgentTrace(assistantMessage, toolResponseMessages) builds an AgentTrace (results matched to calls by tool-call id), and toToolDefinitions(defs) converts the tool definitions.
AgentTrace trace = SpringAiSupport.toAgentTrace(assistantMessage, toolResponseMessages);
List<ToolDefinition> tools = SpringAiSupport.toToolDefinitions(toolDefinitions);
EvalTestCase testCase = trace.toTestCase(userMessage, tools);
var validity = ToolCallValidityEvaluator.builder().build().evaluate(testCase);
For the full agent evaluator set, use the evaluate-agent skill.
$ARGUMENTS what the Spring AI application doesSpringAiSupport utilities@SpringBootTestWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
spring-ai, dokimos, evaluation, llm-testing, rag-evaluation, java-testing
npx claudepluginhub dokimos-dev/dokimos --plugin evaluate-spring-aiOther plugins' skills for the same job