此技能提供 TypeScript、JavaScript、React 和 Node.js 開發的全面編碼標準和最佳實踐,協助開發人員撰寫清晰、可維護的程式碼。
下載技能 ZIP
在 Claude 中上傳
前往 設定 → 功能 → 技能 → 上傳技能
開啟並開始使用
測試它
正在使用「coding-standards」。 Show me how to properly handle async errors
預期結果:
使用 try-catch 區塊進行適當的錯誤記錄。總是拋出有意義的錯誤,而不是默默失敗。對於 fetch 呼叫,檢查 response.ok 並明確處理 HTTP 錯誤。
正在使用「coding-standards」。 What are the naming conventions for functions?
預期結果:
使用動詞-名詞模式,如 'fetchUserData' 或 'calculateTotal'。避免單獨使用名詞,如 'data' 或 'handler'。對於布林函數,使用 'is'、'has' 或 'can' 前綴。
正在使用「coding-standards」。 How should I structure my React components?
預期結果:
使用函數元件和 TypeScript 介面作為 props。明確定義元件 props,而不是使用 any 類型。讓元件專注於單一職責。
安全審計
安全This skill is a documentation resource containing coding standards and best practices in markdown format. The static analyzer flagged 72 potential issues, but all are false positives: JavaScript template literals in code examples were misidentified as shell execution, lazy loading patterns as dynamic imports, fetch examples as network calls, and generic error message text as cryptographic/system issues. No actual security risks exist - the skill provides educational content about code quality.
高風險問題 (2)
中風險問題 (2)
低風險問題 (1)
品質評分
你能建構什麼
學習現代 JavaScript 模式
新開發人員可以學習正確的 TypeScript 和 JavaScript 編碼模式,包括不可變性、async/await 最佳實踐和類型安全。
標準化團隊程式碼風格
開發團隊可以在其專案中採用一致的編碼標準,並記錄命名、格式和結構的慣例。
改善程式碼審查流程
在程式碼審查期間使用這些標準,以確保一致性並在合併前發現常見的程式碼品質問題。
試試這些提示
Using the coding-standards skill, show me the best practices for writing TypeScript interfaces and types.
Using the coding-standards skill, what is the recommended structure for a React functional component with props?
Using the coding-standards skill, document the REST API conventions and response format standards.
Using the coding-standards skill, show me the best practices for handling errors in async functions.
最佳實務
- 撰寫自我說明的程式碼,使用清晰的變數和函數名稱,而不是過度依賴註解
- 始終使用不可變性模式 - 優先使用展開運算子而不是直接變更
- 定義適當的 TypeScript 類型,而不是使用 'any' 來維持類型安全
避免
- 避免在 TypeScript 中使用 'any' 類型,因為這會破壞類型檢查的目的
- 不要直接變更狀態 - 始終使用函式更新,如 setCount(prev => prev + 1)
- 避免深度巢狀的條件判斷 - 使用提前返回來保持程式碼扁平和可讀