Validate branch name

From lightspeedwp/.github · View interactive version

Validate branch name is an AI agent skill from the GitHub repository lightspeedwp/.github. Validates that a branch name follows the {type}/{scope}-{short-title} convention, rejects forbidden prefixes (claude/, copilot/, openai/), and checks the type against the repository's canonical list. Use before creating or updating a PR, whenever a branch name needs checking against this repository'

How to use this skill

Skill file

validate-branch-name

Validates a branch name follows {type}/{scope}-{short-title} format.

When to use this skill

Before any PR is created or updated, and whenever a branch name needs to be checked against this repository's branching convention (e.g. docs/BRANCHING_STRATEGY.md).

Input

{
  branchName: string,   // e.g. "feat/pr-agent-consolidation-portability"
  config: object,       // optional: override allowed types through config.allowed_types only
}

Behaviour

Output

{ valid: boolean, errors: string[] }

Usage

import { validateBranchName } from "./scripts/validate-branch-name.js";

const result = await validateBranchName({ branchName: "feat/my-feature" });
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.