不良的結構描述會造成查詢緩慢、遷移脆弱,以及資料不一致。此技能會引導 Claude、Codex 和 Claude Code 做出實用的結構描述設計決策。
下載技能 ZIP
在 Claude 中上傳
前往 設定 → 功能 → 技能 → 上傳技能
開啟並開始使用
Agent 可讀資源
當 AI Agent、爬蟲或腳本需要乾淨脈絡、而不是讀取完整頁面時,請使用這些連結。
測試它
正在使用「database-schema-designer」。 Design an order management schema for customers, orders, products, and payments.
預期結果:
- 包含 customers、products、orders、order items 和 payments 的正規化實體清單。
- 建議的鍵和關係,包括 order item junction 行為。
- 用於 customer order history、payment status 和 recent order 查詢的索引。
正在使用「database-schema-designer」。 Review a migration that renames a required customer email column.
預期結果:
- 分階段遷移計畫,會先新增新欄位,再移除舊欄位。
- Backfill 和 dual-write 步驟,以在部署期間維持相容性。
- 用於資料完整性與應用程式就緒狀態的 rollback 和 validation checks。
正在使用「database-schema-designer」。 Model a document database for orders with customer and item data.
預期結果:
- 根據更新頻率和文件大小提出 embed-versus-reference 建議。
- 針對 customer lookups、creation date sorting 和 text search 的建議索引。
- 關於文件成長、一致性預期和 shard key selection 的警告。
安全審計
低風險Static analysis reported weak cryptography, system reconnaissance, and Ruby backtick execution patterns. Manual review found these are false positives from database terminology, SQL metadata queries, and Markdown fenced examples rather than executable behavior. One low-severity content issue remains because a negative Python example uses SQL string interpolation without calling out injection risk.
Confirmed security concerns (4)
偵測到的模式
品質評分
你可以打造什麼
規劃新的產品資料庫
在開始實作前定義實體、關係、鍵、約束和初始索引。
審查遷移計畫
檢查結構描述變更是否可逆、分階段進行,且適合安全地部署到生產環境。
選擇 SQL 或 NoSQL 建模
針對已知的存取模式,比較正規化的關聯式模型與嵌入式或參照式文件模型。
試試這些提示
Design a database schema for [application]. Include entities, relationships, primary keys, foreign keys, and important constraints.
Review this schema for normalization, indexes, constraints, and migration risks. Explain the top changes I should make first: [schema summary].
Create a safe migration plan for changing [old structure] to [new structure]. Include rollout steps, rollback steps, validation checks, and downtime risks.
Given these access patterns and data volumes, propose SQL or NoSQL schema changes, indexes, partitioning options, and tradeoffs: [details].
最佳實務
- 在選擇索引或儲存技術之前,先從實體、關係和存取模式開始。
- 記錄每個 denormalization、index 和 migration step,以及其存在原因。
- 使用接近真實的資料測試遷移,並包含 rollback 和 validation steps。
避免
- 不要只是為了避免建模實際需要完整性檢查的關係而選擇 NoSQL。
- 不要在未衡量讀寫取捨的情況下,為每個欄位都新增索引。
- 不要在沒有分階段應用程式 rollout plan 的情況下進行破壞性結構描述變更。