Skip to content
Skills Library
Programming · Review & audit

gitattributes

/gitattributes

Use when auditing or updating .gitattributes export-ignore coverage so dev-only files (lint configs, CI, tests, docs, build tooling) don't ship in the WordPress.org plugin zip. Run before a release, after adding a new top-level file or config, or when a tool is renamed (e.g. .eslintrc.js → eslint.config.cjs).

Licence
MIT
Last repository change
27.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use when auditing or updating .gitattributes export-ignore coverage so dev-only files (lint configs, CI, tests, docs, build tooling) don't ship in the WordPress.org plugin zip. Run before a release, after adding a new top-level file or config, or when a tool is renamed (e.g. .eslintrc.js → eslint.config.cjs).

Original author description

Use when auditing or updating .gitattributes export-ignore coverage so dev-only files (lint configs, CI, tests, docs, build tooling) don't ship in the WordPress.org plugin zip. Run before a release, after adding a new top-level file or config, or when a tool is renamed (e.g. .eslintrc.js → eslint.config.cjs).

How it works

  1. Why This Matters
  2. Quick Audit (one command)
  3. Cross-Check Tracked vs Ignored
  4. What Belongs in Each Bucket
  5. When to Run This Audit
  6. Writing Rules
  7. Linguist Attributes (bonus)
  8. Red Flags
Original SKILL.md headings · 88 lines, 591 words
SKILL.md preview
---
name: gitattributes
description: Use when auditing or updating .gitattributes export-ignore coverage so dev-only files (lint configs, CI, tests, docs, build tooling) don't ship in the WordPress.org plugin zip. Run before a release, after adding a new top-level file or config, or when a tool is renamed (e.g. .eslintrc.js → eslint.config.cjs).
---

# .gitattributes Export-Ignore Audit

Ensure the WordPress.org release archive (`git archive` output) contains only runtime files. Dev tooling, tests, CI, and repo meta must be `export-ignore`d.

## Why This Matters

The WordPress.org zip is built via `git archive`. Anything without `export-ignore` ends up on every user's site, bloating the install and shipping dev-only code. Equally bad: stale `export-ignore` entries for files that no longer exist look tidy but protect nothing.

## Quick Audit (one command)

```bash
# Entries in the release archive at the repository root
git archive --format=tar HEAD | tar -t | awk -F/ '{print $1}' | sort -u

# Same, but uses the working-tree .gitattributes (use while iterating on edits)
git archive --worktree-attributes --format=tar HEAD | tar -t | awk -F/ '{print $1}' | sort -u
```

`git archive HEAD` reads `.gitattributes` from the commit, so uncommitted fixes won't show up. Use `--worktree-attributes` to preview a pending change before committing.

The output should contain ONLY runtime artifacts. For this plugin that's:
`LICENSE`, `readme.txt`, `activitypub.php`, `assets`, `build`, `includes`, `integration`, `patterns`, `templates`.

Anything else in the list is a gap — add an `export-ignore` rule.

## Cross-Check Tracked vs Ignored

```bash
# Top-level tracked entries
git ls-tree --name-only HEAD | sort > /tmp/tracked.txt

# Entries referenced in .gitattributes
grep export-ignore .gitattributes | awk '{print $1}' | sed 's|^/||; s|/$||' | sort > /tmp/ignored.txt

# Stale entries (in .gitattributes but no longer tracked)
comm -23 /tmp/ignored.txt /tmp/tracked.txt
```

Stale entries aren't dangerous, but they rot and mislead future readers. Delete them.

## What Belongs in Each Bucket

