Copilot commented on code in PR #15569:
URL: https://github.com/apache/grails-core/pull/15569#discussion_r3067233363


##########
.agents/skills/style-fixer/SKILL.md:
##########
@@ -0,0 +1,211 @@
+---
+name: style-fixer
+description: Guide for running, interpreting, and fixing code style violations 
in grails-core using GrailsCodeStylePlugin — covering CodeNarc, Checkstyle, 
PMD, SpotBugs, and Spotless
+license: Apache-2.0
+---
+
+<!--
+SPDX-License-Identifier: Apache-2.0
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+## What I Do
+
+- Explain how `GrailsCodeStylePlugin` enforces code quality across all 60+ 
modules via a single aggregation task.
+- Guide you through running style checks, interpreting the per-tool Markdown 
violation reports, and fixing each class of violation.
+- Describe which tools are always-on vs. opt-in, how to configure them via 
Gradle properties, and which violations can be auto-fixed.
+
+## When to Use Me
+
+Activate this skill when:
+
+- Running `./gradlew aggregateStyleViolations` and interpreting the resulting 
`*_VIOLATIONS.md` files.
+- Fixing CodeNarc, Checkstyle, PMD, SpotBugs, or Spotless violations reported 
in those files.
+- Configuring code style tools across the repo (enabling/disabling tools or 
adjusting rule files).
+- Preparing a commit — the plugin output must be clean before merging.
+
+---
+
+## Plugin Overview
+
+`GrailsCodeStylePlugin` is applied to **every** subproject via the 
`org.apache.grails.gradle.grails-code-style` plugin ID. It:
+
+1. Applies CodeNarc, Checkstyle, and (optionally) PMD, SpotBugs, Spotless, and 
JaCoCo.
+2. Redirects all XML reports to a **shared** directory 
(`build/codestyle/<tool>/`) so they are visible from the root.
+3. Registers a per-project `codeStyle` task and a root 
`aggregateStyleViolations` task.
+4. Writes aggregated Markdown violation files to the repo root.
+
+---
+
+## Key Tasks
+
+| Task | Scope | Description |
+|------|-------|-------------|
+| `./gradlew codeStyle` | per-project | Runs all enabled style checks for that 
project |
+| `./gradlew aggregateStyleViolations` | root | Runs all checks across every 
module, then writes `*_VIOLATIONS.md` |
+| `./gradlew codenarcFix` | per-project | Auto-fixes a subset of CodeNarc 
violations |
+
+### Quick commands
+
+```bash
+# Check a single module
+./gradlew :grails-core:codeStyle
+
+# Full multi-module check + report
+./gradlew aggregateStyleViolations
+
+# Skip style in tests (default); include test sources
+./gradlew aggregateStyleViolations -Pgrails.codestyle.enabled.tests=true
+
+# Ignore failures (collect reports without failing the build)
+./gradlew aggregateStyleViolations -Pgrails.codestyle.ignoreFailures=true
+
+# Auto-fix some CodeNarc violations before running checks
+./gradlew codenarcFix codeStyle
+```
+
+---
+
+## Output Files
+
+After running `aggregateStyleViolations`, these files appear in the repo root:
+
+| File | Tool | Always generated |
+|------|------|-----------------|
+| `CODENARC_VIOLATIONS.md` | CodeNarc | Yes |
+| `CHECKSTYLE_VIOLATIONS.md` | Checkstyle | Yes |
+| `PMD_VIOLATIONS.md` | PMD | Only if `grails.codestyle.enabled.pmd=true` |
+| `SPOTBUGS_VIOLATIONS.md` | SpotBugs | Only if 
`grails.codestyle.enabled.spotbugs=true` |

Review Comment:
   The Output Files table says PMD/SpotBugs reports are only generated when 
enabled, but `aggregateStyleViolations` always writes `PMD_VIOLATIONS.md` and 
`SPOTBUGS_VIOLATIONS.md` (they’ll contain “No violations found!” when the tools 
are disabled). Update the table wording so readers don’t assume the files won’t 
exist unless enabled.
   ```suggestion
   | `PMD_VIOLATIONS.md` | PMD | Yes — may contain `No violations found!` when 
`grails.codestyle.enabled.pmd=false` |
   | `SPOTBUGS_VIOLATIONS.md` | SpotBugs | Yes — may contain `No violations 
