From petems-skills
Commit and push with Peter's conventional commit format (50-char titles, * bullet details, imperative mood)
How this skill is triggered — by the user, by Claude, or both
Slash command
/petems-skills:git-commit-and-push-petemsThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
When the user asks you to commit (and optionally push) changes, follow these steps carefully.
When the user asks you to commit (and optionally push) changes, follow these steps carefully.
This skill builds on established commit message conventions with petems-specific preferences layered on top. For background on why each rule exists, see the reference material below.
Read these files when you need deeper context on the reasoning behind a rule:
${CLAUDE_SKILL_DIR}/references/conventional-commits-v1.md${CLAUDE_SKILL_DIR}/references/karma-commit-message-convention.md${CLAUDE_SKILL_DIR}/references/sparkbox-semantic-commit-messages.md${CLAUDE_SKILL_DIR}/references/petems-preferences.mdgit add -A or git add ., which can accidentally include sensitive files (.env, credentials) or large binariesRun the following bash commands in parallel to understand the current state:
git status — see all untracked and modified files. IMPORTANT: Never use the -uall flag as it can cause memory issues on large repos.git diff and git diff --staged — see both staged and unstaged changes.git log --oneline -10 — see recent commit messages for style reference.git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@'
If that returns nothing (no remote HEAD configured), fall back to checking which of master or main exists as a local branch. Prefer master if both exist.git branch --show-current — get the current branch name.Compare the current branch against the detected trunk branch.
git checkout -b <branch-name>.<branch-name> to avoid committing directly to <trunk>."When creating a new branch, use the following pattern:
<type>/#<issueNumber>-<alias>
| | |
| | +---> Summary in kebab-case.
| +--------------> Reference to the issue/ticket.
+------------------------> Type: feat, fix, docs, style, refactor, test, or chore.
When there is no issue number, use a short slug, e.g. feat/add-oauth-login, fix/null-pointer-in-parser, refactor/extract-auth-middleware.
| Prefix | Purpose |
|---|---|
feat or feature | New feature |
fix | Bug fix |
docs | Documentation only |
style | Formatting, missing semicolons, etc. |
refactor | Code change that neither fixes nor adds |
test | Adding or updating tests |
chore | Maintenance (deps, CI, build, etc.) |
Reference: https://gist.github.com/seunggabi/87f8c722d35cd07deb3f649d45a31082
Analyze all staged changes (both previously staged and newly added) and draft a commit message following Conventional Commits format with petems preferences applied.
The base format comes from the Conventional Commits spec (
${CLAUDE_SKILL_DIR}/references/conventional-commits-v1.md), with type prefixes drawn from the Karma convention (${CLAUDE_SKILL_DIR}/references/karma-commit-message-convention.md). Where this skill diverges from those specs, see petems preferences (${CLAUDE_SKILL_DIR}/references/petems-preferences.md).
<type>(<scope>): <description>feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert* bullet points to describe what changed and why (petems preference; the specs do not mandate a bullet character)#123Closes #123 or Fixes #123 when the commit resolves an issuefeat(auth): add OAuth2 login support
* Add OAuth2 provider configuration
* Update login controller for new flow
* Add token refresh middleware
Closes #42
.env, credentials.json, etc.), warn the user if they specifically request to commit those filesgit commit -m "$(cat <<'EOF'
<type>(<scope>): <description>
* Detail line one
* Detail line two
Co-Authored-By: Claude <[email protected]>
EOF
)"
git status after the commit completes to verify success.If the user asked to push:
git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null-u: git push -u origin $(git branch --show-current)git push--amend).Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub petems/petems-skills --plugin blog-post-writer-petems