AgentSkillsCN

update-rule

基于用户意图更新现有规则

SKILL.md
--- frontmatter
name: update-rule
description: Update an existing rule based on user intent

/update-rule

Update an existing rule's OpenGrep patterns based on user instruction.

Usage

code
/update-rule <id> <instruction> [--agent <name>]
  • <id>: Rule ID (e.g., S4, C1, CLAUDE_S2)
  • <instruction>: What to change (e.g., "fix invalid pattern", "more aggressive")
  • --agent <name>: Agent name for template resolution (default: claude)

Examples

code
/update-rule S1 "increase threshold to 400 lines"
/update-rule C7 "fix regex syntax error"
/update-rule CLAUDE_S2 "add detection for nested rules"

Workflow

Follow: workflow.md

Reference

Quick Reference

NEVER change:

  • Rule ID
  • Filenames
  • Category or type

File locations:

ScopePath
Corecore/{category}/{ID}-{slug}/{ID}-{slug}.md and .yml
Agentagents/{agent}/rules/{ID}-{slug}/{ID}-{slug}.md and .yml

Directory structure:

code
{rule-id}/
├── {rule-id}.md
├── {rule-id}.yml
└── tests/
    ├── fail.md   # Should trigger
    └── pass.md   # Should not trigger

Save with {{templates}} intact - resolution is only for validation.