用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ViewWay/MiniHES --skill pr-creator命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
MiniHES 后端开发规范。当用户进行 FastAPI 后端开发、API 设计、数据库操作、 DLMS 协议实现、数据采集任务开发时自动激活。 涵盖分层架构、编码原则、安全要求、数据库规范。
MiniHES 代码审查。当用户请求审查代码、review PR、检查变更时激活。 支持本地变更审查和指定文件审查,输出结构化审查报告。 引用 backend-checklist.md 和 frontend-checklist.md 作为审查依据。
修复代码格式和 lint 问题。当用户在提交前需要修复代码风格、 排查 lint 错误、或说 "fix"、"格式化"、"lint" 时激活。
基于 SOC 职业分类
正在显示 SKILL.md
| 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 刷新机制