Install
openclaw skills install tosr-test-pub-update-1774335120Professional code review and Git commit workflow management. Use this skill when users mention 'push', 'commit', '提交', or any Git submission operations. Provides comprehensive pre-commit checks, code quality review, build verification, and Git workflow guidance following industry best practices.
openclaw skills install tosr-test-pub-update-1774335120This skill provides professional code review and Git commit workflow management. It ensures code quality through systematic pre-commit checks, build verification, and adherence to Git best practices before any code submission.
NEVER automatically commit or push code without explicit user approval.
All Git operations require user confirmation at each step.
ALWAYS use Chinese for commit messages.
All commit messages must be written in Chinese, following the conventional commits format with Chinese descriptions.
When user mentions push/commit/提交:
go build to ensure compilationgo build againBefore making any code modifications, automatically commit existing uncommitted changes:
# Check for uncommitted changes
git status
# If changes exist, commit them
git add .
git commit -m "chore: 保存当前工作进度"
Note: This is a local commit only (no push). It preserves work-in-progress state.
Ask user explicitly:
"检测到有代码变更,是否需要进行 Code Review?"
If user agrees, proceed to comprehensive code review.
Perform systematic review covering:
Code Quality:
Go-Specific Standards:
Project Standards:
Security:
Provide actionable feedback with specific line references and improvement suggestions.
Create concise, descriptive commit message in Chinese following conventional commits format:
<type>: <description>
[optional body]
Types:
feat: 新功能fix: 修复bugrefactor: 重构docs: 文档更新style: 代码格式调整test: 测试相关chore: 构建/工具相关Example:
feat: 添加用户认证中间件
- 实现JWT token验证
- 添加权限检查逻辑
- 完善错误处理
Present to user for approval:
"建议的 commit message:
[commit message]
是否同意使用此 commit message?"
Only after user approval:
git add .
git commit -m "[approved commit message]"
Before any push operation, verify build succeeds:
go build
If build fails:
Always pull latest changes before pushing:
git pull
If pull brings new changes:
go build again to verify compatibilityOnly after all checks pass:
git push
Before committing, verify:
If violations detected, warn user and request confirmation or exclusion.
Remote URL format: Always use SSH format (git@github.com:user/repo.git) instead of HTTPS.
If HTTPS remote detected, suggest converting to SSH:
git remote set-url origin git@github.com:user/repo.git
For Go projects:
go build before commitgo build after pull if new changes mergedBefore push, ensure:
go build succeedsgit pull executedgo build succeeds again (if pull brought changes)User: "帮我提交代码"
Assistant:
feat: 添加用户登录功能,是否同意?"git commitgo build to verifygit pullgo build againgit push密码检测规则 🔒 在 Critical Rules 部分新增: 禁止提交包含密码的文件 提交前自动扫描敏感信息,包括: 明文密码 API keys、tokens、secrets 数据库凭证 私钥 任何敏感认证信息 如果检测到敏感数据,立即停止提交并警告用户 检测模式包括: password =, PASSWORD =, pwd = api_key =, secret =, token = private_key, 密码, 口令 数据库连接字符串中的凭证 JWT secrets、加密密钥
多功能分离提交规则 📦 在 Critical Rules 部分新增: 当变更包含多个不同功能时,必须分别提交 自动分析和分组文件: 按文件路径和模块结构分组 按相关功能分组(认证、API、数据库、UI等) 按逻辑功能边界分组 为每个功能组生成独立的 commit message 按顺序依次提交,而不是一次性提交所有文件 示例: 如果变更包含"用户认证"和"数据导出"两个功能,会创建两个独立的 commit: feat: 添加用户认证功能 (认证相关文件) feat: 实现数据导出功能 (导出相关文件)