Cspell Config
MicrosoftOfficialPublished by Microsoft
- Skill
- Workflow
- Software development
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a rigorous procedure for updating cspell configurations. It emphasizes resolving the project's actual authoritative command and configuration chain rather than making assumptions about file locations. The workflow guides the user through detecting project context, identifying the correct configuration files and custom dictionaries, curating unknown tokens, and applying updates while maintaining existing formatting and structure.
What it does
- Detects the project's authoritative cspell command and configuration hierarchy.
- Identifies active custom dictionaries and configuration overlays.
- Filters unknown tokens to separate project-specific terms from likely typos.
- Updates configuration files and dictionaries with sorted, deduplicated word lists.
- Refines ignorePaths to align with project-specific ignore files.
- Validates changes by re-running the spell check to ensure a meaningful reduction in issues.
When to use it
- When a project's spell check reports excessive false positives due to missing domain-specific vocabulary.
- When you need to integrate project-specific ignore paths into the existing cspell setup.
- When you need to organize or clean up existing cspell configuration files.
- When setting up spell checking for a new project that requires custom dictionary management.
Advantages
- Ensures changes are applied to the actual configuration files loaded by the project.
- Prevents the addition of obvious garbage or typos to the dictionary.
- Maintains consistency with existing configuration formats and coding styles.
- Provides a verifiable validation step to confirm the effectiveness of the updates.
Usage examples
- “Update my cspell configuration to include new project-specific terms and ignore build artifacts.”
- The agent will analyze your project's cspell setup, identify the correct config file, filter out noise, add the new terms to the appropriate word list, and update ignorePaths.
- “My spell check is failing on many technical terms; can you fix the configuration?”
- The agent will run the project's spell check, categorize the unknown technical terms, and add them to your cspell configuration or custom dictionary.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/microsoft/cspell-config/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip cspell-config.zip -d .agents/skills
Documentation by Microsoft
Update cspell Configuration with Project-Specific Words and Ignores
Context
Goal: Add commonly used project-specific words to the cspell configuration, alphabetize the words list, and add useful
ignorePathsaligned with the project's ignore files.cspell supports multiple config formats and file names. Detect which format the project uses rather than assuming any specific one.
Projects may also use custom dictionary files, such as
.txtword lists, organized in a dedicated directory. Discover and respect existing dictionary structure.Configuration authority is invocation-bound, not a fixed ranking of file locations. The command that runs cspell determines the base configuration, cspell's own per-file lookup determines overlays, and a custom dictionary participates only when an effective configuration defines and enables it. File enumeration order never establishes authority.
Required Steps
Step 1: Detect Project Context and the Authoritative Command
Identify the project's primary language and package manager by inspecting files at the workspace root, for example
package.json,pyproject.toml,Cargo.toml,go.mod,*.csproj,pom.xml, andGemfile.Determine how cspell is installed or available. Check for a project dependency, an installed command with
cspell --version, ornpxor equivalent availability. If cspell is not available, ask the user for their preferred installation method.Record the installed cspell version. The resolution details below describe cspell 10.x behavior. When the project pins a different major version, confirm behavior against that version's documentation or observed output before relying on any ordering claim.
Check for an existing spell-check script in the project's task runner, for example
package.jsonscripts,Makefiletargets,justfilerecipes, orpyproject.tomlscripts. Use the project command when one exists. It is the authority for the rest of this workflow.From that command, capture the invocation working directory, the file globs it passes, any explicit
--config, and any config-search controls such as--no-config-search,--config-search,--stop-config-search-at, or an equivalent setting. These inputs determine which configuration the project actually uses.
Step 2: Resolve the Authoritative cspell Configuration
Inventory candidate config files across the workspace using a broad glob pattern, for example
cspell*and.cspell*. cspell recognizes many naming variants including dotfiles such as.cspell.json, plain names such ascspell.json, json with comments, JavaScript module configs, and yaml configs. Also checkpackage.jsonfor acspellconfiguration key. Treat this inventory as candidates only. Enumeration order carries no authority.Identify the invocation-base config, which governs file discovery for the whole run:
When the command passes
--config, that file is the base.Otherwise the base is the config cspell finds from the invocation working directory.
Because the base owns discovery, a file excluded by the base
ignorePathsstays excluded no matter what a nested config says.
Determine per-file overlays. Unless config search is turned off, cspell searches upward from each checked file for the nearest recognized config and merges it over the base settings. Only the nearest config applies. An intermediate ancestor between the file and the base participates only when the selected config imports it. In merged settings, nested scalar values win and mergeable arrays accumulate.
Apply same-directory recognized-name order when one directory holds more than one representation. In cspell 10.x, a
package.jsonwith an object-valuedcspellkey is selected before.cspell.json, thencspell.json, then the remaining recognized names. Sibling files are not merged automatically. A sibling participates only through an explicitimportor an explicit invocation. Verify this ordering against the installed version rather than asserting it from memory.Note that
--configalone does not disable the per-file search.--no-config-searchand thenoConfigSearch: truesetting disable it.--config-searchre-enables it.--stop-config-search-atbounds how far the upward search walks.Follow every
importin the selected configs and record the imported files, since an import can supply the definitions and words a token would otherwise need.If no config file exists anywhere in the resolution chain, create
cspell.jsonat the invocation root with a minimal scaffold usingversion,language,ignorePaths, andwords.Record the resolved base config path, the applicable local config path for the files you intend to change, the imported files, and each candidate you did not select, with the reason.
If these inputs do not identify exactly one authoritative mutation target, stop and ask the user which config or dictionary to write to. Present the resolved command, the candidates, and why the choice is ambiguous. Do not guess.
Step 3: Resolve Custom Dictionaries
Collect every
dictionaryDefinitionsentry from the resolved configs and their imports, and search for a.cspell/directory or any other referenced dictionary location.Catalog existing custom dictionary text files, including
.txtword lists, and note their names, paths, and apparent categories.Treat a dictionary as active only when a definition supplies its name and an effective
dictionarieslist, applicable override, or language setting enables that name. A definition alone does not load the file, and a dictionary file that no config references has no effect.Resolve relative dictionary paths from the config that defines them, not from the process working directory.
When the same dictionary name is defined more than once among active definitions, the later effective definition replaces the earlier one. Record which definition wins before writing to any file.
Check the
dictionariesfield for enabled built-in dictionaries, for examplek8s,docker,rust,aws,terraform,python, andcsharp.When adding new words later, route each token to the inline
wordsarray of the authoritative config or to an active custom dictionary file whose category fits. Never write to an inactive dictionary. If no active custom dictionaries exist, add all tokens to the inlinewordsarray.
Step 4: Run Initial Spell Check
Run cspell using the project command discovered in Step 1, or fall back to direct invocation, for example
npx cspell "**/*"orcspell "**/*".Collect unknown words from the output, excluding paths already covered by
ignorePaths.
Step 5: Curate and Categorize Tokens
Group unknown tokens into categories: project-specific terms, acronyms, technology names, environment variables, proper nouns, and potential typos.
Filter out obvious garbage using these heuristics:
Hex strings of 16 or more characters:
[a-f0-9]{16,}.Base64-looking strings:
[A-Za-z0-9+/]{20,}={0,2}.Tokens appearing only in lockfiles, minified assets, or build output.
Identify likely typos that should be fixed in source rather than added to the dictionary, for example
recievetoreceive. Report these separately for the user to review. <!-- cspell:disable-line -->For each remaining token, decide placement. Use the inline
wordsarray for project-specific terms, or the appropriate custom dictionary file when one exists and the token fits its category.
Step 6: Update Configuration and Dictionaries
Write curated tokens only to the targets resolved in Steps 2 and 3: the inline
wordsarray of the authoritative config, or an active custom dictionary file. Preserve original casing and avoid introducing duplicates.Sort the
wordsarray alphabetically using case-insensitive sort while preserving original case.Sort custom dictionary text files alphabetically with one word per line if they follow that convention.
Add or refine
ignorePathsentries to align with the project's ignore files, such as.gitignoreand.dockerignore, but do not ignore source folders containing meaningful code and documentation. Add anignorePathsentry to the config that governs discovery for the affected files. An entry placed in a nested config cannot exclude a file the invocation base already enumerated, and cannot re-include a file the base excluded.Preserve the existing config format and style conventions, including indentation, trailing commas, and module export structure.
Step 7: Validate and Report
Re-run cspell using the same command from Step 4, from the same working directory and with the same config and search flags, so the before and after runs are comparable.
Report the final counts: files checked, issues found, and files with issues.
Report the resolution basis for the changes: the command used, the invocation-base config, the applicable local config, each file or dictionary written, and the candidates you did not select with the reason.
If the issue count has not meaningfully decreased from baseline, with a target of at least 80 percent reduction, provide a short rationale and suggest next actions such as adding more words, fixing typos, or adding more ignore paths. When tokens you added are still reported, treat it as a resolution problem. Confirm the config you edited is the one the command loads and that any dictionary you wrote to is enabled.
List any typos identified in Step 5 that should be fixed in source.
Acceptance Criteria
Every configuration or dictionary change is written to a target the project's own cspell command actually loads, and the report names the command, base config, local config, and unselected candidates.
The cspell configuration includes a comprehensive
ignorePathsarray that excludes generated and vendored folders.The
wordsarray and any custom dictionary files contain the most common project-specific tokens, alphabetized and deduplicated.A final cspell run shows a meaningful reduction from the baseline, with a target of at least 80 percent, or the remaining categories are documented with rationale.
Notes and Best Practices
Prefer observed command behavior over any remembered ordering rule. When resolution is unclear, run the project command with increased verbosity and let its output identify the configuration in effect.
Do not reimplement cspell's resolver. Use the tool's own output to confirm which settings applied.
Preserve original casing for tokens. Do not normalize to uppercase or lowercase.
Prefer adding tokens for environment variables, infrastructure outputs, and technology names rather than silencing real typos.
When in doubt about a token that appears only once in generated files, prefer ignoring the generated file path instead of adding the token.
For diacritics and special characters, for example
Piña,José,Müller,Straße,naïve,résumé, andZürich, preserve the original forms but consider adding simplified fallbacks only if tests or files use them. <!-- cspell:disable-line -->When the project uses a JavaScript config format, preserve the module export structure and do not convert to json.
Adapt file-type globs for the spell-check command to the project's languages, for example
"**/*.{py,md,yaml,yml}"for Python projects and"**/*.{cs,md,json}"for C# projects.
Files
- ATTRIBUTION.mdAdded by AutoGineer835 B
- LICENSELicence file added by AutoGineer1.1 KiB
- SKILL.md11.6 KiB
ATTRIBUTION.md
Attribution
This folder is an unmodified copy of the Agent Skill "cspell-config", distributed by AutoGineer (https://autogineer.com/agent-skills).
Commit: f425e943bf228052a23e6bc4810b5faef030314f
Published by: Microsoft (https://github.com/microsoft)
Publisher: Microsoft (https://github.com/microsoft)
Licence: MIT License (https://spdx.org/licenses/MIT.html)
Licence evidence: declared in the frontmatter ("license: MIT")
Retrieved: 2026-11-07
The skill's own files are unmodified copies. AutoGineer is not affiliated with or endorsed by the author or the publisher.
Files added by AutoGineer
ATTRIBUTION.md: this file, written by AutoGineer
LICENSE: copied from LICENSE
Requirements and compatibility
Written for: GitHub Copilot, Claude Code
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Claude Code frontmatter, Needs Python, Needs Node.js
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Microsoft
- Publisher
- Microsoft (Official)
- Source
- microsoft/hve-core · .github/skills/experimental/cspell-config · commit f425e94
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Microsoft or Microsoft.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download cspell-config.zip