diff --git a/skills-generator/src/main/resources/skill-indexes/152-skill.xml b/skills-generator/src/main/resources/skill-indexes/152-skill.xml new file mode 100644 index 00000000..53000527 --- /dev/null +++ b/skills-generator/src/main/resources/skill-indexes/152-skill.xml @@ -0,0 +1,77 @@ + + + + Juan Antonio Breña Moral + 0.15.0 + Apache-2.0 + Use when you need to set up Gatling performance testing for a Java Maven project — including adding Gatling dependencies and the Gatling Maven plugin, creating Java simulations, running gatling:test, configuring a simulation class, and reviewing generated reports. This should trigger for requests such as Add Gatling performance testing; Apply Gatling performance testing; Create a Gatling simulation; Add Gatling support. + + + Run performance tests based on Gatling + ` when multiple simulations exist +- Use `./mvnw gatling:help -Ddetail=true -Dgoal=test` to inspect available plugin options +- Review generated Gatling run output and reports under the build output directory + +**Scope:** Use Gatling through the Maven plugin for Java simulations. Prefer project-local Maven wrapper commands when available. +]]> + + + Gatling setup must be Maven-based, reproducible, and compatible with Java project conventions. Prefer official Gatling Maven plugin behavior and avoid inventing unsupported command-line options. + + **PREREQUISITE**: Verify the project is Maven-based and prefer `./mvnw` when the Maven wrapper exists + **BUILD CONFIGURATION**: Add Gatling dependencies with test scope and configure `io.gatling:gatling-maven-plugin` in `pom.xml` + **VERSION SELECTION**: Use the project's existing dependency/version-management pattern; if no Gatling versions are present, ask before pinning versions or use placeholders that require replacement + **SIMULATION LOCATION**: Place Java simulations under `src/test/java` using an appropriate package name + **RESOURCE LOCATION**: Place Gatling resources such as `gatling.conf`, feeders, request-body templates, and Logback test configuration under `src/test/resources` + **BEFORE APPLYING**: Read the reference for setup, execution, and verification guidance + **EDGE CASE**: If the project is not Maven-based, stop and explain that this skill targets Maven projects before suggesting Gradle or sbt alternatives + **EDGE CASE**: If multiple simulations exist, configure or pass `-Dgatling.simulationClass=<FullyQualifiedClassName>` for non-interactive execution + + + + + + Add Gatling performance testing + Apply Gatling performance testing + Create a Gatling simulation + Add Gatling support + + + + + + Inspect the Maven project + Check for `pom.xml`, the Maven wrapper, existing test dependencies, dependency management, plugin management, and any existing Gatling configuration. + + + Add Gatling build configuration + Add the Gatling test dependency and `io.gatling:gatling-maven-plugin` using the project's existing version and plugin configuration style. + + + Create or adapt Java simulations + Create Java simulation classes under `src/test/java` or adapt existing simulations, keeping scenario names, base URLs, injection profiles, and assertions explicit. + + + Configure resources + Add optional Gatling resources under `src/test/resources`, including `gatling.conf`, feeders, request body templates, and `logback-test.xml` only when the project needs them. + + + Run and explain Gatling execution + Use `./mvnw gatling:test` to run simulations and `-Dgatling.simulationClass=<FullyQualifiedClassName>` when a specific simulation must be selected. + + + Verify reports and next steps + Confirm the Gatling run completed, point to the generated report location from the command output, and summarize any failed assertions or performance findings. + + + diff --git a/skills-generator/src/main/resources/skill-references/152-java-performance-gatling.xml b/skills-generator/src/main/resources/skill-references/152-java-performance-gatling.xml new file mode 100644 index 00000000..59e04738 --- /dev/null +++ b/skills-generator/src/main/resources/skill-references/152-java-performance-gatling.xml @@ -0,0 +1,155 @@ + + + + + Juan Antonio Breña Moral + 0.15.0 + Apache-2.0 + Run performance tests based on Gatling + Use when you need to set up Gatling performance testing for a Java Maven project — including adding Gatling dependencies and the Gatling Maven plugin, creating Java simulations, running gatling:test, configuring a simulation class, and reviewing generated reports. + + + You are a Senior software engineer with extensive experience in Java software development, Maven, and performance testing with Gatling + + + When a user requests Gatling performance testing setup, provide a Maven-based Gatling solution for Java simulations, including build configuration, simulation structure, execution commands, and report verification. + + + + Prerequisites and requirements that must be met before proceeding with Gatling performance testing setup + + Verify that the project is Maven-based before applying this skill + Prefer the Maven wrapper (`./mvnw`) when it exists in the project root + Use the project's existing dependency and plugin version-management style + If no Gatling version convention exists, ask before pinning versions or use explicit placeholders that require replacement + Do not invent unsupported Gatling Maven plugin options; use `gatling:help` for available options + Do not edit generated reports or generated build output directly + + + + + + Inspect the Project + + When a user requests Gatling performance testing setup: + + 1. Check whether `pom.xml` exists in the project root. + 2. Check whether the Maven wrapper exists (`./mvnw` or `mvnw.cmd`). + 3. Inspect existing dependency management, plugin management, and test dependencies. + 4. Search for existing Gatling simulations or configuration before adding new files. + + **Required Maven Project Structure:** + ``` + project-root/ + ├── pom.xml + ├── mvnw # Preferred when present + ├── src/test/java/ + │ └── .../ExampleSimulation.java # Java Gatling simulation + ├── src/test/resources/ + │ ├── gatling.conf # Optional Gatling configuration + │ ├── logback-test.xml # Optional logging override + │ └── data/ # Optional feeders or request bodies + └── target/ + └── gatling/ # Generated reports + ``` + + + + + Add Maven Configuration + +Add Gatling with the project's existing Maven style. Prefer properties or dependency management when the project already centralizes versions. + +**Dependency:** +```xml + + io.gatling.highcharts + gatling-charts-highcharts + MANUALLY_REPLACE_WITH_LATEST_VERSION + test +]]> +``` + +**Plugin:** +```xml + + io.gatling + gatling-maven-plugin + MANUALLY_REPLACE_WITH_LATEST_VERSION +]]> +``` + +If the user wants Gatling bound to the Maven lifecycle, configure an execution for the `test` goal. By default, the Gatling Maven plugin binds the `test` goal to the `integration-test` phase when configured with an execution. + + + + + Create Java Simulation + + Create simulations as Java test sources under `src/test/java` using a package that matches the project conventions. + + **Simulation Guidance:** + - Use descriptive simulation class names ending with `Simulation` + - Keep base URLs configurable through system properties or environment variables when appropriate + - Use explicit scenario names that describe the user journey under load + - Define injection profiles that match the requested load model + - Add assertions only when the expected latency, success rate, or throughput target is clear + - Keep feeders and request body templates under `src/test/resources` + + + + + Run Gatling Tests + + **Basic Usage:** + ```bash + # Run with the Maven wrapper + ./mvnw gatling:test + + # Run with a specific simulation class + ./mvnw gatling:test -Dgatling.simulationClass=com.example.performance.ExampleSimulation + + # Inspect available options for the test goal + ./mvnw gatling:help -Ddetail=true -Dgoal=test + ``` + + If there is exactly one simulation, Gatling can run it directly. If multiple simulations exist, pass `-Dgatling.simulationClass=<FullyQualifiedClassName>` or configure the plugin with a simulation class for repeatable non-interactive execution. + + + + + Review Reports + + After execution, read the command output to locate the generated Gatling report. Reports are generated under the Maven build output, typically below `target/gatling/`. + + **Report Review Checklist:** + - Confirm the simulation completed without build failures + - Check failed requests and error distributions + - Review response time percentiles and throughput + - Review assertion failures when assertions are configured + - Summarize findings and recommend follow-up load profiles only when supported by the observed result + + + + + + + Summarize the Maven changes applied to `pom.xml` + List created or updated Gatling simulation and resource files + Provide the exact command used to run Gatling tests + Point to the generated report location shown by Gatling + Summarize failed assertions, errors, or notable performance findings + + + + + + **PROJECT TYPE CHECK**: Stop with guidance if the project is not Maven-based + **VERSION MANAGEMENT**: Follow existing Maven version-management conventions instead of scattering hard-coded versions + **NON-INTERACTIVE RUNS**: Use `-Dgatling.simulationClass=<FullyQualifiedClassName>` when multiple simulations would make execution ambiguous + **CONFIGURATION SAFETY**: Place `gatling.conf` in `src/test/resources` because Gatling resolves it from the classpath + **REPORT SAFETY**: Treat `target/gatling/` as generated output and do not edit reports directly + **VALIDATION**: Run `./mvnw gatling:test` or the closest project-specific Maven verification command after setup when feasible + + + diff --git a/skills-generator/src/main/resources/skills.xml b/skills-generator/src/main/resources/skills.xml index 3912b36e..ea885ad2 100644 --- a/skills-generator/src/main/resources/skills.xml +++ b/skills-generator/src/main/resources/skills.xml @@ -177,6 +177,11 @@ 151-java-performance-jmeter + + + 152-java-performance-gatling + + 161-java-profiling-detect