Setup Go Gitignore
| This documentation was generated with the assistance of AI. Please report any inaccuracies. |
Create or refresh the root .gitignore of a Go module — typically a command-line tool scaffolded by
Setup Go CLI. The template is a trimmed, house-style version of GitHub’s Go.gitignore
extended with what this catalog’s scaffold, gates and release tooling write. It never overwrites an existing
.gitignore without showing a diff and getting approval.
Purpose
iru-setup-go-gitignore ignores the binaries go build leaves at the repository root (root-anchored, so
cmd/<bin>/ stays tracked), test binaries and profiles, coverage output (coverage.out, *.coverprofile,
/covdata/), the /build/ report and docs-generator directory, GoReleaser’s /dist/, per-developer
go.work/go.work.sum, env files (keeping .env.example), editor/OS files and the repository-wide
.integration-test.lock/. /vendor/ is ignored only when dependencies are not vendored (detected, or asked);
go.work is left alone when the repository tracks a deliberate workspace. Antora and root Node sections are added
only when detected. For a Bubble Tea terminal UI (bubbletea in go.mod, or a root .ui-quality.yml or
.ui-screenshots/) a terminal-UI section ignores .ui-screenshots/, the directory the UI tests write their captures
to (see Building user interfaces); .ui-quality.yml,
internal/tui/ui_screenshots_test.go and the committed docs/modules/ROOT/images/ui/ tree are never ignored.
It never ignores go.mod, go.sum, testdata/ or .secrets.baseline, and removes a go.sum ignore line from an
existing file. The draft is checked with git check-ignore so it cannot hide cmd/*/main.go, internal/, testscript
files or the committed CLI reference page. When .gitignore exists it announces an update, shows a diff and asks
Update / Keep as is / Replace.
Plugin
Shipped by the iru-go plugin of the ai-catalog marketplace (install with /plugin install iru-go@ai-catalog; see Plugins).
Invocation
/iru-setup-go-gitignore
Optionally with an args block of key: value lines (see below) for scripted runs.
Inputs
| Argument | Required | Description | Default |
|---|---|---|---|
|
No |
Comma-separated binary name(s) to ignore at the root. |
Every |
|
No |
|
Detected from |
|
No |
|
Detected from the root |
|
No |
|
|
Any other key forwarded by Setup CLI Repository (such as language, ui or distribution) is ignored and named in the report.
Outputs
-
A root
.gitignore— created, updated (merged, keeping hand-added lines), replaced with the template, or left untouched when kept as is. -
A report stating whether the run was from scratch or an update, the action taken (created / updated / replaced / kept as is, and its source), the binary names used, the vendoring and workspace decisions, which conditional sections were included or skipped, whether a
go.sumignore line was removed, thegit check-ignoreresult, and any tracked file under a newly ignored path with thegit rm -r --cachedit needs. -
Explicit warnings: review the file before committing; writing
.gitignorenever untracks committed files; always commitgo.modandgo.sum; rotate any committed.envcredentials.
Execution flow
Dependencies
Invokes
None — iru-setup-go-gitignore is a leaf skill; it only reads go.mod, GoReleaser and docs config, runs read-only git commands, and writes .gitignore.
Invoked by
-
Setup CLI Repository — Step 6, root .gitignore for the
golanguage (passingbin-name), via theiru-isolated-skill-executoragent.
Also named as a follow-up step by Setup Go CLI when run standalone.
Source
SKILL.md on GitHub — the file this page was generated from.