[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6ACGDZ4Z6FRBRVZFYFF29FW":3,"skill-same:01M6ACGDZ4Z6FRBRVZFYFF29FW":83},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":45,"linkOnly":46,"markdownContent":47,"markdownBody":48,"frontMatter":49,"refName":50,"commitSha":51,"skillDirectory":52,"forksCount":53,"repositoryHtmlUrl":54,"repositoryHomepageUrl":55,"ownerHtmlUrl":56,"ownerBlogUrl":57,"ownerDescription":17,"updatedAt":58,"install":59,"resources":72},"01M6ACGDZ4Z6FRBRVZFYFF29FW","violation-fixer","代码风格违规修复","Guide for running, interpreting, and fixing code style and analysis violations in grails-core using GrailsCodeStylePlugin, GrailsCodeAnalysisPlugin, and GrailsViolationAggregationPlugin - covering CodeNarc, Checkstyle, PMD, SpotBugs, and JaCoCo","使用 GrailsCodeStylePlugin、GrailsCodeAnalysisPlugin 和 GrailsViolationAggregationPlugin 在 grails-core 中运行、解读并修复代码风格与分析违规的指南，涵盖 CodeNarc、Checkstyle、PMD、SpotBugs 和 JaCoCo。","apache\u002Fgrails-core","apache","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F47359?v=4","01M6AC83E6K4FDKK7HZ8WNMQKE","The Apache Software Foundation","01M6ACFVWFRRTGBQBMWZHV6TS9",2942,"Apache-2.0",null,"https:\u002F\u002Fgithub.com\u002Fapache\u002Fgrails-core\u002Fblob\u002F8.0.x\u002F.agents\u002Fskills\u002Fviolation-fixer\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQJH394GT47X57A9Q8G7HX","测试与质量保障","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44],"violation fixer","fixer","code style","core","code","grails","analysis","guide","checkstyle","style","pmd","spotbugs","for","running","2026-11-10 10:12:30",false,"---\nname: violation-fixer\ndescription: Guide for running, interpreting, and fixing code style and analysis violations in grails-core using GrailsCodeStylePlugin, GrailsCodeAnalysisPlugin, and GrailsViolationAggregationPlugin - covering CodeNarc, Checkstyle, PMD, SpotBugs, and JaCoCo\nlicense: Apache-2.0\n---\n\u003C!--\nSPDX-License-Identifier: Apache-2.0\n\nLicensed to the Apache Software Foundation (ASF) under one or more contributor license agreements; and to You under the Apache License, Version 2.0. \n-->\n\n## What I Do\n\n- Explain how `GrailsCodeStylePlugin`, `GrailsCodeAnalysisPlugin`, and `GrailsViolationAggregationPlugin` enforce code quality across all 60+ modules.\n- Guide you through running style and analysis checks, interpreting the per-tool Markdown violation reports, and fixing each class of violation.\n- Describe which tools are always-on vs. opt-in, how to configure them via Gradle properties, and which violations can be auto-fixed.\n\n## When to Use Me\n\nActivate this skill when:\n\n- Running `.\u002Fgradlew aggregateViolations` and interpreting the resulting `*_VIOLATIONS.md` files.\n- Fixing CodeNarc, Checkstyle, PMD, SpotBugs, or Spotless violations reported in those files.\n- Configuring code style or analysis tools across the repo (enabling\u002Fdisabling tools or adjusting rule files).\n- Preparing a commit - the plugin output must be clean before merging.\n\n---\n\n## Plugin Overview\n\n| Plugin | Applied to | Responsibility |\n|--------|-----------|----------------|\n| `org.apache.grails.gradle.grails-code-style` | Every subproject | Applies Checkstyle, CodeNarc, and code analysis; registers per-project `codeStyle` task; redirects XML reports to root `build\u002Freports\u002Fcode-style\u002F` |\n| `org.apache.grails.gradle.grails-code-analysis` | Every subproject | Applies PMD and SpotBugs (both opt-in); registers per-project `codeAnalysis` task; redirects XML reports to root `build\u002Freports\u002Fcode-analysis\u002F` |\n| `org.apache.grails.gradle.grails-jacoco` | Every subproject | Applies JaCoCo; wires `jacocoTestReport` to run after each `test` task |\n| `org.apache.grails.gradle.grails-violation-aggregation` | **Root project only** | Registers `aggregateViolations` and `aggregateJacocoCoverage` tasks; writes Markdown summaries to `build\u002Freports\u002Fviolations\u002F` |\n\n---\n\n## Key Tasks\n\n| Task | Scope | Description |\n|------|-------|-------------|\n| `.\u002Fgradlew codeStyle` | per-project | Runs Checkstyle and CodeNarc for that project |\n| `.\u002Fgradlew codeAnalysis` | per-project | Runs PMD and\u002For SpotBugs for that project (when enabled) |\n| `.\u002Fgradlew aggregateViolations` | root | Runs all checks across every module, then writes `*_VIOLATIONS.md` to `build\u002Freports\u002Fviolations\u002F` |\n| `.\u002Fgradlew validateRepositoryConventions` | root | Validates canonical skill metadata, AGENTS paths, GitHub Action pins, and message keys. RAT provenance is the separate `rat` task, which `aggregateViolations` runs |\n| `.\u002Fgradlew cleanViolationReports` | root | Deletes analyzer XML reports, their markers, and the aggregate Markdown so the next aggregate run re-analyzes every module. The root `clean` runs it |\n| `.\u002Fgradlew aggregateJacocoCoverage` | root | Runs JaCoCo reports across every module, then writes `JACOCO_COVERAGE.md` to `build\u002Freports\u002Fviolations\u002F` |\n| `.\u002Fgradlew codenarcFix` | per-project | Auto-fixes a subset of CodeNarc violations |\n\n### Quick commands\n\n```bash\n# Check a single module (style only)\n.\u002Fgradlew :grails-core:codeStyle\n\n# Check a single module (analysis - enable through the module extension or an override)\n.\u002Fgradlew :grails-core:codeAnalysis -Pgrails.code-analysis.enabled.pmd=true\n\n# Full multi-module check + report (use --continue so the reports are written even when an analyzer fails)\n.\u002Fgradlew aggregateViolations --continue\n\n# Force every module to be re-analyzed instead of reusing UP-TO-DATE analyzer results\n.\u002Fgradlew cleanViolationReports aggregateViolations --continue\n\n# Repository conventions only\n.\u002Fgradlew validateRepositoryConventions\n\n# Include test sources in style checks\n.\u002Fgradlew aggregateViolations -Pgrails.code-style.enabled.tests=true\n\n# Include test sources in analysis\n.\u002Fgradlew aggregateViolations -Pgrails.code-analysis.enabled.tests=true\n\n# Ignore failures (collect reports without failing the build)\n.\u002Fgradlew aggregateViolations -Pgrails.code-style.ignoreFailures=true -Pgrails.code-analysis.ignoreFailures=true\n\n# Auto-fix some CodeNarc violations before running checks\n.\u002Fgradlew codenarcFix codeStyle\n\n# JaCoCo coverage report\n.\u002Fgradlew aggregateJacocoCoverage\n```\n\n---\n\n## Output Files\n\nAfter running `aggregateViolations`, these files appear under `build\u002Freports\u002Fviolations\u002F` in the **root project build directory**:\n\n| File | Tool | Always generated |\n|------|------|-----------------|\n| `build\u002Freports\u002Fviolations\u002FCODENARC_VIOLATIONS.md` | CodeNarc | Yes |\n| `build\u002Freports\u002Fviolations\u002FCHECKSTYLE_VIOLATIONS.md` | Checkstyle | Yes |\n| `build\u002Freports\u002Fviolations\u002FPMD_VIOLATIONS.md` | PMD | Yes - reports `PMD is disabled.` when PMD is disabled |\n| `build\u002Freports\u002Fviolations\u002FSPOTBUGS_VIOLATIONS.md` | SpotBugs | Yes - reports `SpotBugs is disabled.` when SpotBugs is disabled |\n| `build\u002Freports\u002Fviolations\u002FREPOSITORY_CONVENTIONS.md` | Repository conventions | Yes - lists skill, Action, or message-key failures. Ordered after `rat` in the `aggregateViolations` lane |\n\nAfter running `aggregateJacocoCoverage`:\n\n| File | Tool | Generated |\n|------|------|-----------|\n| `build\u002Freports\u002Fviolations\u002FJACOCO_COVERAGE.md` | JaCoCo | Only when at least one subproject has a JaCoCo CSV report |\n\nAll reports are inside `build\u002F` and are excluded from version control via `.gitignore`. A clean run produces `No violations found! ?` in each style file. **The build must be clean before committing.**\n\nEach aggregated style or analysis report begins with `Modules analyzed:`, which names only modules that contributed data. Each file is a Markdown table grouped by module, with columns: **Class**, **Tool**, **Violation**, **Line**, **Message**.\n\nOnly the aggregate lane (`aggregateViolations`, `aggregateStyleViolations`, `aggregateAnalysisViolations`) writes these Markdown files. Running an analyzer task directly, such as `.\u002Fgradlew :grails-core:checkstyleMain`, produces only that task's own XML report and deliberately leaves the aggregate Markdown untouched, so a partial run can never overwrite an authoritative full-repository report. Because the writer is part of that lane rather than a per-task finalizer, pass `--continue` when you expect violations, otherwise the failing analyzer stops the build before the report explaining the failure is written. Analyzers for unchanged modules stay UP-TO-DATE between aggregate runs and their previous results are aggregated; run `cleanViolationReports` (or the root `clean`) first to force a full re-analysis.\n\n## Repository Conventions\n\nRun `.\u002Fgradlew validateRepositoryConventions` to write `build\u002Freports\u002Fviolations\u002FREPOSITORY_CONVENTIONS.md`. Fix the reported source rather than suppressing the validation.\n\n| Finding | Fix |\n|---------|-----|\n| Skill | Start `SKILL.md` with YAML front matter, supply string `name`, `description`, and `license` values, use a valid directory name that matches `name`, and keep names unique. Every skill path that `AGENTS.md` references must exist, but `AGENTS.md` is not required to index every skill. |\n| GitHub Action | Pin third-party references to one lowercase 40-hex immutable reference for that action across workflows and repository-local `action.yml` or `action.yaml` manifests. A 40-hex value may be a commit or annotated-tag object SHA. `actions\u002F*` must use the full tag of a release (`vX.Y.Z`) and `apache\u002F*` a version or branch reference, never a 40-hex SHA, and local `.\u002F...` uses are permitted. Pin Docker `uses`, Docker action `runs.image`, and workflow job\u002Fservice container images to literal immutable `name@sha256:\u003Cdigest>` values. |\n| Message key | Remove or rename the duplicate logical key in the reported `grails-app\u002Fi18n\u002F**\u002F*.properties` file, preserving escaped separators and continuation semantics. |\n\n---\n\n## Tool Details\n\n### CodeNarc (Groovy - always enabled)\n\nRule file: `build\u002Fcode-style\u002Fcodenarc\u002Fcodenarc.groovy` (generated by the plugin during setup; not intended to be edited directly).\n\nMost common violations and how to fix them:\n\n| Rule | Fix |\n|------|-----|\n| `UnnecessaryGString` | Replace `\"plain string\"` with `'plain string'` |\n| `UnnecessarySemicolon` | Remove trailing `;` |\n| `SpaceBeforeOpeningBrace` | Add space before `{` → `method() {` |\n| `SpaceAroundMapEntryColon` | `[key: value]` not `[key:value]` |\n| `ConsecutiveBlankLines` | Collapse 3+ blank lines to 2 |\n| `ClassStartsWithBlankLine` | Remove blank line right after `class Foo {` |\n| `NoWildcardImports` | Expand `import org.foo.*` to explicit imports |\n| `UnusedImport` | Remove imports not referenced in the file |\n| `MethodName` | Method names must be camelCase (not `snake_case`) |\n| `VariableName` | Variable names must be camelCase |\n| `LineLength` | Keep lines ≤ 200 chars (default) |\n\nAuto-fixable via `codenarcFix`: `ClassStartsWithBlankLine`, `SpaceAroundMapEntryColon`, `UnnecessaryGString`, `UnnecessarySemicolon`, `SpaceBeforeOpeningBrace`, `ConsecutiveBlankLines`.\n\n### Checkstyle (Java - always enabled)\n\nRule file: `build\u002Fcode-style\u002Fcheckstyle\u002Fcheckstyle.xml`.\n\nCommon violations:\n\n| Rule | Fix |\n|------|-----|\n| `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 |\n| `AvoidStarImport` | Use explicit class imports |\n| `UnusedImports` | Remove unused imports |\n| `WhitespaceAround` | Add spaces around operators and keywords |\n| `NeedBraces` | Add `{}` to single-statement `if`\u002F`for`\u002F`while` |\n| `FileTabCharacter` | Replace tabs with 4 spaces |\n| `NewlineAtEndOfFile` | Ensure file ends with `\\n` |\n\n### PMD (Java\u002FGroovy - opt-in)\n\nEnable PMD in each clean module's `build.gradle` with `grailsCodeAnalysis { enablePmd() }`. Use `-Pgrails.code-analysis.enabled.pmd.projects=:project-a,:project-b` to also enable selected project paths for a baseline run. Use `-Pgrails.code-analysis.enabled.pmd=true` or `=false` to switch PMD on or off for every project; when set, it wins over both the module opt-ins and the `.projects` list. PMD excludes sources under each project's configured build directory.\n\n`enablePmd()` configures PMD immediately, so customize the `pmd*` tasks directly after it, for example `tasks.named('pmdMain') { ... }`.\n\nRule file: `build\u002Fcode-analysis\u002Fpmd\u002Fpmd.xml`.\n\n### SpotBugs (Java bytecode - opt-in)\n\nEnable SpotBugs in each clean module's `build.gradle` with `grailsCodeAnalysis { enableSpotbugs() }`. Use `-Pgrails.code-analysis.enabled.spotbugs.projects=:project-a,:project-b` to also enable selected project paths for a baseline run. Use `-Pgrails.code-analysis.enabled.spotbugs=true` or `=false` to switch SpotBugs on or off for every project; when set, it wins over both the module opt-ins and the `.projects` list.\n\n`enableSpotbugs()` configures SpotBugs immediately, so customize the `spotbugs*` tasks directly after it, for example `tasks.named('spotbugsMain') { ... }`.\n\nRuns at `Effort.MAX` \u002F `Confidence.HIGH`. Only high-confidence bugs are reported.\n\n### Spotless (Java auto-formatting - opt-in)\n\nEnable: `-Pgrails.code-style.enabled.spotless=true`\n\nUses Palantir Java Format. Can auto-fix by running:\n```bash\n.\u002Fgradlew spotlessApply\n```\n\n---\n\n## Configuration Properties\n\nAll properties can be set in `gradle.properties` or passed as `-P` flags:\n\n### `grails-code-style` plugin (Checkstyle + CodeNarc)\n\n| Property | Default | Description |\n|----------|---------|-------------|\n| `grails.code-style.enabled.checkstyle` | `true` | Enable Checkstyle |\n| `grails.code-style.enabled.codenarc` | `true` | Enable CodeNarc |\n| `grails.code-style.enabled.spotless` | `false` | Enable Spotless |\n| `grails.code-style.enabled.tests` | `false` | Also check test source sets |\n| `grails.code-style.ignoreFailures` | `false` | Collect reports without failing build |\n| `grails.code-style.codenarc.fix` | `false` | Run `codenarcFix` before CodeNarc tasks |\n| `grails.codestyle.dir.checkstyle` | (auto) | Custom path to Checkstyle config dir |\n| `grails.codestyle.dir.codenarc` | (auto) | Custom path to CodeNarc config dir |\n| `skipCodeStyle` | unset | If present, every static check is skipped: CodeNarc and Checkstyle, and PMD and SpotBugs as well. The aggregate reports say the tools were skipped |\n\n### `grails-code-analysis` plugin (PMD + SpotBugs)\n\nEnable PMD and SpotBugs primarily in each module's `build.gradle`:\n\n```groovy\ngrailsCodeAnalysis {\n    enablePmd()\n    enableSpotbugs()\n}\n```\n\nThe Gradle properties below are all-project or selected-project overrides for baseline runs.\n\n| Property | Default | Description |\n|----------|---------|-------------|\n| `grails.code-analysis.enabled.pmd` | unset | When set, `true` or `false` overrides PMD for every project, including `enablePmd()` opt-ins and the `.projects` list |\n| `grails.code-analysis.enabled.pmd.projects` | unset | Also enable PMD for comma-separated project paths, unless the all-project property is set |\n| `grails.code-analysis.enabled.spotbugs` | unset | When set, `true` or `false` overrides SpotBugs for every project, including `enableSpotbugs()` opt-ins and the `.projects` list |\n| `grails.code-analysis.enabled.spotbugs.projects` | unset | Also enable SpotBugs for comma-separated project paths, unless the all-project property is set |\n| `grails.code-analysis.enabled.tests` | `false` | Also analyse test source sets |\n| `grails.code-analysis.ignoreFailures` | `false` | Collect ordinary findings without failing the build; missing expected XML always fails |\n| `grails.code-analysis.dir.pmd` | (auto) | Custom path to PMD config dir |\n| `skipCodeAnalysis` | unset | If present, PMD and SpotBugs are skipped while CodeNarc and Checkstyle still run. `skipCodeStyle` also skips them |\n\n---\n\n## Fixing Violations Workflow\n\n1. Run `.\u002Fgradlew aggregateViolations -Pgrails.code-style.ignoreFailures=true -Pgrails.code-analysis.ignoreFailures=true`\n2. Open `build\u002Freports\u002Fviolations\u002FCODENARC_VIOLATIONS.md` and `build\u002Freports\u002Fviolations\u002FCHECKSTYLE_VIOLATIONS.md` to see all issues by module\n3. For CodeNarc, run `.\u002Fgradlew codenarcFix` to auto-fix what it can\n4. Fix remaining violations manually using the table above\n5. Re-run `.\u002Fgradlew aggregateViolations` and confirm files contain `No violations found! ?`\n6. The reports are inside `build\u002F` and do not need to be deleted before committing\n\n---\n\n## Reports Directory Structure\n\nAll XML reports are consolidated at:\n```\nbuild\u002Freports\u002Fcode-style\u002F        ← XML inputs for style aggregation\n├── checkstyle\u002F\n│   ├── \u003Chex-project-path>-checkstyleMain.xml\n│   ├── \u003Chex-project-path>-checkstyleCli.xml\n│   └── ...\n└── codenarc\u002F\n    ├── \u003Chex-project-path>-codenarcMain.xml\n    └── ...\n\nbuild\u002Freports\u002Fcode-analysis\u002F     ← XML inputs for analysis aggregation (if enabled)\n├── pmd\u002F\n└── spotbugs\u002F\n\nbuild\u002Freports\u002Fviolations\u002F       ← Markdown summaries written by aggregateViolations\n├── CODENARC_VIOLATIONS.md\n├── CHECKSTYLE_VIOLATIONS.md\n├── PMD_VIOLATIONS.md\n├── SPOTBUGS_VIOLATIONS.md\n├── REPOSITORY_CONVENTIONS.md\n└── JACOCO_COVERAGE.md          ← written by aggregateJacocoCoverage\n```\n\nThe filename prefix is the UTF-8 hexadecimal encoding of the full Gradle project path. Aggregation decodes it back to paths such as `:grails-core`, preventing nested projects with the same leaf name from colliding.\n","\u003C!--\nSPDX-License-Identifier: Apache-2.0\n\nLicensed to the Apache Software Foundation (ASF) under one or more contributor license agreements; and to You under the Apache License, Version 2.0. \n-->\n\n## What I Do\n\n- Explain how `GrailsCodeStylePlugin`, `GrailsCodeAnalysisPlugin`, and `GrailsViolationAggregationPlugin` enforce code quality across all 60+ modules.\n- Guide you through running style and analysis checks, interpreting the per-tool Markdown violation reports, and fixing each class of violation.\n- Describe which tools are always-on vs. opt-in, how to configure them via Gradle properties, and which violations can be auto-fixed.\n\n## When to Use Me\n\nActivate this skill when:\n\n- Running `.\u002Fgradlew aggregateViolations` and interpreting the resulting `*_VIOLATIONS.md` files.\n- Fixing CodeNarc, Checkstyle, PMD, SpotBugs, or Spotless violations reported in those files.\n- Configuring code style or analysis tools across the repo (enabling\u002Fdisabling tools or adjusting rule files).\n- Preparing a commit - the plugin output must be clean before merging.\n\n---\n\n## Plugin Overview\n\n| Plugin | Applied to | Responsibility |\n|--------|-----------|----------------|\n| `org.apache.grails.gradle.grails-code-style` | Every subproject | Applies Checkstyle, CodeNarc, and code analysis; registers per-project `codeStyle` task; redirects XML reports to root `build\u002Freports\u002Fcode-style\u002F` |\n| `org.apache.grails.gradle.grails-code-analysis` | Every subproject | Applies PMD and SpotBugs (both opt-in); registers per-project `codeAnalysis` task; redirects XML reports to root `build\u002Freports\u002Fcode-analysis\u002F` |\n| `org.apache.grails.gradle.grails-jacoco` | Every subproject | Applies JaCoCo; wires `jacocoTestReport` to run after each `test` task |\n| `org.apache.grails.gradle.grails-violation-aggregation` | **Root project only** | Registers `aggregateViolations` and `aggregateJacocoCoverage` tasks; writes Markdown summaries to `build\u002Freports\u002Fviolations\u002F` |\n\n---\n\n## Key Tasks\n\n| Task | Scope | Description |\n|------|-------|-------------|\n| `.\u002Fgradlew codeStyle` | per-project | Runs Checkstyle and CodeNarc for that project |\n| `.\u002Fgradlew codeAnalysis` | per-project | Runs PMD and\u002For SpotBugs for that project (when enabled) |\n| `.\u002Fgradlew aggregateViolations` | root | Runs all checks across every module, then writes `*_VIOLATIONS.md` to `build\u002Freports\u002Fviolations\u002F` |\n| `.\u002Fgradlew validateRepositoryConventions` | root | Validates canonical skill metadata, AGENTS paths, GitHub Action pins, and message keys. RAT provenance is the separate `rat` task, which `aggregateViolations` runs |\n| `.\u002Fgradlew cleanViolationReports` | root | Deletes analyzer XML reports, their markers, and the aggregate Markdown so the next aggregate run re-analyzes every module. The root `clean` runs it |\n| `.\u002Fgradlew aggregateJacocoCoverage` | root | Runs JaCoCo reports across every module, then writes `JACOCO_COVERAGE.md` to `build\u002Freports\u002Fviolations\u002F` |\n| `.\u002Fgradlew codenarcFix` | per-project | Auto-fixes a subset of CodeNarc violations |\n\n### Quick commands\n\n```bash\n# Check a single module (style only)\n.\u002Fgradlew :grails-core:codeStyle\n\n# Check a single module (analysis - enable through the module extension or an override)\n.\u002Fgradlew :grails-core:codeAnalysis -Pgrails.code-analysis.enabled.pmd=true\n\n# Full multi-module check + report (use --continue so the reports are written even when an analyzer fails)\n.\u002Fgradlew aggregateViolations --continue\n\n# Force every module to be re-analyzed instead of reusing UP-TO-DATE analyzer results\n.\u002Fgradlew cleanViolationReports aggregateViolations --continue\n\n# Repository conventions only\n.\u002Fgradlew validateRepositoryConventions\n\n# Include test sources in style checks\n.\u002Fgradlew aggregateViolations -Pgrails.code-style.enabled.tests=true\n\n# Include test sources in analysis\n.\u002Fgradlew aggregateViolations -Pgrails.code-analysis.enabled.tests=true\n\n# Ignore failures (collect reports without failing the build)\n.\u002Fgradlew aggregateViolations -Pgrails.code-style.ignoreFailures=true -Pgrails.code-analysis.ignoreFailures=true\n\n# Auto-fix some CodeNarc violations before running checks\n.\u002Fgradlew codenarcFix codeStyle\n\n# JaCoCo coverage report\n.\u002Fgradlew aggregateJacocoCoverage\n```\n\n---\n\n## Output Files\n\nAfter running `aggregateViolations`, these files appear under `build\u002Freports\u002Fviolations\u002F` in the **root project build directory**:\n\n| File | Tool | Always generated |\n|------|------|-----------------|\n| `build\u002Freports\u002Fviolations\u002FCODENARC_VIOLATIONS.md` | CodeNarc | Yes |\n| `build\u002Freports\u002Fviolations\u002FCHECKSTYLE_VIOLATIONS.md` | Checkstyle | Yes |\n| `build\u002Freports\u002Fviolations\u002FPMD_VIOLATIONS.md` | PMD | Yes - reports `PMD is disabled.` when PMD is disabled |\n| `build\u002Freports\u002Fviolations\u002FSPOTBUGS_VIOLATIONS.md` | SpotBugs | Yes - reports `SpotBugs is disabled.` when SpotBugs is disabled |\n| `build\u002Freports\u002Fviolations\u002FREPOSITORY_CONVENTIONS.md` | Repository conventions | Yes - lists skill, Action, or message-key failures. Ordered after `rat` in the `aggregateViolations` lane |\n\nAfter running `aggregateJacocoCoverage`:\n\n| File | Tool | Generated |\n|------|------|-----------|\n| `build\u002Freports\u002Fviolations\u002FJACOCO_COVERAGE.md` | JaCoCo | Only when at least one subproject has a JaCoCo CSV report |\n\nAll reports are inside `build\u002F` and are excluded from version control via `.gitignore`. A clean run produces `No violations found! ?` in each style file. **The build must be clean before committing.**\n\nEach aggregated style or analysis report begins with `Modules analyzed:`, which names only modules that contributed data. Each file is a Markdown table grouped by module, with columns: **Class**, **Tool**, **Violation**, **Line**, **Message**.\n\nOnly the aggregate lane (`aggregateViolations`, `aggregateStyleViolations`, `aggregateAnalysisViolations`) writes these Markdown files. Running an analyzer task directly, such as `.\u002Fgradlew :grails-core:checkstyleMain`, produces only that task's own XML report and deliberately leaves the aggregate Markdown untouched, so a partial run can never overwrite an authoritative full-repository report. Because the writer is part of that lane rather than a per-task finalizer, pass `--continue` when you expect violations, otherwise the failing analyzer stops the build before the report explaining the failure is written. Analyzers for unchanged modules stay UP-TO-DATE between aggregate runs and their previous results are aggregated; run `cleanViolationReports` (or the root `clean`) first to force a full re-analysis.\n\n## Repository Conventions\n\nRun `.\u002Fgradlew validateRepositoryConventions` to write `build\u002Freports\u002Fviolations\u002FREPOSITORY_CONVENTIONS.md`. Fix the reported source rather than suppressing the validation.\n\n| Finding | Fix |\n|---------|-----|\n| Skill | Start `SKILL.md` with YAML front matter, supply string `name`, `description`, and `license` values, use a valid directory name that matches `name`, and keep names unique. Every skill path that `AGENTS.md` references must exist, but `AGENTS.md` is not required to index every skill. |\n| GitHub Action | Pin third-party references to one lowercase 40-hex immutable reference for that action across workflows and repository-local `action.yml` or `action.yaml` manifests. A 40-hex value may be a commit or annotated-tag object SHA. `actions\u002F*` must use the full tag of a release (`vX.Y.Z`) and `apache\u002F*` a version or branch reference, never a 40-hex SHA, and local `.\u002F...` uses are permitted. Pin Docker `uses`, Docker action `runs.image`, and workflow job\u002Fservice container images to literal immutable `name@sha256:\u003Cdigest>` values. |\n| Message key | Remove or rename the duplicate logical key in the reported `grails-app\u002Fi18n\u002F**\u002F*.properties` file, preserving escaped separators and continuation semantics. |\n\n---\n\n## Tool Details\n\n### CodeNarc (Groovy - always enabled)\n\nRule file: `build\u002Fcode-style\u002Fcodenarc\u002Fcodenarc.groovy` (generated by the plugin during setup; not intended to be edited directly).\n\nMost common violations and how to fix them:\n\n| Rule | Fix |\n|------|-----|\n| `UnnecessaryGString` | Replace `\"plain string\"` with `'plain string'` |\n| `UnnecessarySemicolon` | Remove trailing `;` |\n| `SpaceBeforeOpeningBrace` | Add space before `{` → `method() {` |\n| `SpaceAroundMapEntryColon` | `[key: value]` not `[key:value]` |\n| `ConsecutiveBlankLines` | Collapse 3+ blank lines to 2 |\n| `ClassStartsWithBlankLine` | Remove blank line right after `class Foo {` |\n| `NoWildcardImports` | Expand `import org.foo.*` to explicit imports |\n| `UnusedImport` | Remove imports not referenced in the file |\n| `MethodName` | Method names must be camelCase (not `snake_case`) |\n| `VariableName` | Variable names must be camelCase |\n| `LineLength` | Keep lines ≤ 200 chars (default) |\n\nAuto-fixable via `codenarcFix`: `ClassStartsWithBlankLine`, `SpaceAroundMapEntryColon`, `UnnecessaryGString`, `UnnecessarySemicolon`, `SpaceBeforeOpeningBrace`, `ConsecutiveBlankLines`.\n\n### Checkstyle (Java - always enabled)\n\nRule file: `build\u002Fcode-style\u002Fcheckstyle\u002Fcheckstyle.xml`.\n\nCommon violations:\n\n| Rule | Fix |\n|------|-----|\n| `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 |\n| `AvoidStarImport` | Use explicit class imports |\n| `UnusedImports` | Remove unused imports |\n| `WhitespaceAround` | Add spaces around operators and keywords |\n| `NeedBraces` | Add `{}` to single-statement `if`\u002F`for`\u002F`while` |\n| `FileTabCharacter` | Replace tabs with 4 spaces |\n| `NewlineAtEndOfFile` | Ensure file ends with `\\n` |\n\n### PMD (Java\u002FGroovy - opt-in)\n\nEnable PMD in each clean module's `build.gradle` with `grailsCodeAnalysis { enablePmd() }`. Use `-Pgrails.code-analysis.enabled.pmd.projects=:project-a,:project-b` to also enable selected project paths for a baseline run. Use `-Pgrails.code-analysis.enabled.pmd=true` or `=false` to switch PMD on or off for every project; when set, it wins over both the module opt-ins and the `.projects` list. PMD excludes sources under each project's configured build directory.\n\n`enablePmd()` configures PMD immediately, so customize the `pmd*` tasks directly after it, for example `tasks.named('pmdMain') { ... }`.\n\nRule file: `build\u002Fcode-analysis\u002Fpmd\u002Fpmd.xml`.\n\n### SpotBugs (Java bytecode - opt-in)\n\nEnable SpotBugs in each clean module's `build.gradle` with `grailsCodeAnalysis { enableSpotbugs() }`. Use `-Pgrails.code-analysis.enabled.spotbugs.projects=:project-a,:project-b` to also enable selected project paths for a baseline run. Use `-Pgrails.code-analysis.enabled.spotbugs=true` or `=false` to switch SpotBugs on or off for every project; when set, it wins over both the module opt-ins and the `.projects` list.\n\n`enableSpotbugs()` configures SpotBugs immediately, so customize the `spotbugs*` tasks directly after it, for example `tasks.named('spotbugsMain') { ... }`.\n\nRuns at `Effort.MAX` \u002F `Confidence.HIGH`. Only high-confidence bugs are reported.\n\n### Spotless (Java auto-formatting - opt-in)\n\nEnable: `-Pgrails.code-style.enabled.spotless=true`\n\nUses Palantir Java Format. Can auto-fix by running:\n```bash\n.\u002Fgradlew spotlessApply\n```\n\n---\n\n## Configuration Properties\n\nAll properties can be set in `gradle.properties` or passed as `-P` flags:\n\n### `grails-code-style` plugin (Checkstyle + CodeNarc)\n\n| Property | Default | Description |\n|----------|---------|-------------|\n| `grails.code-style.enabled.checkstyle` | `true` | Enable Checkstyle |\n| `grails.code-style.enabled.codenarc` | `true` | Enable CodeNarc |\n| `grails.code-style.enabled.spotless` | `false` | Enable Spotless |\n| `grails.code-style.enabled.tests` | `false` | Also check test source sets |\n| `grails.code-style.ignoreFailures` | `false` | Collect reports without failing build |\n| `grails.code-style.codenarc.fix` | `false` | Run `codenarcFix` before CodeNarc tasks |\n| `grails.codestyle.dir.checkstyle` | (auto) | Custom path to Checkstyle config dir |\n| `grails.codestyle.dir.codenarc` | (auto) | Custom path to CodeNarc config dir |\n| `skipCodeStyle` | unset | If present, every static check is skipped: CodeNarc and Checkstyle, and PMD and SpotBugs as well. The aggregate reports say the tools were skipped |\n\n### `grails-code-analysis` plugin (PMD + SpotBugs)\n\nEnable PMD and SpotBugs primarily in each module's `build.gradle`:\n\n```groovy\ngrailsCodeAnalysis {\n    enablePmd()\n    enableSpotbugs()\n}\n```\n\nThe Gradle properties below are all-project or selected-project overrides for baseline runs.\n\n| Property | Default | Description |\n|----------|---------|-------------|\n| `grails.code-analysis.enabled.pmd` | unset | When set, `true` or `false` overrides PMD for every project, including `enablePmd()` opt-ins and the `.projects` list |\n| `grails.code-analysis.enabled.pmd.projects` | unset | Also enable PMD for comma-separated project paths, unless the all-project property is set |\n| `grails.code-analysis.enabled.spotbugs` | unset | When set, `true` or `false` overrides SpotBugs for every project, including `enableSpotbugs()` opt-ins and the `.projects` list |\n| `grails.code-analysis.enabled.spotbugs.projects` | unset | Also enable SpotBugs for comma-separated project paths, unless the all-project property is set |\n| `grails.code-analysis.enabled.tests` | `false` | Also analyse test source sets |\n| `grails.code-analysis.ignoreFailures` | `false` | Collect ordinary findings without failing the build; missing expected XML always fails |\n| `grails.code-analysis.dir.pmd` | (auto) | Custom path to PMD config dir |\n| `skipCodeAnalysis` | unset | If present, PMD and SpotBugs are skipped while CodeNarc and Checkstyle still run. `skipCodeStyle` also skips them |\n\n---\n\n## Fixing Violations Workflow\n\n1. Run `.\u002Fgradlew aggregateViolations -Pgrails.code-style.ignoreFailures=true -Pgrails.code-analysis.ignoreFailures=true`\n2. Open `build\u002Freports\u002Fviolations\u002FCODENARC_VIOLATIONS.md` and `build\u002Freports\u002Fviolations\u002FCHECKSTYLE_VIOLATIONS.md` to see all issues by module\n3. For CodeNarc, run `.\u002Fgradlew codenarcFix` to auto-fix what it can\n4. Fix remaining violations manually using the table above\n5. Re-run `.\u002Fgradlew aggregateViolations` and confirm files contain `No violations found! ?`\n6. The reports are inside `build\u002F` and do not need to be deleted before committing\n\n---\n\n## Reports Directory Structure\n\nAll XML reports are consolidated at:\n```\nbuild\u002Freports\u002Fcode-style\u002F        ← XML inputs for style aggregation\n├── checkstyle\u002F\n│   ├── \u003Chex-project-path>-checkstyleMain.xml\n│   ├── \u003Chex-project-path>-checkstyleCli.xml\n│   └── ...\n└── codenarc\u002F\n    ├── \u003Chex-project-path>-codenarcMain.xml\n    └── ...\n\nbuild\u002Freports\u002Fcode-analysis\u002F     ← XML inputs for analysis aggregation (if enabled)\n├── pmd\u002F\n└── spotbugs\u002F\n\nbuild\u002Freports\u002Fviolations\u002F       ← Markdown summaries written by aggregateViolations\n├── CODENARC_VIOLATIONS.md\n├── CHECKSTYLE_VIOLATIONS.md\n├── PMD_VIOLATIONS.md\n├── SPOTBUGS_VIOLATIONS.md\n├── REPOSITORY_CONVENTIONS.md\n└── JACOCO_COVERAGE.md          ← written by aggregateJacocoCoverage\n```\n\nThe filename prefix is the UTF-8 hexadecimal encoding of the full Gradle project path. Aggregation decodes it back to paths such as `:grails-core`, preventing nested projects with the same leaf name from colliding.\n",{"name":5,"license":16,"description":7},"8.0.x","8803d54c23f742d11efb3e01eeee86489bb4ba95",".agents\u002Fskills\u002Fviolation-fixer",979,"https:\u002F\u002Fgithub.com\u002Fapache\u002Fgrails-core","https:\u002F\u002Fgrails.apache.org\u002F","https:\u002F\u002Fgithub.com\u002Fapache","https:\u002F\u002Fwww.apache.org\u002F","2026-11-15 03:12:29",{"source":9,"skillName":5,"commands":60,"prompt":70,"zipAvailable":71},[61,64,67],{"tool":62,"command":63},"npx","npx skills add apache\u002Fgrails-core --skill violation-fixer",{"tool":65,"command":66},"bunx","bunx skills add apache\u002Fgrails-core --skill violation-fixer",{"tool":68,"command":69},"pnpm","pnpm dlx skills add apache\u002Fgrails-core --skill violation-fixer","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fapache\u002Fgrails-core\u002Fblob\u002F8.0.x\u002F.agents\u002Fskills\u002Fviolation-fixer\u002FSKILL.md",true,[73,79],{"path":74,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":77,"sourceHtmlUrl":78},"agents\u002Fopenai.yaml","REFERENCE","参考文档",137,"https:\u002F\u002Fgithub.com\u002Fbnferguson\u002Fdotfiles\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fask-matt\u002Fagents\u002Fopenai.yaml",{"path":80,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":81,"sourceHtmlUrl":82},"PHASE-BOUNDARIES.md",4249,"https:\u002F\u002Fgithub.com\u002Fbnferguson\u002Fdotfiles\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fask-matt\u002FPHASE-BOUNDARIES.md",[84,90,96,102,108,114],{"skillNo":85,"name":5,"nameZh":17,"description":17,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":89},"01M7B5APRW1EKGNHWGDMK15JE5","https:\u002F\u002Fgithub.com\u002Fapache\u002Fgrails-core\u002Fblob\u002F8.0.x\u002F.claude\u002Fskills\u002Fviolation-fixer\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":91,"name":92,"nameZh":17,"description":17,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":89},"01M7B5AMFA8A8560CGDCFHW3SK","test-fixer","https:\u002F\u002Fgithub.com\u002Fapache\u002Fgrails-core\u002Fblob\u002F8.0.x\u002F.claude\u002Fskills\u002Ftest-fixer\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":17,"description":17,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":89},"01M7B5AKHFJW84NSXM8BZBAA9C","mono-repo-integration","https:\u002F\u002Fgithub.com\u002Fapache\u002Fgrails-core\u002Fblob\u002F8.0.x\u002F.claude\u002Fskills\u002Fmono-repo-integration\u002FSKILL.md",[],[],{"skillNo":103,"name":104,"nameZh":17,"description":17,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":89},"01M7B5AJHPW5ADFJNKM5KVFKSE","hibernate-developer","https:\u002F\u002Fgithub.com\u002Fapache\u002Fgrails-core\u002Fblob\u002F8.0.x\u002F.claude\u002Fskills\u002Fhibernate-developer\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":17,"description":17,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":89},"01M7B5AHGRTVSKFD4M3KMHWZRZ","grails-8-upgrade","https:\u002F\u002Fgithub.com\u002Fapache\u002Fgrails-core\u002Fblob\u002F8.0.x\u002F.claude\u002Fskills\u002Fgrails-8-upgrade\u002FSKILL.md",[],[],{"skillNo":115,"name":116,"nameZh":17,"description":17,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":89},"01M7B5AG2FWXSXCK1ESCBWB2X9","gradle-developer","https:\u002F\u002Fgithub.com\u002Fapache\u002Fgrails-core\u002Fblob\u002F8.0.x\u002F.claude\u002Fskills\u002Fgradle-developer\u002FSKILL.md",[],[]]