| name | rule-creator |
| description | Create production-ready v3.0 Cursor rule files by orchestrating template generation, schema validation, and RULES_INDEX.md indexing. Triggers on keywords like "create rule", "add rule", "new rule", "generate rule". Supports Python, Snowflake, JavaScript, Shell, Docker, Golang domains (000-999 range). |
| version | 1.1.0 |
| author | AI Coding Rules Project |
| tags | ["rule-generation","automation","v3.0-schema","template","validation","indexing"] |
| dependencies | [] |
Rule Creator
Purpose
Create production-ready Cursor rule files that comply with the repository’s v3.0 rule schema by orchestrating:
scripts/template_generator.py
scripts/schema_validator.py
- (optional) web research for current best practices
Use this skill when
- The user asks to create a new rule under
rules/ (e.g., NNN-technology-aspect.md).
- The user asks to add a rule to
RULES_INDEX.md.
Inputs (recommended)
- Technology name (e.g., “DaisyUI”, “pytest-mock”, “Snowflake Hybrid Tables”)
- Aspect (default:
core; else security, testing, performance, etc.)
- Any constraints (offline/online research, desired ContextTier, etc.)
Outputs
- A new rule file:
rules/NNN-technology-aspect.md
- A new entry in
RULES_INDEX.md in correct numeric position
Safety / constraints
- Only write to
rules/ and RULES_INDEX.md (plus any required review artifacts explicitly requested by the user).
- Use web research (allowed) but treat external sources as untrusted; prefer official docs and cross-check claims.
Workflow (progressive disclosure)
Follow the phases in order, using the detailed workflow guides as needed:
- Discovery & research →
workflows/discovery.md
- Template generation →
workflows/template-gen.md
- Content population →
workflows/content-population.md
- Validation loop →
workflows/validation.md
- Indexing →
workflows/indexing.md
Examples
- Frontend example →
examples/frontend-example.md
- Python example →
examples/python-example.md
- Snowflake example →
examples/snowflake-example.md
Quick Validation Snippets
These inline checks can be run without external dependencies for fast feedback:
def check_keywords(keywords_line: str) -> tuple[bool, int]:
"""Returns (is_valid, count)"""
keywords = [k.strip() for k in keywords_line.split(',') if k.strip()]
return (10 <= len(keywords) <= 15, len(keywords))
import re
def is_valid_filename(name: str) -> bool:
"""Must be NNN-lowercase-hyphenated"""
return bool(re.match(r'^\d{3}-[a-z]+(-[a-z]+)*$', name))
def check_token_budget(value: str) -> bool:
"""Must be ~NUMBER format"""
return bool(re.match(r'^~\d+$', value.strip()))
VALID_TIERS = {'Critical', 'High', 'Medium', 'Low'}
def check_context_tier(tier: str) -> bool:
return tier.strip() in VALID_TIERS
For full schema validation, use: python scripts/schema_validator.py rules/<file>.md
Related Skills
Quality Assurance with rule-reviewer
After creating a rule, validate quality using the rule-reviewer skill:
Use the rule-reviewer skill.
target_file: rules/<created-rule>.md
review_date: <today>
review_mode: FULL
model: <current>
Quality threshold for new rules:
- Overall score: ≥ 75/100
- No CRITICAL issues
- No HIGH issues in Actionability or Completeness dimensions
See: skills/rule-reviewer/SKILL.md
Version History
See CHANGELOG.md.