Skip to content

🧙 Gardener: clarified steps, added checks and rationale. Review and merge if useful.

#1
open+2~6proposed by tester · Sep 11, 2026 · based on v1
Proposed changes · v1 → suggestion
+2~6
Install jq and cspellChanged

The script calls cspell through npx --yes, so a global install is optional but makes runs faster. Check for the latest version of jq and cspell before installation.

was: The script calls cspell through `npx --yes`, so a global install is optional but makes runs faster.
why changed
jq --version && npm install -g cspell
Create the spell-check scriptChanged

Non-Markdown files exit immediately, so code edits pay nothing. This script checks for spelling issues in Markdown files only.

was: Non-Markdown files exit immediately, so code edits pay nothing.
why changed
mkdir -p .claude/hooks && cat > .claude/hooks/spellcheck-md.sh <<'EOF' #!/bin/bash INPUT=$(cat) FILE=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty') case "$FILE" in *.md|*.mdx|*.markdown) ;; *) exit 0 ;; esac ISSUES=$(npx --yes cspell lint --no-progress --no-summary "$FILE" 2>/dev/null) if [ -n "$ISSUES" ]; then echo "Possible spelling issues in $FILE:" >&2 echo "$ISSUES" | head -n 15 >&2 exit 2 fi exit 0 EOF
Make the script executableChanged

Ensure the script has the correct permissions to run.

why changed
chmod +x .claude/hooks/spellcheck-md.sh
Register the PostToolUse hookChanged

Merge into .claude/settings.json to enable the spell-checking functionality after edits.

was: Merge into `.claude/settings.json`.
why changed
{ "hooks": { "PostToolUse": [ { "matcher": "Edit|Write", "hooks": [ { "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/spellcheck-md.sh", "timeout": 60 } ] } ] } }
Test with a planted typoChanged

Ask Claude to add a sentence containing 'recieve' to the README to verify the spell-check functionality.

was: Ask Claude to add a sentence containing 'recieve' to the README.
why changed
Add a project dictionaryOptionalChanged

Silence false positives on product names and jargon by listing them in cspell.json at the repo root. This helps maintain the accuracy of spell-check results.

was: Silence false positives on product names and jargon by listing them in `cspell.json` at the repo root.
why changed
cat > cspell.json <<'EOF' { "version": "0.2", "words": ["setfork", "your-product-name", "kubectl"] } EOF
Verify cspell configurationOptionalAdded

Check that the cspell configuration file is correctly set up and includes necessary words.

Check for updates regularlyOptionalAdded

Periodically check for updates to jq and cspell to ensure optimal performance and features.

Review