.claude/skills/database-assistant/SKILL.md
[UDS] 引導資料庫設計、遷移規劃和查詢最佳化
npx skillsauth add asiaostrich/universal-dev-standards databaseInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
語言: English | 繁體中文
引導資料庫設計、遷移規劃和查詢最佳化。
| 原則 | 說明 | |------|------| | 正規化 | 消除冗餘(至少 3NF) | | 參照完整性 | 強制外鍵約束 | | 索引策略 | 依查詢模式建立索引 | | 遷移安全 | 可逆、零停機 | | 資料保護 | 加密敏感欄位、稽核存取 |
| 正規形式 | 規則 | |----------|------| | 1NF | 原子值、無重複群組 | | 2NF | 1NF + 無部分相依 | | 3NF | 2NF + 無遞移相依 | | 反正規化 | 僅針對已證實的讀取效能需求 |
PLAN ──► WRITE ──► TEST ──► DEPLOY ──► VERIFY
識別受影響的表、估算資料量、規劃回滾策略。
撰寫正向和回滾腳本。使用遞增編號的遷移。
在 staging 環境使用類生產資料執行。驗證遷移後資料完整性。
在維護窗口執行,或使用線上 Schema 變更工具。
檢查列數、約束有效性、應用程式功能。
| 類型 | 使用場景 | |------|----------| | B-tree | 等值、範圍查詢(預設) | | Hash | 僅精確匹配 | | GIN | 全文搜尋、JSONB | | Partial | 過濾子集 | | Composite | 多欄位查詢 |
/database - 互動式資料庫設計引導/database schema - 審查 Schema 設計/database --migration - 遷移規劃助手/database 完成後,AI 助手應建議:
資料庫設計完成。建議下一步:
- 執行
/security檢查資料保護措施- 執行
/testing規劃資料庫測試策略- 執行
/checkin確認遷移符合提交規範- 產生 API 端點 → 執行
/api-design
development
[UDS] 扫描代码库的调试残留与代码质量问题;可自动修正安全模式。 Use when: before committing, during PR review, or periodic codebase cleanup. Keywords: sweep, debug cleanup, console.log, debugger, TODO, ts-any, code quality, 扫描, 清理.
tools
[UDS] 从规格衍生 BDD 场景、TDD 骨架或 ATDD 表格
development
[UDS] 识别重复流程并以正确的开发深度构建 Skill
tools
[UDS] AI 辅助 git push 安全层:质量门禁 + 协作护栏。 Use when: pushing commits, force pushing, pushing to protected branches, pushing feature branches. Keywords: git push, force push, protected branch, quality gate, push receipt, PR automation, 推送, 保护分支, 质量门禁.