feat(typescript-guidelines): fire on JavaScript, gate on Standard §3.1.1 - #24
Merged
Merged
Conversation
The description's negative trigger — "Do NOT trigger for standard JavaScript (unless type-safety is requested)" — became wrong the moment §3.1.1 landed. The one point at which this skill most needs to load is when someone reaches for plain JavaScript, because that is exactly when the Standard says to stop and write TypeScript instead. As written, the skill reached only those who had already chosen TypeScript: the audience that needs the rule least. Description: the negative JS trigger is replaced by a positive one — .js/.mjs/.cjs, package.json, Node/Deno/Bun, Electron, npm packages, VS Code extensions, browser scripts — with the reason stated inline so the loading agent knows what to do on arrival (convert, or file the exemption). Trimmed the V8 and project-reference clauses to pay for it: 966 rendered characters against the §5.6 cap of 1000. Body: new "§3.1.1 — TypeScript over JavaScript (read this first)" section ahead of Core Philosophy, giving the four-step gate — prefer a memory-safe alternative, else author TypeScript, else check the three no-filing exemptions, else document one — plus the transpiling-is-not- typechecking note. Anti-Patterns gains authoring stray .js, @ts-ignore, and bundler-only CI; the pre-commit checklist gains two §3.1.1 lines. Both bundles rebuilt and byte-verified against the working tree. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
The problem
Standard §3.1.1 landed in #23: wherever the JavaScript runtime is required, source MUST be TypeScript. But this skill's description ended with:
That negative trigger is now actively wrong. The one moment the skill most needs to load is when someone reaches for plain JavaScript — because that is exactly when §3.1.1 says stop, write TypeScript instead. As written, the skill reached only people who had already chosen TypeScript: the audience that needs the rule least. A rule that cannot reach its audience is not in force.
The fix
Trigger (the important half). The negative JS trigger is replaced by a positive one —
.js/.mjs/.cjs,package.json, Node/Deno/Bun, Electron, npm packages, VS Code extensions, browser scripts — with the reason stated inline, so the loading agent knows what to do on arrival: convert it, or file the exemption.Do NOT trigger for other languagesis kept.Paying for the added text: the
project references (composite, incremental)and V8 clauses were trimmed. 966 rendered characters against the §5.6 cap of 1000.Body. New
## §3.1.1 — TypeScript over JavaScript (read this first)section ahead of Core Philosophy, giving a four-step gate:.jsand offer to convert later..js, vendored/§4.2 file, generated output)? Emitted.jsis a derived artifact and out of scope.Plus a note that converting a
.jswith a rename that leavesanyeverywhere satisfies neither §3.1.1 nor this skill, and that transpiling is not typechecking (esbuild/SWC/Bun strip types without checking them;tsc --noEmitgates CI).Anti-Patterns gains authoring stray
.js,@ts-ignore, and bundler-only CI. Pre-commit checklist gains two §3.1.1 lines.Verification
reuse lint— compliantunzip -p … | diff -) against the working tree🤖 Generated with Claude Code