技能 performance-fundamentals
⚡
performance-fundamentals
安全 🌐
网络访问📁
文件系统访问⚙️
外部命令
自動優化程式碼效能
效能問題會拖慢應用程式並讓使用者感到挫折。此技能會自動識別程式碼中的優化機會。它會檢視資料庫查詢、前端渲染、API 回應和資源使用情況,找出瓶頸所在。
支持: Claude Codex Code(CC)
1
下载技能 ZIP
2
在 Claude 中上传
前往 设置 → 功能 → 技能 → 上传技能
3
开启并开始使用
测试它
正在使用“performance-fundamentals”。 檢視此資料庫查詢模式
预期结果:
- Found N+1 query pattern: User.findAll() followed by Post.findByUserId() in loop
- Solution: Use include/join to fetch posts in single query
- Estimated improvement: 100x faster for 1000 users
- Add index on user_id column in posts table
正在使用“performance-fundamentals”。 分析此 React 元件
预期结果:
- Creating new function on every render in Child onClick prop
- Fix: Wrap with useCallback or move component outside render
- Expensive sort operation runs on every re-render
- Fix: Wrap with useMemo to cache sorted result
安全审计
安全v5 • 1/16/2026
Documentation-only skill containing performance best practices and review guidelines. No executable code, network calls, or file system access detected. All 30 static findings are false positives triggered by technical keywords in performance documentation. The skill-report.json already contains a passing security audit confirming safe-to-publish status.
2
已扫描文件
355
分析行数
3
发现项
5
审计总数
风险因素
🌐 网络访问 (1)
📁 文件系统访问 (1)
审计者: claude 查看审计历史 →
质量评分
38
架构
100
可维护性
87
内容
19
社区
100
安全
91
规范符合性
你能构建什么
資料庫查詢優化
檢視 API 端點和資料存取模式,以消除 N+1 查詢並改善回應時間。
React 效能檢視
分析 React 元件是否有不必要的重新渲染、記憶化機會和套件大小問題。
效能檢查清單
確保拉取請求在合併到正式程式碼庫之前符合效能標準。
试试这些提示
資料庫檢視
Review this API endpoint for database performance issues: [paste code]. Check for N+1 queries, missing indexes, and pagination opportunities.
React 元件
Analyze this React component for performance issues: [paste code]. Look for unnecessary re-renders, missing memoization, and optimization opportunities.
程式碼檢視
Review this code for performance bottlenecks: [paste code]. Consider time complexity, memory usage, and scalability at 10k+ items.
API 優化
Optimize this API response: [paste JSON]. Suggest field selection, pagination, compression, and caching strategies.
最佳实践
- 在迴圈中獲取相關記錄時,務必檢查 N+1 查詢
- 對任何可能超過 100 項的列表端點使用分頁
- 記憶化昂貴的計算和回呼函式,以防止不必要的重新計算
避免
- 獲取所有記錄而不使用分頁或限制
- 在渲染方法內部建立新函式或物件
- 忘記清理計時器、訂閱和事件監聽器
常见问题
這支援哪些框架?
適用於任何框架。範例包括 React、Vue、Node.js、Python、Ruby 和 SQL 資料庫。
它如何偵測效能問題?
根據已知的反模式(如 N+1 查詢、缺少記憶化和可擴展性瓶頸)分析程式碼模式。
它可以自動修復問題嗎?
不行,它會識別問題並建議解決方案。開發人員根據建議實作優化。
它會存取哪些資料?
僅檢視您貼上或分享的程式碼。沒有檔案系統存取、網路呼叫或資料收集。
建議的準確度如何?
基於既定的效能模式。在部署之前,請務必在您的特定環境中測試優化。
這適合初學者嗎?
是的。包含說明和範例,幫助開發人員學習效能概念和最佳實踐。