error-pattern-safety
Installation
SKILL.md
Error Pattern Safety Guidelines
This document outlines the safety guidelines for error pattern regex in agentic engines to prevent infinite loops in JavaScript.
The Problem
When using regex patterns with the JavaScript global flag (/pattern/g), patterns that can match zero-width (empty strings) can cause infinite loops. This happens because:
- JavaScript's
regex.exec()with thegflag useslastIndexto track position - When a pattern matches zero-width,
lastIndexdoesn't advance - 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
Related skills
More from github/gh-aw
github-mcp-server
GitHub MCP Server Documentation
43developer
Developer Instructions for GitHub Agentic Workflows
38dictation instructions
Instructions for fixing speech-to-text errors and improving text quality in gh-aw documentation and workflows
33javascript-refactoring
Instructions for refactoring JavaScript code into separate files
32github-pr-query
Query GitHub pull requests efficiently with jq argument support for filtering
31documentation
Documentation Brief description for SEO and navigation
30