Setup Python Gitignore
| This documentation was generated with the assistance of AI. Please report any inaccuracies. |
Create or refresh the root .gitignore for a Python project — a universal base plus sections for whatever is actually
detected (Django static/media/SQLite paths, a file-based FastAPI database, Sphinx or MkDocs output, notebooks, PDM
files, Node tooling, an Antora docs build). It mirrors iru-setup-php-gitignore and iru-setup-typescript-gitignore
for the Python ecosystem and never overwrites an existing .gitignore without showing a diff and getting approval.
Purpose
iru-setup-python-gitignore bootstraps a .gitignore that matches what a uv-managed Python project really
produces: bytecode, build/ and dist/ output (coverage XML, JUnit results, API docs, uv build artifacts),
*.egg-info/, virtual environments (.venv/), pytest/coverage/Hypothesis/tox/nox caches, mypy/Ruff/Pyre/Pytype
caches, env files (keeping .env.example), .pypirc, logs, OS/editor noise and the repository-wide
.integration-test.lock/ directory. It adds a section only when the thing it targets is present: Django’s
STATIC_ROOT/MEDIA_ROOT/db.sqlite3 (read from the settings), a file-based SQLite database for FastAPI, Celery beat
files, browser UI test output (.ui-screenshots/ and pytest-playwright’s test-results/ — for a Django project, or any project with pytest-playwright or a tests/ui/ directory; .ui-quality.yml stays tracked), Sphinx or MkDocs build directories, Jupyter checkpoints, PDM local files, root Node tooling, and Antora build
output.
It never ignores uv.lock (or poetry.lock/pdm.lock/Pipfile.lock), .python-version or .secrets.baseline —
CI installs with uv sync --locked, so those files must be committed — and proposes removing such a line from an
existing file. When .gitignore already exists it announces an update, shows the merged draft as a diff, and asks
Update (merge, keep hand-added entries) / Keep as is / Replace (template only).
Plugin
Shipped by the iru-python plugin of the ai-catalog marketplace (install with /plugin install iru-python@ai-catalog; see Plugins).
Invocation
/iru-setup-python-gitignore
Optionally with an args block of key: value lines (see below) for scripted runs.
Inputs
| Argument | Required | Description | Default |
|---|---|---|---|
|
No |
|
|
Outputs
-
A root
.gitignore— created from scratch, updated (merged, keeping hand-added lines), or 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 whether it came from the user’s answer or
on-existing), the detected flavor, which conditional sections were included or skipped and why, whether auv.lockor.python-versionignore line was removed, thegit check-ignoreresult, and which hand-added lines were preserved or dropped. -
Explicit warnings: review the file before committing (detection is heuristic); run
git rm -r --cachedmanually for anything already tracked under a newly ignored path (rotate credentials if.envor.pypircwas committed); commituv.lockand.python-version; and which entries were verified versus inferred.
Execution flow
Dependencies
Invokes
None — iru-setup-python-gitignore is a leaf skill; it only reads manifests and config files and writes
.gitignore. It relies on the flavor markers also used by Explore and
Setup Python Repository, but does not call them.
Invoked by
-
Setup Python Repository — Step 7, root .gitignore, via the
iru-isolated-skill-executoragent.
Source
SKILL.md on GitHub — the file this page was generated from.