🛡️
QualityGo

Error Pattern Safety

by github

Error Pattern Safety is a Quality skill for Claude Code, published by github in gh-aw.

4.9K stars495 forkson github/gh-awAdded 2026/08/16Repository updated 2026/08/16
actionscaiciclaude-codecodexcopilotgh-extensiongithub-actions
Install in seconds
Install Error Pattern Safety
Copy Error Pattern Safety into your Claude Code skills folder. Run the command in your terminal, or review the source on GitHub before installing.
terminal
npx degit https://github.com/github/gh-aw/tree/main/.github/skills/error-pattern-safety ~/.claude/skills/error-pattern-safety

Requires Node.js. Downloads this skill only — not the rest of the repository — into your Claude Code skills folder.

Without Node.js

git clone https://github.com/github/gh-aw.git

Clones the whole repository, then copy the skill’s own directory into your skills folder yourself.

In this catalog

Source file
.github/skills/error-pattern-safety/SKILL.md in github/gh-aw
Installs to
~/.claude/skills/error-pattern-safety
Collection
One of 25 skills cataloged from this repository
Category
Quality1354 skills

What Error Pattern Safety does

Error Pattern Safety provides rules for writing safe regular expressions that prevent JavaScript infinite loops in agentic engines.

Error Pattern Safety is cataloged under Quality on DirSkills. Error Pattern Safety comes from a repository tagged actions, cai, ci, claude-code and codex.

Documentation

README

Error Pattern Safety Guidelines

Use these regex safety rules in agentic engines to prevent JavaScript infinite loops.

The Problem

With the JavaScript global flag (/pattern/g), zero-width matches can cause infinite loops because:

  1. JavaScript's regex.exec() with the g flag uses lastIndex to track position
  2. When a pattern matches zero-width, lastIndex doesn't advance
  3. The same position is matched repeatedly, causing an infinite loop

Dangerous Pattern Examples

❌ NEVER USE THESE PATTERNS:

// Pure .* - matches everything including empty string at end
/.*/g

// Single character with * - matches zero or more (including zero)
/a*/g

// Patterns that can match empty string
/(x|y)*/g

Safe Pattern Examples

✅ ALWAYS USE PATTERNS LIKE THESE:

This is the opening of the README. Read the full README on GitHub.

Commands Error Pattern Safety provides

Slash commands named in this skill’s SKILL.md, listed in the order they first appear.

  • /error
  • /access

Frequently asked about Error Pattern Safety

  • What else does github publish alongside Error Pattern Safety?

    Error Pattern Safety is one of 25 skills that DirSkills catalogs from github/gh-aw, the repository it ships in. Its siblings there include AWF Release Integrator, Agent Session CLI and Agent Task CLI. Each one is a separate skill with its own page in this directory, installs the same way Error Pattern Safety does, and is maintained by github in that same repository. The rest of the collection is listed on the github/gh-aw page.

  • How does Error Pattern Safety compare to other Quality skills?

    Error Pattern Safety ranks #309 by stars among the 1354 Quality skills in this catalog. The most-starred ones next to it are Benchmark, Benchmark Optimization Loop and API Design Patterns. DirSkills ranks by the star count of the repository each skill ships in, so that order reflects how popular those repositories are rather than any review of Error Pattern Safety against them. Open each page to compare what they document and how they install.

More from github/gh-aw

Error Pattern Safety is one of 25 skills cataloged on DirSkills from github/gh-aw.

See all 25 skills
🔄
2w ago

AWF Release Integrator

AWF Release Integrator upgrades gh-aw to the latest gh-aw-firewall release, bumps version constants, rebuilds generated artifacts, and reviews upstream spec changes to identify follow-up tasks.
DevOps
4.9K495
🤖
2w ago

Agent Session CLI

Agent Session CLI uses the gh agent-session command to inspect and manage GitHub Copilot coding agent sessions, including creating tasks from natural language instructions, listing, viewing, and updating them.
AI Engineering
4.9K495
🤖
2w ago

Agent Task CLI

Agent Task CLI creates GitHub Copilot coding agent tasks from the command line, using natural language instructions that trigger automated code changes and pull requests. Use it to delegate coding work, list and view tasks, and integrate with GitHub Agentic Workflows.
AI Engineering
4.9K495
🤖
2w ago

Agentic Workflows

Agentic Workflows compiles Markdown-defined AI agent jobs into GitHub Actions, so developers can define AI-powered repository automation and run AI agents securely through GitHub Actions for reasoning tasks.
DevOps
4.9K495
🔀
2w ago

Agentic Workflows Router

Agentic Workflows Router dispatches user requests to design, create, update, debug, or upgrade GitHub Agentic Workflows to the correct internal prompt or skill file. Use it when working on agentic workflows in a repository, and follow the matched instructions directly.
AI Engineering
4.9K495
🔍
2w ago

Checkout Credential Review

Checkout Credential Review helps review code that performs git or gh operations against repository checkouts, ensuring the right credentials are available at the right time and that sparseness, shallowness, and credential-free factors are considered.
Quality
4.9K495