Maintain clarity in shell configuration files by documenting function origin, purpose, and status.
# =============================================================================
# Function: <function_name>
# Added: <YYYY-MM-DD>
# Source: <Claude|ChatGPT|Manual|StackOverflow|etc>
# Purpose: <brief one-line description>
# Usage: <example command with arguments>
# Status: <active|testing|deprecated|broken>
# Notes: <optional additional context>
# =============================================================================- Function: Primary function name (or alias if applicable)
- Added: Date added to config (ISO format: YYYY-MM-DD)
- Source: Where the function came from (AI assistant, manual creation, copied from docs, etc)
- Purpose: Brief description of what it does
- Usage: Example command showing typical invocation
- Status: Current state
active- working and regularly usedtesting- experimental, may have issuesdeprecated- superseded by better solutionbroken- known to not work, kept for reference
- Notes: (Optional) Caveats, known issues, dependencies
# =============================================================================
# Function: gist-clip
# Added: 2025-11-12
# Source: Claude
# Purpose: Create GitHub gist from Windows clipboard via WSL
# Usage: gist-clip "description" "filename.md"
# Status: active
# Notes: Emoji encoding unreliable, prefer ASCII alternatives
# =============================================================================
pwsh-clip() {
powershell.exe -NoProfile -Command '$OutputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8; Get-Clipboard'
}
gist-clip() {
local desc="${1:-clipboard content}"
pwsh-clip | gh gist create --desc "$desc" --public --filename "${2:-content.md}" -
}# =============================================================================
# Function: old-backup
# Added: 2024-03-15
# Source: Manual
# Purpose: Quick rsync backup to external drive
# Usage: old-backup /source /dest
# Status: deprecated
# Notes: Replaced by backup-safe.sh (includes verification and logging)
# =============================================================================# =============================================================================
# Function: docker-clean-all
# Added: 2024-08-22
# Source: StackOverflow
# Purpose: Nuclear option for Docker cleanup
# Usage: docker-clean-all
# Status: broken
# Notes: Destructive. Removed after C volume incident 2024-09-XX
# =============================================================================- Future auditing: Quickly find and remove unused/broken functions
- Context preservation: Remember why something was added
- Source tracking: Know which AI assistant or resource provided the code
- Status visibility: Identify experimental vs production-ready functions
- Safe deprecation: Keep references without active use
# Find all functions by source
grep -n "Source: Claude" ~/.bashrc
# Find deprecated functions
grep -n "Status: deprecated" ~/.bashrc
# Find functions added in specific month
grep -n "Added: 2025-11" ~/.bashrc
# List all annotated functions
grep -n "# Function:" ~/.bashrcWhen AI assistants (Claude, ChatGPT, etc) provide shell functions or aliases, request they include this annotation format by default. Share this standard across sessions for consistency.
Template Version: 1.0
Created: 2025-11-12
Compatible with: bash, zsh, fish (with comment syntax adjustment)