| Category | Examples | Rule |
|----------|----------|------|
| Runtime PHP | `activitypub.php`, `includes/`, `integration/` | keep |
| Runtime assets | `assets/`, `build/`, `patterns/`, `templates/` | keep |
| WordPress.org meta | `readme.txt`, `LICENSE` | keep |
| Dev dotfiles | `.editorconfig`, `.prettierrc.js`, `.stylelintrc.json`, `eslint.config.cjs`, `.wp-env.json` | export-ignore |
| Repo meta | `.github/`, `.githooks/`, `.gitignore`, `.gitattributes`, `.wordpress-org/` | export-ignore |
| Agent/AI tooling | `.agents/`, `.claude/`, `AGENTS.md`, `CLAUDE.md` | export-ignore |
| Build & package configs | `package.json`, `package-lock.json`, `composer.json`, `webpack.config.js`, `tsconfig.json`, `jest.config.js`, `jest.setup.js` | export-ignore |
| QA configs | `phpcs.xml`, `phpunit.xml.dist` | export-ignore |
| Source (pre-build) | `src/` | export-ignore (shipping `build/` instead) |
| Tests | `tests/` | export-ignore |
| Docs for contributors | `docs/`, `snippets/`, `CHANGELOG.md`, `CODE_OF_CONDUCT.md`, `CONTRIBUTING.md`, `FEDERATION.md`, `README.md`, `SECURITY.md` | export-ignore |
| Scripts | `bin/`, `local/` | export-ignore |

## When to Run This Audit

- Before tagging a release.
- After adding or renaming any top-level file, dotfile, or config.
- After adopting a new dev tool (lint, test runner, bundler).
- When a linter flat-config migration renames files (e.g. `.eslintrc.js` → `eslint.config.cjs`).

## Writing Rules

- Use a leading `/` to anchor to the repo root: `/phpcs.xml`, not `phpcs.xml`.
- Use a trailing `/` for directories: `/tests/`.
- Keep grouping comments tidy (dotfiles, build configs, source/tests, docs, linguist).

## Linguist Attributes (bonus)

Also used in `.gitattributes` to shape GitHub's language stats:

- `/build/**  linguist-generated` — hides machine-built output.
- `/docs/**   linguist-documentation` — keeps docs out of the language bar.
- `/package-lock.json  linguist-generated` — hides lockfile churn.

These don't affect the archive, but live in the same file, so keep them current too.

## Red Flags

- Release zip is larger than expected → something new is leaking in.
- New dev dependency added, `.gitattributes` untouched → likely a gap.
- Lint tool migrated to a new config filename → old entry is stale, new file is leaking.
- Top-level file renamed → old export-ignore is dead weight, new one is missing.

Versions

The database has no other skills named gitattributes.

Database snapshot: 13.11.2026 · package version 05b3e9f18224 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90configure-gitattributes
    Configure .gitattributes: union-merge for append-only tables, linguist-generated for build output, LF normalization. Use when setting up .gitattributes or taming append-only merge conflicts.
  • 100eslint
    ESLint is the standard linting tool for JavaScript and TypeScript projects. It statically analyzes your code to find problems, enforce coding conventions, and catch bugs before they reach production. Flat config (`eslint.config.js`) is the only config format in ESLint 10; the…
  • 100linting-neostandard-eslint9
    Configures ESLint v9 flat config and neostandard for JavaScript and TypeScript projects, including migrating from legacy `.eslintrc*` files or the `standard` package. Use when you need to set up or fix linting with `eslint.config.js` or `eslint.config.mjs`, troubleshoot lint…
  • 100wp-plugin-zip
    Builds and checks WordPress plugin and theme .zip packages so they install and activate cleanly. Use it whenever you package a WordPress plugin or theme for upload, a release or a client, and whenever the user reports "Plugin file does not exist", "The package could not be…
  • 90wp-plugin-development
    WordPress plugin architecture review for Codex. Use when reviewing plugin structure, lifecycle hooks, Settings API usage, CPT and taxonomy registration, hook design, i18n, and WordPress.org readiness.
  • 100eslint-to-biome
    Migrate JS/TS linting from ESLint+Prettier to Biome. Use when .eslintrc* or eslint.config.* exists and no biome.json is present.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.