agentleFS
opsmillopsmill/infrahub/.agents/skills/speckit-git-validate/SKILL.md

speckit-git-validate

Skill548 starsChanged 8 days agoApache-2.0View on GitHub

Validate current branch follows feature branch naming conventions

35 other projects use a version of this, 32 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

11 rules. 6 are common, 0 are distinctive, and 5 are very specific to this project.

  • 6

    Common

    Most of the 32 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Check if Git is available by running git rev-parse --is-inside-work-tree 2>/dev/null

    line 18
  2. Common:

    If Git is not available, output a warning and skip validation:

    line 19
  3. Common:

    If on a feature branch (matches either pattern):

    line 39
  4. Very specific:

    Check if the corresponding spec directory exists under specs/:

    line 41
  5. Very specific:

    If spec directory exists: ✓ Spec directory found: <path>

    line 44
  6. Very specific:

    If spec directory missing: ⚠ No spec directory found for prefix <prefix>

    line 45
  7. Common:

    If NOT on a feature branch:

    line 47
  8. Common:

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

    line 53
  9. Very specific:

    Check the SPECIFY_FEATURE environment variable as a fallback

    line 54
  10. Common:

    If set, validate that value against the naming patterns

    line 55
  11. Common:

    If not set, skip validation with a warning

    line 56

“Common” is measured: kept by at least 6 in 10 of the 32 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
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:

  1. Sequential: ^[0-9]{3,}- (e.g., 001-feature-name, 042-fix-bug, 1000-big-feature)
  2. 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 the YYYYMMDD-HHMMSS portion
  • 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_FEATURE environment variable as a fallback
  • If set, validate that value against the naming patterns
  • If not set, skip validation with a warning

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.