Claude Code Plugins

Community-maintained marketplace

Feedback

bash-tool-enforcer

@CodeTonight-SA/cips
0
0

Using grep in bash scripts instead of rg (ripgrep)

Install Skill

1Download skill
2Enable skills in Claude

Open claude.ai/settings/capabilities and find the "Skills" section

3Upload to Claude

Click "Upload skill" and select the downloaded ZIP file

Note: Please verify skill by going through its instructions before using it.

SKILL.md

name bash-tool-enforcer
description Using grep in bash scripts instead of rg (ripgrep)
status Active
auto_generated true
generation_date Wed Dec 03 2025 10:35:51 GMT+0000 (Coordinated Universal Time)
source_pattern grep-usage-in-scripts

Bash Tool Enforcer

Purpose: Using grep in bash scripts instead of rg (ripgrep)

Activation: Automatically activates when bash-tool-enforcer pattern is detected or user invokes /bash-tool-enforcer.

Status: Active - Auto-generated from pattern detection


Problem

Using grep in bash scripts instead of rg (ripgrep)

Severity: Token Impact:

Detected Occurrences

This pattern was detected in recent workflow history, triggering automatic skill generation.


Solution

Implementation Protocol

Detection:

  • Monitor for pattern: grep-usage-in-scripts
  • Alert when threshold exceeded
  • Suggest alternative approach

Prevention:

  • Pre-execution validation gate
  • Alternative path suggestion
  • Token impact estimation

Automation:

  • Auto-apply remediation when safe
  • Log prevention to metrics
  • Update pattern database

Usage

Manual Invocation

/bash-tool-enforcer
```text

### Automatic Activation
This skill activates automatically when:
- Pattern is detected in real-time
- Efficiency audit is running
- Self-improvement cycle is active

---

## Examples

### Before (Inefficient)
```json
[Pattern-specific bad example extracted from history]
```text

### After (Optimised)
```json
[Pattern-specific good example based on remediation]
```text

---

## Metrics

**Token Budget:** 5000

### Success Criteria:
- Pattern occurrences reduced by 80%+
- Token savings measurable in metrics
- No false positives blocking valid workflows

### Tracking:
Logged to `~/.claude/metrics.jsonl` with:
- `skill_triggered`: Skill activation count
- `tokens_saved`: Estimated savings
- `false_positives`: Invalid activations

---

## Integration

### CLAUDE.md Registration
Auto-added to skills list:
```markdown
- **bash-tool-enforcer**: Using grep in bash scripts instead of rg (ripgrep)
```text

### Pattern Database
Registered in `~/.claude/patterns.json`:
```json
{
  "grep-usage-in-scripts": {
    "skill": "bash-tool-enforcer",
    "remediation": "",
    "status": "active"
  }
}
```text

---

## Meta-Optimization

This skill is subject to meta-analysis:
- **Usage tracking:** If triggered <3 times in 30 days → candidate for retirement
- **Effectiveness tracking:** If token savings <500/trigger → candidate for revision
- **False positive rate:** If >20% → threshold adjustment needed

### Self-improvement trigger:
Run `/audit-efficiency` to analyse this skill's performance and generate meta-improvements.

---

## Notes

- Auto-generated by self-improvement-engine
- Source pattern: grep-usage-in-scripts
- Based on  severity violation
- Token impact per occurrence: 

### Maintenance:
- Review quarterly
- Update based on usage metrics
- Archive if unused for 90 days