found!` when `grails.codestyle.enabled.spotbugs=false` |
   ```



##########
.agents/skills/style-fixer/SKILL.md:
##########
@@ -0,0 +1,211 @@
+---
+name: style-fixer
+description: Guide for running, interpreting, and fixing code style violations 
in grails-core using GrailsCodeStylePlugin — covering CodeNarc, Checkstyle, 
PMD, SpotBugs, and Spotless
+license: Apache-2.0
+---
+
+<!--
+SPDX-License-Identifier: Apache-2.0
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+## What I Do
+
+- Explain how `GrailsCodeStylePlugin` enforces code quality across all 60+ 
modules via a single aggregation task.
+- Guide you through running style checks, interpreting the per-tool Markdown 
violation reports, and fixing each class of violation.
+- Describe which tools are always-on vs. opt-in, how to configure them via 
Gradle properties, and which violations can be auto-fixed.
+
+## When to Use Me
+
+Activate this skill when:
+
+- Running `./gradlew aggregateStyleViolations` and interpreting the resulting 
`*_VIOLATIONS.md` files.
+- Fixing CodeNarc, Checkstyle, PMD, SpotBugs, or Spotless violations reported 
in those files.
+- Configuring code style tools across the repo (enabling/disabling tools or 
adjusting rule files).
+- Preparing a commit — the plugin output must be clean before merging.
+
+---
+
+## Plugin Overview
+
+`GrailsCodeStylePlugin` is applied to **every** subproject via the 
`org.apache.grails.gradle.grails-code-style` plugin ID. It:
+
+1. Applies CodeNarc, Checkstyle, and (optionally) PMD, SpotBugs, Spotless, and 
JaCoCo.
+2. Redirects all XML reports to a **shared** directory 
(`build/codestyle/<tool>/`) so they are visible from the root.
+3. Registers a per-project `codeStyle` task and a root 
`aggregateStyleViolations` task.
+4. Writes aggregated Markdown violation files to the repo root.
+
+---
+
+## Key Tasks
+
+| Task | Scope | Description |
+|------|-------|-------------|
+| `./gradlew codeStyle` | per-project | Runs all enabled style checks for that 
project |
+| `./gradlew aggregateStyleViolations` | root | Runs all checks across every 
module, then writes `*_VIOLATIONS.md` |
+| `./gradlew codenarcFix` | per-project | Auto-fixes a subset of CodeNarc 
violations |
+
+### Quick commands
+
+```bash
+# Check a single module
+./gradlew :grails-core:codeStyle
+
+# Full multi-module check + report
+./gradlew aggregateStyleViolations
+
+# Skip style in tests (default); include test sources
+./gradlew aggregateStyleViolations -Pgrails.codestyle.enabled.tests=true
+
+# Ignore failures (collect reports without failing the build)
+./gradlew aggregateStyleViolations -Pgrails.codestyle.ignoreFailures=true
+
+# Auto-fix some CodeNarc violations before running checks
+./gradlew codenarcFix codeStyle
+```
+
+---
+
+## Output Files
+
+After running `aggregateStyleViolations`, these files appear in the repo root:
+
+| File | Tool | Always generated |
+|------|------|-----------------|
+| `CODENARC_VIOLATIONS.md` | CodeNarc | Yes |
+| `CHECKSTYLE_VIOLATIONS.md` | Checkstyle | Yes |
+| `PMD_VIOLATIONS.md` | PMD | Only if `grails.codestyle.enabled.pmd=true` |
+| `SPOTBUGS_VIOLATIONS.md` | SpotBugs | Only if 
`grails.codestyle.enabled.spotbugs=true` |
+| `JACOCO_COVERAGE_VIOLATIONS.md` | JaCoCo | Only if 
`grails.codestyle.enabled.jacoco=true` |
+
+Each file is a Markdown table grouped by module, with columns: **Class**, 
**Tool**, **Violation**, **Line**, **Message**.
+
+A clean run produces `No violations found! 🎉` in each file. **A commit must 
not include any violations.**
+
+---
+
+## Tool Details
+
+### CodeNarc (Groovy — always enabled)
+
+Rule file: `build/codestyle/codenarc/codenarc.groovy` (auto-extracted from 
plugin JAR on first run).

