Setup Java Gitignore

This documentation was generated with the assistance of AI. Please report any inaccuracies.

Create or update the root .gitignore for a JVM project (Java or Kotlin, Maven or Gradle, plain, Spring Boot or Quarkus), using this repository’s own .gitignore as the concrete reference template — never overwriting an existing file without showing the user exactly what would change and getting an explicit Update / Keep / Replace decision first.

Purpose

iru-setup-java-gitignore composes a JVM-appropriate .gitignore: a universal base (compiled classes, logs, packaged artifacts, JVM crash logs) plus conditionally-detected sections for the actual build tool (Maven target/ or Gradle build//.gradle/, with the wrapper jar kept tracked and source packages named build or target protected), Kotlin compiler caches (.kotlin/), Quarkus leftovers (.quarkus/, quarkus.log*, a stray jacoco.exec), the .integration-test.lock/ directory used to serialize container-backed test runs, IDE files (IntelliJ, VS Code, Eclipse), a generated build-info properties file if a Groovy/Maven plugin writes one, and Antora documentation build output. It never invents entries for things that aren’t actually present in the target repository. The skill announces whether it is creating .gitignore from scratch or updating an existing one. If .gitignore already exists, it is treated as sensitive: the skill reads it, warns, merges rather than duplicates, shows the user a diff, and asks whether to Update (merge, keeping hand-added entries), Keep it as is, or Replace it with the pure template (hand-added entries lost) — unless on-existing already decides.

Purpose group

Plugin

Shipped by the iru-java plugin of the ai-catalog marketplace (install with /plugin install iru-java@ai-catalog; see Plugins).

Invocation

/iru-setup-java-gitignore

Optionally with an args block carrying on-existing for scripted runs.

Inputs

Argument Required Description Default

on-existing (args)

No

ask, keep, update, or replace: how to treat an already-existing .gitignore without asking. The existing-file warning is still printed (and, for update/replace, the diff). It is the only key read; any other key an orchestrator passes (e.g. mode, open-source) is ignored.

ask

(everything else)

No

The skill derives everything else it needs by exploring the target repository directly (presence of pom.xml/build.gradle*, Kotlin sources, io.quarkus or Testcontainers usage, .idea//.vscode/Eclipse files, a build-info-writing plugin step, and docs/antora-playbook.yml).

Not applicable.

Outputs

  • A .gitignore file at the repository root — newly created, updated, or replaced, or left untouched when Keep is chosen.

  • If .gitignore didn’t previously exist: it is written directly, no approval step needed.

  • If .gitignore already existed: a diff of the proposed content is shown first, and the user chooses Update (write the merged draft), Keep as is (no change), or Replace (write the pure-template version), unless on-existing decides.

  • A closing report stating whether the file was created, updated, replaced, or kept as is (and whether that came from the user or on-existing), which conditional sections (build tool, Kotlin, Quarkus, integration-test lock, IDE, build-info file, Antora build output) were included versus skipped and why, the hand-added lines dropped by Replace, and the template entries still missing after Keep.

Execution flow

flowchart TD A[Start /iru-setup-java-gitignore] --> A0["Step 0: Parse args\n(on-existing only)"] A0 --> B{".gitignore already\nexists at root?"} B -- no --> B1["Announce: creating from scratch"] B -- yes --> D["Announce: updating existing;\nread existing content; warn"] B1 --> C D --> C["Compose universal base template\n(classes, logs, jars, crash logs)"] C --> E["Detect project-specific additions:\nMaven/Gradle output dir, Kotlin, Quarkus,\nintegration-test lock, IDE files,\nbuild-info file, Antora build output"] E --> F["Compose proposed content\n(merge with existing lines if any)"] F --> G{"Did .gitignore\nalready exist?"} G -- no --> H["Write .gitignore directly"] G -- yes --> I["Show diff; on-existing decides,\nelse ask: Update / Keep as is / Replace"] I -- update --> H I -- replace --> H2["Write pure-template version"] I -- keep --> J["Leave existing .gitignore untouched"] H --> K["Report: created / updated /\nreplaced / kept as is"] H2 --> K J --> K

Dependencies

Invokes

None — iru-setup-java-gitignore is a leaf skill; it does not call any other skill in this catalog.

Invoked by

  • Setup Java Library Repository — Step 5 runs iru-setup-java-gitignore after iru-setup-java-library and iru-setup-antora have run, so it can detect their generated files (the Maven pom.xml/source layout and the Antora docs build output) already in place. It’s invoked with no args (or only on-existing, when the orchestrator received it) — it derives everything else by exploring the repository directly. For an existing .gitignore it asks Update / Keep / Replace itself.

  • Setup Java Spring Boot — Step 9, root .gitignore.

  • Setup Quarkus Repository — Step 5, root .gitignore, via the iru-isolated-skill-executor agent.

None — this skill does not delegate any part of its work to a built-in agent.

Source

SKILL.md on GitHub — the file this page was generated from.