Files
ZQYY.FQ-ETL/.kiro/hooks/db-schema-doc-enforcer.kiro.hook

22 lines
1.5 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"enabled": true,
"name": "DB Schema 文档执行 (bd_manual)",
"description": "当数据库 schema/migration 相关文件被保存时,检查是否有表结构变更,并自动更新 docs/bd_manual/ 下对应的表结构文档。",
"version": "1",
"when": {
"type": "fileEdited",
"patterns": [
"**/migrations/**/*.*",
"**/*.sql",
"**/*ddl*.*",
"**/*schema*.*",
"**/*.prisma"
]
},
"then": {
"type": "askAgent",
"prompt": "一个数据库相关文件刚被保存。你必须检查是否发生了 schema/表结构变更。\n\n如果发生了表结构变更你必须更新以下目录中的文档\ndocs/bd_manual/\n\n最低输出要求必须写入对应 schema 目录 + 表结构文档):\n1) 变更内容:表/字段/类型/可空性/默认值/约束/索引/外键的具体变化\n2) 变更原因:业务背景与动机\n3) 影响范围ETL 管线、后端 API 契约、小程序字段等\n4) 回滚策略:如何回退 + 数据回填注意事项\n5) 验证 SQL至少 3 条查询语句用于验证变更正确性\n6) 溯源留痕日期Asia/TaipeiYYYY-MM-DDPromptPrompt-ID + ≤5 行摘录或原文Direct cause必要性 + 修改方案简介)\n\n如果没有发生表结构变更例如仅修改注释在变更日志文档中写一条简短说明\"无结构性变更\"(同样要带日期 + Prompt-ID。"
},
"workspaceFolderName": "FQ-ETL",
"shortName": "db-schema-doc-enforcer"
}