AGENT SKILL
Git 分支命名规范校验
speckit-git-validate
验证当前分支是否遵循功能分支命名规范
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- speckit-git-validate
- metadata
- { "author": "github-spec-kit", "source": "git:commands/speckit.git.validate.md" }
- description
- Validate current branch follows feature branch naming conventions
- compatibility
- Requires spec-kit project structure with .specify/ directory
03 SKILL.md 正文
Validate Feature Branch
Validate that the current Git branch follows the expected feature branch naming conventions.
Prerequisites
- Check if Git is available by running
git rev-parse --is-inside-work-tree 2>/dev/null - If Git is not available, output a warning and skip validation:
[specify] Warning: Git repository not detected; skipped branch validation
Validation Rules
Get the current branch name:
git rev-parse --abbrev-ref HEAD
The branch name must match one of these patterns:
- Sequential:
^[0-9]{3,}-(e.g.,001-feature-name,042-fix-bug,1000-big-feature) - Timestamp:
^[0-9]{8}-[0-9]{6}-(e.g.,20260319-143022-feature-name)
Execution
If on a feature branch (matches either pattern):
- Output:
✓ On feature branch: <branch-name> - Check if the corresponding spec directory exists under
specs/:- For sequential branches, look for
specs/<prefix>-*where prefix matches the numeric portion - For timestamp branches, look for
specs/<prefix>-*where prefix matches theYYYYMMDD-HHMMSSportion
- For sequential branches, look for
- If spec directory exists:
✓ Spec directory found: <path> - If spec directory missing:
⚠ No spec directory found for prefix <prefix>
If NOT on a feature branch:
- Output:
✗ Not on a feature branch. Current branch: <branch-name> - Output:
Feature branches should be named like: 001-feature-name or 20260319-143022-feature-name
Graceful Degradation
If Git is not installed or the directory is not a Git repository:
- Check the
SPECIFY_FEATUREenvironment variable as a fallback - If set, validate that value against the naming patterns
- If not set, skip validation with a warning
04 同仓库更多 Skills
Speckit 任务转 Issue
speckit-taskstoissues
speckit.taskstoissues:使用 speckit 将任务清单转换为问题跟踪 Issue
★ 0
Speckit 任务分解
speckit-tasks
speckit.tasks:使用 speckit 将计划分解为可执行任务清单
★ 0
Speckit 功能规格说明
speckit-specify
speckit.specify:使用 speckit 编写功能规格说明
★ 0
Speckit 实现方案规划
speckit-plan
speckit.plan:使用 speckit 制定实现方案与技术计划
★ 0
Speckit 代码实现
speckit-implement
speckit.implement:使用 speckit 根据规格说明与计划执行代码实现
★ 0
Speckit Git 状态验证
speckit-git-validate
speckit.git.validate:使用 speckit 校验 Git 仓库状态与配置
★ 0