agentleFS
SrltasSrltas/claude-skills/java-format/SKILL.md

java-format

Skill0 starsChanged 12 days agoMITView on GitHub

Format Java files in place with google-java-format (AOSP style): the changed, staged, or all files, or given paths. Asks which formatter version to use. Use before committing Java changes. Triggers on phrases like '포맷 확인해줘', 'google-java-format 적용', '자바 포맷 맞춰줘'.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Ask the user which google-java-format version to use (commonly 1.7 or 1.32.0) unless they already said it.

    line 15

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Apply google-java-format

Format Java files with google-java-format in AOSP style, replaced in place (-a -r). Handles the four scopes: changed, staged, all, or explicit paths.

Step 1: Pick the version

Ask the user which google-java-format version to use (commonly 1.7 or 1.32.0) unless they already said it. Projects pin different versions to match their CI, so do not assume a default.

Step 2: Run

bash ${CLAUDE_SKILL_DIR}/assets/format.sh --version <ver> <changed|staged|all|FILE...>
  • changed: working-tree changes (git diff --diff-filter=ACM -- '*.java')
  • staged: staged files (git diff --cached …)
  • all: every *.java under the current directory
  • or one or more file / directory paths

The helper resolves the jar in this order (no hardcoded personal path): GJF_JAR (explicit jar path) → $GJF_DIR/google-java-format-<ver>-all-deps.jar if GJF_DIR is set (point it at your local jar folder, e.g. export GJF_DIR="$HOME/Driver/google-java-format") → the cache ~/.cache/claude-skills/google-java-format/ → otherwise auto-download that version from GitHub releases into the cache. Needs java on PATH (and curl only if it has to download).

Step 3: Report

Say how many files were formatted. This edits files in place, so suggest reviewing git diff before staging. For the all scope on a large tree, confirm the scope with the user first (it can touch many files).

Notes: style is AOSP (4-space) via -a, matching your convention. To format a specific file, pass its path instead of a scope word.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.