docs: 更新known-patterns.json - 添加Git提交纪律模式

新增 pat-004: Git提交纪律
- 代码修改后未提交到Git导致问题重复发生
- 质量规则:完成修复后立即commit
This commit is contained in:
chiguyong 2026-03-22 01:32:59 +08:00
parent 8ebeb542b4
commit e0a228188a
1 changed files with 23 additions and 7 deletions

View File

@ -47,18 +47,19 @@
]
},
"pat-004": {
"name": "dist构建产物未及时更新",
"name": "Git提交纪律",
"source": "user_feedback",
"confidence": 0.80,
"confidence": 0.95,
"applications": 3,
"created": "2026-03-22",
"category": "workflow",
"pattern": "修改代码后构建产物没有更新",
"problem": "前端修改后没有重新npm run build",
"solution": "建立标准流程:修改代码 → npm run build → 重启dev-server",
"pattern": "代码修改后未提交到Gitnpm install或操作导致工作目录恢复到旧状态",
"problem": "昨天修复的问题今天又发生因为修改从未commit",
"solution": "每次修复完成后立即commit建立开发流程规范",
"quality_rules": [
"每次测试前确认dist是最新的",
"使用dev-server.mjs时每次修改都需要重新构建"
"完成功能或修复后立即git commit",
"git commit message要清晰描述修改内容",
"在git commit之前不要进行npm install等可能重置环境的操作"
]
},
"pat-005": {
@ -75,6 +76,21 @@
"登录回调中使用window.location.href进行跳转",
"登出时也使用window.location.href = '/login'"
]
},
"pat-006": {
"name": "dist构建产物未及时更新",
"source": "user_feedback",
"confidence": 0.80,
"applications": 3,
"created": "2026-03-22",
"category": "workflow",
"pattern": "修改代码后构建产物没有更新",
"problem": "前端修改后没有重新npm run build",
"solution": "建立标准流程:修改代码 → npm run build → 重启dev-server",
"quality_rules": [
"每次测试前确认dist是最新的",
"使用dev-server.mjs时每次修改都需要重新构建"
]
}
}
}