creating-rules

Create standardized Markdown rule files for the .claude/rules directory.

88|4|Updated Oct 14, 2018
One-click install
npx skills add https://github.com/skanehira/dotfiles --skill creating-rules
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: creating-rules
Source: https://github.com/skanehira/dotfiles/tree/main/claude/skills/creating-rules
Command: npx skills add https://github.com/skanehira/dotfiles --skill creating-rules

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

.claude/rules/ 配下に、コーディングルール・テスト規約・セキュリティ要件など、プロジェクト固有の実行可能ルールを作成・整理します。条件付きルール(paths)やサブディレクトリ構造を活用して、組織的かつ実務指向の指針を提供します。

Core Features & Use Cases

  • ディレクトリ構造による整理: ルールを機能領域ごとに整理して参照性を高めます。
  • 条件付きルールの活用: paths による対象ファイルの絞り込みをサポートします。
  • ベストプラクティスの参照: references/best-practices.md などのリファレンスと整合させます。

Quick Start

.claude/rules/ 配下に新しいルールファイルを追加し、ファイル名と対象パスを正確に設定してルールを有効化します。ルールは説明的で具体的な記述にします。

Frequently Asked Questions about creating-rules

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

FAQPage Schema
How do I set up coding rules and conventions for my Claude projects?

Create rule files in the .claude/rules directory using Markdown with optional frontmatter to define project-specific conventions for code style, testing, and security. Files are automatically applied based on their placement and path conditions, enforcing best practices across your codebase.

Can I apply different rules to different parts of my project?

Yes, use path-based frontmatter in rule files to target specific directories or file patterns. Organize rules in subdirectories by domain—such as frontend and backend—so conditional rules activate only for relevant project sections.

What's the correct way to structure rule files in the .claude/rules directory?

Use Markdown files with explicit topic-based headings and clear examples of unconditional and conditional rules. Name files descriptively, place them in appropriate subdirectories, and verify syntax and path patterns match your project layout before deployment.

How do I verify that my rules are working correctly?

Check rule placement in the correct .claude/rules subdirectories, confirm Markdown syntax is valid, validate that path patterns match target files, and test rules against sample code to ensure they enforce the intended conventions.

Can rule files reference documentation or best practices?

Yes, rule files support references to documentation like best-practices.md. Link external guides to maintain consistency between your coding conventions and reference materials, creating a unified enforcement framework.