error-pattern-safety

Validate JavaScript regular expression patterns against safety guidelines to prevent infinite loops.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/TeamFlint-Dev/vibe-coding-cn --skill error-pattern-safety-teamflint-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-pattern-safety
Source: https://github.com/TeamFlint-Dev/vibe-coding-cn/tree/main/skills/github/ghAgenticWorkflows/shared/gh-aw-raw/skills/error-pattern-safety
Command: npx skills add https://github.com/TeamFlint-Dev/vibe-coding-cn --skill error-pattern-safety-teamflint-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents infinite loops in agentic engines by enforcing strict guidelines on regular expression patterns used for error detection, ensuring system stability and preventing crashes.

Core Features & Use Cases

  • Regex Safety Validation: Identifies and prevents the use of dangerous regular expressions that can cause infinite loops in JavaScript.
  • Pattern Guidelines: Provides clear rules and examples for writing safe and effective error-matching patterns.
  • Use Case: When integrating new error-detection logic into an agentic system, this Skill ensures that the chosen regex patterns are robust and won't lead to system hangs or performance degradation.

Quick Start

Ensure all new error patterns adhere to the safety rules outlined in the documentation before implementation.

Frequently Asked Questions about error-pattern-safety

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my JavaScript regex cause an infinite loop in an agentic engine?

JavaScript regex infinite loops occur when patterns allow zero-width matches, causing the engine to match the same empty string without advancing. This Skill provides safety guidelines to prevent these dangerous patterns during error processing.

How do I write safe regex patterns for error detection in JavaScript?

To write safe regex patterns in JavaScript, you must enforce specific pattern requirements and validate them against empty strings and real log samples. This Skill provides rules, examples, and validation tests for constructing safe error-matching patterns.

What is a zero-width match and how does it affect system stability?

A zero-width match occurs when a regular expression matches an empty string without consuming characters, leading to infinite loops and system hangs. This Skill identifies and prevents such patterns to ensure agentic system stability.

Can I test my regular expressions against real log samples to prevent system hangs?

Yes, you can prevent system hangs by testing regular expressions against empty strings and real log samples. This Skill requires validation tests to ensure chosen error-detection patterns are robust and will not cause performance degradation.

What are the limitations of using regex for error handling in agentic systems?

Regex limitations in agentic systems include the risk of infinite loops from zero-width matches and performance degradation from unsafe patterns. This Skill mitigates these constraints by enforcing strict construction rules for error detection logic.