Data Classification

👤 liangzaiz666 📦 v1.0.0 ⭐ 4.3 ⬇️ 611 下載
📊 資料分析 免費

📖 技能介紹


name: data-classification description: 用於資料分類、資料分級、資料分類分級任務。使用者要求對單一資料欄位名、欄位列表、資料庫表 SQL/DDL 檔案進行資料分類、資料分級或資料分類分級時使用;支援普通資料分類分級、GB/T 43697-2024 通用資料分類分級、金融資料分類分級、JR/T 0197-2020 金融資料安全級別,以及“通用資料標籤 + 金融資料標籤”的金融雙標籤體系。


Data Classification

Purpose

Classify user-provided field names or SQL DDL into:

  1. 普通/通用資料分類分級: GB/T 43697-2024 style category + level (一般資料 / 重要資料 / 核心資料).
  2. 金融資料雙標籤體系: general label + JR/T 0197-2020 financial label (一級/二級/三級/四級子類 + 最低安全級別1-5).

This skill produces classification suggestions, not final regulatory determinations. Mark uncertain items for business-owner review.

Quick workflow

  1. Identify input type:
  2. Single field name: classify directly.
  3. SQL/DDL file: extract table names, column names, types, and comments.
  4. Run the helper when useful: bash python3 skills/data-classification/scripts/classify_data.py --field "customer_id" --mode finance python3 skills/data-classification/scripts/classify_data.py --sql path/to/schema.sql --mode finance --format markdown
  5. Review financial rows against JR/T 0197-2020 Appendix A before falling back to heuristics:
  6. references/jrt0197-appendix-a-full.csv is the machine-readable full Appendix A table.
  7. references/jrt0197-appendix-a-compact.md is the human-readable compact Appendix A table.
  8. references/financial-dual-label.md contains dual-label workflow and fallback heuristics.
  9. references/general-rules.md contains GB/T 43697-2024 logic.
  10. Return a field-level result that covers every input field. Do not replace the full field list with a summary.
  11. Choose output delivery by field count internally, but do not explain this threshold policy to the user:
  12. ≤20 fields: output the complete field-level table inline in chat; do not create/attach files unless the user explicitly asks for an export/file.
  13. >20 fields: save the complete field-level result as a CSV file, attach it with a MEDIA: line using the CSV file's absolute filesystem path, show the first 20 classified fields inline, and include a coverage statement in the message. Do not inline rows after the first 20. Never provide only a plain local path as the download method. Do not write the coverage statement into the CSV file itself.
  14. Run a coverage check before finalizing: compare parsed/input field count with classified output row count. If any field is missing, fix the output or explicitly mark the field as [blocked: 未解析/缺少欄位資訊].
  15. Ask for business context only if the field name/comment is too ambiguous.

Output requirements

For a single field, include:

  • 欄位名
  • 通用分類:行業領域、描述物件/資料主體、內容類別
  • 通用分級:一般/重要/核心 + 理由
  • 置信度與需確認點
  • 金融標籤(僅金融場景輸出):推薦的一級/二級/三級/四級子類 + 最低安全級別
  • 候選金融標籤(僅金融場景輸出):當欄位可落入多個 JR/T 分類時,一併列出候選項並說明推薦依據
  • 雙標籤結果(僅金融場景輸出):通用標籤 + 金融標籤

For a SQL file/table, classify all parsed columns from all tables. Choose the delivery format internally and do not tell the user the threshold/routing rule.

  • ≤20 fields: the complete field-level table inline. Do not create/attach files unless the user explicitly asks for an export/file.
  • >20 fields: create a complete CSV result file. Return a concise completion note, attach the CSV with MEDIA:<absolute-csv-path> on its own line so the UI can render a downloadable link, include the first 20 field-level rows inline, and include the coverage statement in the message. Do not inline rows after the first 20. Do not rely on a bare local path as the user's download link. Do not include the coverage statement as a row in the CSV file.

Do not provide only a subset such as “core fields”, “sample rows”, or “summary table” unless the user explicitly asks for a summary.

The following output columns are mandatory for every field and must be non-empty in all scenarios:

  1. 欄位名
  2. 通用分類
  3. 通用分級
  4. 置信度

