speckit-git-validate

Validate Git branch names against Speckit naming conventions and specs directory.

Updated Dec 20, 2023
One-click install
npx skills add https://github.com/Thiago-Cruz-eng/Hibrygame --skill speckit-git-validate-thiago-cruz-eng
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: speckit-git-validate
Source: https://github.com/Thiago-Cruz-eng/Hibrygame/tree/main/.claude/skills/speckit-git-validate
Command: npx skills add https://github.com/Thiago-Cruz-eng/Hibrygame --skill speckit-git-validate-thiago-cruz-eng

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents misnamed feature branches by automatically validating that the current Git branch follows the expected Speckit feature naming conventions.

Core Features & Use Cases

  • Branch naming enforcement: Checks whether the current branch name matches either the sequential pattern (numbers + dash) or the timestamp pattern (YYYYMMDD-HHMMSS + dash).
  • Spec directory consistency: Verifies that a matching spec folder exists under specs/ for the extracted branch prefix, helping keep branch structure aligned with Speckit project structure.
  • Graceful fallback when Git is unavailable: Uses the SPECIFY_FEATURE environment variable as a backup source of the feature name when running outside a Git repository.

Real-world use case: you create a feature branch and want confidence that the branch name aligns with the corresponding specs/<prefix>-* directory so your validation and documentation workflow doesn’t break later.

Quick Start

Run the speckit-git-validate skill while your current working directory is on the feature branch you want to check.

Frequently Asked Questions about speckit-git-validate

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate that my Git branch name matches feature naming conventions?

To validate Git branch names, check the current branch against sequential or timestamp prefixes. This ensures feature branches follow consistent naming conventions before extracting the prefix for directory matching.

How does Git branch validation check for a corresponding specs directory?

Branch validation extracts the prefix from the current branch name and checks for a matching specs/<prefix>-* directory. This confirms the spec folder exists and aligns with the extracted branch prefix.

Can I validate feature branch names outside of a Git repository?

Yes, you can validate feature branch names outside a Git repository by using the SPECIFY_FEATURE environment variable. This provides the feature name as a fallback when Git detection fails.

What Git branch naming patterns are supported for feature validation?

Feature branch validation supports sequential patterns using numbers and dashes, and timestamp patterns formatted as YYYYMMDD-HHMMSS followed by a dash. Both formats ensure branches follow consistent naming conventions.

Why does feature branch validation fail when the spec directory is missing?

Validation fails when the specs directory is missing because it requires a matching specs/<prefix>-* path to exist. This check ensures branch structure and spec documentation stay aligned throughout the workflow.