SuperAPI AI Directory

git-flow-manager

General & other

View repository

Updated 10-15 20:10

About this skill

Git Flow Manager Skill (Git workflow management skill)

Capabilities

  • Multi-branch parallel management: Proficient in operating master (release/manage development), dev (parallel development/Fix/Docs) and test (testing/quality checks) branches.
  • Workspace maintenance: Deeply integrated with git worktree to manage multiple physical working directories; use git stash to 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 diff to review change history.

Instructions

  1. 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)。
  2. Atomic operations: Before executing a push (push), you must ensure the local code is synchronized with the remote branch (pull --rebase)。
  3. Environment cleanup: After the task is completed, promptly use git worktree remove to remove temporary worktrees, and execute git worktree prune to clean up residual metadata.
  4. Context protection: When you need to handle urgent tasks, fix bugs, or check PRs, if the corresponding Worktree is unavailable, prioritize using git worktree add to 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 master branch. It is prohibited to execute force 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 log to 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.