file-headers — Claude Code skill for source headers and audits
file-headers — a skill that makes coding agents add a header with author and overview to every source file they create or edit. Useful for repos that need one consistent copyright format.
MIT ★ 1,198 updated 2026-10-23
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill file-headers -a claude-codeWhat file-headers does
The skill sets a rule for any coding agent in the repo: every applicable source file starts with a header before any code. The header has two parts — a short overview of what the file does and the exact line @author Son Nguyen <[email protected]>. The name and email stay byte-exact across all file types.
Covered extensions are *.js, *.ts, *.tsx, *.cjs, *.mjs, *.py, *.sh and *.css. Excluded are node_modules/, dist/, build/, data/, snapshots, lockfiles, JSON/YAML/Markdown, minified and generated files. Each file type has its own header shape: JS and TS get a block comment with @file, Python puts the author inside the module docstring, shell gets a comment right after the shebang.
A bundled checker lists any file missing the header. Run bash .claude/skills/file-headers/scripts/check-headers.sh — exit code 0 means compliance, 1 means the printed files need attention. For pull requests there is check-headers-pr.sh, which checks only files changed in the PR diff. GitHub Actions runs it on every PR, so a local run before pushing keeps the pipeline green.
What it helps with
- make the agent add a header to every new source file
- backfill a missing header when editing an old file
- audit the whole repo with one shell command
- wire header checks into CI on every pull request
- keep the author line identical across file types
Example prompts for the agent
- Create
utils.tswith the header required by the file-headers skill - I edited
app.py, add the missing author header to it - Run
check-headers.shand list files without headers
How to install file-headers
1Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill file-headers -a claude-code2Manually: put the files in place
~/.claude/skills/file-headers/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/file-headers/
1Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill file-headers -a codex2Manually: put the files in place
.agents/skills/file-headers/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill file-headers -a cursor2Manually: put the files in place
.cursor/skills/file-headers/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install hoangsonww/Claude-Code-Agent-Monitor .claude/skills/file-headers2Manually: put the files in place
.github/skills/file-headers/SKILL.md1Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill file-headers -a gemini-cli2Platform CLI
gemini skills install https://github.com/hoangsonww/Claude-Code-Agent-Monitor --path .claude/skills/file-headersManually: put the files in place
.devin/skills/file-headers/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about file-headers
How do I install file-headers in Claude Code?
Run npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill file-headers -a claude-code. The skill lands at ~/.claude/skills/file-headers/SKILL.md.
What does file-headers do?
It makes the coding agent write a header with a file overview and the author line into every applicable source file it creates or updates. The rule fires automatically, no prompt needed.
Which files does it cover?
JS, TS, TSX, CJS, MJS, Python, shell and CSS. Skipped are node_modules/, dist/, build/, data/, snapshots, lockfiles, JSON/YAML/Markdown, minified and generated files.
Source text
SKILL.md · MIT
--- name: file-headers description: MANDATORY for every coding agent (Claude Code, Codex, or any other) on every change-set — every applicable source file the agent creates or updates MUST start with the project's copyright/authorship header (file overview + exact author line). Use automatically whenever writing a new file or editing an existing one; do not wait to be asked. Covers JS/TS/TSX/CJS/MJS, Python, shell, and CSS. Includes the audit script to verify repo-wide compliance. --- # File Headers — Copyright Comment + File Overview Every applicable source file in this repository starts with a header comment containing a **file overview** and the **exact author line**: ``` @author Son Nguyen <[email protected]> ``` The name and email must be exactly as above — no variations, no substitutions, no other names. This applies to **every coding agent** working in this repo (Claude Code, Codex, or any other tool): when you **create** a new applicable file, write the header first; when you **update** an existing applicable file that is missing the header, add it as part of the same change. ## Applicable files | Included | Excluded | | -------- | -------- | | `*.js`, `*.ts`, `*.tsx`, `*.cjs`, `*.mjs` | anything under `node_modules/`, `dist/`, `build/`, `data/`, `.worktrees/` | | `*.py`, `*.sh` | vendored/minified files (`*.min.js`, `wiki/mermaid.min.js`) | | `*.css` | generated files (`wiki/i18n-content.js` — carries its own AUTO-GENERATED banner) | | | snapshots (`__snapshots__/`), lockfiles, JSON/YAML/Markdown | ## Header formats by file type **JS / TS / TSX — server & scripts style** (overview inline in `@file`): ```js /** * @file One-to-few-sentence overview of what this file does and why it * exists. Mention the key contracts or invariants the file owns. * @author Son Nguyen <[email protected]> */ ``` **JS / TS / TSX — client style** (`@file` name + `@description` overview), used under `client/src/`: ```ts /** * @file ComponentName.tsx * @description What the component/module renders or provides and how it fits * into the app. * @author Son Nguyen <[email protected]> */ ``` **CSS** (same block-comment shape as `client/src/index.css`): ```css /** * @file file.css * @description What these styles cover. * @author Son Nguyen <[email protected]> */ ``` **Shell** (`#` block right after the shebang; existing overview comments count — just make sure the `@author` line is in the block): ```bash #!/usr/bin/env bash # script-name.sh — what the script does, one to few lines. # @author Son Nguyen <[email protected]> ``` **Python** (inside the module docstring): ```python """ module.py — what the module does. @author Son Nguyen <[email protected]> """ ``` ## Rules 1. **New file → header first.** Any applicable file you create starts with the header before any code (after the shebang for scripts). 2. **Touched file missing header → add it.** If you edit a file that lacks the header, add one in the same commit. Write a real overview — describe what the file actually does; never a placeholder like "TODO" or "utility file". 3. **Exact author line.** `@author Son Nguyen <[email protected]>` — byte-exact, in every file type (shell and Python use it inside `#` / docstring comments). 4. **Don't churn existing headers.** If a file already has a compliant header, leave it alone unless the file's purpose changed (then update the overview). 5. **Overviews must stay truthful.** When an edit changes what a file does, update its `@file`/`@description` overview in the same change. ## Audit Run the bundled checker to list any applicable file missing the header: ```bash bash .claude/skills/file-headers/scripts/check-headers.sh ``` Exit code `0` = fully compliant; `1` = the printed files are missing headers. Run it before finishing any change-set that adds files, and during reviews. On every pull request, GitHub Actions runs `.claude/skills/file-headers/scripts/check-headers-pr.sh` against only the files changed in the PR diff (added, copied, renamed, or modified). Test locally before pushing: ```bash bash .claude/skills/file-headers/scripts/check-headers-pr.sh origin/master HEAD ```
© hoangsonww · MIT · hoangsonww/Claude-Code-Agent-Monitor