# Creating Rules

> Define coding rules and standards documentation. Use when establishing or updating coding conventions, linter rules, or team standards. Use when this capability is needed.

- Skill: `tomevault-io/creating-rules` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/creating-rules`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/creating-rules/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/creating-rules

---


# Creating Coding Rules

Define and document coding standards that AI agents and developers must follow.

## When to use

- Establishing new coding conventions
- Documenting existing team standards
- Adding linter or formatter rules
- Clarifying ambiguous code patterns

## Rule Document Structure

```markdown
# Rule: [Rule Name]

> Brief description of the rule

## Why this rule exists

[Explain the problem this prevents or benefit it provides]

## Requirements

- Requirement 1
- Requirement 2

## ✅ Correct Examples

[Code showing correct usage]

## ❌ Incorrect Examples

[Code showing what to avoid]

## Exceptions

[Valid exceptions or "No exceptions"]

## Enforcement

- [ ] Linter rule: [rule name]
- [ ] Code review checklist
- [ ] Automated test
```

## Common Rule Categories

### Code Style

- Naming conventions (camelCase, PascalCase)
- File organization
- Import ordering
- Comment standards

### Architecture

- Component structure
- State management patterns
- API design patterns
- Error handling

### Quality

- Test coverage requirements
- Performance thresholds
- Security practices
- Accessibility standards

## Writing Effective Rules

### ✅ Do

- Provide concrete examples
- Explain the "why" not just the "what"
- Include both correct and incorrect examples
- Make rules enforceable (linter, tests)

### ❌ Avoid

- Vague requirements
- Rules without examples
- Conflicting rules
- Overly strict exceptions

## File Organization

```
.context/
└── rules/
    ├── coding-standards.md    # Main standards
    ├── naming-conventions.md  # Naming rules
    ├── testing-rules.md       # Test requirements
    └── security-rules.md      # Security practices
```

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/avicdro) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-13 -->