Review Comment:
   This note suggests the CodeNarc rule file is only extracted on first run, 
but the plugin writes the default config under `build/` (and can overwrite it) 
as part of its setup. Consider clarifying that this file is generated into 
`build/codestyle/...` and isn’t intended to be edited directly.
   ```suggestion
   Rule file: `build/codestyle/codenarc/codenarc.groovy` (generated by the 
plugin under `build/codestyle/...` during setup; it may be overwritten and is 
not intended to be edited directly).
   ```



##########
.agents/skills/hibernate-developer/SKILL.md:
##########
@@ -0,0 +1,130 @@
+---
+name: hibernate-developer
+description: Guide for working in the grails-data-hibernate7 module, 
especially Hibernate 7 domain binding, mapping migration, generators, and 
integration tests. Use this when changing code or tests under 
grails-data-hibernate7.
+license: Apache-2.0
+---

Review Comment:
   New skills were added in this PR (hibernate/style/test), but the root 
`AGENTS.md` “Available Skills” list currently only references 
grails/groovy/java. Please update `AGENTS.md` to include the new skill entries 
so they’re discoverable and actually used by agents/contributors.



##########
.agents/skills/test-fixer/SKILL.md:
##########
@@ -0,0 +1,192 @@
+---
+name: test-fixer
+description: Guide for running, aggregating, and fixing test failures across 
all grails-core modules using GrailsTestPlugin — producing TEST_FAILURES.md 
from multi-module XML test results
+license: Apache-2.0
+---
+
+<!--
+SPDX-License-Identifier: Apache-2.0
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+## What I Do
+
+- Explain how `GrailsTestPlugin` aggregates test failures from all 60+ modules 
into a single `TEST_FAILURES.md` report.
+- Guide you through running tests across the entire repo with `--continue` so 
one failure doesn't stop the rest.
+- Help interpret `TEST_FAILURES.md`, navigate to failing specs, and fix the 
underlying issues.
+
+## When to Use Me
+
+Activate this skill when:
+
+- Running the full test suite and needing to see all failures in one place 
instead of tailing 60 separate reports.
+- Preparing a commit — `TEST_FAILURES.md` must report `All tests passed! 🎉` 
before merging.
+- Triaging which modules have regressions after a dependency upgrade or 
refactor.
+
+---
+
+## Plugin Overview
+
+`GrailsTestPlugin` is applied to the **root project only** via the 
`org.apache.grails.gradle.test-aggregation` plugin ID (registered in 
`build-logic`).
+
+It registers a single `aggregateTestFailures` task that:
+
+1. Waits for (`mustRunAfter`) every `Test` task in every subproject.
+2. Scans all `build/test-results/**/*.xml` directories across subprojects and 
all top-level repo directories.
+3. Parses every `TEST-*.xml` JUnit report for `<failure>` and `<error>` 
elements.
+4. Writes `TEST_FAILURES.md` to the repo root — a Markdown table of failures 
grouped by module.
+
+Note: This plugin does **not** run tests itself. It only aggregates results 
already written to disk. Gradle's own test engine (JUnit Platform) handles test 
execution and XML report generation.
+
+---
+
+## Key Task
+
+```bash
+# Run all tests across all modules, continue even on failure, then aggregate
+./gradlew test aggregateTestFailures --continue
+
+# Run a single module's tests then aggregate
+./gradlew :grails-data-hibernate7-core:test aggregateTestFailures --continue
+
+# Re-run all tests (bypass Gradle's up-to-date caching)
+./gradlew test aggregateTestFailures --continue --rerun-tasks
+```
+
+`--continue` is essential: without it, Gradle stops at the first failing 
module and `aggregateTestFailures` never runs.
+
+---
+
+## Output File
+
+`TEST_FAILURES.md` is written to the repo root. Format:
+
+```markdown
+# Test Failures Summary
+Generated on: 2026-04-10 12:00:00
+
+Found 3 failures.
+
+## Module: grails-data-hibernate7-core
+| Class | Test | Type | Message |
+| :--- | :--- | :--- | :--- |
+| org.grails.orm.hibernate.FooSpec | some feature | 
org.spockframework.runtime.SpockAssertionError | expected: ... |
+```
+
+A clean run produces:
+```markdown
+All tests passed! 🎉
+```
+
+**A commit must not include a `TEST_FAILURES.md` with failures.**

