Capabilities
- Multi-branch parallel management: Proficient in operating
master(release/manage development),dev(parallel development/Fix/Docs) andtest(testing/quality checks) branches. - Workspace maintenance: Deeply integrated with
git worktreeto manage multiple physical working directories; usegit stashto stash unfinished code. - Synchronized collaboration: Pull, push and rebase (
git pull,git push,git rebase,git fetch)。 - Merge and conflict: Handle code merges (
git merge) and assist in resolving conflicts. - History review: Use
git log,git show,git diffto review change history.
Instructions
- Worktree priority: When handling tasks of different dimensions (e.g., development vs testing), prioritize checking and using the corresponding Git Worktree (e.g.,
../momei-dev,../momei-test)。 - Atomic operations: Before executing a push (
push), you must ensure the local code is synchronized with the remote branch (pull --rebase)。 - Environment cleanup: After the task is completed, promptly use
git worktree removeto remove temporary worktrees, and executegit worktree pruneto clean up residual metadata. - Context protection: When you need to handle urgent tasks, fix bugs, or check PRs, if the corresponding Worktree is unavailable, prioritize using
git worktree addto create a new site.
Conventions
- Branch roles: Follow the branch responsibilities defined by Git workflow conventions :
master: Release, merge. Project administrators can directly perform feature development.dev: Parallel development, PR merge review, new requirement exploration, issue fixes (Fix) and documentation maintenance.test: Automated test writing, integration testing, code quality checks and fixes.
- Worktree path: Uniformly use
../momei-[branch]sibling directories in the format. - Cleanup conventions: Regularly clean up worktrees that are no longer needed to keep the development environment tidy.
- Staging management: Before switching branches or worktrees, ensure the current changes have been committed or
stash。 - Security: It is strictly prohibited to perform non-atomic modifications that may undermine stability on the
masterbranch. It is prohibited to executeforce push。 - Format conventions: Commit messages should follow the Conventional Commits conventions to ensure clear change records.
- Commit language: Commit messages should use the user's language habits, and refer to the historical record format output by
git logto maintain consistency. - Collaboration process: Before performing a PR merge, ensure all related worktrees have synchronized the latest code and passed the necessary test verification.
Usage Example
Input: "I need to go to the dev branch to develop a new feature."
Action: Check the ../momei-dev directory; if it does not exist, execute git worktree add ../momei-dev dev, then work in the corresponding directory.
Input: "Clean up all useless worktrees."
Action: Execute git worktree prune then, as needed, rm or git worktree remove Corresponding directory.