Secure gitignore management
Skill meyverick/agy-skills/skills/secure-gitignore-management
Manages and audits .gitignore files. Use when evaluating codebase security to strictly enforce a default-deny pattern for tracking files.From its SKILL.md
npx -y skills add meyverick/agy-skills --skill secure-gitignore-managementAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.7 KB, 573 tokens by cl100k_base, as published. Nobody here has run it
Secure Gitignore Management
This skill enforces a highly secure "default-deny" Git ignore strategy. It prevents accidental credential leaks, environmental configuration leaks, and compilation artifact bloat by strictly allowing only verified source files into the index.
When to Use
- Use when initializing a new repository (
git init). - Use when auditing the repository for accidentally committed credentials.
- Use when modifying the project's build toolchain or adding new environment variable architectures.
- NOT for modifying
.git/internal core configurations.
Core Process
Phase 1: The Default-Deny Architecture
Instead of listing everything you don't want, a secure .gitignore lists everything, then selectively allows what you do want.
- Add
*to the very top of.gitignoreto ignore everything. - Add
!*/to allow directories.
Phase 2: Selective Allow-Listing
Specifically allow your source code directories and configuration files.
!src/!docs/!package.json!README.md
Phase 3: Explicit Security Blocks
Even within allow-listed directories, ensure absolute strict bans on sensitive patterns:
**/*.env**/*.pem**/*_rsa**/*.sqlite(unless explicitly intended for distribution)
Phase 4: Git Index Verification
Verify what Git is actually tracking to ensure no secrets slipped through before the policy was enacted.
- Execute
git ls-filesto audit currently tracked files. - If a sensitive file is tracked, execute
git rm --cached <file>immediately.
Common Rationalizations
| Rationalization | Reality |
|---|---|
| "A default-deny gitignore is too annoying to maintain." | Accidentally leaking AWS keys or database credentials is far more painful. Explicit tracking forces intentional engineering. |
"I'll just add .env to the end of the file." | Without a default-deny pattern, developers inevitably name a secret .env.local or .env.test which slips through the standard blocklist. |
Red Flags
.gitignorefiles that do not start with a universal block (*).- Tracking files named
secrets.json,.env, or ending in.key. - Committing heavy compilation artifacts (e.g.,
node_modules/,dist/).
Verification
Before finalizing Gitignore management, verify:
-
.gitignoreimplements a default-deny*rule. -
git ls-filesreturns zero sensitive credentials, API keys, or.envfiles. - Explicit allow-lists cover only necessary source and configuration files.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.