nop-git-master

Automates Git commits, rebasing, syncing, and history search following Nop project conventions.

693|100|Updated Aug 18, 2022
One-click install
npx skills add https://github.com/entropy-cloud/nop-entropy --skill nop-git-master
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nop-git-master
Source: https://github.com/entropy-cloud/nop-entropy/tree/main/.opencode/skills/nop-git-master
Command: npx skills add https://github.com/entropy-cloud/nop-entropy --skill nop-git-master

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Managing Git operations in the Nop project requires strict adherence to its commit style (semantic Chinese-language messages, module-based splitting) and safe sync/rebase practices. This Skill enforces those conventions automatically and prevents dangerous operations like discarding unpushed commits.

Core Features & Use Cases

  • Smart Commit Splitting: Automatically groups changed files by module, layer, and concern into multiple semantic commits (feat/fix/docs/refactor) with detailed bodies, and updates CHANGELOG.md for breaking changes.
  • Safe Sync & Rebase: Uses git ls-remote and forced refspec fetches to verify remote state before syncing with pull --ff-only, refusing to discard unpushed commits; supports interactive squash and autosquash rebases with conflict resolution.
  • History Search: Finds when code was added or removed via pickaxe search (git log -S), regex search (git log -G), blame, bisect, and file history tracking.
  • Use Case: After modifying files across nop-sys and nop-cluster modules, ask the assistant to commit the changes—it produces a commit plan splitting them into per-module semantic commits, then verifies the build.

Quick Start

Ask the assistant to commit my current changes following the Nop project commit style and split them by module.

Frequently Asked Questions about nop-git-master

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I split a large Git commit into multiple smaller commits?

Group changed files by module first, then by layer (api, dao, service, web), and finally by concern such as docs or config. Each commit gets a semantic message like feat(sys): description, and tests stay in the same commit as their implementation.

How to safely sync a local branch with remote without losing commits?

Check the remote SHA with git ls-remote first, then update the remote tracking ref with a forced refspec fetch, verify no unpushed commits exist with git log origin/branch..HEAD, and finally run git pull --ff-only. Never use reset --hard for syncing.

How do I find when a specific line of code was added in Git?

Use pickaxe search with git log -S "string" --oneline to find commits that added or removed a string, or git log -G for regex matching. For line-level authorship, use git blame -L start,end on the file.

Can I rebase commits that have already been pushed?

Yes, but you must push with git push --force-with-lease afterward, never plain --force. Rebasing on main or master branches is prohibited, and the working directory should be clean or stashed before starting.

When should CHANGELOG.md be updated after a commit?

Update CHANGELOG.md for user-visible features, breaking changes such as API signature or config renames, database schema changes, and important bug fixes. Breaking changes also require a BREAKING CHANGE note in the commit message with migration guidance.