执行 Git 操作(提交、分支、合并、变基、冲突解决与恢复)时强制套用安全规则。
编程
TOSR Publish Then Update Test
试用Professional code review and Git commit workflow management. Use this skill when users mention 'push', 'commit', '提交', or any Git submission operations. Prov...
它能做什么
This 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.
技能文档
Push Flow
Overview
This 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.
Critical Rules
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.
Workflow Decision Tree
When user mentions push/commit/提交:
- Check for uncommitted changes → If exists, proceed to step 2
- Offer code review → Ask user if they want code review
- If code review requested → Perform comprehensive review
- Generate commit message → Present to user for approval
- Execute git commit → Only after user approves message
- Run build verification → Execute
go buildto ensure compilation - Execute git pull → Sync with remote before push
- If pull brings new changes → Run
go buildagain - Execute git push → Only after all checks pass
Pre-Commit Workflow
Step 1: Auto-Commit Existing Changes
Before 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.
Step 2: Offer Code Review
Ask user explicitly:
"检测到有代码变更,是否需要进行 Code Review?"
If user agrees, proceed to comprehensive code review.
Step 3: Code Review Process
Perform systematic review covering:
Code Quality:
- Logic correctness and edge cases
- Error handling completeness
- Code readability and maintainability
- Performance considerations
Go-Specific Standards:
- Adherence to Go coding conventions
- Proper error handling patterns
- Goroutine and concurrency safety
- Resource management (defer usage)
Project Standards:
- Compliance with project coding guidelines
- Naming conventions
- Comment completeness
- Test coverage
Security:
- Input validation
- SQL injection prevention
- Sensitive data handling
Provide actionable feedback with specific line references and improvement suggestions.
Step 4: Generate Commit Message
Create concise, descriptive commit message in Chinese following conventional commits format:
:
[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?"
Step 5: Execute Commit
Only after user approval:
git add .
git commit -m "[approved commit message]"
Step 6: Build Verification
Before any push operation, verify build succeeds:
go build
If build fails:
- Report errors to user
- Do NOT proceed with push
- Offer to help fix build issues
Step 7: Pull Before Push
Always pull latest changes before pushing:
git pull
If pull brings new changes:
- Run
go buildagain to verify compatibility - If build fails, resolve conflicts before pushing
Step 8: Execute Push
Only after all checks pass:
git push
File Size and Type Restrictions
Before committing, verify:
- No binary files (unless explicitly required)
- No files > 1MB
- No sensitive data (credentials, keys, tokens)
If violations detected, warn user and request confirmation or exclusion.
Git Configuration Preferences
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
Go Build Requirements
For Go projects:
- Always run
go buildbefore commit - Always run
go buildafter pull if new changes merged - Ensure compilation succeeds before any push operation
Summary Checklist
Before push, ensure:
- Existing changes auto-committed (if any)
- Code review completed (if requested)
- Commit message approved by user
-
go buildsucceeds -
git pullexecuted -
go buildsucceeds again (if pull brought changes) - No binary files or files > 1MB
- User explicitly approved push operation
Example Interaction
User: "帮我提交代码"
Assistant:
- "检测到有未提交的代码变更,是否需要进行 Code Review?"
- [If yes] Perform code review and provide feedback
- "建议的 commit message:
feat: 添加用户登录功能,是否同意?" - [After approval] Execute
git commit - Execute
go buildto verify - Execute
git pull - [If pull brought changes] Execute
go buildagain - "所有检查通过,是否执行 git push?"
- [After approval] Execute
git 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: 实现数据导出功能 (导出相关文件)
相关技能
诊断生产力系统反复失效的根因,给出最小干预——容量测算、瓶颈定位、可靠的本地记录。
按用户明确指令,在得到大脑(Get笔记)中保存、搜索并管理笔记与知识库。
把自然语言描述转为结构化 JSON,并由 mcp-diagram-generator MCP 服务生成 Draw.io、Mermaid 或 Excalidraw 图表文件。
在本地磁盘以分类纯 Markdown 文件保存需要长期留存的事实,与智能体内置记忆并存。
以 AI 机器人身份加入视频会议,提供语音、虚拟形象与屏幕共享四种模式。
yinwuzhe 的更多技能
浏览全部技能Analyze stocks and cryptocurrencies using Yahoo Finance data. Supports portfolio management, watchlists with alerts, dividend analysis, 8-dimension stock sco...
Analyze stocks and cryptocurrencies using Yahoo Finance data. Supports portfolio management, watchlists with alerts, dividend analysis, 8-dimension stock sco...
Analyze stocks and cryptocurrencies using Yahoo Finance data. Supports portfolio management, watchlists with alerts, dividend analysis, 8-dimension stock sco...
Analyze stocks and cryptocurrencies using Yahoo Finance data. Supports portfolio management, watchlists with alerts, dividend analysis, 8-dimension stock sco...
腾讯云对象存储(COS)和数据万象(CI)集成技能。覆盖文件存储管理、AI处理和知识库三大核心场景。 存储场景:上传文件到云端、下载云端文件、批量管理存储桶文件、获取文件签名链接分享、查看文件元信息。 图片处理场景:图片质量评估打分、AI超分辨率放大、AI智能裁剪、二维码/条形码识别、添加文字水印、获取图片EXI...
微信支付委托代扣接入解决方案,覆盖周期扣款 / 先享后付场景下的纯签约、支付中签约、申请扣款、预扣费通知、解约、查询、退款、对账全链路,提供选型/示例代码/业务速查/质量评估/排障五大能力。Use when user mentions "委托代扣", "周期扣款", "周期扣费", "自动续费", "先享后付",...