# Create Rule

Use when found gap or repetative issue, that produced by you or implemenataion agent.

- Repository: https://github.com/NeoLabHQ/context-engineering-kit (1797 stars)
- Category: AI and agents
- License: GPL-3.0
- Last updated: 2026-08-26
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add NeoLabHQ/context-engineering-kit --skill create-rule -g -a claude-code -y`
Codex: `npx skills add NeoLabHQ/context-engineering-kit --skill create-rule -g -a codex -y`
Cursor: `npx skills add NeoLabHQ/context-engineering-kit --skill create-rule -g -a cursor -y`
Gemini CLI: `npx skills add NeoLabHQ/context-engineering-kit --skill create-rule -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add NeoLabHQ/context-engineering-kit`

## Description

Use when found gap or repetative issue, that produced by you or implemenataion agent. Esentially use it each time when you say "You absolutly right, I should have done it differently." -> need create rule for this issue so it not appears again.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Create Rule

Guide for creating effective `.claude/rules` files with contrastive examples that improve agent accuracy.

## Overview

**Core principle:** Effective rules use contrastive examples (Incorrect vs Correct) to eliminate ambiguity. 

**REQUIRED BACKGROUND:** Rules are behavioral guardrails, that load into every session and shapes how agents behave across all tasks. Skills load on-demand. If guidance is task-specific, create a skill instead.

## About Rules

Rules are modular, always-loaded instructions placed in `.claude/rules/` that enforce consistent behavior. They act as "standing orders", every agent session inherits them automatically.

### What Rules Provide

1. **Behavioral constraints**, What to do and what NOT to do
2. **Code standards**, Formatting, patterns, architecture decisions
3. **Quality gates**, Conditions that must be met before proceeding
4. **Domain conventions**, Project-specific terminology and practices

### Rules vs Skills vs CLAUDE.md

| Aspect | Rules (`.claude/rules/`) | Skills (`skills/`) | CLAUDE.md |
|--------|--------------------------|---------------------|-----------|
| **Loading** | Every session (or path-scoped) | On-demand when triggered | Every session |
| **Purpose** | Behavioral constraints | Procedural knowledge | Project overview |
| **Scope** | Narrow, focused topics | Complete workflows | Broad project context |
| **Size** | Small (50-200 words each) | Medium (200-2000 words) | Medium (project summary) |
| **Format** | Contrastive examples | Step-by-step guides | Key-value / bullet points |

## When to Create a Rule

**Create when:**

- A behavior must apply to ALL agent sessions, not just specific tasks
- Agents repeatedly make the same mistake despite corrections
- A convention has clear right/wrong patterns (contrastive examples possible)
- Path-specific guidance is needed for certain file types

**Do NOT create for:**

The rest: https://github.com/NeoLabHQ/context-engineering-kit/blob/HEAD/antigravity/skills/create-rule/SKILL.md
