xiaohongshu
xiaohongshu
git-squash-commits
Squash multiple git commits into a single commit with an auto-generated comprehensive commit message based on the changes made.
Full skill instructions
This skill helps you squash a range of git commits into a single commit with an automatically generated commit message that summarizes all the changes. It analyzes the commit history and file changes to create a comprehensive, well-structured commit message.
IMPORTANT: Before invoking this skill, you MUST manually reset your branch to the parent of the earliest commit you want to squash. The skill will verify this and prompt you if needed.
Example:
# If you want to squash commits from abc123 to xyz789
# First find the parent of abc123
git log --oneline abc123~5..abc123
# Then reset to the parent (e.g., parent_commit)
git reset --hard parent_commit
When invoking this skill, provide:
The skill will:
ai_docs/git-squash-commits/ directory containing:
The generated commit message follows this structure:
<Type>: <Brief summary of the main changes>
Major changes:
- <Category 1>: <Description>
- <Category 2>: <Description>
- ...
<Specific area> improvements:
- <Detailed change 1>
- <Detailed change 2>
- ...
Other changes:
- <Miscellaneous improvements>
- ...
This squash consolidates N commits focusing on <focus areas>.
Statistics: X files changed, Y insertions(+), Z deletions(-)
User request:
Help me squash commits from f2da9a6 to d2755e90
Skill execution flow:
Please first reset to the parent of f2da9a6:
git reset --hard <parent_commit_id>
Then invoke this skill again.
git merge --squash d2755e90# Get current HEAD
git rev-parse HEAD
# Get parent of start commit
git rev-parse <start_commit>^
# Compare - they should match
# List commits to squash (from start to end, inclusive)
git log --oneline <start_commit>..<end_commit>
# Include the end commit itself
git log --oneline <end_commit> -1
# Get commit messages for analysis
git log --format="%s" <start_commit>~1..<end_commit>
# Get file statistics
git diff --stat <start_commit>~1..<end_commit>
# Get detailed changes for major files
git diff <start_commit>~1..<end_commit> -- <important_files>
Analyze the commits and changes to create a message that:
After generating the commit message but before executing the squash, prompt the user to verify the changes build correctly:
Please run your project's build/compilation command to verify the changes:
- For Node.js: npm run build or yarn build
- For Python: python -m pytest or your test suite
- For Go: go build ./...
- For Rust: cargo build
- For Java/Maven: mvn compile
- For other projects: use your project-specific build command
Please run the build and let me know:
1. If the build succeeds, I will proceed with creating the squash commit
2. If the build fails, share the error output and I will help resolve it
Wait for user response:
# Squash merge all commits
git merge --squash <end_commit>
# Commit with generated message
git commit -m "$(cat <<'EOF'
<generated_message_here>
EOF
)"
# Check new commit is created
git log --oneline -3
# Verify old commits are NOT in current branch
git log --oneline HEAD~20..HEAD | grep -E "(<start_commit_short>|<end_commit_short>)"
# Should return empty
# Create ai_docs directory structure if not exists
mkdir -p ai_docs/git-squash-commits
# Generate summary filename with timestamp and commit hash
SUMMARY_FILE="ai_docs/git-squash-commits/$(date +%Y%m%d_%H%M%S)_$(git rev-parse --short HEAD).md"
# Write summary containing:
# - Squash operation metadata (date, commit range, new commit hash)
# - Generated commit message
# - Statistics (files changed, insertions, deletions)
# - List of original commits that were squashed
cat > "$SUMMARY_FILE" <<EOF
# Git Squash Summary
**Date**: $(date +"%Y-%m-%d %H:%M:%S")
**Branch**: $(git branch --show-current)
**New Commit**: $(git rev-parse HEAD)
## Commit Range Squashed
- Start: <start_commit>
- End: <end_commit>
## Generated Commit Message
\`\`\`
<paste the generated commit message here>
\`\`\`
## Statistics
<paste git diff --stat output>
## Original Commits
<paste git log --oneline output of squashed commits>
EOF
echo "Summary saved to: $SUMMARY_FILE"
ai_docs/git-squash-commits/ directory
YYYYMMDD_HHMMSS_<short_hash>.md (timestamp + new commit hash)ai_docs/ directory should be added to .gitignore if you prefer not to commit these recordsIf the user hasn't reset to the correct parent commit:
git rev-parse <start_commit>^git rev-parse HEADgit reset --hard <correct_parent>xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience