Agent Skillsopen-metadata/OpenMetadata › java-checkstyle

java-checkstyle

GitHub

用于修复Java代码格式和Checkstyle违规。在修改.java文件后、CI报错或用户请求时,执行mvn spotless:apply自动格式化,检查差异并提示提交,确保符合OpenMetadata项目的编码规范。

.agents/skills/java-checkstyle/SKILL.md open-metadata/OpenMetadata

Trigger Scenarios

用户请求修复checkstyle或格式化Java代码 CI报告Java checkstyle失败 完成或编辑.java文件后

Install

npx skills add open-metadata/OpenMetadata --skill java-checkstyle -g -y
More Options

Non-standard path

npx skills add https://github.com/open-metadata/OpenMetadata/tree/main/.agents/skills/java-checkstyle -g -y

Use without installing

npx skills use open-metadata/OpenMetadata@java-checkstyle

指定 Agent (Claude Code)

npx skills add open-metadata/OpenMetadata --skill java-checkstyle -a claude-code -g -y

安装 repo 全部 skill

npx skills add open-metadata/OpenMetadata --all -g -y

预览 repo 内 skill

npx skills add open-metadata/OpenMetadata --list

SKILL.md

Frontmatter
{
    "name": "java-checkstyle",
    "description": "Run `mvn spotless:apply` to fix Java checkstyle \/ formatting failures and verify the result. Run after authoring or modifying any `.java` files, or when CI reports a \"Java checkstyle failed\" \/ \"Fix Java checkstyle\" issue on a PR."
}

Java Checkstyle / Spotless (Codex agent)

OpenMetadata enforces Java formatting via the Spotless Maven plugin. Every CI build runs mvn spotless:check and fails the PR if any file is not formatted.

When to activate

  • The user asks to "fix checkstyle", "fix Java formatting", "apply spotless", "run spotless", "format Java", or similar.
  • CI posts a Java checkstyle failed / Fix Java checkstyle comment on a PR (the bot's exact phrasing is "Please run mvn spotless:apply in the root of your repository and commit the changes to this PR").
  • After you have finished authoring or editing any .java files — before opening a PR or pushing a commit that touches Java.

Procedure

  1. From the repo root run Spotless:

    mvn spotless:apply                 # formats everything
    # or
    mvn -pl <module> spotless:apply    # scope to a single Maven module for speed
    # or
    mvn spotless:check                 # verify only, without rewriting files
    

    Spotless is fast (seconds, no compilation). If it fails with a plugin error rather than a formatting diff, surface the error and stop — do not try to hand-edit formatting around the failure.

  2. Inspect the diff:

    git status --short
    git diff --stat
    

    Expect changes only in .java (and possibly pom.xml) files. If Spotless keeps rewriting a change you just made, re-read the root pom.xml's spotless-maven-plugin config — Spotless is the source of truth, not the IDE.

  3. Only commit if the user asked to. Report the changed-file list first so the user can decide whether to fold the reformat into the in-progress commit or make a separate "Fix Java checkstyle" commit (matches the repo's existing history for bot-triggered formatting-only commits).

Out of scope

  • UI / TypeScript formatting — use yarn pretty / ESLint flow (see AGENTS.md UI section).
  • Python formatting — use make py_format (black + isort + pycln).

Version History

  • a1e7b7a Current 2026-07-24 20:48

Same Skill Collection

.agents/skills/ui-checkstyle/SKILL.md
.claude/skills/java-checkstyle/SKILL.md
.claude/skills/playwright-validation/SKILL.md
.claude/skills/playwright/SKILL.md
.claude/skills/writing-playwright-tests/SKILL.md
skills/code-review/SKILL.md
skills/connector-audit/SKILL.md
skills/connector-building/SKILL.md
skills/connector-review/SKILL.md
skills/connector-standards/SKILL.md
skills/dev-setup/SKILL.md
skills/java-checkstyle/SKILL.md
skills/openmetadata-workflow/SKILL.md
skills/planning/SKILL.md
skills/playwright-validation/SKILL.md
skills/playwright/SKILL.md
skills/pr-checklist/SKILL.md
skills/systematic-debugging/SKILL.md
skills/tdd/SKILL.md
skills/test-enforcement/SKILL.md
skills/test-locally/SKILL.md
skills/ui-checkstyle/SKILL.md
skills/verification/SKILL.md
skills/writing-playwright-tests/SKILL.md
.claude/skills/ui-checkstyle/SKILL.md
.claude/skills/ui-core-components/SKILL.md
skills/ui-core-components/SKILL.md

Metadata

Files
0
Version
a1e7b7a
Hash
f6e4f41b
Indexed
2026-07-24 20:48

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 07:50
浙ICP备14020137号-1 $Гость$