creating-rules

Create path-specific Claude Code rules under .claude/rules with frontmatter.

1|Updated Jan 10, 2026
One-click install
npx skills add https://github.com/kkhys/claude-code-marketplace --skill creating-rules-kkhys
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: creating-rules
Source: https://github.com/kkhys/claude-code-marketplace/tree/main/plugins/base/skills/creating-rules
Command: npx skills add https://github.com/kkhys/claude-code-marketplace --skill creating-rules-kkhys

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Creates modular, path-scoped Claude Code rules (.claude/rules) to organize guidelines for specific file types without duplicating CLAUDE.md content.

Core Features & Use Cases

  • Modular rules stored in .claude/rules with optional path-scoped frontmatter
  • Supports global or path-specific scopes for different file types
  • Keeps CLAUDE.md as high-level reference while housing targeted guidelines

Quick Start

Create a path-specific rule file under .claude/rules for src/api/**/*.ts.

Frequently Asked Questions about creating-rules

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

FAQPage Schema
How do I create path-specific Claude Code rules for certain file types?▼

Path-specific Claude Code rules are created as modular files under the .claude/rules directory using YAML frontmatter to target specific file patterns like src/api/**/*.ts. This approach keeps guidelines organized without duplicating content in CLAUDE.md.

What is the difference between global and path-scoped Claude Code rules?▼

Global Claude Code rules apply across the entire project, while path-scoped rules use YAML frontmatter patterns to target specific file types such as src/api/**/*.ts. Both types are stored in .claude/rules as separate modular files.

How do I set up YAML frontmatter for Claude Code rule files?▼

YAML frontmatter for Claude Code rules requires a name and description field, with optional path-scoping patterns to target specific directories. The frontmatter is validated to ensure the rule applies to the correct file types.

Can I organize Claude Code guidelines without duplicating CLAUDE.md content?▼

Yes, you can create modular rules under .claude/rules to house targeted guidelines for specific file types. This keeps CLAUDE.md as a high-level reference while storing detailed path-specific coding standards in separate rule files.

Does the Claude Code rules system support optional resource directories?▼

Yes, creating Claude Code rules supports optional resource directories including scripts, references, and assets. These are stored under the .claude/rules directory alongside the modular rule files with YAML frontmatter.

When should I use path-scoped rules instead of a single CLAUDE.md file?▼

Use path-scoped rules when you need targeted coding standards for specific file types like src/api/**/*.ts. It prevents CLAUDE.md from becoming overloaded and allows modular guidelines to apply only where relevant.