Skip to content

feat(typescript-guidelines): fire on JavaScript, gate on Standard §3.1.1 - #24

Merged
UnbreakableMJ merged 1 commit into
mainfrom
skill/typescript-guidelines-3.1.1-gate
Aug 4, 2026
Merged

feat(typescript-guidelines): fire on JavaScript, gate on Standard §3.1.1#24
UnbreakableMJ merged 1 commit into
mainfrom
skill/typescript-guidelines-3.1.1-gate

Conversation

@UnbreakableMJ

Copy link
Copy Markdown
Contributor

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:

Do NOT trigger for standard JavaScript (unless type-safety is requested) or other languages.

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 languages is 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:

  1. Is a memory-safe alternative available (Rust→Wasm, Rust/Go server, Flutter/Dart UI)? §3.1 chooses it over the JavaScript runtime entirely.
  2. Is the JS runtime genuinely required? Author it in TypeScript — do not write the .js and offer to convert later.
  3. Does a no-filing exemption cover it (tool config that must be .js, vendored/§4.2 file, generated output)? Emitted .js is a derived artifact and out of scope.
  4. Anything else — including "it is only a small script" — needs a documented technical exemption, stated plainly rather than written silently.

Plus a note that converting a .js with a rename that leaves any everywhere satisfies neither §3.1.1 nor this skill, and that transpiling is not typechecking (esbuild/SWC/Bun strip types without checking them; tsc --noEmit gates CI).

Anti-Patterns gains authoring stray .js, @ts-ignore, and bundler-only CI. Pre-commit checklist gains two §3.1.1 lines.

Verification

  • Description: 966 rendered chars, under the §5.6 cap (CI's skill-description gate re-checks this)
  • reuse lint — compliant
  • Both bundles rebuilt and byte-verified (unzip -p … | diff -) against the working tree

🤖 Generated with Claude Code

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>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@UnbreakableMJ
UnbreakableMJ merged commit 7b2215c into main Aug 4, 2026
1 check passed
@UnbreakableMJ
UnbreakableMJ deleted the skill/typescript-guidelines-3.1.1-gate branch August 4, 2026 23:56
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