Agent SkillsasJEI/vscode › commit

commit

GitHub

根据仓库现有提交风格,为暂存或未暂存的代码变更生成符合规范的提交信息并执行提交。自动检测提交约定,检查状态,生成摘要及可选正文,并在提交后确认结果。

src/vs/sessions/skills/commit/SKILL.md asJEI/vscode

触发场景

用户要求 'commit' 用户要求 'commit changes' 用户要求 'create a commit' 用户要求 'save my work' 用户要求 'check in code'

安装

npx skills add asJEI/vscode --skill commit -g -y
更多选项

非标准路径

npx skills add https://github.com/asJEI/vscode/tree/main/src/vs/sessions/skills/commit -g -y

不安装直接使用

npx skills use asJEI/vscode@commit

指定 Agent (Claude Code)

npx skills add asJEI/vscode --skill commit -a claude-code -g -y

安装 repo 全部 skill

npx skills add asJEI/vscode --all -g -y

预览 repo 内 skill

npx skills add asJEI/vscode --list

SKILL.md

Frontmatter
{
    "name": "commit",
    "description": "Commit staged or unstaged changes with an AI-generated commit message that matches the repository's existing commit style. Use when the user asks to 'commit', 'commit changes', 'create a commit', 'save my work', or 'check in code'."
}

Commit Changes

Help the user commit code changes with a well-crafted commit message derived from the diff, following the conventions already established in the repository.

Guidelines

  • Never amend existing commits without asking.
  • Never force-push or push without explicit user approval.
  • Never skip pre-commit hooks (do not use --no-verify).
  • Never skip signing commits (do not use --no-gpg-sign).
  • Never revert, reset, or discard user changes unless the user explicitly asked for that.
  • Check for obvious secrets or generated artifacts that should not be committed. If something looks risky - ask the user.
  • When in doubt about staging, convention, or message content — ask the user.

Workflow

1. Discover the repository's commit convention

Run the following to sample recent commits and the user's own commits:

# Recent repo commits (for overall style)
git log --oneline -20

# User's recent commits (for personal style)
git log --oneline --author="$(git config user.name)" -10

Analyse the output to determine the commit message convention used in the repository (e.g. Conventional Commits, Gitmoji, ticket-prefixed, free-form). All generated messages must follow the detected convention.

2. Check repository status

git status --short
  • If there are no changes (working tree clean, nothing staged), inform the user and stop.
  • If there are staged changes, proceed with those and do not stage any unstaged changes.
  • If there are only unstaged changes, stage everything (git add -A), and proceed with those.

3. Generate the commit message

Obtain the full diff of what will be committed:

git diff --cached --stat
git diff --cached

Using the diff and the commit convention detected in step 1, draft a commit message with:

  • A subject line (≤ 72 characters) that summarises the change, following the repository's convention.
  • An optional body that explains why the change was made, only when the diff is non-trivial.
  • Reference issue/ticket numbers when they appear in branch names or related context.
  • Focus on the intent of the change, not a file-by-file inventory.

4. Commit

Construct the git commit command with the generated message.

Execute the commit:

git commit -m "<subject>" -m "<body>"

5. Confirm

After the commit:

  • Run git status --short to confirm the commit completed.
  • Run git log --oneline -1 to show the new commit.
  • If pre-commit hooks changed files or blocked the commit, summarize exactly what happened.
  • If hooks rewrote files after the commit attempt, do not amend automatically. Tell the user what changed and ask whether they want you to stage and commit those follow-up edits.

版本历史

  • ce4db66 当前 2026-07-19 08:58

同 Skill 集合

.agents/skills/launch/SKILL.md
.github/skills/accessibility/SKILL.md
.github/skills/add-policy/SKILL.md
.github/skills/agent-host-e2e-tests/SKILL.md
.github/skills/agent-host-logs/SKILL.md
.github/skills/author-contributions/SKILL.md
.github/skills/auto-perf-optimize/SKILL.md
.github/skills/azure-pipelines/SKILL.md
.github/skills/chat-customizations-editor/SKILL.md
.github/skills/chat-perf/SKILL.md
.github/skills/code-oss-logs/SKILL.md
.github/skills/component-fixtures/SKILL.md
.github/skills/cpu-profile-analysis/SKILL.md
.github/skills/design-philosophy/SKILL.md
.github/skills/fix-ci-failures/SKILL.md
.github/skills/fix-errors/SKILL.md
.github/skills/heap-snapshot-analysis/SKILL.md
.github/skills/hygiene/SKILL.md
.github/skills/integrated-browser/SKILL.md
.github/skills/integration-tests/SKILL.md
.github/skills/memory-leak-audit/SKILL.md
.github/skills/otel/SKILL.md
.github/skills/sessions/SKILL.md
.github/skills/smoke-tests/SKILL.md
.github/skills/symbolicate-crash-dump/SKILL.md
.github/skills/tool-rename-deprecation/SKILL.md
.github/skills/unit-tests/SKILL.md
.github/skills/update-screenshots/SKILL.md
.github/skills/ux-css-layout/SKILL.md
.github/skills/ux-theming/SKILL.md
.github/skills/vscode-dev-workbench/SKILL.md
extensions/copilot/.agents/skills/anthropic-sdk-upgrader/SKILL.md
extensions/copilot/.agents/skills/launch/SKILL.md
src/vs/sessions/skills/act-on-feedback/SKILL.md
src/vs/sessions/skills/code-review/SKILL.md
src/vs/sessions/skills/create-draft-pr/SKILL.md
src/vs/sessions/skills/create-pr/SKILL.md
src/vs/sessions/skills/fix-ci/SKILL.md
src/vs/sessions/skills/generate-run-commands/SKILL.md
src/vs/sessions/skills/merge/SKILL.md
src/vs/sessions/skills/sync-upstream/SKILL.md
src/vs/sessions/skills/sync/SKILL.md
src/vs/sessions/skills/troubleshoot/SKILL.md
src/vs/sessions/skills/update-pr/SKILL.md
src/vs/sessions/skills/update-skills/SKILL.md
extensions/copilot/.agents/skills/github-copilot-upgrader/SKILL.md

元信息

文件数
0
版本
ce4db66
Hash
3c9118bf
收录时间
2026-07-19 08:58

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-22 02:48
浙ICP备14020137号-1 $访客地图$