| name | demos-spellcheck |
| description | Run cspell across the project, fix typos, and add legitimate words to the dictionary. Use when the user wants to spellcheck, fix spelling, or resolve cspell failures. |
Spellcheck
Run project-wide spellcheck, then fix all reported errors.
Usage
/demos-spellcheck
Steps
-
Run spellcheck
- Execute
pnpm run spellcheck to check src/**/*.{js,md,mdx,mdc}, docs/**/*.{md,mdx,mdc}, and README.md
- Capture the full error output
-
Analyze each error For every word flagged by cspell, determine if it is:
- A typo – a misspelled word in source code, comments, strings, or content
- A legitimate term – a technical term, brand name, abbreviation, or proper noun that cspell does not know
-
Fix typos in source files
- Open the file and fix the misspelled word in place
- Do NOT add typos to the dictionary
-
Add legitimate words to cspell.json
- Add the word to the
words array in cspell.json
- Keep the array sorted alphabetically (case-insensitive)
- Do not add duplicates
-
Re-run spellcheck
- Execute
pnpm run spellcheck again to confirm all errors are resolved
- If new errors appear, repeat from step 2
-
Format
- Run
/demos-format to ensure all modified files are properly formatted
Dictionary file
- Path:
cspell.json (project root)
- Add words to the
words array (not userWords)
- Keep the array sorted alphabetically
Notes
- Files checked by the script:
src/**/*.{js,md,mdx,mdc}, docs/**/*.{md,mdx,mdc}, and README.md. Files outside
those paths (CLAUDE.md, .claude/**, .cursor/**, plugins/**, config files) are not covered by
pnpm run spellcheck – lint-staged spellchecks them when they are staged for a commit. To check one of them by hand,
run pnpm exec cspell <path>.
- Compound words are allowed (
allowCompoundWords: true)