Skip to content

feat(prompts): add cspell-config prompt for automated spell check maintenance#1516

Open
cundernehr wants to merge 10 commits intomicrosoft:mainfrom
cundernehr:add-cspell-config-prompt
Open

feat(prompts): add cspell-config prompt for automated spell check maintenance#1516
cundernehr wants to merge 10 commits intomicrosoft:mainfrom
cundernehr:add-cspell-config-prompt

Conversation

@cundernehr
Copy link
Copy Markdown
Collaborator

feat(prompts): add cspell-config prompt for automated spell check maintenance

Added a new experimental prompt to the experimental collection that automates cspell.json maintenance. The prompt instructs Copilot to run spell checking across the workspace, curate project-specific words, update the words array (alphabetized and deduped), and synchronize ignorePaths with .gitignore.

Description

Introduced .github/prompts/experimental/cspell-config.prompt.md and registered it across collection manifests and plugin outputs.

The prompt guides Copilot through a structured workflow: run cspell, collect unknown words, filter garbage tokens from legitimate project vocabulary, update cspell.json with curated entries, and re-run validation to confirm reduced issue counts. Acceptance criteria target fewer than 50 remaining issues after execution.

  • Registered the cspell-config prompt in collections/experimental.collection.yml under a new # Prompts section
  • Added the prompt to collections/hve-core-all.collection.yml with maturity: experimental
  • Updated plugins/experimental/.github/plugin/plugin.json with a new "commands" array exposing commands/experimental/
  • Added "commands/experimental/" to plugins/hve-core-all/.github/plugin/plugin.json, maintaining alphabetical order

Related Issue(s)

None

Type of Change

Select all that apply:

Code & Documentation:

  • Bug fix (non-breaking change fixing an issue)
  • New feature (non-breaking change adding functionality)
  • Breaking change (fix or feature causing existing functionality to change)
  • Documentation update

Infrastructure & Configuration:

  • GitHub Actions workflow
  • Linting configuration (markdown, PowerShell, etc.)
  • Security configuration
  • DevContainer configuration
  • Dependency update

AI Artifacts:

  • Reviewed contribution with prompt-builder agent and addressed all feedback
  • Copilot instructions (.github/instructions/*.instructions.md)
  • Copilot prompt (.github/prompts/*.prompt.md)
  • Copilot agent (.github/agents/*.agent.md)
  • Copilot skill (.github/skills/*/SKILL.md)

Note for AI Artifact Contributors:

  • Agents: Research, indexing/referencing other project (using standard VS Code GitHub Copilot/MCP tools), planning, and general implementation agents likely already exist. Review .github/agents/ before creating new ones.
  • Skills: Must include both bash and PowerShell scripts. See Skills.
  • Model Versions: Only contributions targeting the latest Anthropic and OpenAI models will be accepted. Older model versions (e.g., GPT-3.5, Claude 3) will be rejected.
  • See Agents Not Accepted and Model Version Requirements.

Other:

  • Script/automation (.ps1, .sh, .py)
  • Other (please describe):

Sample Prompts (for AI Artifact Contributions)

User Request:

Invoke the cspell-config prompt (via /prompt or equivalent) to update the project's cspell.json with domain-specific vocabulary.

Execution Flow:

  1. Runs npx cspell --config cspell.json "**/*" to identify unknown words
  2. Collects and categorizes unknown tokens, filtering garbage/generated strings
  3. Adds high-value project-specific tokens to the words array (alphabetized, deduped)
  4. Synchronizes ignorePaths with .gitignore entries
  5. Re-runs cspell and reports final issue counts

Output Artifacts:

Updated cspell.json with expanded words array and refined ignorePaths. A summary of added tokens, ignored paths, and remaining issue count.

Success Indicators:

  • cspell.json words array is alphabetized and contains no duplicates
  • ignorePaths reflects .gitignore exclusions for generated folders
  • Final cspell run shows fewer than 50 issues (or provides rationale and next actions)

Note

Human review is recommended for agent-populated Sample Prompts content.

Testing

  • Markdown linting (npm run lint:md): Failed (environment issue — missing markdownlint-rule-search-replace module, pre-existing)
  • Spell checking (npm run spell-check): Failed (4 pre-existing issues in unrelated files: docs/contributing/documentation-maintenance.md, docs/getting-started/methods/submodule.md)
  • Frontmatter validation (npm run lint:frontmatter): Passed (537 files validated, 0 errors)
  • Skill structure validation (npm run validate:skills): Passed (19 skills, 0 errors, 1 pre-existing warning in customer-card-render)
  • Link validation (npm run lint:md-links): Failed (environment issue — markdown-link-check not installed, pre-existing)
  • PowerShell analysis (npm run lint:ps): Passed (all files clean)
  • Security analysis: No sensitive data exposure, dependency vulnerabilities, or privilege escalation detected
  • Diff-based assessment: All manifest updates are consistent and maintain alphabetical ordering
  • Manual testing was not performed

Checklist

Required Checks

  • Documentation is updated (if applicable)
  • Files follow existing naming conventions
  • Changes are backwards compatible (if applicable)
  • Tests added for new functionality (if applicable) (N/A — prompt artifact; no test infrastructure applies)

AI Artifact Contributions

  • Used /prompt-analyze to review contribution
  • Addressed all feedback from prompt-builder review
  • Verified contribution follows common standards and type-specific requirements

