Route pr template

From lightspeedwp/.github · View interactive version

Route pr template is an AI agent skill from the GitHub repository lightspeedwp/.github. Selects the correct PR template for a branch based on its type using the static branch-type routing map or an explicit user override. Use once the branch has been validated and before assembling the PR body, to know which template structure to follow.

How to use this skill

Skill file

route-pr-template

Routes a pull request to the correct template based on branch type.

When to use this skill

After validate-branch-name confirms the branch name, and before orchestrate-pr-creation assembles the PR body — to determine which template structure the PR body must follow.

Input

{
  branchName: string,          // full branch name, e.g. "feat/new-feature"
  branchType: string,          // alternative: just the type, e.g. "feat"
  userSelectedTemplate: string, // optional: explicit user override
}

Behaviour

Output

Matched routes and user overrides return:

{
  routed: true,
  template: string,
  reason: string,
  fallback: false,
  userOverride?: true,
}

Invalid input and unknown branch types use the fallback template and include a warning:

{
  routed: false,
  template: "pr_feature.md",
  reason: "invalid-input" | "unknown-branch-type",
  fallback: true,
  warning: string,
}

Usage

import { routePrTemplate } from './scripts/route-pr-template.js';

const result = await routePrTemplate({ branchName: 'feat/new-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.