AgentSkillsCN

commit

在检查仓库位置与分支安全性的过程中,分阶段提交更改。

SKILL.md
--- frontmatter
name: commit
description: Stages and commits changes while checking for repo location and branch safety.
disable-model-invocation: true
user-invocable: true
argument-hint: "[optional context for the message...]"
allowed-tools: Bash

Task

  1. Find the Repo: Check if the current directory or subdirectories contain multiple Git repositories. If it is ambiguous, ask the user.
  2. Check Branch: Never commit directly to main or master. If on one of these, stop and warn.
  3. Stage: Run git add . in the identified repository.
  4. Draft: Generate a concise Conventional Commit message based on git diff --cached.
  5. Commit: Execute git commit -m "<message>".

Constraints

  • No "Generated by Claude" footer.
  • Use imperative mood.
  • Stop if there are no changes.

Optional User Context

$ARGUMENTS