Required Automated Checks

The following validation commands must pass before merging:

  • Markdown linting: npm run lint:md (N/A — environment missing markdownlint-rule-search-replace)
  • Spell checking: npm run spell-check (N/A — 4 pre-existing issues in unrelated files)
  • Frontmatter validation: npm run lint:frontmatter
  • Skill structure validation: npm run validate:skills
  • Link validation: npm run lint:md-links (N/A — markdown-link-check not installed)
  • PowerShell analysis: npm run lint:ps

Warning

This PR includes experimental GHCP artifacts that may have breaking changes.

  • .github/prompts/experimental/cspell-config.prompt.md

GHCP Artifact Maturity

File Type Maturity Notes
.github/prompts/experimental/cspell-config.prompt.md Prompt ⚠️ experimental Pre-release only

GHCP Maturity Acknowledgment

  • I acknowledge this PR includes non-stable GHCP artifacts
  • Non-stable artifacts are intentional for this change

Additional Notes

  • The experimental collection did not previously have a # Prompts section; one was introduced to house this entry.
  • Plugin outputs were regenerated via npm run plugin:generate before committing.

…oject-specific words and ignores

- include instructions for spell-checking and token management
- define acceptance criteria for cspell.json updates
- document best practices for adding project-specific tokens

🔤 - Generated by Copilot
@cundernehr cundernehr requested a review from a team as a code owner May 4, 2026 00:00
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.43%. Comparing base (57ea279) to head (ea497fd).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1516      +/-   ##
==========================================
- Coverage   87.44%   87.43%   -0.01%     
==========================================
  Files          68       68              
  Lines       10335    10335              
==========================================
- Hits         9037     9036       -1     
- Misses       1298     1299       +1     
Flag Coverage Δ
pester 84.79% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@katriendg katriendg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @cundernehr for this addition!

Before we move to full review, I wanted to validate with you if the intention is truly to have a) generalized prompt for folks to use across repos & distribute it with plugins and extensions, or b) keep it as a useful prompt for contributors to hve-core repo only?

In case of a) I believe it would be beneficial to have the prompt more generic, for example, the config of cspell should be more dynamic (e.g., search cspell.{json,yaml,yml,js,cjs,mjs}, .cspell.json, cspell.config.*), the dictionary files are setup in a specific way in hve-core, but would need to be more generic as well, ...

In case of b) small changes would be recommended to align with hve-core's setup (for example the config file is .cspell.json and not cspell.json, you could move the prompt file at the root of .github/prompts folder which is where HVE Core repo specific prompts reside, and they don't need to be added to any collection, then either to regenerate any plugins.

Chris Undernehr and others added 2 commits May 4, 2026 14:32
@cundernehr
Copy link
Copy Markdown
Collaborator Author

Thanks a lot @cundernehr for this addition!

Before we move to full review, I wanted to validate with you if the intention is truly to have a) generalized prompt for folks to use across repos & distribute it with plugins and extensions, or b) keep it as a useful prompt for contributors to hve-core repo only?

In case of a) I believe it would be beneficial to have the prompt more generic, for example, the config of cspell should be more dynamic (e.g., search cspell.{json,yaml,yml,js,cjs,mjs}, .cspell.json, cspell.config.*), the dictionary files are setup in a specific way in hve-core, but would need to be more generic as well, ...

In case of b) small changes would be recommended to align with hve-core's setup (for example the config file is .cspell.json and not cspell.json, you could move the prompt file at the root of .github/prompts folder which is where HVE Core repo specific prompts reside, and they don't need to be added to any collection, then either to regenerate any plugins.

Thank you for the review! I am going for option A. Please see my latest commit that makes the prompt more generic.

Copy link
Copy Markdown
Contributor

@katriendg katriendg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @ch this is looking good and very useful!
Two minor 'polish' comments you may address before we merge, but fine with leaving them out as well.


1. Re-run cspell using the same command from Step 4.
2. Report the final counts: files checked, issues found, files with issues.
3. If more than 50 issues remain, provide a short rationale and suggest next actions (add more words, fix typos, or add more ignore paths).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment 1 (Step 7.3 + Acceptance criteria) — 💡 Suggestion

The "< 50 issues" target is arbitrary across repo sizes. Either remove the absolute number or express it relative to baseline.

Suggested Change

3. If the issue count has not meaningfully decreased from baseline (target:
   ≥80% reduction), provide a short rationale and suggest next actions
   (add more words, fix typos, or add more ignore paths).

And in Acceptance criteria:

* A final cspell run shows a meaningful reduction from the baseline (target
  ≥80%, or the agent documents the remaining categories with rationale).

### Step 5: Curate and categorize tokens

1. Group unknown tokens into categories: project-specific terms, acronyms, technology names, environment variables, proper nouns, and potential typos.
2. Filter out obvious garbage (long random hashes, base64 strings, generated identifiers).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment 2 (Step 5.2) — 💡 Suggestion

Concrete heuristics make filtering reproducible across runs and repos.

Suggested Change

2. Filter out obvious garbage using these heuristics:
   - hex strings of 16+ chars (`[a-f0-9]{16,}`)
   - base64-looking strings (`[A-Za-z0-9+/]{20,}={0,2}`)
   - tokens appearing only in lockfiles, minified assets, or build output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants