Shell
#!/bin/bash
# Pre-Task Hook: Checks project state before starting new work
# Check if we're in a git repository
if git rev-parse --git-dir > /dev/null 2>&1; then
# Check for uncommitted changes
if ! git diff-index --quiet HEAD -- 2>/dev/null; then
echo "⚠️ Warning: You have uncommitted changes. Consider committing before starting new work."
fi
# Check current branch
CURRENT_BRANCH=$(git branch --show-current)
if [[ "$CURRENT_BRANCH" == "main" ]] || [[ "$CURRENT_BRANCH" == "master" ]]; then
echo "⚠️ Warning: You're on the $CURRENT_BRANCH branch. Consider creating a feature branch for new work."
fi
fi
exit 0