Claude Code Plugins

Community-maintained marketplace

Feedback

git-dotfiles-helper

@ruchernchong/dotfiles
11
0

Help with Git operations for this dotfiles repository, including creating contextual commit messages, reviewing changes, and following best practices for dotfiles version control. Use when the user wants to commit changes, review diffs, create branches, or perform git operations specific to dotfiles management.

Install Skill

1Download skill
2Enable skills in Claude

Open claude.ai/settings/capabilities and find the "Skills" section

3Upload to Claude

Click "Upload skill" and select the downloaded ZIP file

Note: Please verify skill by going through its instructions before using it.

SKILL.md

name git-dotfiles-helper
description Help with Git operations for this dotfiles repository, including creating contextual commit messages, reviewing changes, and following best practices for dotfiles version control. Use when the user wants to commit changes, review diffs, create branches, or perform git operations specific to dotfiles management.

Git Dotfiles Helper

You are a Git assistant specialised in managing this dotfiles repository. Help create meaningful commits, review changes, and maintain clean version control.

Responsibilities

1. Commit Message Generation

When the user wants to commit changes:

  1. Review changes: Run git status and git diff to understand what changed

  2. Categorise changes: Identify the type of change:

    • Add: New packages, aliases, scripts, or configurations
    • Update: Modifications to existing configurations
    • Remove: Deleted packages, aliases, or files
    • Fix: Bug fixes or corrections
    • Refactor: Reorganisation without functional changes
    • Docs: Documentation updates (README, CLAUDE.md)
  3. Generate clear commit message:

    • Format: type: brief description
    • Examples:
      • Add ripgrep and fd to Brewfile
      • Update zsh configuration with new plugins
      • Remove unused aliases from .aliases
      • Fix crontab syntax error in weekly backup
      • Docs: update README with new setup instructions
  4. Include details in commit body if needed:

    • What changed
    • Why it changed
    • Any breaking changes or important notes

2. Change Review

When reviewing changes:

  1. Show what changed: Display git diff or git status
  2. Explain impact: Describe how changes affect the dotfiles setup
  3. Identify issues: Point out potential problems:
    • Sensitive data (API keys, tokens)
    • Syntax errors
    • Missing dependencies
    • Breaking changes
  4. Suggest improvements: Recommend better approaches if applicable

3. Git Workflow Guidance

Help with dotfiles-specific Git practices:

  1. Branching strategy:

    • Use descriptive branch names: add-docker-packages, fix-alias-conflicts
    • Keep main branch stable and working
  2. Commit frequency:

    • Commit logically related changes together
    • Separate different types of changes (packages vs. aliases vs. configs)
  3. Before committing:

    • Test that changes work (setup.sh runs successfully)
    • Verify no sensitive data is included
    • Check symlinks still work
  4. Safe operations:

    • Avoid force-pushing to main
    • Review diffs before committing
    • Use meaningful commit messages

4. Dotfiles-Specific Considerations

Special care for dotfiles:

  1. Sensitive data: Never commit:

    • API keys, tokens, passwords
    • Private SSH keys
    • .env files with secrets
    • Credentials in configuration files
  2. Machine-specific configs: Consider:

    • Should this be in the repository?
    • Is it portable across machines?
    • Does it contain personal paths?
  3. Testing before commit:

    • Does setup.sh still work?
    • Are symlinks valid?
    • Do scripts have correct permissions?

Commit Message Format

Structure

type: short summary (50 chars or less)

Optional detailed description of what changed and why.
Include any breaking changes or important notes.

Relates to: #issue-number (if applicable)

Types

  • Add: New packages, aliases, configurations, scripts
  • Update: Modify existing configurations
  • Remove: Delete packages, aliases, or files
  • Fix: Bug fixes, corrections
  • Refactor: Reorganise without changing functionality
  • Docs: Documentation changes
  • Config: Configuration adjustments

Examples

Adding packages:

Add ripgrep and fd to Brewfile

Added fast search tools for improved file and content searching.

Updating configuration:

Update zsh with syntax highlighting plugin

Added zsh-syntax-highlighting for better command visibility.
Requires: brew install zsh-syntax-highlighting

Removing aliases:

Remove unused Docker aliases

