Skip to content

feat: enforce WebJs brand casing with one simple prose rule + one-time fix#855

Merged
vivek7405 merged 6 commits into
mainfrom
feat/brand-casing-midsentence
Jul 9, 2026
Merged

feat: enforce WebJs brand casing with one simple prose rule + one-time fix#855
vivek7405 merged 6 commits into
mainfrom
feat/brand-casing-midsentence

Conversation

@vivek7405

Copy link
Copy Markdown
Collaborator

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. WebJs is a proper noun, so it is capitalized wherever it names the project in prose (sentence start AND mid-sentence). It stays lowercase webjs ONLY as a literal code token. The rule flags a standalone lowercase webjs in prose, with just two structurally-detectable exclusions (no open-ended word list):

  1. Code. Token forms are caught for free by a word boundary (@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: {} }).
  2. CLI commands. webjs <subcommand> stays lowercase. This is the one finite, real list, and a drift-guard test keeps it in sync with bin/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 WebJs across AGENTS.md, README.md, agent-docs/, the docs site (docs/), the marketing website/, 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 the examples/blog copy 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

@vivek7405 vivek7405 marked this pull request as ready for review July 9, 2026 06:03
@vivek7405 vivek7405 merged commit f41d105 into main Jul 9, 2026
9 of 10 checks passed
@vivek7405 vivek7405 deleted the feat/brand-casing-midsentence branch July 9, 2026 06:05
@vivek7405

Copy link
Copy Markdown
Collaborator Author

Tracked by #858.

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.
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.

1 participant