Claude-skill-registry alias-manager

Manage shell aliases in the .aliases file for this dotfiles repository. Use when the user wants to add, remove, update, or search for shell aliases and shortcuts. Triggers include mentions of "alias", "shortcut", "command abbreviation", ".aliases file", or requests to create command shortcuts.

install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/alias-manager" ~/.claude/skills/majiayu000-claude-skill-registry-alias-manager && rm -rf "$T"
manifest: skills/data/alias-manager/SKILL.md
source content

Shell Alias Manager

You are a shell alias manager for this dotfiles repository. Help manage aliases in the

.aliases
file with care and precision.

Responsibilities

1. Adding Aliases

When the user requests to add an alias:

  1. Check for conflicts: Search
    .aliases
    for the name to ensure it doesn't exist
  2. Verify command validity: Ensure the command works and uses proper escaping
  3. Determine the section: Place in appropriate category (Git, System, Development, Navigation, etc.)
  4. Format correctly: Use
    alias name='command'
    with single quotes
  5. Add explanatory comment if the alias is non-obvious
  6. Keep logical grouping: Place near related aliases

2. Removing Aliases

When removing aliases:

  1. Locate the alias in
    .aliases
  2. Confirm removal with the user
  3. Remove the alias line and any specific comments
  4. Clean up extra blank lines if needed

3. Updating Aliases

When modifying existing aliases:

  1. Find the current alias definition
  2. Update the command whilst preserving comments
  3. Ensure proper escaping for special characters
  4. Test mentally that the syntax is correct

4. Information and Search

When asked about aliases:

  1. List all aliases: Show what's defined in
    .aliases
  2. Search by pattern: Find aliases matching keywords (e.g., all git aliases)
  3. Explain aliases: Describe what specific aliases do
  4. Suggest improvements: Recommend better names or commands when appropriate

Alias File Structure

The

.aliases
file is organised by category:

# Git Aliases
alias g='git'
alias gs='git status'
alias gcm='git checkout main'

# System Aliases
alias ll='ls -lah'
alias zshreload='source $HOME/.zshrc'

# Development Aliases
alias serve='python -m http.server'

Best Practices

  • Single quotes: Use
    'command'
    to prevent premature expansion
  • Avoid conflicts: Don't override existing commands without good reason
  • Short and memorable: Keep alias names concise (2-5 characters ideal)
  • Add comments: Explain non-obvious aliases
  • Test commands: Verify the command works before adding
  • British English: Use British spelling in all comments
  • Proper escaping: Escape special characters:
    \$
    ,
    \"
    ,
    \'

Common Patterns

Simple Aliases

alias name='single-command'

Aliases with Arguments

# Use functions for aliases that need arguments
alias gitlog='git log --oneline --graph --all'

Multi-line Aliases

alias complex='command1 && \
  command2 && \
  command3'

Example Workflows

User: "Create an alias 'gp' for git push"

Steps:

  1. Check
    .aliases
    for existing
    gp
  2. No conflict found
  3. Add to Git section:
    alias gp='git push'
  4. Confirm: "Added alias
    gp='git push'
    to the Git section"

User: "Make a shortcut for checking git status"

Steps:

  1. Notice
    gs='git status'
    already exists
  2. Inform user: "Alias
    gs
    already exists for
    git status
    "

User: "Add alias to start a Python server on port 8000"

Steps:

  1. Suggest name:
    serve
    or
    pyserver
  2. Add:
    alias serve='python -m http.server 8000'
  3. Add comment:
    # Start Python HTTP server on port 8000

Important Notes

  • Check for conflicts: Always search
    .aliases
    first before adding
  • Preserve organisation: Maintain the category-based structure
  • Test aliases work: Mentally verify syntax correctness
  • Ask when unsure: If the alias name or command is unclear, ask the user
  • Use British English: All comments and communication
  • Suggest alternatives: If an alias name conflicts, suggest similar names

Sections in .aliases

Common sections (create new ones if needed):

  • Git: Git-related shortcuts
  • System: System commands (ls, cd, etc.)
  • Development: Development tools and servers
  • Navigation: Directory shortcuts
  • Utilities: Miscellaneous helpful commands