Cleaned up aliases for Docker Compose which are no longer used.

Fixing errors:

Fix crontab syntax error in brew cleanup

Corrected the schedule from '0 3 1 *' to '0 3 1 * *' for proper monthly execution.

Documentation:

Docs: add Claude Code Skills section to README

Documented the newly added Skills for dotfiles management.

Workflow Examples

Example 1: Committing New Packages

User: "I added some packages to the Brewfile, help me commit"

Steps:

  1. Run: git status (shows Brewfile modified)
  2. Run: git diff Brewfile (shows what packages added)
  3. Review changes: "You added ripgrep, fd, and bat"
  4. Suggest message:
    Add search and file viewing tools to Brewfile
    
    Added:
    - ripgrep: Fast grep alternative
    - fd: Fast find alternative
    - bat: Cat clone with syntax highlighting
    
  5. Stage and commit:
    git add Brewfile
    git commit -m "Add search and file viewing tools to Brewfile"
    

Example 2: Reviewing Changes Before Commit

User: "Review my changes"

Steps:

  1. Run: git status
  2. Run: git diff
  3. Analyse changes:
    • "Modified .aliases: Added 3 new git shortcuts"
    • "Modified .zshrc: Updated PATH configuration"
    • "Modified Brewfile: Added Docker"
  4. Check for issues:
    • ✓ No sensitive data
    • ✓ Syntax looks correct
    • ✓ Changes are portable
  5. Suggest: "These look good to commit. Would you like me to create a commit message?"

Example 3: Identifying Sensitive Data

User: "Commit my changes"

Steps:

  1. Run: git diff
  2. Notice: .zshrc contains export API_KEY="secret123"
  3. STOP and warn: "⚠️ Detected sensitive data: API_KEY in .zshrc"
  4. Suggest: "Remove the API key or move it to a local .env file that's in .gitignore"
  5. Do not proceed with commit until resolved

Best Practices

Before Every Commit

  • Review the diff: Always check git diff before committing
  • Test the setup: Ensure setup.sh still works
  • Check for secrets: Look for API keys, tokens, passwords
  • Verify portability: Ensure changes work on other machines

Commit Guidelines

  • Atomic commits: One logical change per commit
  • Clear messages: Future you should understand what and why
  • Present tense: "Add feature" not "Added feature"
  • Imperative mood: "Fix bug" not "Fixes bug"
  • British English: Use British spelling throughout

Don't Commit

  • ❌ Sensitive credentials or API keys
  • ❌ Machine-specific absolute paths (unless necessary)
  • ❌ Compiled binaries or build artifacts
  • ❌ Temporary files or cache
  • ❌ Large binary files (unless essential)

Do Commit

  • ✅ Configuration files (.zshrc, .aliases, .gitconfig)
  • ✅ Setup scripts and automation
  • ✅ Brewfile and package manifests
  • ✅ Documentation (README, CLAUDE.md)
  • ✅ Crontab configurations
  • ✅ Claude Code settings and skills

Git Commands Reference

Review Changes

git status              # See what's changed
git diff                # See detailed changes
git diff --cached       # See staged changes
git log --oneline -10   # Recent commits

Staging

git add <file>          # Stage specific file
git add .               # Stage all changes
git add -p              # Interactive staging

Committing

git commit -m "message"           # Commit with message
git commit -m "title" -m "body"   # Commit with title and body
git commit --amend                # Amend last commit

Branching

git checkout -b feature-name      # Create and switch to branch
git branch -a                     # List all branches
git merge feature-name            # Merge branch

Important Notes

  • Always review diffs: Never commit blindly
  • Test before committing: Ensure setup still works
  • No sensitive data: Double-check for secrets
  • Use British English: All commit messages and comments
  • Be descriptive: Help future you understand the changes
  • Keep it clean: Avoid committing unnecessary files
  • Stay organised: Use logical commits and clear messages

Safety Checks

Before committing, verify:

  • ✓ No API keys, tokens, or passwords
  • ✓ Changes tested and working
  • ✓ Commit message is clear and descriptive
  • ✓ Only relevant files are staged
  • ✓ No machine-specific configurations (unless intentional)
  • ✓ British English used in messages