Skip to content
Back to skills

Generate Rule

ASecurity

Generate a rule skeleton with proper schema and directory structure

  • 11 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added February 10, 2026
developmentgogit

Works with

  • terminal

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned February 12, 2026

npx -y skills add reporails/rules --skill generate-rule --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Generate Rule?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Generate Rule
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/reporails-generate-rule/badge)](https://www.skillsdirectory.com/skills/reporails-generate-rule)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: generate-rule
description: Generate a rule skeleton with proper schema and directory structure
---

# /generate-rule

Generate a rule skeleton with coordinate-based ID, directory structure, and placeholder files.

## Usage

```
/generate-rule <coordinate> <scope> <title> [--agent <name>]
```

- `<coordinate>`: Rule coordinate (e.g., CORE:S:0005, CLAUDE:S:0003)
- `<scope>`: `core` or agent name (e.g., `claude`)
- `<title>`: Short title for the rule
- `--agent <name>`: Agent for path resolution (default: `claude`)

## Examples

```
/generate-rule CORE:S:0005 core "My New Rule"
/generate-rule CLAUDE:S:0003 claude "Some Agent Rule"
```

## Workflow

1. Validate coordinate is not in `registry/tombstones.yml`
2. Validate coordinate slot is not already taken in `registry/coordinate-map.yml`
3. Determine category from coordinate letter (S/C/E/M/G)
4. Resolve directory path from `backbone.rules.patterns` and `backbone.rules.categories`
5. Create directory: `{category_path}/{slug}/`
6. Generate `rule.md` with frontmatter (id, slug, title, category, type, level, targets, checks)
7. Generate `rule.yml` with OpenGrep patterns (if deterministic/semantic)
8. Create `tests/pass/` and `tests/fail/` directories with `.gitkeep`
9. Update `registry/coordinate-map.yml` with new slug→coordinate entry

## Reference

- Schema: `schemas/rule.schema.yml` — field definitions and validation rules
- Registry: `registry/coordinate-map.yml` — existing coordinates
- Registry: `registry/tombstones.yml` — dead slots

## Quick Reference

| Decision | Result |
|----------|--------|
| Structural/file checks only | type: mechanical |
| OpenGrep pattern matching | type: deterministic |
| LLM evaluation needed | type: semantic (prompt field on terminal check) |
| Has backing sources | Add to backed_by with source IDs from docs/sources.yml |
| No backing sources | Omit backed_by (optional field) |

Files in this skill

  • SKILL.md1.9 KB
  • rule-authoring.md3.1 KB
  • workflow.md1.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.