Handle pr errors

From lightspeedwp/.github · View interactive version

Handle pr errors is an AI agent skill from the GitHub repository lightspeedwp/.github. Catches an error from any stage of the PR workflow, categorizes it, assigns a severity, and suggests recovery options and next steps. Use whenever any other pr-agent skill returns or throws an error, to turn it into an actionable recovery response instead of a bare failure.

How to use this skill

Skill file

handle-pr-errors

Handles errors and provides recovery mechanisms for the PR creation workflow.

When to use this skill

Whenever any other skill in this agent (validate-branch-name, route-pr-template, orchestrate-pr-creation, validate-and-apply-labels, submit-pr) returns or throws an error — to categorise it and suggest a concrete recovery path rather than surfacing a bare failure.

Input

{
  error: object,     // { type, message, stage }
  context: object,   // optional: context from the failed operation
  history: array,     // optional: prior attempts, for retry logic
}

Behaviour

Output

Handled errors include their classification and recovery plan:

{
  handled: true,
  errorCategory: string,
  severity: string,
  originalError: string,
  recoveryOptions: string[],
  recommendedAction: string,
  nextSteps: string[],
  retryable: boolean,
  retryCount: number,
  maxRetries: 3,
}

Invalid input and failures caught while handling an error return the same failure shape:

{
  handled: false,
  error: string,
  recoveryOptions: [],
}

Usage

import { handlePrErrors } from './scripts/handle-pr-errors.js';

const result = await handlePrErrors({ error: { message: 'Rate limit exceeded' } });
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.