跳到正文
Skillpedia
部署与云(DevOps)10k · #12000

speckit-git-feature

它能做什么

这个技能为某个功能创建新的 Git 分支,分支名使用编号或时间戳。适合使用 Git 和 Spec Kit 方法的开发者。

适用场景

  • ✓你开始一个新的功能规格,想为它创建独立 Git 分支的时候。
  • ✓你希望分支名遵循编号或时间戳的格式的时候。
  • ✓你需要把分支名设为你选定的某个确切值的时候。

技能链接

https://github.com/unoplatform/uno/blob/master/.claude/skills/speckit-git-feature/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/unoplatform/uno/blob/master/.claude/skills/speckit-git-feature/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请为我的功能规格创建一个新的 Git 分支,编号顺序与本项目中的其他分支保持一致。”

每周 5 个新技能,1 分钟读完。

工作原理

这个技能检查分支应如何编号,创建分支,并切换到该分支。它只处理分支,不处理规格文件。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Create Feature Branch

Create and switch to a new git feature branch for the given specification. This command handles branch creation only — the spec directory and files are created by the core /speckit.specify workflow.

User Input

$ARGUMENTS

You MUST consider the user input before proceeding (if not empty).

Environment Variable Override

If the user explicitly provided GIT_BRANCH_NAME (e.g., via environment variable, argument, or in their request), pass it through to the script by setting the GIT_BRANCH_NAME environment variable before invoking the script. When GIT_BRANCH_NAME is set:

  • The script uses the exact value as the branch name, bypassing all prefix/suffix generation
  • --short-name, --number, and --timestamp flags are ignored
  • FEATURE_NUM is extracted from the name if it starts with a numeric prefix, otherwise set to the full branch name

Prerequisites

  • Verify Git is available by running git rev-parse --is-inside-work-tree 2>/dev/null
  • If Git is not available, warn the user and skip branch creation

Branch Numbering Mode

Determine the branch numbering strategy by checking configuration in this order:

  1. Check .specify/extensions/git/git-config.yml for branch_numbering value
  2. Check .specify/init-options.json for branch_numbering value (backward compatibility)
  3. Default to sequential if neither exists

Execution

Generate a concise short name (2-4 words) for the branch:

  • Analyze the feature description and extract the most meaningful keywords
  • Use action-noun format when possible (e.g., "add-user-auth", "fix-payment-bug")
  • Preserve technical terms and acronyms (OAuth2, API, JWT, etc.)

Run the appropriate script based on your platform:

  • Bash: .specify/extensions/git/scripts/bash/create-new-feature.sh --json --short-name "<short-name>" "<feature description>"
  • Bash (timestamp): .specify/extensions/git/scripts/bash/create-new-feature.sh --json --timestamp --short-name "<short-name>" "<feature description>"
  • PowerShell: .specify/extensions/git/scripts/powershell/create-new-feature.ps1 -Json -ShortName "<short-name>" "<feature description>"
  • PowerShell (timestamp): .specify/extensions/git/scripts/powershell/create-new-feature.ps1 -Json -Timestamp -ShortName "<short-name>" "<feature description>"

IMPORTANT:

  • Do NOT pass --number — the script determines the correct next number automatically
  • Always include the JSON flag (--json for Bash, -Json for PowerShell) so the output can be parsed reliably
  • You must only ever run this script once per feature
  • The JSON output will contain BRANCH_NAME and FEATURE_NUM

Graceful Degradation

If Git is not installed or the current directory is not a Git repository:

  • Branch creation is skipped with a warning: [specify] Warning: Git repository not detected; skipped branch creation
  • The script still outputs BRANCH_NAME and FEATURE_NUM so the caller can reference them

Output

The script outputs JSON with:

  • BRANCH_NAME: The branch name (e.g., 003-user-auth or 20260319-143022-user-auth)
  • FEATURE_NUM: The numeric or timestamp prefix used
常见问题

它会编写规格文件吗?

不会。这个技能只创建分支。规格由另一个步骤生成。

分支如何编号?

根据项目设置,这个技能可以使用连续编号或时间戳。

如果没有安装 Git 怎么办?

这个技能会提醒你,并跳过创建分支。

详情

作者的原始描述

Create a feature branch with sequential or timestamp numbering

repo: unoplatform/uno

热度

GitHub 星标
10k
排名
#12000
许可证
Apache-2.0
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能