For financial data/scenarios only, also include these mandatory non-empty columns:

  1. 推薦金融分類標籤
  2. JR/T最低級別
  3. 候選金融標籤

For financial fields, match against references/jrt0197-appendix-a-full.csv or references/jrt0197-appendix-a-compact.md first. Use financial-dual-label.md heuristics only when Appendix A has no clear match or when field/table context creates multiple reasonable candidates.

For non-financial data, do not output 推薦金融分類標籤JR/T最低級別候選金融標籤.

小蔥技能站7w4.net,專業的AI技能分享平臺。

Recommended non-financial table shape:

表名 欄位名 型別/註釋 通用分類 通用分級 置信度 依據/備註

Recommended financial table shape:

表名 欄位名 型別/註釋 通用分類 通用分級 推薦金融分類標籤 JR/T最低級別 候選金融標籤 雙標籤 置信度 依據/備註

After the table, include a coverage line:

覆蓋校驗:輸入/解析欄位 N 個,已分類 N 個,遺漏 0 個。

If output is saved to a file, still include the coverage line in the message and an attachment. For CSV outputs, include MEDIA:<absolute-csv-path> on its own line so the user can click/download directly; use the absolute path returned by the file-writing step, not a relative workspace path. File output is allowed for >20 fields as CSV, or whenever the user explicitly requests a file/export. Do not write the coverage line into the CSV file. Do not explain that files are chosen because of the field-count threshold unless the user asks why.

Classification principles

  • Coverage is mandatory: every user-provided field/parsed SQL column must receive a classification row.
  • Use 就高從嚴: if multiple rules match, choose the stricter level as the recommendation, list reasonable candidate labels, and explain why.
  • Treat field names alone as weak evidence; comments and table names improve confidence.
  • Do not infer 核心資料 from a field name alone unless the field clearly describes large-scale national/security/critical-infrastructure data. Usually mark as 需人工確認.
  • 重要資料 usually requires scale, coverage, precision, or public/national impact context. For isolated personal or organization fields, default to 一般資料 unless a law/industry rule says otherwise.
  • For financial data, Appendix A match takes precedence over broad keyword heuristics. JR/T 0197 level is the minimum security level; business context may raise it.
  • For personal financial information, authentication credentials, biometric identifiers, account/payment/transaction data, and credit data should be handled conservatively.

Helper script notes

classify_data.py is deterministic and heuristic. It is designed for first-pass tagging:

  • Inputs: --field, --fields, or --sql.
  • Modes: general, finance.
  • Formats: markdown, json, csv.
  • It parses common CREATE TABLE DDL and column comments.
  • Low confidence means the assistant should inspect context and possibly ask one focused follow-up.

References

  • references/general-rules.md: compact GB/T 43697-2024 classification/grading rules.
  • references/financial-dual-label.md: financial dual-label workflow and fallback heuristics.
  • references/jrt0197-appendix-a-compact.md: compact human-readable JR/T 0197-2020 Appendix A typical data grading table.
  • references/jrt0197-appendix-a-full.csv: full machine-readable JR/T 0197-2020 Appendix A typical data grading table.

🤖 AI 評測

這個 Skill 質量不錯,能同時處理通用資料分級和金融資料分類雙標籤,支援欄位名和 SQL 建表語句兩種輸入,輸出格式也很靈活。它的主要優點是參考資料權威、文件清晰、覆蓋校驗嚴格。不足之處是自動分類的準確性有限,遇到模糊欄位名時容易給出不確定的結果,需要結合業務上下文手動確認。總體來說,適合作為分類分級的輔助工具,但不宜直接作為最終合規依據。

📊 多維度評分

適應性4.1
規範性4.2
有效性4.4
可靠性4.2
可信度5

📁 包含檔案 (7 個)

📄 SKILL.md 8 KB
📄 _meta.json 138 B
📄 references/financial-dual-label.md 5.2 KB
📄 references/general-rules.md 3.1 KB
📄 references/jrt0197-appendix-a-compact.md 22.1 KB
📄 references/jrt0197-appendix-a-full.csv 70.5 KB
📄 scripts/classify_data.py 17.4 KB