agentleFS
haruharu/redmine_ai_helper/.claude/skills/speckit-branch-convention-validate/SKILL.md

speckit-branch-convention-validate

Skill107 starsChanged 9 months agoMITView on GitHub

Check all feature branches and spec folders against the configured naming

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check all existing feature branches and spec folders against the configured naming convention.

    line 17
  2. Very specific:

    Verify a spec-kit project exists by checking for .specify/ directory

    line 29
  3. Very specific:

    If no convention is configured, use the default pattern ({seq}-{kebab} for both branch and folder)

    line 31
  4. Very specific:

    Load convention: Read .specify/branch-convention.yml and extract:

    line 35

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “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

Branch Convention Validate Skill

Validate Branch Convention

Check all existing feature branches and spec folders against the configured naming convention. Reports compliance status and identifies violations.

User Input

$ARGUMENTS

You MUST consider the user input before proceeding (if not empty). The user may specify a specific branch to validate (e.g., "003-user-auth") or "all" to check everything.

Prerequisites

  1. Verify a spec-kit project exists by checking for .specify/ directory
  2. Load convention config from .specify/branch-convention.yml
  3. If no convention is configured, use the default pattern ({seq}-{kebab} for both branch and folder)

Outline

  1. Load convention: Read .specify/branch-convention.yml and extract:
    • branch_pattern — the expected branch naming pattern
    • folder_pattern — the expected spec folder naming pattern
    • Token definitions (seq_padding, separator, lowercase, etc.)
  2. Collect branches and folders: Gather all feature-related items:
    • Git branches: List all local branches matching spec-kit patterns (exclude main, master, develop)
    • Spec folders: List all directories under specs/
    • Match pairs: Associate each branch with its corresponding spec folder
  3. Validate each item: For every branch and folder, check:

    CheckRuleExample Violation
    Pattern matchBranch matches branch_pattern structureuser-auth missing sequence number
    Type prefixIf pattern includes {type}, prefix must be in type_prefix mapfeature/003-auth instead of feat/003-auth
    Sequence format{seq} must be zero-padded to seq_padding digits3-auth instead of 003-auth
    Length limitBranch name must not exceed max_length characters003-very-long-branch-name-that-exceeds-limit...
    Case ruleIf lowercase: true, no uppercase characters (except ticket IDs)003-User-Auth
    SeparatorWords must use configured separator003_user_auth when separator is -
    Branch-folder syncBranch name and folder name must be derivable from same sourceBranch feat/003-auth but folder 004-auth
    Ticket formatIf pattern includes {ticket}, must match ticket_pattern regexproj-142 when pattern requires [A-Z]+-[0-9]+
  4. Output compliance report:

    # Branch Convention Compliance Report
    
    **Convention**: {preset name or "custom"}
    **Branch pattern**: {branch_pattern}
    **Folder pattern**: {folder_pattern}
    
    ## Results
    
    | Branch | Folder | Status | Issues |
    |--------|--------|--------|--------|
    | feat/003-user-auth | 003-user-auth | ✅ Compliant | — |
    | 004-chat-system | 004-chat-system | ⚠️ Non-compliant | Missing type prefix |
    | feat/5-api | 5-api | ⚠️ Non-compliant | Sequence not zero-padded |
    
    ## Summary
    - **Total**: {N} branches
    - **Compliant**: {X} ✅
    - **Non-compliant**: {Y} ⚠️
    - **Orphaned folders** (no branch): {Z}
    
    ## Recommended Actions
    1. Run `/speckit.branch-convention.rename` to fix non-compliant items
  5. Report: Output the compliance report. Do not modify any files — this command is read-only.

Rules

  • Read-only — this command never modifies any files or branches
  • Always show all items — include compliant and non-compliant for full visibility
  • Be specific about violations — explain exactly which rule was violated and what the correct name should be
  • Handle missing config gracefully — if no convention is configured, validate against the default pattern and note that no custom convention has been set

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.