원클릭으로
implement-rule
Implement checks, patterns, and fixtures for an existing recommended rule skeleton
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Implement checks, patterns, and fixtures for an existing recommended rule skeleton
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | implement-rule |
| description | Implement checks, patterns, and fixtures for an existing recommended rule skeleton |
Implement checks, OpenGrep patterns, and test fixtures for an existing recommended rule that has a skeleton but empty checks: [].
/implement-rule <coordinate> [--agent <name>] [--dry-run]
<coordinate>: Rule coordinate (e.g., RRAILS:C:0008, RRAILS_CLAUDE:S:0002)--agent <name>: Agent for template var resolution (default: claude)--dry-run: Show what would be generated without writing files/implement-rule RRAILS:C:0001
/implement-rule RRAILS_CLAUDE:S:0001 --agent claude
/implement-rule RRAILS:E:0002 --dry-run
Resolve rule directory from coordinate:
registry/coordinate-map.ymlcore/{category}/{slug}/agents/{agent}/rules/{slug}/Parse rule.md frontmatter and body:
id, type, level, targets, question, criteria, Pass/Fail examples from bodychecks: is already non-empty — rule is already implementedFollow the same pattern design principles as rules/ (core):
| Field | Design role |
|---|---|
title | Names the concern |
question | Defines the evaluation question |
criteria | Lists observable properties of a PASSING file — invert for violations |
| Pass example | Structural pattern that makes it good |
| Fail example | Structural pattern that makes it bad |
Think in terms of violation structure, not fixture discrimination.
args from rule descriptionnegate: true only when no structural signature exists{{instruction_files}} in pathsWrite checks: array in rule.md frontmatter:
{RULE_ID}:check:{SLOT} formatFor deterministic/semantic rules, write OpenGrep rules in rule.yml.
For mechanical-only rules: leave rule.yml as rules: [].
Fixtures simulate REAL instruction files (30-80 lines).
Pass fixture (tests/pass/): Realistic file satisfying the rule.
Fail fixture (tests/fail/): Realistic file with one specific violation.
Remove .gitkeep from directories that now have real fixture content.
Run the test harness from the rules/ runtime:
docker compose -f ../rules/runtime/docker-compose.yml run test --package /recommended --rule <coordinate>
This package depends on rules/ (core) for:
../rules/runtime/ — test runner, checks.py, Docker harness../rules/agents/{agent}/config.yml — template variable resolution../rules/schemas/rule.schema.yml — check field definitions../rules/schemas/rule.schema.yml../rules/docs/opengrep-guide.md../rules/runtime/../rules/agents/{agent}/config.ymlregistry/coordinate-map.yml| rule.md severity | rule.yml severity |
|---|---|
| critical | ERROR |
| high | WARNING |
| medium | WARNING |
| low | WARNING |