بنقرة واحدة
pr-creator
创建 Pull Request。当用户说 "创建 PR"、"提 PR"、"提交合并请求" 时激活。 确保遵循 conventional commit、模板规范、安全护栏。
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
创建 Pull Request。当用户说 "创建 PR"、"提 PR"、"提交合并请求" 时激活。 确保遵循 conventional commit、模板规范、安全护栏。
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
MiniHES 后端开发规范。当用户进行 FastAPI 后端开发、API 设计、数据库操作、 DLMS 协议实现、数据采集任务开发时自动激活。 涵盖分层架构、编码原则、安全要求、数据库规范。
MiniHES 代码审查。当用户请求审查代码、review PR、检查变更时激活。 支持本地变更审查和指定文件审查,输出结构化审查报告。 引用 backend-checklist.md 和 frontend-checklist.md 作为审查依据。
修复代码格式和 lint 问题。当用户在提交前需要修复代码风格、 排查 lint 错误、或说 "fix"、"格式化"、"lint" 时激活。
MiniHES 前端开发规范。当用户进行 Vue 3 前端开发、组件设计、 页面布局、样式调整时自动激活。 涵盖技术栈、组件设计原则、设计规范、Ant Design Vue 用法。
Systematic code review patterns covering security, performance, maintainability, correctness, and testing
Distills iteration lessons, categorizes them, and injects them into the most relevant Skill.md files with deduplication.
| name | pr-creator |
| description | 创建 Pull Request。当用户说 "创建 PR"、"提 PR"、"提交合并请求" 时激活。 确保遵循 conventional commit、模板规范、安全护栏。 |
# 确认不在 main 分支
git branch --show-current
如果当前在 main,必须先创建新分支:
git checkout -b feat/描述性名称
禁止直接 push main。
# 检查未提交的变更
git status
# 暂存并提交
git add .
git commit -m "type(scope): description"
遵循 Conventional Commits:
| Type | 用途 | 示例 |
|---|---|---|
feat | 新功能 | feat(collector): add DLMS task scheduler |
fix | Bug 修复 | fix(meter): resolve serial number unique constraint |
docs | 文档 | docs(api): update meter endpoint docs |
refactor | 重构 | refactor(schemas): simplify response models |
test | 测试 | test(task): add task service unit tests |
chore | 杂项 | chore(deps): update sqlalchemy to 2.0.36 |
# 后端
cd backend && uv run ruff check . && uv run pytest
# 前端(如有前端变更)
cd frontend && pnpm run lint && pnpm run build
检查失败时,修复问题后再继续。不要跳过。
# 再次确认不是 main
git branch --show-current
# 推送
git push -u origin HEAD
# 写描述到临时文件
cat > /tmp/pr_body.md << 'EOF'
## 变更说明
<简要描述本次 PR 做了什么>
## 变更类型
- [ ] 新功能 (feat)
- [ ] Bug 修复 (fix)
- [ ] 重构 (refactor)
- [ ] 文档 (docs)
- [ ] 测试 (test)
## 检查清单
- [ ] 代码已通过 lint 检查
- [ ] 测试已通过
- [ ] 数据库迁移已生成(如有模型变更)
- [ ] 无硬编码密钥/密码
## 相关 Issue
Fixes #
EOF
# 创建 PR
gh pr create --title "type(scope): 简要描述" --body-file /tmp/pr_body.md
# 清理
rm /tmp/pr_body.md
| 规则 | 说明 |
|---|---|
| 禁止 push main | 最高优先级,每次 push 前必须确认分支 |
| 禁止跳过 preflight | lint 和测试必须通过 |
| 禁止硬编码密钥 | 提交前检查 |
| 必须使用模板 | PR 描述必须包含检查清单 |
type(scope): 中文简要描述
示例:
feat(devices): 添加电表批量导入功能fix(collector): 修复任务超时重试逻辑refactor(auth): 重构 JWT token 刷新机制