/generate-goldens:generate-goldensfrom generate-goldens
Generates synthetic multi-turn conversation goldens for chatbot and support agent testing using GoldenGenerator and ScenarioSeed. Useful for replayable regression test suites.
Ships in generate-goldens. 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.
Generate a multi-turn conversation dataset for Dokimos. The user will describe the conversations to synthesize via $ARGUMENTS.
GoldenGenerator runs each ScenarioSeed through ConversationSimulator against the application under test and turns every resulting conversation into one dataset example. Generate a suite once, commit it, replay it in CI.
dokimos-core/src/main/java/dev/dokimos/core/conversation/GoldenGenerator.javadokimos-core/src/main/java/dev/dokimos/core/conversation/ScenarioSeed.javadokimos-core/src/main/java/dev/dokimos/core/conversation/UserPersonas.javadokimos-kotlin/src/main/kotlin/dev/dokimos/kotlin/dsl/conversation/ConversationDsl.ktdokimos-examples/src/main/java/dev/dokimos/examples/conversation/goldens/Read GoldenGenerator.java and ScenarioSeed.java before generating, and check UserPersonas.java for the available personas.
A seed is one conversation to synthesize. It is either scripted or persona-driven, never both and never neither.
Scripted: a fixed list of user turns, replayed verbatim. No judge is needed on the user side, and the run stops at the last user turn even when maxTurns is higher.
ScenarioSeed refund = ScenarioSeed.scripted(
"Refund for a broken product",
List.of("My blender arrived broken and I want a refund", "The order number is #123"));
Setting initialMessage on a scripted seed replaces the first turn, so userTurns.get(0) is never sent. Leave it empty, as ScenarioSeed.scripted does, to let the script drive every turn.
Persona-driven: a factory that receives the generator's JudgeLM and returns a SimulatedUser, so the user side is written by a model. The factory is applied at generation time, so a method reference works without a judge in scope.
ScenarioSeed escalation = ScenarioSeed.builder()
.scenario("Angry customer escalates")
.initialMessage("This product broke on day one!")
.personaFactory(UserPersonas::aggressiveCustomer)
.expectedOutcome("The agent apologizes and offers a replacement or refund")
.maxTurns(6)
.build();
Personas available as method references: aggressiveCustomer, confusedUser, impatientUser, satisfiedCustomer, technicalExpert, noviceUser, adversarialUser, offTopicUser. UserPersonas.custom(judge, persona, guidelines) needs a lambda.
GoldenGenerator generator = GoldenGenerator.builder()
.application(app) // required, a ConversationalApplication
.judge(judgeLM) // only needed for persona-driven seeds
.name("support-goldens")
.maxTurns(10) // default limit for seeds without their own
.seed(refund)
.seed(escalation)
.build();
generator.write(Path.of("src/test/resources/datasets/support-goldens.json"));
val generator = goldenGenerator {
application = app
judge = judgeLM
name = "support-goldens"
seed {
scenario = "Refund for a broken product"
userTurns(listOf("My blender arrived broken and I want a refund", "The order number is #123"))
expectedOutcome = "The agent asks for the order number and then issues a refund"
}
}
toJson(), toJsonl(), write(path) and writeJsonl(path) all emit the shape Dataset parses, so a generated file feeds @DatasetSource directly.
Each seed produces one example, in seed order:
| Field | Value |
|---|---|
inputs["input"] | the rendered transcript of the whole conversation |
expectedOutputs["output"] | the application's last reply, for scripted seeds only |
metadata | scenario, turnCount, expectedOutcome when set, the seed's own metadata, and error plus errorSource if the run failed |
id | golden-0, golden-1, and so on |
A persona-driven seed gets no default answer, because grading an application against its own reply proves nothing. Set one with expectedOutput("output", ...) on the seed, which also overrides the scripted default.
ConversationalApplication. If not, wrap it: respond(trajectory) answers trajectory.lastUserMessage() given the turns so far.$ARGUMENTS. Prefer scripted seeds for the paths that must not regress, and persona-driven seeds for open-ended behavior. Persona seeds need a judge and cost API calls per turn.expectedOutcome. It is the criterion a judge grades the replay against, and it never stops the simulation.src/test/resources/datasets/, then read it before committing. Scan for error and errorSource keys, which mark seeds whose run failed.Never feed inputs["input"] back to the application as a prompt. It is the whole transcript, assistant replies included, so it hands the model the answer it is being graded on.
To grade the recording as it stands, judge the transcript against the criterion in metadata:
@ParameterizedTest
@DatasetSource("classpath:datasets/support-goldens.json")
void replaysGoldens(Example example) {
String expectedOutcome = example.metadataAs("expectedOutcome", String.class);
assertThat(expectedOutcome).isNotNull();
EvalTestCase testCase = EvalTestCase.builder()
.input(example.input())
.metadata("tasks", List.of(expectedOutcome))
.build();
Assertions.assertEval(testCase, TaskCompletionEvaluator.builder().judge(judgeLM).build());
}
To gate the application instead of the recording, replay only the recorded USER: turns through ConversationSimulator and grade the conversation that comes back. SupportGoldenReplayTest in dokimos-examples does this.
maxTurns low, 2 to 6, unless the scenario genuinely needs a long conversation.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub dokimos-dev/dokimos --plugin generate-goldensOther plugins' skills for the same job