Vale styles are collections of rules organized into reusable packages. This guide shows you how to create, structure, and share custom styles.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/errata-ai/vale/llms.txt
Use this file to discover all available pages before exploring further.
What is a Style?
A style is a directory containing Vale rules (YAML files) that enforce a specific writing standard. Each style has:- A directory name (the style name)
- One or more rule files (
.ymlextension) - Optional configuration files
Creating a Basic Style
Create the style directory
Create a directory in your The directory name becomes your style name (
StylesPath:MyCompany).Style Organization
Directory Structure
A well-organized style follows this structure:Naming Conventions
Follow these conventions for rule files:- Use PascalCase for rule names:
Acronyms.yml,PassiveVoice.yml - Make names descriptive:
HeadingCapitalization.ymlnotHeading.yml - Group related rules with prefixes:
Spelling*.yml,Terms*.yml
Rule names appear in alerts as
StyleName.RuleName, so choose names that make sense to your users.Built-in Default Rules
Vale provides built-in rules in theVale style. You can reference these in your config:
.vale.ini
internal/check/definition.go:
- Vale.Avoid: Blocks specific tokens
- Vale.Terms: Enforces terminology from vocabularies
- Vale.Repetition: Detects repeated words
- Vale.Spelling: Spell checks with dictionary support
Creating a Vocabulary
Vocabularies define accepted and rejected terms for your style.Add accepted terms
List one term per line in These terms will be:
accept.txt:styles/MyCompany/Vocab/accept.txt
- Excluded from spell checking
- Used as exceptions in rules with
vocab: true
Terms in
accept.txt are automatically added as exceptions to all rules with vocab: true (the default for most rule types).Rule Reuse with Exceptions
Use thevocab and exceptions keys to make rules flexible:
styles/MyCompany/Abbreviations.yml
vocab: true, the rule automatically ignores all terms from your vocabulary’s accept.txt.
Style Metadata
Create ameta.json file to provide style information:
styles/MyCompany/meta.json
Packaging for Distribution
To share your style, create a package compatible with Vale’ssync command.
Using Multiple Styles
Combine multiple styles in your configuration:.vale.ini
Style Inheritance
While Vale doesn’t support direct style inheritance, you can reference rules from other styles:.vale.ini
Testing Your Style
Create test cases for your style:MyCompany/test/Acronyms/valid.md
MyCompany/test/Acronyms/invalid.md
MyCompany/test/.vale.ini
Publishing to the Vale Style Library
To share your style with the community:- Create a GitHub repository following the package structure above
- Add comprehensive documentation in your README
- Submit to the styles repository: https://github.com/errata-ai/styles
- Follow the submission guidelines in the repository
- Microsoft: Microsoft Writing Style Guide
- Google: Google Developer Documentation Style Guide
- write-good: Naive linter for English prose
- proselint: Prose linting from professional writers
Advanced: Style Configuration
Create a default configuration file for your style:MyCompany/.vale.ini
Example: Complete Style
Here’s a complete minimal style:MyCompany style files
MyCompany style files
styles/MyCompany/Terms.yml
styles/MyCompany/Headings.yml
styles/MyCompany/Spelling.yml
styles/MyCompany/Vocab/accept.txt
.vale.ini
Best Practices
- Start with vocabulary: Define your terminology first
- Test thoroughly: Create test cases for each rule
- Document your rules: Add clear messages and links
- Version your style: Use semantic versioning
- Provide examples: Include example configuration files
- Use consistent naming: Follow established naming conventions
- Enable vocab by default: Set
vocab: trueon most rules - Package for distribution: Make it easy for others to install
Next Steps
Writing Rules
Learn how to create individual Vale rules
CI Integration
Integrate your style into CI/CD pipelines