Skip to content

eldermoraes/quarkus-agentic-scaffolding / skills/scaffold-project

scaffold-project

Verified

Scaffold Quarkus + LangChain4j projects end-to-end and add agentic components to existing ones — AI services, tools, agents and multi-agent workflows, RAG pipelines, MCP clients and servers (Model Context Protocol), guardrails, and embedding store setups. Use this whenever the user wants a new Quarkus + LangChain4j project or module created, or an agentic component added to an existing project in this stack, including a baseline pom.xml, application.properties, project layout, or starter classes.

templates/AiServiceTest.java.template

View on GitHub
/*
 * Wiring smoke test for the ChatAssistant AI service (pairs with AiService.java.template).
 *
 * What the ACTIVE test below verifies: booting Quarkus with @QuarkusTest builds the CDI
 * container and the AI-service proxy (Quarkus augmentation) at startup, and injecting the
 * assistant proves that wiring succeeded. assertNotNull does NOT send a prompt, so the test is
 * fast, deterministic, and passes without a running Ollama and without any inference.
 *
 * What it does NOT do: it does not call the model, does not assert on generated text, and does
 * not exercise tools, guardrails, or RAG. Those need something answering as the model: a live
 * one, as in the commented examples, or a fake chat endpoint the test points the model's
 * base-url at (the scaffolding's own CI drives every entry service that way).
 *
 * RAG projects: run through the Dev MCP (devui-testing_runTests), this test starts inside the
 * dev-mode JVM, which already loaded the in-process embedding model's native tokenizer library
 * during startup ingestion. A second load from the test classloader fails with
 * "UnsatisfiedLinkError: Native Library ... already loaded in another classloader", so keep
 * %test.quarkus.langchain4j.easy-rag.ingestion-strategy=off from the RAG block of
 * application.properties uncommented: the test application then never loads the model. Do not
 * call a RAG-augmented service here; retrieval loads the model and fails the same way.
 *
 * Only quarkus-junit is required on the test classpath for the active test to compile and run.
 * The commented model-dependent and evaluation examples additionally need a live Ollama and,
 * for evals, the quarkus-langchain4j-testing-evaluation-junit5 dependency (already added,
 * test-scoped, in templates/pom.xml.template — the platform BOM manages its version).
 */
package org.acme.ai;

import io.quarkus.test.junit.QuarkusTest;
import jakarta.inject.Inject;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertNotNull;

@QuarkusTest
public class ChatAssistantTest {

    @Inject
    ChatAssistant assistant;

    @Test
    void aiServiceIsWired() {
        // CDI wiring + Quarkus AI-service augmentation succeeded if the proxy was injected.
        // No model call happens here, so this passes without a running Ollama.
        assertNotNull(assistant);
    }

    // --- Model-dependent test (requires a running Ollama; not run in CI) ---------------------
    // Uncomment to exercise real inference. Keep prompts fixed and configure the model with
    // temperature=0 for deterministic assertions (project conventions section 5). Assert a
    // stable property of the reply rather than exact wording — model output is fuzzy.
    //
    //   @Test
    //   void answersARealQuestion() {
    //       String reply = assistant.answer("My deployment returns HTTP 503. What should I check?");
    //       assertNotNull(reply);
    //       org.junit.jupiter.api.Assertions.assertFalse(reply.isBlank());
    //   }
}

/*
 * ===================== AI-quality evaluation (opt-in) =====================
 * Model output is fuzzy, so grade it with the evaluation framework instead of brittle string
 * asserts. This needs a live model and the test-scoped dependency
 *   io.quarkiverse.langchain4j:quarkus-langchain4j-testing-evaluation-junit5
 * which templates/pom.xml.template already adds (version managed by the platform BOM).
 * Shape verified against https://docs.quarkiverse.io/quarkus-langchain4j/dev/testing.html
 *
 * Labelled samples go in a YAML file under src/test/resources (a list of
 * name / parameters / expected-output entries):
 *
 *   - name: reset_password
 *     parameters:
 *       - "How do I reset my password?"
 *     expected-output: |
 *       Explain that the user opens Settings > Security and clicks "Reset password".
 *     tags: ["support"]
 *
 * Programmatic style — inject a Scorer and the samples, then score with a strategy:
 *
 *   import io.quarkiverse.langchain4j.evaluation.junit5.Evaluate;
 *   import io.quarkiverse.langchain4j.evaluation.junit5.SampleLocation;
 *   import io.quarkiverse.langchain4j.evaluation.junit5.ScorerConfiguration;
 *   import io.quarkiverse.langchain4j.testing.evaluation.EvaluationReport;
 *   import io.quarkiverse.langchain4j.testing.evaluation.Samples;
 *   import io.quarkiverse.langchain4j.testing.evaluation.Scorer;
 *   import io.quarkiverse.langchain4j.testing.evaluation.similarity.SemanticSimilarityStrategy;
 *   import static org.junit.jupiter.api.Assertions.assertTrue;
 *
 *   @QuarkusTest
 *   @Evaluate                                    // enables the evaluation extension
 *   class ChatAssistantScorerTest {
 *       @Inject ChatAssistant assistant;
 *
 *       @Test
 *       void meetsQualityBar(
 *               @ScorerConfiguration(concurrency = 4) Scorer scorer,
 *               @SampleLocation("src/test/resources/support-samples.yaml") Samples<String> samples) {
 *           EvaluationReport<String> report = scorer.evaluate(
 *                   samples,
 *                   params -> assistant.answer(params.get(0, String.class)),
 *                   new SemanticSimilarityStrategy(0.8)); // embedding cosine threshold, 0..1
 *           assertTrue(report.score() >= 80.0);          // report.score() is a 0..100 percentage
 *       }
 *   }
 *
 * Declarative style — @EvaluationTest wires samples + strategy + the pass threshold for you and
 * calls a method named by @EvaluationFunction (see the docs for that binding):
 *
 *   @QuarkusTest
 *   @Evaluate
 *   class ChatAssistantEvalTest {
 *       @Inject ChatAssistant assistant;
 *
 *       @EvaluationFunction("answer")
 *       String answer(Parameters p) { return assistant.answer(p.get(0, String.class)); }
 *
 *       @EvaluationTest(
 *               samples = "src/test/resources/support-samples.yaml",
 *               function = "answer",
 *               strategy = SemanticSimilarityStrategy.class,
 *               minScore = 80.0)                          // fails the test below this percentage
 *       void graded() { }
 *   }
 *
 * Swap the strategy for an LLM-as-judge with
 *   io.quarkiverse.langchain4j.testing.evaluation.judge.AiJudgeStrategy
 * (add quarkus-langchain4j-testing-evaluation-ai-judge, also BOM-managed) when a model should
 * grade semantic correctness rather than embedding similarity.
 */
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall