Create new Claude Code rules with proper structure and best practices. Use this skill when developing custom rules for coding standards, conventions, or guidelines that Claude should follow.
/plugin marketplace add RBozydar/rbw-claude-code/plugin install core@rbw-claude-codeThis skill inherits all available tools. When active, it can use any tool Claude has access to.
templates/prohibited.mdtemplates/standards.mdtemplates/style.mdThis skill helps you develop effective Claude Code rules. Rules are markdown files in .claude/rules/ that provide persistent instructions Claude follows during a session.
# Rule Name
Brief description of what this rule enforces.
## Section 1
Clear, actionable guidelines.
## Section 2
Examples showing good vs bad patterns.
## Checklist (optional)
- [ ] Quick verification items
Define coding standards for a language or framework:
# TypeScript Standards
## Naming Conventions
| Type | Convention | Example |
|------|------------|---------|
| Interfaces | PascalCase with I prefix | `IUserService` |
| Types | PascalCase | `UserResponse` |
| Constants | UPPER_SNAKE | `MAX_RETRIES` |
## Preferred Patterns
### Use type inference when obvious
```typescript
// Good - type is obvious
const count = 0;
// Bad - redundant
const count: number = 0;
### Prohibited Rules
List things to avoid:
```markdown
# Prohibited Patterns
## Never Use
### 1. any type
```typescript
// Bad
function process(data: any) { ... }
// Good
function process(data: unknown) { ... }
// Bad
const name = user!.name;
// Good
if (user) {
const name = user.name;
}
any types! assertions without guards@ts-ignore without comments
### Style Rules
Define formatting and style preferences:
```markdown
# Code Style
## Imports
Order imports in these groups, separated by blank lines:
1. Node built-ins
2. External packages
3. Internal modules
4. Relative imports
## Comments
- Explain WHY, not WHAT
- No commented-out code in commits
- Use JSDoc for public APIs only
## Formatting
- Max line length: 100 characters
- Use trailing commas in multiline
- Prefer template literals over concatenation
Define structural patterns:
# Service Layer Architecture
## Structure
src/ services/ user/ user.service.ts # Business logic user.repository.ts # Data access user.types.ts # Types and interfaces index.ts # Public exports
## Patterns
### Services depend on repositories, never the reverse
```typescript
// Good
class UserService {
constructor(private repo: UserRepository) {}
}
// Bad - repository importing service
class UserRepository {
constructor(private service: UserService) {} // NO!
}
## Best Practices
### DO
- Use tables for quick reference
- Include code examples for every guideline
- Group related items together
- Provide a checklist at the end
- Keep rules under 200 lines
### DON'T
- Write walls of text
- Be vague ("write good code")
- Include too many topics in one file
- Repeat what's in other rules
- Use rules for documentation
## Adding Rules to Templates
To contribute a rule to rbw-claude-code:
1. Create the rule in `templates/rules/` or a subdirectory
2. Follow the structure of existing rules
3. Update the README in that directory
4. Test by symlinking to a project
### Directory Structure
templates/rules/ ├── python/ # Python-specific rules │ ├── README.md │ ├── asyncio.md │ └── ... ├── typescript/ # TypeScript rules (create if needed) │ └── ... ├── anti-slop.md # General rules at root └── README.md # Overview of all rules
## Testing Your Rule
1. Create the rule in your project's `.claude/rules/`
2. Start a new Claude Code session
3. Ask Claude to do something the rule addresses
4. Verify Claude follows the rule
5. Iterate on wording if needed
## Templates
Ready-to-use templates are available in:
${CLAUDE_PLUGIN_ROOT}/skills/create-rule/templates/
- `standards.md` - Coding standards template
- `prohibited.md` - Prohibited patterns template
- `style.md` - Style guide template
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.