AgentSkillsCN

commit

采用安全的 Git 提交工作流,有效防止直接向主分支提交代码。当用户提出“提交更改”“保存更改”“执行 Git 提交”,或在完成需要版本控制的任务时,可使用此技能。在位于主分支时,系统会自动创建功能分支。除非用户明确要求,否则绝不自动生成拉取请求。

SKILL.md
--- frontmatter
name: commit
description: Safe git commit workflow that prevents commits to main branch. Use when the user asks to "commit changes", "save changes", "git commit", or when completing a task that needs version control. Automatically creates feature branches when on main. NEVER creates pull requests unless explicitly requested by the user.

Safe Commit Workflow

  1. Check branch: git branch --show-current
  2. If on main: Create branch git checkout -b feat/<name> or fix/<name>
  3. Format: moon fmt && moon info
  4. Commit with conventional message (feat:, fix:, refactor:, etc.)
  5. Never push or create PR unless explicitly requested