Review Comment:
   This doc says commits must not include `TEST_FAILURES.md` *with failures*, 
but repo guidance requires removing `TEST_FAILURES.md` even after a clean run 
(the aggregator always writes the file). Please align this section with 
AGENTS.md’s “report no issues and are removed” rule.
   ```suggestion
   **A clean run should report no issues, and `TEST_FAILURES.md` is a generated 
artifact that must be removed before committing, whether it contains failures 
or not.**
   ```



##########
.agents/skills/style-fixer/SKILL.md:
##########
@@ -0,0 +1,211 @@
+---
+name: style-fixer
+description: Guide for running, interpreting, and fixing code style violations 
in grails-core using GrailsCodeStylePlugin — covering CodeNarc, Checkstyle, 
PMD, SpotBugs, and Spotless
+license: Apache-2.0
+---
+
+<!--
+SPDX-License-Identifier: Apache-2.0
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+## What I Do
+
+- Explain how `GrailsCodeStylePlugin` enforces code quality across all 60+ 
modules via a single aggregation task.
+- Guide you through running style checks, interpreting the per-tool Markdown 
violation reports, and fixing each class of violation.
+- Describe which tools are always-on vs. opt-in, how to configure them via 
Gradle properties, and which violations can be auto-fixed.
+
+## When to Use Me
+
+Activate this skill when:
+
+- Running `./gradlew aggregateStyleViolations` and interpreting the resulting 
`*_VIOLATIONS.md` files.
+- Fixing CodeNarc, Checkstyle, PMD, SpotBugs, or Spotless violations reported 
in those files.
+- Configuring code style tools across the repo (enabling/disabling tools or 
adjusting rule files).
+- Preparing a commit — the plugin output must be clean before merging.
+
+---
+
+## Plugin Overview
+
+`GrailsCodeStylePlugin` is applied to **every** subproject via the 
`org.apache.grails.gradle.grails-code-style` plugin ID. It:
+
+1. Applies CodeNarc, Checkstyle, and (optionally) PMD, SpotBugs, Spotless, and 
JaCoCo.
+2. Redirects all XML reports to a **shared** directory 
(`build/codestyle/<tool>/`) so they are visible from the root.
+3. Registers a per-project `codeStyle` task and a root 
`aggregateStyleViolations` task.
+4. Writes aggregated Markdown violation files to the repo root.
+
+---
+
+## Key Tasks
+
+| Task | Scope | Description |
+|------|-------|-------------|
+| `./gradlew codeStyle` | per-project | Runs all enabled style checks for that 
project |
+| `./gradlew aggregateStyleViolations` | root | Runs all checks across every 
module, then writes `*_VIOLATIONS.md` |
+| `./gradlew codenarcFix` | per-project | Auto-fixes a subset of CodeNarc 
violations |
+
+### Quick commands
+
+```bash
+# Check a single module
+./gradlew :grails-core:codeStyle
+
+# Full multi-module check + report
+./gradlew aggregateStyleViolations
+
+# Skip style in tests (default); include test sources
+./gradlew aggregateStyleViolations -Pgrails.codestyle.enabled.tests=true
+
+# Ignore failures (collect reports without failing the build)
+./gradlew aggregateStyleViolations -Pgrails.codestyle.ignoreFailures=true
+
+# Auto-fix some CodeNarc violations before running checks
+./gradlew codenarcFix codeStyle
+```
+
+---
+
+## Output Files
+
+After running `aggregateStyleViolations`, these files appear in the repo root:
+
+| File | Tool | Always generated |
+|------|------|-----------------|
+| `CODENARC_VIOLATIONS.md` | CodeNarc | Yes |
+| `CHECKSTYLE_VIOLATIONS.md` | Checkstyle | Yes |
+| `PMD_VIOLATIONS.md` | PMD | Only if `grails.codestyle.enabled.pmd=true` |
+| `SPOTBUGS_VIOLATIONS.md` | SpotBugs | Only if 
`grails.codestyle.enabled.spotbugs=true` |
+| `JACOCO_COVERAGE_VIOLATIONS.md` | JaCoCo | Only if 
`grails.codestyle.enabled.jacoco=true` |
+
+Each file is a Markdown table grouped by module, with columns: **Class**, 
**Tool**, **Violation**, **Line**, **Message**.
+
+A clean run produces `No violations found! 🎉` in each file. **A commit must 
not include any violations.**
+
+---
+
+## Tool Details
+
+### CodeNarc (Groovy — always enabled)
+
+Rule file: `build/codestyle/codenarc/codenarc.groovy` (auto-extracted from 
plugin JAR on first run).
+
+Most common violations and how to fix them:
+
+| Rule | Fix |
+|------|-----|
+| `UnnecessaryGString` | Replace `"plain string"` with `'plain string'` |
+| `UnnecessarySemicolon` | Remove trailing `;` |
+| `SpaceBeforeOpeningBrace` | Add space before `{` → `method() {` |
+| `SpaceAroundMapEntryColon` | `[key: value]` not `[key:value]` |
+| `ConsecutiveBlankLines` | Collapse 3+ blank lines to 2 |
+| `ClassStartsWithBlankLine` | Remove blank line right after `class Foo {` |
+| `NoWildcardImports` | Expand `import org.foo.*` to explicit imports |
+| `UnusedImport` | Remove imports not referenced in the file |
+| `MethodName` | Method names must be camelCase (not `snake_case`) |
+| `VariableName` | Variable names must be camelCase |
+| `LineLength` | Keep lines ≤ 200 chars (default) |
+
+Auto-fixable via `codenarcFix`: `ClassStartsWithBlankLine`, 
`SpaceAroundMapEntryColon`, `UnnecessaryGString`, `UnnecessarySemicolon`, 
`SpaceBeforeOpeningBrace`, `ConsecutiveBlankLines`.
+
+### Checkstyle (Java — always enabled)
+
+Rule file: `build/codestyle/checkstyle/checkstyle.xml`.
+
+Common violations:
+
+| Rule | Fix |
+|------|-----|
+| `ImportOrder` | Re-order imports: `java|javax`, then `groovy`, then 
`jakarta`, then blank, then `io.spring|org.springframework`, then 
`grails|org.apache.grails|org.grails`, then static imports |
+| `AvoidStarImport` | Use explicit class imports |
+| `UnusedImports` | Remove unused imports |
+| `WhitespaceAround` | Add spaces around operators and keywords |
+| `NeedBraces` | Add `{}` to single-statement `if`/`for`/`while` |
+| `FileTabCharacter` | Replace tabs with 4 spaces |
+| `NewlineAtEndOfFile` | Ensure file ends with `\n` |
+
+### PMD (Java/Groovy — opt-in)
+
+Enable: `-Pgrails.codestyle.enabled.pmd=true`
+
+Rule file: `build/codestyle/pmd/pmd.xml`.
+
+### SpotBugs (Java bytecode — opt-in)
+
+Enable: `-Pgrails.codestyle.enabled.spotbugs=true`
+
+Runs at `Effort.MAX` / `Confidence.HIGH`. Only high-confidence bugs are 
reported.
+
+### Spotless (Java auto-formatting — opt-in)
+
+Enable: `-Pgrails.codestyle.enabled.spotless=true`
+
+Uses Palantir Java Format. Can auto-fix by running:
+```bash
+./gradlew spotlessApply
+```
+
+---
+
+## Configuration Properties
+
+All properties can be set in `gradle.properties` or passed as `-P` flags:
+
+| Property | Default | Description |
+|----------|---------|-------------|
+| `grails.codestyle.enabled.checkstyle` | `true` | Enable Checkstyle |
+| `grails.codestyle.enabled.codenarc` | `true` | Enable CodeNarc |
+| `grails.codestyle.enabled.pmd` | `false` | Enable PMD |
+| `grails.codestyle.enabled.spotbugs` | `false` | Enable SpotBugs |
+| `grails.codestyle.enabled.spotless` | `false` | Enable Spotless |
+| `grails.codestyle.enabled.jacoco` | `false` | Enable JaCoCo coverage |
+| `grails.codestyle.enabled.tests` | `false` | Also check test source sets |
+| `grails.codestyle.ignoreFailures` | `false` | Collect reports without 
failing build |
+| `grails.codestyle.codenarc.fix` | `false` | Run `codenarcFix` before 
CodeNarc tasks |
+| `grails.codestyle.dir.checkstyle` | (auto) | Custom path to Checkstyle 
config dir |
+| `grails.codestyle.dir.codenarc` | (auto) | Custom path to CodeNarc config 
dir |
+| `grails.codestyle.dir.pmd` | (auto) | Custom path to PMD config dir |
+| `grails.codestyle.dir.spotless` | (auto) | Custom path to Spotless config 
dir |
+| `skipCodeStyle` | unset | If present, all style tasks are skipped |
+
+---
+
+## Fixing Violations Workflow
+
+1. Run `./gradlew aggregateStyleViolations 
-Pgrails.codestyle.ignoreFailures=true`
+2. Open `CODENARC_VIOLATIONS.md` and `CHECKSTYLE_VIOLATIONS.md` to see all 
issues by module
+3. For CodeNarc, run `./gradlew codenarcFix` to auto-fix what it can
+4. Fix remaining violations manually using the table above
+5. Re-run `./gradlew aggregateStyleViolations` and confirm files contain `No 
violations found! 🎉`
+6. Delete the `*_VIOLATIONS.md` files before committing (clean state produces 
no output file)

