typescript-write
撰寫更安全的 Metabase TypeScript
當團隊使用寬泛型別、型別轉換或不清楚的模型時,TypeScript 變更可能會失去安全性。此技能會引導 Claude、Codex 和 Claude Code 採用 Metabase 專用的型別模式與驗證步驟。
使用我的智慧代理安裝
將此請求複製給你的智慧代理,其中包含權威 Skill 頁面和清單。
Review the Skillstore skill "typescript-write" from https://skillstore.io/skills/metabase-typescript-write.md and its manifest at https://skillstore.io/api/skills/metabase-typescript-write/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.你的智慧代理仍應顯示其計畫,並依安全政策請求必要確認。
Agent 可讀資源
當 AI Agent、爬蟲或腳本需要乾淨脈絡、而不是讀取完整頁面時,請使用這些連結。
測試它
正在使用「typescript-write」。 某個元件接收寬泛物件,但只讀取 id 和 name。
預期結果:
回應會將 prop 形狀收窄為必要欄位,重用領域 id 型別,並移除不必要的型別轉換。
正在使用「typescript-write」。 某個功能對載入、錯誤和資料狀態使用分開的布林值。
預期結果:
回應會提出可辨識聯集,為載入、錯誤、成功和空白狀態提供窮盡的渲染路徑。
正在使用「typescript-write」。 某個 JavaScript 檔案需要功能變更。
預期結果:
回應會建議在加入功能之前,以單獨變更將檔案轉換為 TypeScript。
安全審計
安全All static findings are false positives caused by Markdown formatting, local documentation includes, and a TypeScript code example. No prompt injection, malicious intent, command execution, network access, or unsafe runtime behavior was found in SKILL.md.
風險因素
⚡ 包含腳本 (3)
⚙️ 外部命令 (25)
📁 檔案系統存取 (3)
分享與引用此報告
分享版本化評估報告、中性徽章、嵌入卡片與引用。Skillstore 只報告證據,不判斷該 Skill 是否安全。
複製報告連結
https://skillstore.io/skills/metabase-typescript-write/audits/10?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown 徽章
[](https://skillstore.io/skills/metabase-typescript-write?utm_source=security_passport_badge)HTML 徽章
<a href="https://skillstore.io/skills/metabase-typescript-write?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/metabase-typescript-write/security.svg" alt="Skillstore security assessment" loading="lazy"></a>嵌入卡片
<iframe src="https://skillstore.io/embed/skills/metabase-typescript-write.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>學術引用 (APA · BibTeX · CFF)
APA 引用
metabase. (2026). typescript-write security audit report (audit version 10) [Author version unspecified]. Skillstore. https://skillstore.io/skills/metabase-typescript-write/audits/10BibTeX 引用
@techreport{metabase-metabase-typescript-write-2026,
author = {metabase},
title = {typescript-write security audit report (audit version 10)},
institution = {Skillstore},
year = {2026},
number = {10},
url = {https://skillstore.io/skills/metabase-typescript-write/audits/10},
note = {Author version unspecified}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "typescript-write security audit report (audit version 10)"
version: "unspecified"
type: report
authors:
- name: "metabase"
date-released: "2026-07-09"
url: "https://skillstore.io/skills/metabase-typescript-write/audits/10"
identifiers:
- type: other
value: "skillstore:metabase-typescript-write:audit:10"
description: "Skillstore immutable audit report identifier"
Skillstore 評分
評分依據 證據置信度: 高你可以打造什麼
安全地重構弱型別 TypeScript
以更精確的簽章和可重用的領域型別取代型別轉換、any 型別和寬泛的 record。
精確建模 UI 狀態
使用可辨識聯集和窮盡檢查來表示載入、錯誤、空白和成功狀態。
審查 JavaScript 遷移範圍
在功能開發繼續之前,判斷被修改的 JavaScript 是否應改為 TypeScript。
試試這些提示
Use the typescript-write skill to improve this function without introducing any. Keep the signature narrow and explain the type changes briefly.
Use the typescript-write skill to refactor these React props. Prefer existing Metabase types, avoid casts, and keep optional values precise.
Use the typescript-write skill to model this async UI state with a discriminated union. Include exhaustive handling and avoid broad string states.
Use the typescript-write skill to assess this JavaScript file. Propose a separate TypeScript conversion plan before implementing the feature change.
最佳實務
- 先尋找既有的 Metabase 型別,再定義新的形狀。
- 在系統邊界使用 unknown,並立即透過具型別的 guard 將其收窄。
- 完成前執行 TypeScript Language Server 檢查和專案型別檢查。
避免
- 不要使用 any、雙重型別轉換或寬泛的 record 來消除編譯器錯誤。
- 不要重複產生的 API 型別,或在本機重新定義共用的型別 guard。
- 當可以在來源處收窄時,不要讓 undefined 穿過多層。