microsoft/fast/typescript
Claude Code and agent skill by microsoft/fast
- vendor
Checking that the SKILL.md file is still in the repository.
Use this guide when working on TypeScript changes in the FAST monorepo — authoring Web Components, writing templates and styles, working with the observable/reactive system, and testing.
Install
npx vskill@latest install microsoft/fast/typescriptSKILL.md
The same SKILL.md was published earlier as microsoft/fast/typescript.
TypeScript Patterns for FAST
Modules
fast-element enables verbatimModuleSyntax, so type-only imports must use import type or the inline type qualifier:
Sub-entry-points expose focused APIs through the exports map:
The barrel index.ts explicitly lists every re-export grouped by subsystem — no export * statements.
Aside from the index.ts or index.*.ts files there should be no barrel exports.
Side Effects
Do not add side effectful code and do not add sideEffects to package.json files. APIs added should import named exports.
Browser APIs
Do not use
Our stance as a framework library is that certain browser APIs are best avoided by the framework. We may facilitate the use of them through our provided APIs.
List of APIs to avoid implementing in FAST packages:
requestIdleCallbacksetTimeoutsetInterval
Avoid
Some browser APIs can be used but should be avoided as a developer may encounter edge cases with task queuing or other logic their app is executing.
List of APIs to avoid in FAST packages:
requestAnimationFramequeueMicrotask
Custom elements
Elements extend FASTElement. Do not use the @customElement decorator.
Use define() for registration. define() returns a Promise that resolves immediately when a template is provided:
Example define.ts (side-effect import):
Templates
Templates use the html tagged template literal typed to the element class:
Binding syntax
| Prefix | Purpose | Example | |
|---|---|---|---|
${x => ...} | Content or attribute | ${x => x.name} | |
@event | Event listener | @click=${x => x.handleClick()} | |
@event | Event with context | @click=${(x, c) => c.parent.remove(x)} | |
:prop | DOM property | :value=${twoWay(x => x.description)} | |
?attr | Boolean attribute | ?disabled=${x => !x.isValid} |
Two-way bindings require a sub-entry-point import:
Partial HTML
Use html.partial() to inject pre-built HTML strings into a template without creating a full ViewTemplate:
Styles
Styles use the css tagged template literal. They attach through the element definition's styles property:
For declarative HTML definitions, styles live in a separate .styles.css file linked from both the initial shadow root template and the <f-template>:
css.partial() works the same way as html.partial() — injecting raw CSS strings.
Reactivity
@attr maps HTML attributes to properties. @observable creates reactive properties tracked by templates. @volatile marks getters whose dependencies change between calls:
Notify the system after in-place mutations that it cannot detect automatically:
Make plain objects observable via the state sub-entry-point:
Testing
Tests use Playwright Test (*.pw.spec.ts) and combine two patterns within the same file.
Direct-import tests
For logic that does not need browser APIs — the test callback takes no parameters:
Browser-evaluated tests
For tests requiring DOM APIs, navigate to the Vite dev server and import via "/main.js". The @ts-expect-error comment is required because TypeScript cannot resolve the URL-based import:
Only serializable values can cross the page.evaluate boundary — run expect() assertions outside it on the returned data.
The test harness at packages/<package>/test/main.ts re-exports source modules for browser tests. When adding new package exports, add them there too.
TypeScript idioms
Const-type merging for enumerations
Frozen const objects paired with a type extracted from their values replace TypeScript enum:
Interface-const merging
FASTElement is both an interface (instance shape) and a const (constructor). Static methods use typeof to carry overloaded signatures:
Tagged template intersection types
html and css are typed as intersections of a tagged template function and a .partial() method:
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 10 Jul 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/typescript/SKILL.md
Popularity
- Repository stars
- 9,666
- Repository forks
- 628
- 7-day trend score
- 46
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 17 Mar 2026, 8 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoft/fast/typescript)