返回 Skill 列表
extension
分类: 开发与工程无需 API Key

starting-implementation

提供了在创建、编辑或删除文件之前验证实现要求的指南,并在不满足要求时采取适当的措施。

person作者: jakexiaohubgithub

Instructions

  1. Run git branch --show-current to obtain the current branch name.
  2. Run git status --porcelain to check for uncommitted changes.
    • If the output contains 0 lines: Set uncommitted changes to false.
    • If the output contains 1 or more lines: Set uncommitted changes to true.
  3. Based on the current branch name and uncommitted changes, follow the appropriate procedure:
    • If the current branch is main or master:
      • Inform the user that they are starting work on the main branch.
      • Require the user to create and switch to a new branch using git switch -c <branch name> with a branch name appropriate for the changes.
    • If the current branch is not main or master and there are uncommitted changes:
      • Inform the user that uncommitted changes exist on a non-main branch.
      • Ask the user whether they want to switch to a new branch now.
      • If the user chooses to switch, create and switch to a new branch using git switch -c <branch name>.
      • If the user chooses not to switch, proceed with caution and remind them to commit or stash changes as appropriate.
    • If the current branch is not main or master and there are no uncommitted changes:
      • Proceed with the implementation on the current branch, or recommend creating a new branch if appropriate for the scope of the changes.