What problem does it solve?
Discourse's global tsconfig is deliberately not strict, so type-checking alone cannot guarantee correct TypeScript in core, plugins, and themes. This Skill encodes the strict-grade authoring bar, the faithful-port rules for converting .js/.gjs files to .ts/.gts, and the runtime pitfalls (like stale extensioned imports) that ember-tsc never catches.
Core Features & Use Cases
- Component and modifier patterns: Signature interfaces for .gts components (Args, Element, Blocks), template-only components via TOC, ember-modifier classes, and typed @service declare injection with Service-suffixed bindings.
- Faithful JS-to-TS conversion: A catalogue of forbidden transformations that pass lint:types but change runtime behavior, plus rename mechanics under squash-merge and a per-file conversion-completeness checklist.
- Compile-time type tests: Guidance for expect-type tests in frontend/discourse/type-tests, including the rule to split @glint-expect-error negatives into separate files.
- Use Case: When converting a .gjs component to .gts, apply the faithful-port rules to keep every guard and fallback intact, type the Signature against all real call sites, grep for stale .gjs imports, and verify with bin/lint, pnpm lint:types, and bin/qunit.
Quick Start
Ask the AI to convert a specific Discourse .gjs component to .gts with a fully typed Signature and typed service injections, then run the lint, type-check, and test verification steps.