ruler-authoring

Edit and debug rules in the ruler.yml schema for Claude Code.

Updated Apr 20, 2026
One-click install
npx skills add https://github.com/DJVdio/claude-tools --skill ruler-authoring
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ruler-authoring
Source: https://github.com/DJVdio/claude-tools/tree/main/plugins/ruler-engine/skills/ruler-authoring
Command: npx skills add https://github.com/DJVdio/claude-tools --skill ruler-authoring

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the challenge of effectively managing and authoring rules for Claude Code, providing a structured approach to rule creation and debugging.

Core Features & Use Cases

  • Rule Editing: Facilitates editing .claude-rules/ruler.yml and related rule files.
  • Rule Debugging: Assists in debugging why a rule did not trigger.
  • Rule Schema Understanding: Offers guidance on the ruler.yml schema, matching semantics, best practices, and the ruler-engine CLI.

Quick Start

Use the ruler-authoring skill to create a new rule for the 'Edit' tool with the following YAML structure:

Rule: Prevent unused variables
Why: To avoid runtime errors and improve code readability.
How to apply: Use the `command_regex` field to match lines containing unused variables.

Frequently Asked Questions about ruler-authoring

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a rule in ruler.yml for Claude Code?

To create a rule in ruler.yml for Claude Code, you edit the `.claude-rules/ruler.yml` file using a structured YAML format that defines the rule, why it exists, and how to apply it via matching semantics like `command_regex`.

Why is my Claude Code rule not triggering when I expect it to?

If your Claude Code rule is not triggering, you can debug the rule by analyzing the ruler.yml schema matching semantics and verifying the `command_regex` configuration to ensure the pattern correctly matches the intended tool inputs.

What is the ruler.yml schema structure for Claude Code rules?

The ruler.yml schema defines rules for Claude Code using fields for the rule name, the reason or `Why` it applies, and the `How to apply` section, which typically utilizes matching semantics like `command_regex` to target specific tool behaviors.

Do I need to know the ruler-engine CLI to manage Claude Code rules?

Yes, understanding the ruler-engine CLI is necessary to effectively manage and debug Claude Code rules, as it provides the command-line interface required to execute, test, and verify the matching semantics of your ruler.yml configurations.

What's the best way to prevent unused variables using Claude Code rules?

The best way to prevent unused variables using Claude Code rules is to author a specific entry in ruler.yml that uses the `command_regex` field within the `How to apply` section to match lines containing unused variables during the Edit tool execution.

Can I use Claude Code rules to enforce custom code review checks?

You can enforce custom code review checks by authoring rules in the `.claude-rules/ruler.yml` file, utilizing matching semantics to trigger specific rule behaviors based on the code patterns or tool inputs you need to validate.