Back to Skills

commit-changes

pjt222
Updated 6 days ago
14 views
17
2
17
View on GitHub
Metageneral

About

The commit-changes skill stages, commits, and amends Git changes using conventional commit messages. It enables selective staging, descriptive message writing via HEREDOC format, and commit history verification. Use it when saving logical work units, creating conventional commits, amending recent commits, or reviewing staged changes.

Quick Install

Claude Code

Recommended
Primary
npx skills add pjt222/agent-almanac -a claude-code
Plugin CommandAlternative
/plugin add https://github.com/pjt222/agent-almanac
Git CloneAlternative
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/commit-changes

Copy and paste this command in Claude Code to install this skill

Documentation

提交

擇檔、書訊、驗史也。

  • 存工於控→用
  • 書規範訊→用
  • 改末提交→用
  • 提前覆察→用

  • :變檔若干
  • :提交訊(未給則代擬)
  • :改前乎
  • :共作屬

一:察變

查樹態、視差也:

# See which files are modified, staged, or untracked
git status

# See unstaged changes
git diff

# See staged changes
git diff --staged

得:諸變、擇、未追之檔皆明。

敗:git status 敗→驗於庫內(git rev-parse --is-inside-work-tree)。

二:擇檔

勿用 git add .git add -A,擇檔以免誤入密檔或雜變:

# Stage specific files by name
git add src/feature.R tests/test-feature.R

# Stage all changes in a specific directory
git add src/

# Stage parts of a file interactively (not supported in non-interactive contexts)
# git add -p filename

提前察擇:

git diff --staged

得:唯意之檔與變入擇。無 .env、密、巨檔也。

敗:誤入→ git reset HEAD <file> 撤。密入→立撤乃提。

三:書訊

用規範提交式。必以 HEREDOC 傳訊以正格:

git commit -m "$(cat <<'EOF'
feat: add weighted mean calculation

Implements weighted_mean() with support for NA handling and
zero-weight filtering. Includes input validation for mismatched
vector lengths.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
EOF
)"

規範類型:

TypeWhen to use
feat新功
fix除錯
docs僅文
test增更驗
refactor重構無增減
chore建、CI、依更
style排版空白(無邏輯變)

得:提交成,訊述「何以」,非僅「何」也。

敗:預提鉤敗→修、重 git add、建提交(勿 --amend,敗提未生也)。

四:改末提交(可)

未推共遠方可改:

# Amend message only
git commit --amend -m "$(cat <<'EOF'
fix: correct weighted mean edge case for empty vectors

EOF
)"

# Amend with additional staged changes
git add forgotten-file.R
git commit --amend --no-edit

得:前提交就地更。git log -1 示改後容。

敗:已推→勿改。建新提交代之。強推改提→史分歧。

五:驗提交

# View the last commit
git log -1 --stat

# View recent commit history
git log --oneline -5

# Verify the commit content
git show HEAD

得:提交顯於史,訊、作者、檔變皆正。

敗:檔誤→ git reset --soft HEAD~1 撤而留擇、乃重提正。

  • 唯意之檔入提交
  • 無密(令牌、密碼、.env)入
  • 訊合規範式
  • 訊體述「何以」
  • git log 示正元
  • 預提鉤(若存)皆過

  • 一提過多:一提一邏變。無關者分之
  • 盲用 git add .:必先察 git status。宜按名擇
  • 改已推:永勿改推共枝。重寫史害同作
  • 訊含糊:「修錯」「更新」無益。述何變、何以
  • --no-edit:補忘檔入末提→用 --no-edit 存舊訊
  • 鉤敗而 --amend:鉤敗則提未生。--amend提。修鉤後必建新提

  • manage-git-branches - 提前枝工
  • create-pull-request - 提後下步
  • resolve-git-conflicts - 合併/改基衝突
  • configure-git-repository - 庫設與規

GitHub Repository

pjt222/agent-almanac
Path: i18n/wenyan-ultra/skills/commit-changes
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams

Related Skills

content-collections

Meta

This skill provides a production-tested setup for Content Collections, a TypeScript-first tool that transforms Markdown/MDX files into type-safe data collections with Zod validation. Use it when building blogs, documentation sites, or content-heavy Vite + React applications to ensure type safety and automatic content validation. It covers everything from Vite plugin configuration and MDX compilation to deployment optimization and schema validation.

View skill

polymarket

Meta

This skill enables developers to build applications with the Polymarket prediction markets platform, including API integration for trading and market data. It also provides real-time data streaming via WebSocket to monitor live trades and market activity. Use it for implementing trading strategies or creating tools that process live market updates.

View skill

creating-opencode-plugins

Meta

This skill helps developers create OpenCode plugins that hook into 25+ event types like commands, files, and LSP operations. It provides the plugin structure, event API specifications, and implementation patterns for JavaScript/TypeScript modules. Use it when you need to intercept, monitor, or extend the OpenCode AI assistant's lifecycle with custom event-driven logic.

View skill

sglang

Meta

SGLang is a high-performance LLM serving framework that specializes in fast, structured generation for JSON, regex, and agentic workflows using its RadixAttention prefix caching. It delivers significantly faster inference, especially for tasks with repeated prefixes, making it ideal for complex, structured outputs and multi-turn conversations. Choose SGLang over alternatives like vLLM when you need constrained decoding or are building applications with extensive prefix sharing.

View skill