Vale's text.frontmatter.description scope silently stops matching once the description is a YAML block scalar spanning 2+ physical lines — the style used by most skills/agents in this repo. scripts/vale-wrap.sh flattens the description to one line in a scratch copy (preserving the repo-relative path and total line count) before invoking real vale, and both audit skills plus the pre-commit hook now call it instead of vale directly. Also tightens the pre-commit hook's file glob to single path segments so it can't cross into docs/research examples or asset templates the way the audit skills' scoped invocations already avoid. Addresses PR #85 review feedback. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FxG5T8EJDgkABXxuneuFfn
3.7 KiB
3.7 KiB
name, description, metadata
| name | description | metadata | |||||||
|---|---|---|---|---|---|---|---|---|---|
| vale-config | Use when installing or configuring Vale, the cross-platform prose/style linter — setting up .vale.ini, choosing a StylesPath, adding built-in, third-party, or custom styles, and activating them per file glob via BasedOnStyles. Covers the setup side of Vale only: getting a project from "no Vale config" to "vale sync runs clean and BasedOnStyles is wired up correctly". Use even if the user doesn't say "Vale" explicitly — "set up prose linting", "lint our docs for style", "enforce a vocabulary/terminology list in markdown" all apply. Do not use when the user wants to actually run Vale and interpret its output on existing config — use vale-run for that. |
|
Gotchas
- Installing the
valebinary installs no styles. A fresh.vale.iniwithBasedOnStylesset will fail or find nothing untilvale syncruns and downloads thePackagesit declares. .vale.iniis order-sensitive: global (core) settings first, then the optional[formats]section, then glob sections ([*],[*.md], …). Settings in a glob section only apply to files matching that glob.Packages(top-level, fetched byvale sync) andBasedOnStyles(per-glob, activates) are separate keys — a style only lints files once it's in both. This is the step people forget.- A rule scoped to
text.frontmatter.<key>(e.g.text.frontmatter.description) only reliably matches when that field's value is a single physical line. If it's a YAML block scalar (>/|) spanning 2+ physical lines, the scope silently stops matching — no error, just 0 findings — confirmed against Vale 3.15.2. Verify with a deliberately-bad multi-line fixture before trusting a frontmatter-scoped rule in production; if the field is commonly authored as a multi-line block scalar, flatten it to one line ahead of thevalecall rather than relying on the scope alone.
Setup workflow
- Install the
valebinary:brew install vale(macOS),snap install vale(Linux),choco install vale(Windows), ordocker pull jdkato/vale. - Pick a
StylesPath(conventionallystyles) and create it. This is where all styles, dictionaries, and vocab live. - Write
.vale.iniat the project root with at minimum:StylesPath = styles MinAlertLevel = suggestion [*.md] BasedOnStyles = ValeValehere is the built-in style (Vale.Spelling,Vale.Terms,Vale.Avoid,Vale.Repetition) — no download needed, it always works. - Add third-party styles (optional) by declaring them in
Packages, then activating them in the same or another glob'sBasedOnStyles:Packages = Google, write-good [*.md] BasedOnStyles = Vale, Google, write-good - Sync: run
vale syncto download everything listed inPackagesintoStylesPath. - Verify activation: confirm every style named in
Packagesalso appears in at least one glob'sBasedOnStyles— an unreferenced package downloads but never lints anything.
For the full .vale.ini field reference (formats mapping, vocab, local overrides, custom rule header fields), read references/configuration-reference.md.
Custom styles
A custom style is just a new subdirectory under StylesPath, holding one YAML file per rule:
styles/
└── MyStyle/
└── NoJargon.yml
Each rule file needs extends (the check it implements, e.g. existence) and message at minimum. Activate the style the same way as any other: add MyStyle to BasedOnStyles for the relevant glob. See references/configuration-reference.md for the full rule header field table.