chore: add pre-push hook and AGENTS.md protection rules

- .githooks/pre-push: 防误删保护钩子(受保护路径、大量删除、pom.xml 保护、比例检查)
- AGENTS.md: 添加安全铁律章节,标注受保护路径和提交规范

Install: git config core.hooksPath .githooks
This commit is contained in:
2026-05-27 09:05:48 +08:00
parent 5b2b9d0721
commit 30461d7577
2 changed files with 105 additions and 1 deletions

View File

@@ -185,4 +185,22 @@ npm run preview
- 前端端口81
- API 前缀:`/openhis`
- Swagger UI`/openhis/swagger-ui/index.html`
- Druid 监控:`/openhis/druid/login.html`
- Druid 监控:`/openhis/druid/login.html`
## 🔒 安全铁律
### 受保护路径(严禁删除)
以下文件和目录在任何提交中都禁止删除:
- `openhis-server-new/pom.xml`
- `openhis-server-new/core-admin/``core-common/``core-flowable/``core-framework/``core-generator/``core-quartz/``core-system/`
- `openhis-server-new/openhis-application/``openhis-domain/``openhis-common/`
- 任何 `pom.xml` 文件
### 提交规范
1. **单次提交删除文件数不得超过 100 个**
2. **删除/新增文件比例不得超过 80%**
3. **提交前执行 `git diff --stat` 检查变更范围**
4. **不确定的操作优先用 `git revert` 而不是 `git rm`**
### 违规后果
违反上述规则会导致推送被 `pre-push` 钩子拦截,或触发 Gitea 分支保护规则。