Review Comment:
   Step 6 says a clean state produces no `*_VIOLATIONS.md` output file, but the 
code-style aggregation task always writes the markdown reports even when there 
are zero violations. Please remove or rephrase this to avoid misleading 
contributors (it’s fine to say the files should be deleted before committing).
   ```suggestion
   6. Delete the generated `*_VIOLATIONS.md` files before committing, even if 
they report no violations
   ```



##########
.agents/skills/test-fixer/SKILL.md:
##########
@@ -0,0 +1,192 @@
+---
+name: test-fixer
+description: Guide for running, aggregating, and fixing test failures across 
all grails-core modules using GrailsTestPlugin — producing TEST_FAILURES.md 
from multi-module XML test results
+license: Apache-2.0
+---
+
+<!--
+SPDX-License-Identifier: Apache-2.0
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+## What I Do
+
+- Explain how `GrailsTestPlugin` aggregates test failures from all 60+ modules 
into a single `TEST_FAILURES.md` report.
+- Guide you through running tests across the entire repo with `--continue` so 
one failure doesn't stop the rest.
+- Help interpret `TEST_FAILURES.md`, navigate to failing specs, and fix the 
underlying issues.
+
+## When to Use Me
+
+Activate this skill when:
+
+- Running the full test suite and needing to see all failures in one place 
instead of tailing 60 separate reports.
+- Preparing a commit — `TEST_FAILURES.md` must report `All tests passed! 🎉` 
before merging.
+- Triaging which modules have regressions after a dependency upgrade or 
refactor.
+
+---
+
+## Plugin Overview
+
+`GrailsTestPlugin` is applied to the **root project only** via the 
`org.apache.grails.gradle.test-aggregation` plugin ID (registered in 
`build-logic`).
+
+It registers a single `aggregateTestFailures` task that:
+
+1. Waits for (`mustRunAfter`) every `Test` task in every subproject.
+2. Scans all `build/test-results/**/*.xml` directories across subprojects and 
all top-level repo directories.
+3. Parses every `TEST-*.xml` JUnit report for `<failure>` and `<error>` 
elements.
+4. Writes `TEST_FAILURES.md` to the repo root — a Markdown table of failures 
grouped by module.
+
+Note: This plugin does **not** run tests itself. It only aggregates results 
already written to disk. Gradle's own test engine (JUnit Platform) handles test 
execution and XML report generation.
+
+---
+
+## Key Task
+
+```bash
+# Run all tests across all modules, continue even on failure, then aggregate
+./gradlew test aggregateTestFailures --continue
+
+# Run a single module's tests then aggregate
+./gradlew :grails-data-hibernate7-core:test aggregateTestFailures --continue
+
+# Re-run all tests (bypass Gradle's up-to-date caching)
+./gradlew test aggregateTestFailures --continue --rerun-tasks
+```
+
+`--continue` is essential: without it, Gradle stops at the first failing 
module and `aggregateTestFailures` never runs.
+
+---
+
+## Output File
+
+`TEST_FAILURES.md` is written to the repo root. Format:
+
+```markdown
+# Test Failures Summary
+Generated on: 2026-04-10 12:00:00
+
+Found 3 failures.
+
+## Module: grails-data-hibernate7-core
+| Class | Test | Type | Message |
+| :--- | :--- | :--- | :--- |
+| org.grails.orm.hibernate.FooSpec | some feature | 
org.spockframework.runtime.SpockAssertionError | expected: ... |
+```
+
+A clean run produces:
+```markdown
+All tests passed! 🎉
+```
+
+**A commit must not include a `TEST_FAILURES.md` with failures.**
+
+---
+
+## Interpreting Failures
+
+Each row in the table gives you:
+
+| Column | Meaning |
+|--------|---------|
+| `Class` | Fully-qualified Spock spec or JUnit class |
+| `Test` | Feature method name (Spock) or test method name (JUnit) |
+| `Type` | Exception class (e.g. `SpockAssertionError`, 
`IllegalStateException`) |
+| `Message` | First 200 characters of the failure message or stack |
+
+### Common Failure Patterns
+
+| Type | Likely Cause |
+|------|-------------|
+| `ConditionNotSatisfiedException` | Spock `then:` assertion failed — check 
expected vs actual values |
+| `SpockAssertionError` | Explicit `assert` failed inside a spec |
+| `BeanCreationException` | Spring context failed to start — check 
`@SpringBootTest` config or missing beans |
+| `HibernateException` | Schema/session issue — check entity mapping or test 
datasource |
+| `IllegalStateException` | Missing setup, invalid test state, or static 
pollution from parallel tests |
+| `NullPointerException` | Uninitialized mock or service — check `given:` 
block |
+| `MissingMethodException` | Groovy dynamic dispatch failure — usually a 
missing method or wrong type |
+
+---
+
+## Running Tests for a Specific Module
+
+```bash
+# All tests in a module
+./gradlew :grails-data-hibernate7-dbmigration:test
+
+# A specific spec
+./gradlew :grails-data-hibernate7-dbmigration:test \
+  --tests 
"org.grails.plugins.databasemigration.command.DbmGenerateGormChangelogCommandSpec"
+
+# A specific feature method (use the exact feature name)
+./gradlew :grails-data-hibernate7-core:test \
+  --tests "org.grails.orm.hibernate.FooSpec.my feature name"
+
+# Force rerun even if Gradle thinks it's up-to-date
+./gradlew :grails-data-hibernate7-core:test --rerun-tasks
+```
+
+---
+
+## Test Source Layout
+
+| Source set | Directory | Task |
+|------------|-----------|------|
+| Unit tests | `src/test/groovy/` | `test` |
+| Integration tests | `src/integration-test/groovy/` | `integrationTest` |
+
+Most specs in grails-core are **unit tests** (`src/test/groovy/`) run by the 
`test` task.
+A small number of modules use `integrationTest` for full Spring context tests.
+
+---
+
+## Parallel Test Execution
+
+Tests run in parallel (`maxParallelForks` defaults to `availableProcessors * 
3/4`). This can cause:

Review Comment:
   The default parallelism here omits the CI default: the root build sets 
`maxParallelForks` to 4 on CI, otherwise `availableProcessors * 3/4` 
(overridable via `-PmaxTestParallel`). Please tweak this sentence so it matches 
the actual Gradle configuration.
   ```suggestion
   Tests run in parallel (`maxParallelForks` defaults to `4` on CI and to 
`availableProcessors * 3/4` otherwise; override with `-PmaxTestParallel`). This 
can cause:
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to