
Hygiene
Run VS Code’s staged-file hygiene linter before you finish a change so commits are not blocked by the repo pre-commit hook.
Overview
Hygiene is an agent skill for the Ship phase that runs VS Code’s pre-commit hygiene linter on staged or specified files so commits pass unicode, quoting, header, indentation, ESLint, and stylelint rules.
Install
npx skills add https://github.com/microsoft/vscode --skill hygieneWhat is this skill?
- Runs via `npm run precommit` (scans `git diff --cached` staged files only)
- Direct file check: `node --experimental-strip-types build/hygiene.ts path/to/file.ts`
- Rejects non-ASCII unless suppressed with allow-any-unicode comments
- Enforces single-quoted strings except externalized localized double-quoted strings
- Requires Microsoft copyright headers, tab indentation, ESLint, and stylelint
- Scans only staged files from `git diff --cached` via `npm run precommit`
Adoption & trust: 1.3k installs on skills.sh; 186k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You finished a patch but the VS Code pre-commit hook will reject the commit for unicode, quotes, missing copyright headers, or lint violations you have not run against staged files.
Who is it for?
Contributors working in the VS Code repo who want the agent to verify hygiene on staged changes before calling the task done.
Skip if: Projects without this hygiene script, or teams that only need generic ESLint/Prettier without VS Code’s unicode and copyright rules.
When should I use this skill?
Making code changes in the VS Code repo and before declaring work complete or committing.
What do I get? / Deliverables
Staged files pass the hygiene scanner, so `npm run precommit` succeeds and the commit is not blocked by the hook.
- Clean `npm run precommit` output on staged files
- Hygiene-compliant diffs ready to commit
Recommended Skills
Journey fit
Hygiene is a last-mile quality gate immediately before commit—canonical on the Ship shelf under review, not during ideation or launch. It enforces style, headers, unicode, and lint rules on staged diffs—the same class of work as pre-merge review and CI hygiene.
How it compares
Use instead of guessing style rules in chat—this mirrors the repo’s dedicated pre-commit hygiene script, not a generic formatter skill.
Common Questions / FAQ
Who is hygiene for?
Solo builders and contributors patching the VS Code codebase who need staged-file checks that match the official pre-commit hygiene hook.
When should I use hygiene?
Use in Ship when you are about to commit or declare work complete—after staging changes and before opening a PR—so unicode, headers, tabs, ESLint, and stylelint issues are caught early.
Is hygiene safe to install?
It instructs the agent to run local npm/node hygiene commands on your repo; review the Security Audits panel on this page and confirm scripts match your trusted VS Code fork before running.
SKILL.md
READMESKILL.md - Hygiene
# Hygiene Checks VS Code runs a hygiene check as a git pre-commit hook. Commits will be rejected if hygiene fails. ## Running the hygiene check **Always run the pre-commit hygiene check before declaring work complete.** This catches issues that would block a commit. To run the hygiene check on your staged files: ```bash npm run precommit ``` This executes `node --experimental-strip-types build/hygiene.ts`, which scans only **staged files** (from `git diff --cached`). To check specific files directly (without staging them first): ```bash node --experimental-strip-types build/hygiene.ts path/to/file.ts ``` ## What it checks The hygiene linter scans staged files for issues including (but not limited to): - **Unicode characters**: Non-ASCII characters (em-dashes, curly quotes, emoji, etc.) are rejected. Use ASCII equivalents in comments and code. Suppress with `// allow-any-unicode-next-line` or `// allow-any-unicode-comment-file`. - **Double-quoted strings**: Only use `"double quotes"` for externalized (localized) strings. Use `'single quotes'` everywhere else. - **Copyright headers**: All files must include the Microsoft copyright header. - **Indentation**: Tabs only, no spaces for indentation. - **Formatting**: TypeScript files must match the formatter output (run `Format Document` to fix). - **ESLint**: TypeScript files are linted with ESLint. - **Stylelint**: CSS files are linted with stylelint.