agentleFS
nrjdalalnrjdalal/zerostarter/.agents/skills/ignore-sync/SKILL.md

ignore-sync

Skill65 starsChanged 16 days agoMITView on GitHub

Mirror .gitignore to .dockerignore. Use whenever a .gitignore entry is added or removed, or when auditing a bloated Docker build context.

  • Reads credentials

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

Ignore Sync

.dockerignore does not inherit from .gitignore. Whatever git ignores but .dockerignore misses still enters the Docker build context (COPY . . in the prepare stage of web/next/Dockerfile and api/hono/Dockerfile), and on this repo that has meant gigabytes: web/next/.next alone hit 3GB and .turbo 23GB.

The two files are mirrors

.gitignore is the source of truth and .dockerignore follows it byte-for-byte. Every ignore rule and every shared ! un-ignore (e.g. !.yarn/patches) lives in the shared body of both: same entry, same section, same order, same commit.

The one sanctioned divergence is the labeled tail at the end of each file, for a git-only or docker-only override. There the label is all that differs, # git overrides versus # docker overrides, and today each tail carries only !.env.example.

.env stays out of the context

Real .env* files never enter the Docker context. Each build mounts the host file as a required BuildKit secret (--mount=type=secret,id=dotenv,target=/app/.env,required=true; compose supplies it via secrets.dotenv.file: .env), so it is validated in full during the build yet never lands in a layer. A diff that re-includes .env* to feed a builder-stage COPY is drift; sync it away.

Audit

diff -u .gitignore .dockerignore

Done when the only difference is the tail label:

-# git overrides
+# docker overrides

Any other differing line is a missed sync.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.