commit
Purpose
Guide the process of creating well-structured git commits with meaningful commit messages. This skill ensures commits follow best practices and include proper attribution.
Workflow
- Check git status to see untracked and modified files
- Review staged and unstaged changes with git diff
- Examine recent commit messages for style consistency
- Analyze changes and draft an appropriate commit message
- Stage relevant files and create the commit
- Verify the commit succeeded
Instructions
When the user wants to commit changes:
Step 1: Gather Context
Run the following commands in parallel to understand the current state:
# See all untracked and modified files (never use -uall flag)
git status
# See both staged and unstaged changes
git diff
git diff --staged
# See recent commit messages for style reference
git log --oneline -10
Step 2: Analyze Changes
Review all changes (staged and unstaged) and determine:
- Nature of changes: New feature, enhancement, bug fix, refactoring, test, docs, etc.
- Scope: Which components or areas are affected
- Purpose: Why these changes were made (the "why" not the "what")
Step 3: Draft Commit Message
Create a concise commit message following these guidelines:
- First line: Imperative mood, under 72 characters, summarizes the change
- Use accurate verbs: "add" for new features, "update" for enhancements, "fix" for bug fixes
- Focus on "why": Explain the purpose rather than describing the code changes
- Keep it brief: 1-2 sentences for simple changes
Conventional Commits
If the recent commit history follows the Conventional Commits format, the generated commit message must also follow that format. Conventional Commits use this structure:
<type>[(optional scope)]: <description>
Common types: feat, fix, docs, style, refactor, test, chore, ci, build, perf.
Examples:
feat(auth): add OAuth2 login supportfix: resolve race condition in connection poolingdocs(readme): update installation instructionsrefactor(db): simplify query builder logicchore: bump dependency versions
Look at the output of git log --oneline -10 from Step 1. If the majority of recent commits use the type: or type(scope): prefix pattern, adopt the same format for the new commit message.
Standard Commit Messages
If the commit history does not follow Conventional Commits, use a standard imperative format:
Add validation for user email inputFix race condition in connection poolingUpdate authentication flow to support OAuth2Refactor database queries for better performance
Step 4: Security Check
Before committing, verify:
- No sensitive files are being committed (.env, credentials.json, private keys)
- No secrets or API keys in the changes
- Warn the user if any suspicious files are detected
Step 5: Stage and Commit
Stage specific files by name rather than using git add -A or git add .:
# Stage specific files
git add path/to/file1 path/to/file2
# Create commit with sign-off flag and HEREDOC for proper formatting
git commit --signoff -m "$(cat <<'EOF'
Commit message here.
Assisted-by: <assistant-name>
EOF
)"
Step 6: Verify Success
After committing, run git status to confirm the commit succeeded.
Important Rules
- Never commit without user request: Only create commits when explicitly asked
- Never push code: Do not run
git pushunder any circumstances, uless user explicitly requests it - Never amend unless requested: Always create new commits, not amend existing ones
- Never skip hooks: Do not use --no-verify or --no-gpg-sign unless user requests
- Never force push: Avoid destructive git operations
- Never update git config: Do not modify user's git configuration
- Stage files explicitly: Prefer specific file paths over
git add -A - Always sign off: Use
--signoffflag with every commit
Attribution
Always include the Assisted-by: trailer at the end of commit messages. The coding agent should use its own identity from context to fill in the appropriate value (e.g., "Claude Code", "Cursor", "GitHub Copilot").
Sign-off
Always use the --signoff (or -s) flag when creating commits. This adds a Signed-off-by: trailer with the committer's identity from git config.
Handling Pre-commit Hook Failures
If a pre-commit hook fails:
- The commit did NOT happen - do not use --amend
- Fix the issues identified by the hook
- Re-stage the fixed files
- Create a NEW commit (not amend)
Example Usage
User: "Commit my changes"
Response:
- Run git status and git diff to see changes
- Analyze the modifications
- Draft: "Add CODEOWNERS validation script and GitHub workflow"
- Stage the specific files changed
- Create the commit with --signoff and appropriate "Assisted-by:" trailer
- Confirm success with git status
More from kadel/claude-plugins
jira cli usage
This skill should be used when the user asks to "interact with Jira", "list Jira issues", "create Jira issue", "manage sprints", "view epics", "search issues", "move issue status", "assign issue", or mentions using the jira command-line tool for project management.
13backstage custom resource
This skill should be used when the user asks to "create Backstage CR", "create RHDH custom resource", "configure rhdh-operator", "create Backstage manifest", "modify Backstage CR", "configure RHDH deployment", "add dynamic plugins to CR", "configure Backstage database", "set up Backstage route", "configure app-config for RHDH", "create rhdh.redhat.com/v1alpha Backstage", or mentions creating or modifying a Backstage Custom Resource for the rhdh-operator.
10worktree feature development
This skill should be used when the user asks to "start a new feature", "create feature branch in worktree", "set up isolated feature development", "work on feature in separate directory", or mentions git worktree for feature isolation.
10generate frontend wiring
This skill should be used when the user asks to "generate frontend wiring", "show frontend wiring", "create RHDH binding", "generate dynamic plugin config", "show plugin wiring for RHDH", "create app-config for frontend plugin", or wants to generate the RHDH dynamic plugin wiring configuration for an existing Backstage frontend plugin. The skill analyzes the plugin's source code and generates the appropriate configuration.
9rhdh frontend dynamic plugin bootstrap
This skill should be used when the user asks to "create RHDH frontend plugin", "bootstrap frontend dynamic plugin", "create UI plugin for RHDH", "new frontend plugin for Red Hat Developer Hub", "add entity card to RHDH", "create dynamic route", "add sidebar menu item", "configure mount points", "create theme plugin", or mentions creating frontend components, UI pages, entity cards, or visual customizations for Red Hat Developer Hub or RHDH. This skill is specifically for frontend plugins - for backend plugins, use the separate backend plugin skill.
9rhdh backend dynamic plugin bootstrap
This skill should be used when the user asks to "create RHDH backend plugin", "bootstrap backend dynamic plugin", "create backstage backend plugin for RHDH", "new backend plugin for Red Hat Developer Hub", "create dynamic backend plugin", "scaffold RHDH backend plugin", "new scaffolder action", "create catalog processor", or mentions creating a new backend plugin, backend module, or server-side functionality for Red Hat Developer Hub or RHDH. This skill is specifically for backend plugins - for frontend plugins, use the separate frontend plugin skill.
9