Gitignore Generator

Automatically generate, audit, and repair .gitignore files to prevent secrets leakage and repository pollution.

Install
cmdop skills install agensi-gitignore-generator

The Gitignore Generator is an AI agent skill published by agensi that automates the creation, auditing, and repair of .gitignore files across software projects. Rather than relying on a developer to manually write or copy patterns, the skill scans project manifests to detect the active tech stack — including Node.js, Python, Rust, Go, and Java — and produces a .gitignore file matched to that environment, including polyglot and monorepo setups.

Beyond file generation, the skill performs a multi-step audit of the repository. It checks the Git index for files that are already tracked but should be ignored — such as .env files, API keys, and other sensitive assets — and identifies hardcoded secrets in source code. It also validates .gitignore pattern syntax, covering edge cases like correct negation and recursive matching that are commonly handled incorrectly when patterns are written by hand or generated by a language model without this specialised logic.

When sensitive files have already been committed to history, the skill provides the exact CLI commands needed to purge those files from the Git index and history. Standard patterns for OS-specific junk files and common IDEs are included. The skill does not expose any callable tools in the conventional MCP sense; it operates as a reasoning and generation capability surfaced to the agent directly. It is the wrong choice if the project has no Git repository, or if only a simple one-language project is involved and the developer prefers a static template.

Use cases

  • Generate a .gitignore file automatically after scaffolding a new Node.js or Python project
  • Audit an existing repository to find sensitive files such as .env or API key files already tracked by Git
  • Identify hardcoded secrets in source code before pushing to a remote
  • Repair a repository where secrets were accidentally committed by receiving exact Git history-purge commands
  • Support monorepo or polyglot setups by scanning manifests for multiple language stacks
  • Validate .gitignore pattern syntax including negation rules and recursive glob matching

When to use it

  • When setting up a new repository and the tech stack spans multiple languages or frameworks
  • When an existing repo may have accidentally tracked sensitive files or secrets
  • When .gitignore pattern syntax correctness is critical and manual authoring is unreliable
  • When an AI agent workflow needs automated repository hygiene as part of a CI or onboarding step

When not to use it

  • When the project has no Git repository at all
  • When a static, pre-made .gitignore template is sufficient and no auditing is needed
  • When the runtime environment does not support agent skill execution
  • When a full secrets-scanning pipeline with audit logging and policy enforcement is required