feat: enforce WebJs brand casing with one simple prose rule + one-time fix#855
Merged
Conversation
Collaborator
Author
|
Tracked by #858. |
This was referenced Jul 9, 2026
vivek7405
added a commit
that referenced
this pull request
Jul 9, 2026
#855 correctly capitalized the llms.txt index H1 in llms.server.ts to '# WebJs documentation' but left test/docs/llms.test.mjs and docs/AGENTS.md pinning the old lowercase form, which failed on main. Update the test assertion and the docs spec to match the emitted WebJs casing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Brand casing follows the em-dash pattern already used in this repo. First a one-time purge of existing violations, then a dead-simple absolute hook rule that blocks new ones.
The rule
One unified check, replacing the prior sentence-start-only rule and the rejected verb allowlist.
WebJsis a proper noun, so it is capitalized wherever it names the project in prose (sentence start AND mid-sentence). It stays lowercasewebjsONLY as a literal code token. The rule flags a standalone lowercasewebjsin prose, with just two structurally-detectable exclusions (no open-ended word list):@webjsdev,webjs.dev,"webjs",WEBJS_*,webjsdev/webjs,<webjs-suspense>). Inline`code`and fenced spans are stripped. Bare identifiers are left alone (if (!webjs),const webjs = pkg.webjs,{ webjs: {} }).webjs <subcommand>stays lowercase. This is the one finite, real list, and a drift-guard test keeps it in sync withbin/webjs.js.Because it flags by default, it catches EVERY verb (
webjs ships,webjs powers,webjs handles), not a hardcoded set. The follower is a following word or a sentence-ending period only, so it never false-blocks real code (biases toward false-negatives, the same caution as the em-dash rule).One-time fix
Capitalized existing brand-prose occurrences to
WebJsacross AGENTS.md, README.md,agent-docs/, the docs site (docs/), the marketingwebsite/, and package source comments. CLI commands, token forms, and code were left lowercase. Each surface was reviewed and committed separately.Scope notes
The hook is repo-only. The scaffold copy (
packages/cli/templates/.claude/hooks/) and theexamples/blogcopy deliberately carry NO brand rule (a generated user app is not webjs-branded) and are unchanged. Excluded from the fix:changelog/(auto-generated), scaffold templates, and.sh/ CI code.Tests
test/hooks/block-prose-punctuation.test.mjs: 19 of 19 passing, including the inverted-rule cases, the code-safety counterfactuals, and a CLI-list drift guard.https://claude.ai/code/session_016RNAZ8EfZYE8ZBpKUCzUao