writing-rules

Automate creation and governance of CLAUDE rules in .claude/rules.

111|29|Updated Mar 25, 2026
One-click install
npx skills add https://github.com/xiaolai/nlpm-for-claude --skill writing-rules-xiaolai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-rules
Source: https://github.com/xiaolai/nlpm-for-claude/tree/main/skills/nlpm/writing-rules
Command: npx skills add https://github.com/xiaolai/nlpm-for-claude --skill writing-rules-xiaolai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams craft consistent, enforceable Claude rules for .claude/rules, reducing ambiguity and guarding against conflicting guidance.

Core Features & Use Cases

  • The Golden Format: each rule uses a clear imperative, consequence, and mechanism.
  • Positive Framing: emphasizes actionable guidance that Claude can follow reliably.
  • Enforceability & Quality: provides tests, scoping guidance, and a built-in quality checklist to keep rules maintainable.
  • Worked Examples: demonstrates how to consolidate multiple rules into cohesive documentation for a project.

Quick Start

Create or update a rule in .claude/rules using the Golden Format and verify enforceability with the 30-second test.

Frequently Asked Questions about writing-rules

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

FAQPage Schema
How do I write enforceable Claude rules for my project?

Claude rules use the Golden Format, which structures each rule with a clear imperative, consequence, and mechanism. This ensures positive framing and actionable guidance that Claude can follow reliably.

What is the best way to prevent conflicting rules in .claude/rules?

Preventing conflicting rules involves applying path scoping and enforceability tests during rule creation. A built-in quality checklist and documented worked examples help maintain consistency across all CLAUDE rule artifacts.

How do I check if a Claude rule is enforceable?

You check if a Claude rule is enforceable using a 30-second test provided by the governance process. This test verifies positive framing, path scoping, and that the rule follows the Golden Format for reliable execution.

When do I need to use positive framing for Claude rules?

Positive framing is needed whenever you draft or update CLAUDE rule artifacts. It emphasizes actionable guidance that Claude can follow reliably, reducing ambiguity and guarding against unenforceable instructions.

Does path scoping work for project-wide rule governance?

Path scoping works effectively for project-wide rule governance by limiting rule application to specific directories. Combined with conflict prevention and a quality checklist, it keeps CLAUDE rule artifacts maintainable.

Why are my Claude rules not being followed consistently?

Claude rules are often not followed due to ambiguity or lack of enforceability tests. Applying the Golden Format with positive framing and path scoping ensures rules provide actionable, reliable guidance.