Skip to content

[Feature]: Use ERE instead of BRE in grep patterns for clarity #154

@sjnims

Description

@sjnims

Problem or Need

Some validator scripts use Basic Regular Expressions (BRE) with escaped alternation, which is less readable and more error-prone than Extended Regular Expressions (ERE).

Example in validate-agent.sh:200:

# Current (BRE with escaped alternation)
if ! echo "$SYSTEM_PROMPT" | grep -q "You are\|You will\|Your"; then

This works but:

  • Escaped pipes (\|) are easy to forget or get wrong
  • Different grep implementations may handle BRE alternation differently
  • ERE is more widely understood

Proposed Solution

Use grep -E (or grep -Eq) for patterns with alternation:

# Clearer (ERE with unescaped alternation)
if ! echo "$SYSTEM_PROMPT" | grep -Eq "You are|You will|Your"; then

Which component would this affect?

  • Skill

Specific Component (if applicable)

  • plugins/plugin-dev/skills/agent-development/scripts/validate-agent.sh
  • Potentially other scripts using similar patterns

Alternatives Considered

  • Keep BRE: Works but less readable
  • Use egrep: Deprecated alias for grep -E

Additional Context

This is a minor maintainability improvement. The current code works correctly but could confuse contributors unfamiliar with BRE escaping rules.

How important is this feature to you?

  • Low - Just a suggestion

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions