技能 database-schema-designer
📦

database-schema-designer

v1.0.0 低風險

設計可靠的資料庫結構描述

也可從以下取得: softaworks

不良的結構描述會造成查詢緩慢、遷移脆弱,以及資料不一致。此技能會引導 Claude、Codex 和 Claude Code 做出實用的結構描述設計決策。

支援: Claude Codex Code(CC)
📊 76 尚可
1

下載技能 ZIP

2

在 Claude 中上傳

前往 設定 → 功能 → 技能 → 上傳技能

3

開啟並開始使用

測試它

正在使用「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 的警告。

安全審計

低風險
v6 • 6/28/2026

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.

3
已掃描檔案
1,031
分析行數
4
Review items
0
False positives ignored

Confirmed security concerns (4)

False Positive: Weak Cryptography Detections Are Database Terms
Verdict: FALSE_POSITIVE. The flagged weak cryptography patterns occur in documentation about schema design, index types, and template metadata. They do not implement MD5, SHA1, DES, or any cryptographic operation.
The reviewed lines are prose, headings, or SQL comments about database schema design. No cryptographic API, hash function implementation, or password handling code is present.
False Positive: Backtick Execution Detections Are Markdown Fences
Verdict: FALSE_POSITIVE. The flagged Ruby or shell backtick detections correspond to Markdown code block delimiters around SQL, JSON, JavaScript, and Python examples. The skill has no script file or instruction that executes shell commands.
The matched areas are fenced documentation examples, not runtime code. No command shell, Ruby evaluation, subprocess call, or user-controlled command construction was found.
False Positive: Reconnaissance Detections Are SQL Review Queries
Verdict: FALSE_POSITIVE. The flagged reconnaissance patterns are database inspection guidance such as EXPLAIN and INFORMATION_SCHEMA checks. These are normal schema validation queries and do not inspect the host system.
The context is database query analysis and migration validation. There is no filesystem, network, host inventory, or credential discovery behavior.
Negative Example Uses SQL String Interpolation
Verdict: LOW_RISK_CONTENT_ISSUE. A Python example marked as bad demonstrates an N+1 query using an f-string inside a SQL query. Because the example is explicitly labeled bad, this is not malicious, but it could be clearer that interpolation also creates SQL injection risk.
The unsafe interpolation is visible in a negative example, so legitimate teaching context is clear. The risk is limited to possible user misunderstanding if the snippet is copied without the surrounding warning.

偵測到的模式

SQL String Interpolation Appears In A Negative Example
審計單位: codex 檢視審計紀錄 →

品質評分

55
架構
100
可維護性
87
內容
70
社群
82
安全
74
規範符合度

你可以打造什麼

規劃新的產品資料庫

在開始實作前定義實體、關係、鍵、約束和初始索引。

審查遷移計畫

檢查結構描述變更是否可逆、分階段進行,且適合安全地部署到生產環境。

選擇 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 的情況下進行破壞性結構描述變更。

常見問題

這個技能可以同時設計 SQL 和 NoSQL 結構描述嗎?
可以。它涵蓋關聯式正規化,以及 embedding 和 referencing 等文件建模模式。
它會產生完整的遷移檔案嗎?
它提供遷移結構和規劃指引。最終 SQL 應依目標資料庫引擎調整。
它可以檢查我的即時資料庫嗎?
不會。它會根據你提供的結構描述、需求和存取模式運作。
它能協助索引決策嗎?
可以。它會說明 foreign key、composite、partial、text 和 document database indexes。
它對生產環境遷移審查有用嗎?
可以。它強調可逆遷移、staging tests、validation queries 和 rollout sequencing。
它能取代資料庫管理員嗎?
不會。它能協助準備設計和審查,但關鍵的生產環境變更仍需要專家驗證。

開發者詳細資訊