スキル一覧に戻る

commit-changes

pjt222
更新日 2 days ago
2 閲覧
17
2
17
GitHubで表示
ドキュメントgeneral

について

このClaudeスキルは、Gitのステージング、コミット、および修正を扱い、コンベンショナルコミットメッセージをサポートします。選択的なステージング、HEREDOCによるコミットメッセージの確認、最終確定前の履歴検証を可能にします。論理的な作業単位の保存、直前のコミットの修正、ステージングされた変更が正しいことを確認するためにご利用ください。

クイックインストール

Claude Code

推奨
メイン
npx skills add pjt222/agent-almanac -a claude-code
プラグインコマンド代替
/plugin add https://github.com/pjt222/agent-almanac
Git クローン代替
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/commit-changes

このコマンドをClaude Codeにコピー&ペーストしてスキルをインストールします

ドキュメント

Commit Changes

Stage selective → clear msg → verify history.

Use When

  • Save logical unit → version control
  • Write conventional msg
  • Amend last commit (msg or content)
  • Review before commit

In

  • Required: Changed files
  • Optional: Commit msg (drafted if none)
  • Optional: Amend prev?
  • Optional: Co-author

Do

Step 1: Review

Check tree + diffs:

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

# See unstaged changes
git diff

# See staged changes
git diff --staged

→ Clear view all modified, staged, untracked.

If err: git status fails → verify inside repo (git rev-parse --is-inside-work-tree).

Step 2: Stage Selective

Stage specific files, not git add . or -A → avoids secrets + unrelated changes:

# 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

Review staged before commit:

git diff --staged

→ Only intended files. No .env, creds, big binaries.

If err: accidental stage → git reset HEAD <file>. Secret staged → unstage immediately before commit.

Step 3: Write Msg

Conventional format. Always HEREDOC → proper formatting:

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
)"

Conventional types:

TypeWhen
featNew feature
fixBug fix
docsDocs only
testAdd/update tests
refactorNo behavior change
choreBuild, CI, deps
styleFormatting, whitespace

→ Commit created w/ msg explaining why, not what.

If err: pre-commit hook fails → fix, re-stage, create new commit (no --amend → failed commit never existed).

Step 4: Amend Last (Optional)

Amend only if not pushed:

# 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

→ Prev commit updated in-place. git log -1 shows amended.

If err: already pushed → no amend. New commit instead. Force-push → history divergence.

Step 5: Verify

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

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

# Verify the commit content
git show HEAD

→ Commit in history w/ correct msg, author, files.

If err: wrong files → git reset --soft HEAD~1 (undo, keep staged), re-commit.

Check

  • Only intended files committed
  • No secrets (tokens, passwords, .env)
  • Msg conventional
  • Body explains why
  • git log shows correct metadata
  • Pre-commit hooks passed

Traps

  • Too much at once: One commit = one logical change. Split unrelated.
  • git add . blind: Always git status first. Stage by name.
  • Amend pushed: Never amend pushed commits → rewrites history, breaks collaborators.
  • Vague msgs: "fix bug" tells nothing. Say what + why.
  • Forget --no-edit: Content amend → use --no-edit → keeps msg.
  • Hook fail → --amend: Hook fail = no commit. --amend hits prev commit. Always new commit after hook fix.

  • manage-git-branches — branch workflow before commit
  • create-pull-request — next step after commit
  • resolve-git-conflicts — merge/rebase conflicts
  • configure-git-repository — repo setup + conventions

GitHub リポジトリ

pjt222/agent-almanac
パス: i18n/caveman-ultra/skills/commit-changes
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams

関連スキル

railway-docs

ドキュメント

このスキルは、Railwayの機能や仕様、特定のドキュメントURLに関する質問に答えるために、最新のRailwayドキュメントを取得します。開発者がRailwayの公式情報源から正確かつ最新の情報を直接受け取れるようにします。ユーザーがRailwayの動作方法について尋ねたり、Railwayドキュメントを参照する際にご利用ください。

スキルを見る

n8n-code-python

ドキュメント

このClaudeスキルは、n8nのコードノードでPythonコードを記述するための専門的なガイダンスを提供します。具体的には、Pythonの標準ライブラリの使用方法や、`_input`、`_json`、`_node`といったn8n独自の構文の扱い方を解説します。n8n環境内におけるPythonの制限事項を開発者が理解できるよう支援し、ほとんどのワークフローではJavaScriptの使用を推奨しながらも、特定のデータ変換ニーズに対応するPythonソリューションを提案します。

スキルを見る

archon

ドキュメント

Archonスキルは、RAGを活用したセマンティック検索とプロジェクト管理をREST APIを通じて提供します。ドキュメントの検索、階層的なプロジェクト/タスクの管理、ドキュメントアップロード機能を備えたナレッジ検索の実行にご利用いただけます。外部ドキュメントを検索する際は、他の情報源を利用する前に常にArchonを最優先で使用してください。

スキルを見る

n8n-code-javascript

ドキュメント

このClaudeスキルは、n8nのCodeノードでJavaScriptコードを書くための専門的なガイダンスを提供します。`$input`/`$json`変数、HTTPヘルパー、DateTime処理などの重要なn8n固有の構文を網羅し、一般的なエラーのトラブルシューティングも行います。CodeノードでカスタムJavaScript処理を必要とするn8nワークフローを開発する際にご利用ください。

スキルを見る