Podstawy
TypeScript
Writes and reviews TypeScript for front-end apps (TypeScript 7, React, Vue, Svelte, Angular, Astro) - strict config, no any, types checked at the boundaries (API, storage, forms), narrowing instead of casts, a tsconfig that builds on 6 and 7. Use when editing .ts or .tsx files or a tsconfig, upgrading TypeScript, or when asked to type an API response or review types.
fe-typescripttypescript6 regułładowane zawsze: 87 tokenów; przy użyciu: 1016 tokenów; w referencjach na żądanie: 2090 tokenów.
Instalacja
init instaluje ten skill, gdy projekt używa: typescript. Wybierz agenta, aby zobaczyć, gdzie trafią jego pliki.
npx github:dawidolko/frontend-skills init Ten sposób nie był jeszcze testowany. npx i pnpm dlx są przetestowane; jeśli ten zawiedzie, użyj jednego z nich.
Bez --agents polecenie init rozpoznaje agentów po tym, co projekt już ma, a gdy nie znajdzie żadnego, pyta:
Po czym init rozpoznaje każdego z agentów (17)
| Agent | Rozpoznawany po |
|---|---|
| Claude Code | CLAUDE.md .claude CLAUDE.local.md |
| OpenAI Codex | .codex AGENTS.override.md |
| Cursor | .cursor .cursorrules |
| GitHub Copilot | .github/copilot-instructions.md .github/instructions .github/skills .github/prompts |
| Gemini CLI | GEMINI.md .gemini |
| Antigravity CLI | .agents/rules .agent/rules |
| Devin / Windsurf | .devin .windsurf .windsurfrules |
| OpenCode | opencode.json opencode.jsonc .opencode |
| Cline | .clinerules .cline |
| Zed | .rules .zed |
| JetBrains Junie | .junie |
| Kiro | .kiro |
| Augment | .augment .augment-guidelines |
| Trae | .trae |
| Continue | .continue |
| Amazon Q Developer | .amazonq |
| Aider | .aider.conf.yml CONVENTIONS.md |
Gdzie trafia fe-typescript dla: Claude Code
.claude/skills/fe-typescript/SKILL.mdskill.claude/skills/fe-typescript/references/typescript.mdskill.claude/rules/fe-typescript.mdplik regułCLAUDE.mdblok instrukcji
Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.
Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.
---
paths:
- "**/*.ts"
- "**/*.tsx"
- "**/*.mts"
- "**/*.cts"
- "**/tsconfig*.json"
---
# TypeScript (frontend-skills)
Writes and reviews TypeScript for front-end apps (TypeScript 7, React, Vue, Svelte, Angular, Astro) - strict config, no any, types checked at the boundaries (API, storage, forms), narrowing instead of casts, a tsconfig that builds on 6 and 7. Use when editing .ts or .tsx files or a tsconfig, upgrading TypeScript, or when asked to type an API response or review types.
- Keep `strict` on; never set it or one of its flags to `false` (ts/strict).
- Use no option removed in TypeScript 7: `baseUrl`, `moduleResolution: "node"`, `target: "es5"`, `outFile` (ts/no-deprecated-options).
- With Vite or another per-file compiler, set `verbatimModuleSyntax` and write `import type` (ts/isolated-modules).
- Never write `any`: use the real type, a generic, or `unknown` and narrow it (ts/no-explicit-any).
- Validate data from `fetch`, `JSON.parse`, storage, `postMessage` and URLs at run time; never type it with `as` (ts/validate-untrusted).
- Silence an error only with `@ts-expect-error` and a reason, never `@ts-ignore` (ts/no-ts-ignore).
- Narrow with `typeof`, `instanceof`, `in` and type guards instead of `as` casts and `!` assertions.
- Model states as discriminated unions (`{ status: 'error'; error: Error }`) and end a `switch` over them with a `never` check.
- Infer local types; annotate exported functions, component props and module boundaries.
Before larger changes, read the full skill: `.claude/skills/fe-typescript/SKILL.md`. Explain any rule id with `npx github:dawidolko/frontend-skills explain <id>`.Gdzie trafia fe-typescript dla: OpenAI Codex
.agents/skills/fe-typescript/SKILL.mdskill.agents/skills/fe-typescript/references/typescript.mdskillAGENTS.mdblok instrukcji
Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.
OpenAI Codex nie ma plików reguł zawężonych do typów plików; czyta skille i blok instrukcji.
Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.
## Front-end work (frontend-skills)
- Before front-end work, read `.frontend-skills/profile.json` (the stack) and `.frontend-skills/lessons.md` (confirmed conventions of this project; they win over any skill).
- Use the installed `fe-*` skill that matches the files you edit.
- After changing UI code, run `npx github:dawidolko/frontend-skills audit --changed --json` and fix findings at `serious` and above; `explain <rule id>` gives the reason, the source and the fix.
- Name rule ids (such as `a11y/img-alt`) in reviews and commit messages.Gdzie trafia fe-typescript dla: Cursor
.agents/skills/fe-typescript/SKILL.mdskill.agents/skills/fe-typescript/references/typescript.mdskill.cursor/rules/fe-typescript.mdcplik regułAGENTS.mdblok instrukcji
Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.
Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.
---
description: Writes and reviews TypeScript for front-end apps (TypeScript 7, React, Vue, Svelte, Angular, Astro) - strict config, no any, types checked at the boundaries (API, storage, forms), narrowing instead of casts, a tsconfig that builds on 6 and 7. Use when editing .ts or .tsx files or a tsconfig, upgrading TypeScript, or when asked to type an API response or review types.
globs: **/*.ts, **/*.tsx, **/*.mts, **/*.cts, **/tsconfig*.json
alwaysApply: false
---
# TypeScript (frontend-skills)
- Keep `strict` on; never set it or one of its flags to `false` (ts/strict).
- Use no option removed in TypeScript 7: `baseUrl`, `moduleResolution: "node"`, `target: "es5"`, `outFile` (ts/no-deprecated-options).
- With Vite or another per-file compiler, set `verbatimModuleSyntax` and write `import type` (ts/isolated-modules).
- Never write `any`: use the real type, a generic, or `unknown` and narrow it (ts/no-explicit-any).
- Validate data from `fetch`, `JSON.parse`, storage, `postMessage` and URLs at run time; never type it with `as` (ts/validate-untrusted).
- Silence an error only with `@ts-expect-error` and a reason, never `@ts-ignore` (ts/no-ts-ignore).
- Narrow with `typeof`, `instanceof`, `in` and type guards instead of `as` casts and `!` assertions.
- Model states as discriminated unions (`{ status: 'error'; error: Error }`) and end a `switch` over them with a `never` check.
- Infer local types; annotate exported functions, component props and module boundaries.
Before larger changes, read the full skill: `.agents/skills/fe-typescript/SKILL.md`. Explain any rule id with `npx github:dawidolko/frontend-skills explain <id>`.Gdzie trafia fe-typescript dla: GitHub Copilot
.agents/skills/fe-typescript/SKILL.mdskill.agents/skills/fe-typescript/references/typescript.mdskill.github/instructions/fe-typescript.instructions.mdplik regułAGENTS.mdblok instrukcji
Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.
Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.
---
applyTo: "**/*.ts,**/*.tsx,**/*.mts,**/*.cts,**/tsconfig*.json"
description: "Writes and reviews TypeScript for front-end apps (TypeScript 7, React, Vue, Svelte, Angular, Astro) - strict config, no any, types checked at the boundaries (API, storage, forms), narrowing instead of casts, a tsconfig that builds on 6 and 7. Use when editing .ts or .tsx files or a tsconfig, upgrading TypeScript, or when asked to type an API response or review types."
---
# TypeScript (frontend-skills)
- Keep `strict` on; never set it or one of its flags to `false` (ts/strict).
- Use no option removed in TypeScript 7: `baseUrl`, `moduleResolution: "node"`, `target: "es5"`, `outFile` (ts/no-deprecated-options).
- With Vite or another per-file compiler, set `verbatimModuleSyntax` and write `import type` (ts/isolated-modules).
- Never write `any`: use the real type, a generic, or `unknown` and narrow it (ts/no-explicit-any).
- Validate data from `fetch`, `JSON.parse`, storage, `postMessage` and URLs at run time; never type it with `as` (ts/validate-untrusted).
- Silence an error only with `@ts-expect-error` and a reason, never `@ts-ignore` (ts/no-ts-ignore).
- Narrow with `typeof`, `instanceof`, `in` and type guards instead of `as` casts and `!` assertions.
- Model states as discriminated unions (`{ status: 'error'; error: Error }`) and end a `switch` over them with a `never` check.
- Infer local types; annotate exported functions, component props and module boundaries.
Before larger changes, read the full skill: `.agents/skills/fe-typescript/SKILL.md`. Explain any rule id with `npx github:dawidolko/frontend-skills explain <id>`.Gdzie trafia fe-typescript dla: Gemini CLI
.agents/skills/fe-typescript/SKILL.mdskill.agents/skills/fe-typescript/references/typescript.mdskillGEMINI.mdblok instrukcji
Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.
Gemini CLI: Gemini CLI was replaced by Antigravity CLI for unpaid tiers on 2026-06-18; choose "antigravity" too if you use it.
Gemini CLI nie ma plików reguł zawężonych do typów plików; czyta skille i blok instrukcji.
Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.
## Front-end work (frontend-skills)
- Before front-end work, read `.frontend-skills/profile.json` (the stack) and `.frontend-skills/lessons.md` (confirmed conventions of this project; they win over any skill).
- Use the installed `fe-*` skill that matches the files you edit.
- After changing UI code, run `npx github:dawidolko/frontend-skills audit --changed --json` and fix findings at `serious` and above; `explain <rule id>` gives the reason, the source and the fix.
- Name rule ids (such as `a11y/img-alt`) in reviews and commit messages.Gdzie trafia fe-typescript dla: Antigravity CLI
.agents/skills/fe-typescript/SKILL.mdskill.agents/skills/fe-typescript/references/typescript.mdskill.agents/rules/fe-typescript.mdplik regułAGENTS.mdblok instrukcji
Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.
Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.
---
trigger: glob
globs: "**/*.ts, **/*.tsx, **/*.mts, **/*.cts, **/tsconfig*.json"
description: "Writes and reviews TypeScript for front-end apps (TypeScript 7, React, Vue, Svelte, Angular, Astro) - strict config, no any, types checked at the boundaries (API, storage, forms), narrowing instead of casts, a tsconfig that builds on 6 and 7. Use when editing .ts or .tsx files or a tsconfig, upgrading TypeScript, or when asked to type an API response or review types."
---
# TypeScript (frontend-skills)
- Keep `strict` on; never set it or one of its flags to `false` (ts/strict).
- Use no option removed in TypeScript 7: `baseUrl`, `moduleResolution: "node"`, `target: "es5"`, `outFile` (ts/no-deprecated-options).
- With Vite or another per-file compiler, set `verbatimModuleSyntax` and write `import type` (ts/isolated-modules).
- Never write `any`: use the real type, a generic, or `unknown` and narrow it (ts/no-explicit-any).
- Validate data from `fetch`, `JSON.parse`, storage, `postMessage` and URLs at run time; never type it with `as` (ts/validate-untrusted).
- Silence an error only with `@ts-expect-error` and a reason, never `@ts-ignore` (ts/no-ts-ignore).
- Narrow with `typeof`, `instanceof`, `in` and type guards instead of `as` casts and `!` assertions.
- Model states as discriminated unions (`{ status: 'error'; error: Error }`) and end a `switch` over them with a `never` check.
- Infer local types; annotate exported functions, component props and module boundaries.
Before larger changes, read the full skill: `.agents/skills/fe-typescript/SKILL.md`. Explain any rule id with `npx github:dawidolko/frontend-skills explain <id>`.Gdzie trafia fe-typescript dla: Devin / Windsurf
.agents/skills/fe-typescript/SKILL.mdskill.agents/skills/fe-typescript/references/typescript.mdskill.devin/rules/fe-typescript.mdplik regułAGENTS.mdblok instrukcji
Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.
Devin / Windsurf: Devin CLI also reads .cursor/rules; with Cursor chosen too, the CLI sees both rule files of a skill.
Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.
---
trigger: glob
globs: "**/*.ts,**/*.tsx,**/*.mts,**/*.cts,**/tsconfig*.json"
---
# TypeScript (frontend-skills)
Writes and reviews TypeScript for front-end apps (TypeScript 7, React, Vue, Svelte, Angular, Astro) - strict config, no any, types checked at the boundaries (API, storage, forms), narrowing instead of casts, a tsconfig that builds on 6 and 7. Use when editing .ts or .tsx files or a tsconfig, upgrading TypeScript, or when asked to type an API response or review types.
- Keep `strict` on; never set it or one of its flags to `false` (ts/strict).
- Use no option removed in TypeScript 7: `baseUrl`, `moduleResolution: "node"`, `target: "es5"`, `outFile` (ts/no-deprecated-options).
- With Vite or another per-file compiler, set `verbatimModuleSyntax` and write `import type` (ts/isolated-modules).
- Never write `any`: use the real type, a generic, or `unknown` and narrow it (ts/no-explicit-any).
- Validate data from `fetch`, `JSON.parse`, storage, `postMessage` and URLs at run time; never type it with `as` (ts/validate-untrusted).
- Silence an error only with `@ts-expect-error` and a reason, never `@ts-ignore` (ts/no-ts-ignore).
- Narrow with `typeof`, `instanceof`, `in` and type guards instead of `as` casts and `!` assertions.
- Model states as discriminated unions (`{ status: 'error'; error: Error }`) and end a `switch` over them with a `never` check.
- Infer local types; annotate exported functions, component props and module boundaries.
Before larger changes, read the full skill: `.agents/skills/fe-typescript/SKILL.md`. Explain any rule id with `npx github:dawidolko/frontend-skills explain <id>`.Gdzie trafia fe-typescript dla: OpenCode
.agents/skills/fe-typescript/SKILL.mdskill.agents/skills/fe-typescript/references/typescript.mdskillAGENTS.mdblok instrukcji
Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.
OpenCode nie ma plików reguł zawężonych do typów plików; czyta skille i blok instrukcji.
Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.
## Front-end work (frontend-skills)
- Before front-end work, read `.frontend-skills/profile.json` (the stack) and `.frontend-skills/lessons.md` (confirmed conventions of this project; they win over any skill).
- Use the installed `fe-*` skill that matches the files you edit.
- After changing UI code, run `npx github:dawidolko/frontend-skills audit --changed --json` and fix findings at `serious` and above; `explain <rule id>` gives the reason, the source and the fix.
- Name rule ids (such as `a11y/img-alt`) in reviews and commit messages.Gdzie trafia fe-typescript dla: Cline
.claude/skills/fe-typescript/SKILL.mdskill.claude/skills/fe-typescript/references/typescript.mdskill.clinerules/fe-typescript.mdplik regułAGENTS.mdblok instrukcji
Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.
Cline: If .clinerules is a single file rather than a folder, Cline rule files are not written; skills still are.
Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.
---
paths:
- "**/*.ts"
- "**/*.tsx"
- "**/*.mts"
- "**/*.cts"
- "**/tsconfig*.json"
---
# TypeScript (frontend-skills)
Writes and reviews TypeScript for front-end apps (TypeScript 7, React, Vue, Svelte, Angular, Astro) - strict config, no any, types checked at the boundaries (API, storage, forms), narrowing instead of casts, a tsconfig that builds on 6 and 7. Use when editing .ts or .tsx files or a tsconfig, upgrading TypeScript, or when asked to type an API response or review types.
- Keep `strict` on; never set it or one of its flags to `false` (ts/strict).
- Use no option removed in TypeScript 7: `baseUrl`, `moduleResolution: "node"`, `target: "es5"`, `outFile` (ts/no-deprecated-options).
- With Vite or another per-file compiler, set `verbatimModuleSyntax` and write `import type` (ts/isolated-modules).
- Never write `any`: use the real type, a generic, or `unknown` and narrow it (ts/no-explicit-any).
- Validate data from `fetch`, `JSON.parse`, storage, `postMessage` and URLs at run time; never type it with `as` (ts/validate-untrusted).
- Silence an error only with `@ts-expect-error` and a reason, never `@ts-ignore` (ts/no-ts-ignore).
- Narrow with `typeof`, `instanceof`, `in` and type guards instead of `as` casts and `!` assertions.
- Model states as discriminated unions (`{ status: 'error'; error: Error }`) and end a `switch` over them with a `never` check.
- Infer local types; annotate exported functions, component props and module boundaries.
Before larger changes, read the full skill: `.claude/skills/fe-typescript/SKILL.md`. Explain any rule id with `npx github:dawidolko/frontend-skills explain <id>`.Gdzie trafia fe-typescript dla: Zed
.agents/skills/fe-typescript/SKILL.mdskill.agents/skills/fe-typescript/references/typescript.mdskillCLAUDE.mdblok instrukcji
Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.
Zed: Zed reads only the first instruction file of its list; the block is placed in that file.
Zed nie ma plików reguł zawężonych do typów plików; czyta skille i blok instrukcji.
Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.
## Front-end work (frontend-skills)
- Before front-end work, read `.frontend-skills/profile.json` (the stack) and `.frontend-skills/lessons.md` (confirmed conventions of this project; they win over any skill).
- Use the installed `fe-*` skill that matches the files you edit.
- After changing UI code, run `npx github:dawidolko/frontend-skills audit --changed --json` and fix findings at `serious` and above; `explain <rule id>` gives the reason, the source and the fix.
- Name rule ids (such as `a11y/img-alt`) in reviews and commit messages.Gdzie trafia fe-typescript dla: JetBrains Junie
.agents/skills/fe-typescript/SKILL.mdskill.agents/skills/fe-typescript/references/typescript.mdskillAGENTS.mdblok instrukcji
Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.
JetBrains Junie: Junie reads .agents/skills only in a trusted project.
JetBrains Junie nie ma plików reguł zawężonych do typów plików; czyta skille i blok instrukcji.
Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.
## Front-end work (frontend-skills)
- Before front-end work, read `.frontend-skills/profile.json` (the stack) and `.frontend-skills/lessons.md` (confirmed conventions of this project; they win over any skill).
- Use the installed `fe-*` skill that matches the files you edit.
- After changing UI code, run `npx github:dawidolko/frontend-skills audit --changed --json` and fix findings at `serious` and above; `explain <rule id>` gives the reason, the source and the fix.
- Name rule ids (such as `a11y/img-alt`) in reviews and commit messages.Gdzie trafia fe-typescript dla: Kiro
.kiro/skills/fe-typescript/SKILL.mdskill.kiro/skills/fe-typescript/references/typescript.mdskill.kiro/steering/fe-typescript.mdplik regułAGENTS.mdblok instrukcji
Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.
Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.
---
inclusion: fileMatch
fileMatchPattern: ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts", "**/tsconfig*.json"]
---
# TypeScript (frontend-skills)
Writes and reviews TypeScript for front-end apps (TypeScript 7, React, Vue, Svelte, Angular, Astro) - strict config, no any, types checked at the boundaries (API, storage, forms), narrowing instead of casts, a tsconfig that builds on 6 and 7. Use when editing .ts or .tsx files or a tsconfig, upgrading TypeScript, or when asked to type an API response or review types.
- Keep `strict` on; never set it or one of its flags to `false` (ts/strict).
- Use no option removed in TypeScript 7: `baseUrl`, `moduleResolution: "node"`, `target: "es5"`, `outFile` (ts/no-deprecated-options).
- With Vite or another per-file compiler, set `verbatimModuleSyntax` and write `import type` (ts/isolated-modules).
- Never write `any`: use the real type, a generic, or `unknown` and narrow it (ts/no-explicit-any).
- Validate data from `fetch`, `JSON.parse`, storage, `postMessage` and URLs at run time; never type it with `as` (ts/validate-untrusted).
- Silence an error only with `@ts-expect-error` and a reason, never `@ts-ignore` (ts/no-ts-ignore).
- Narrow with `typeof`, `instanceof`, `in` and type guards instead of `as` casts and `!` assertions.
- Model states as discriminated unions (`{ status: 'error'; error: Error }`) and end a `switch` over them with a `never` check.
- Infer local types; annotate exported functions, component props and module boundaries.
Before larger changes, read the full skill: `.kiro/skills/fe-typescript/SKILL.md`. Explain any rule id with `npx github:dawidolko/frontend-skills explain <id>`.Gdzie trafia fe-typescript dla: Augment
.agents/skills/fe-typescript/SKILL.mdskill.agents/skills/fe-typescript/references/typescript.mdskillAGENTS.mdblok instrukcji
Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.
Augment nie ma plików reguł zawężonych do typów plików; czyta skille i blok instrukcji.
Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.
## Front-end work (frontend-skills)
- Before front-end work, read `.frontend-skills/profile.json` (the stack) and `.frontend-skills/lessons.md` (confirmed conventions of this project; they win over any skill).
- Use the installed `fe-*` skill that matches the files you edit.
- After changing UI code, run `npx github:dawidolko/frontend-skills audit --changed --json` and fix findings at `serious` and above; `explain <rule id>` gives the reason, the source and the fix.
- Name rule ids (such as `a11y/img-alt`) in reviews and commit messages.Gdzie trafia fe-typescript dla: Trae
.trae/skills/fe-typescript/SKILL.mdskill.trae/skills/fe-typescript/references/typescript.mdskill.trae/rules/fe-typescript.mdplik regułAGENTS.mdblok instrukcji
Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.
Trae: Trae reads AGENTS.md only after it is enabled in its settings.
Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.
---
description: "Writes and reviews TypeScript for front-end apps (TypeScript 7, React, Vue, Svelte, Angular, Astro) - strict config, no any, types checked at the boundaries (API, storage, forms), narrowing instead of casts, a tsconfig that builds on 6 and 7. Use when editing .ts or .tsx files or a tsconfig, upgrading TypeScript, or when asked to type an API response or review types."
globs: **/*.ts,**/*.tsx,**/*.mts,**/*.cts,**/tsconfig*.json
alwaysApply: false
---
# TypeScript (frontend-skills)
- Keep `strict` on; never set it or one of its flags to `false` (ts/strict).
- Use no option removed in TypeScript 7: `baseUrl`, `moduleResolution: "node"`, `target: "es5"`, `outFile` (ts/no-deprecated-options).
- With Vite or another per-file compiler, set `verbatimModuleSyntax` and write `import type` (ts/isolated-modules).
- Never write `any`: use the real type, a generic, or `unknown` and narrow it (ts/no-explicit-any).
- Validate data from `fetch`, `JSON.parse`, storage, `postMessage` and URLs at run time; never type it with `as` (ts/validate-untrusted).
- Silence an error only with `@ts-expect-error` and a reason, never `@ts-ignore` (ts/no-ts-ignore).
- Narrow with `typeof`, `instanceof`, `in` and type guards instead of `as` casts and `!` assertions.
- Model states as discriminated unions (`{ status: 'error'; error: Error }`) and end a `switch` over them with a `never` check.
- Infer local types; annotate exported functions, component props and module boundaries.
Before larger changes, read the full skill: `.trae/skills/fe-typescript/SKILL.md`. Explain any rule id with `npx github:dawidolko/frontend-skills explain <id>`.Gdzie trafia fe-typescript dla: Continue
.frontend-skills/skills/fe-typescript/SKILL.mdskill.frontend-skills/skills/fe-typescript/references/typescript.mdskill.continue/rules/fe-typescript.mdplik reguł
Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.
Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.
---
name: "TypeScript"
description: "Writes and reviews TypeScript for front-end apps (TypeScript 7, React, Vue, Svelte, Angular, Astro) - strict config, no any, types checked at the boundaries (API, storage, forms), narrowing instead of casts, a tsconfig that builds on 6 and 7. Use when editing .ts or .tsx files or a tsconfig, upgrading TypeScript, or when asked to type an API response or review types."
globs: ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts", "**/tsconfig*.json"]
alwaysApply: false
---
# TypeScript (frontend-skills)
- Keep `strict` on; never set it or one of its flags to `false` (ts/strict).
- Use no option removed in TypeScript 7: `baseUrl`, `moduleResolution: "node"`, `target: "es5"`, `outFile` (ts/no-deprecated-options).
- With Vite or another per-file compiler, set `verbatimModuleSyntax` and write `import type` (ts/isolated-modules).
- Never write `any`: use the real type, a generic, or `unknown` and narrow it (ts/no-explicit-any).
- Validate data from `fetch`, `JSON.parse`, storage, `postMessage` and URLs at run time; never type it with `as` (ts/validate-untrusted).
- Silence an error only with `@ts-expect-error` and a reason, never `@ts-ignore` (ts/no-ts-ignore).
- Narrow with `typeof`, `instanceof`, `in` and type guards instead of `as` casts and `!` assertions.
- Model states as discriminated unions (`{ status: 'error'; error: Error }`) and end a `switch` over them with a `never` check.
- Infer local types; annotate exported functions, component props and module boundaries.
Before larger changes, read the full skill: `.frontend-skills/skills/fe-typescript/SKILL.md`. Explain any rule id with `npx github:dawidolko/frontend-skills explain <id>`.Gdzie trafia fe-typescript dla: Amazon Q Developer
.frontend-skills/skills/fe-typescript/SKILL.mdskill.frontend-skills/skills/fe-typescript/references/typescript.mdskill.amazonq/rules/frontend-skills.mdblok instrukcji
Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.
Amazon Q Developer: Amazon Q Developer IDE plugins reach end of support on 2027-04-30; AWS points to Kiro.
Amazon Q Developer nie ma plików reguł zawężonych do typów plików; czyta skille i blok instrukcji.
Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.
## Front-end work (frontend-skills)
- Before front-end work, read `.frontend-skills/profile.json` (the stack) and `.frontend-skills/lessons.md` (confirmed conventions of this project; they win over any skill).
- Use the installed `fe-*` skill that matches the files you edit.
- After changing UI code, run `npx github:dawidolko/frontend-skills audit --changed --json` and fix findings at `serious` and above; `explain <rule id>` gives the reason, the source and the fix.
- Name rule ids (such as `a11y/img-alt`) in reviews and commit messages.
### Skills
- `fe-typescript` (TypeScript): when editing `**/*.ts`, `**/*.tsx`, `**/*.mts`, `**/*.cts`, `**/tsconfig*.json`, first read `.frontend-skills/skills/fe-typescript/SKILL.md`.Gdzie trafia fe-typescript dla: Aider
.frontend-skills/skills/fe-typescript/SKILL.mdskill.frontend-skills/skills/fe-typescript/references/typescript.mdskillCONVENTIONS.mdblok instrukcji.aider.conf.ymlkonfiguracja
Dla każdego agenta także: .frontend-skills/profile.json, .frontend-skills/lessons.md i .frontend-skills/install.json.
Aider nie ma plików reguł zawężonych do typów plików; czyta skille i blok instrukcji.
Zaplanowane przez sam instalator dla przykładowego projektu React z repozytorium.
## Front-end work (frontend-skills)
- Before front-end work, read `.frontend-skills/profile.json` (the stack) and `.frontend-skills/lessons.md` (confirmed conventions of this project; they win over any skill).
- Use the installed `fe-*` skill that matches the files you edit.
- After changing UI code, run `npx github:dawidolko/frontend-skills audit --changed --json` and fix findings at `serious` and above; `explain <rule id>` gives the reason, the source and the fix.
- Name rule ids (such as `a11y/img-alt`) in reviews and commit messages.
### Skills
- `fe-typescript` (TypeScript): when editing `**/*.ts`, `**/*.tsx`, `**/*.mts`, `**/*.cts`, `**/tsconfig*.json`, first read `.frontend-skills/skills/fe-typescript/SKILL.md`.Jak go używać
Po instalacji agent sam ładuje skill, gdy zadanie pasuje do jego opisu. Możesz też poprosić o niego własnymi słowami, na przykład:
A żeby sprawdzić i poprawić pracę:
- Użyj skilla fe-typescript na tym pliku.
- Uruchom audyt front-endu na moich zmianach i popraw wszystko, co poważne.
- Wyjaśnij ts/strict i popraw to tutaj.
Reguły, których uczy
ts/strictTypeScript runs with strict on; no config turns strict or one of its checks (strictNullChecks, noImplicitAny...) off.
ts/no-deprecated-optionsA TypeScript 6 or 7 tsconfig uses no option deprecated in 6.0 and removed in 7.0 (baseUrl, moduleResolution node, target es5).
ts/isolated-modulesA Vite project's tsconfig sets isolatedModules or verbatimModuleSyntax, so code the bundler compiles file by file type-checks the same way.
ts/no-explicit-anyType values with a real type or unknown (then narrow), never any.
ts/validate-untrustedData from outside the program (fetch, JSON.parse, storage) is validated at run time, not given a type with as or an annotation.
ts/no-ts-ignoreSilence a type error with @ts-expect-error and a reason, never @ts-ignore or @ts-nocheck.
Skrót reguł
Ta część jest kopiowana do zawężonego pliku reguł każdego agenta, więc musi być zrozumiała sama w sobie:
- Keep
stricton; never set it or one of its flags tofalse(ts/strict). - Use no option removed in TypeScript 7:
baseUrl,moduleResolution: "node",target: "es5",outFile(ts/no-deprecated-options). - With Vite or another per-file compiler, set
verbatimModuleSyntaxand writeimport type(ts/isolated-modules). - Never write
any: use the real type, a generic, orunknownand narrow it (ts/no-explicit-any). - Validate data from
fetch,JSON.parse, storage,postMessageand URLs at run time; never type it withas(ts/validate-untrusted). - Silence an error only with
@ts-expect-errorand a reason, never@ts-ignore(ts/no-ts-ignore). - Narrow with
typeof,instanceof,inand type guards instead ofascasts and!assertions. - Model states as discriminated unions (
{ status: 'error'; error: Error }) and end aswitchover them with anevercheck. - Infer local types; annotate exported functions, component props and module boundaries.
Kroki, które wykonuje agent
- Check the version in the profile. On TypeScript 7 (
tscis the native compiler, no programmatic API until 7.1), tools that importtypescript(typescript-eslint,vue-tsc,svelte-check, Astro, MDX) need 6.0 through the aliastypescript@npm:@typescript/typescript6; keep TS 7 as@typescript/nativefortsc. - Start a browser app's tsconfig from
"module": "esnext","moduleResolution": "bundler","verbatimModuleSyntax": true,"noUncheckedIndexedAccess": true, and list global types in"types"(it defaults to[]since 6.0, sovite/clientornodemust be named). - Put one schema per external shape next to the call (Valibot or Zod Mini, or the validator already in the project); derive the type from it (
v.InferOutput<typeof User>), so type and check cannot drift. - Type props and events in the framework's way: React
ComponentProps<'button'>, VuedefineProps<Props>(), Sveltelet { a }: Props = $props(), Angularinput.required<T>(). - Prefer
satisfiesto check a literal against a type without widening it;as constobjects instead ofenumwhen code runs through type stripping. - Type-check in CI with
tsc --noEmit(or the framework's checker): bundlers only strip types.
Jak agent sprawdza swoją pracę
npx github:dawidolko/frontend-skills audit --changedreads the tsconfig files (strict, removed options, isolated modules) and.tsx, Vue, Svelte and Astro scripts (any, unchecked casts,@ts-ignore). Plain.tsfiles are not read by the audit yet; run the linter on them.- Lint with typescript-eslint's typed config (
no-explicit-any,no-floating-promises,no-unsafe-*,ban-ts-comment).
Sprawdzane audytem
Testy statyczne tych reguł działają w audit; to prawdziwa sesja na przykładowym projekcie:
audit: liczby według wagi, każda reguła z pierwszym miejscem, kod wyjścia.Pliki referencyjne
references/typescript.md2090 tokenów