Skip to content

Structured guide for writing .claude/rules files with Incorrect/Correct contrastive examples to stop recurring agent mistakes.

CCM score
52 of 100
skills.sh installs
1.3K
GitHub stars
1.9K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers when to create a rule versus a skill or CLAUDE.md, with a comparison table of loading, scope, size, and format
  • Defines global, path-scoped, and priority rule types, each with its paths frontmatter and example
  • Requires a Description-Incorrect-Correct template, keeping each rule file to 50-200 words and one concern per file
  • Designed for teams that want agents to stop repeating the same mistakes across sessions

Install

$ npx -y skills add neolabhq/context-engineering-kit --skill create-rule -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

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

Details

Repository
github.com/neolabhq/context-engineering-kit
Categories
Agent Workflow & Planning, Skill & Plugin Building
First seen
Jun 3, 2026

Questions

What does the create-rule skill do?

The create-rule skill guides you in writing effective .claude/rules files that use contrastive Incorrect and Correct examples to keep agents from repeating the same gap or mistake. It applies whenever a repetitive issue shows up, such as when an agent says it should have done something differently.

How do I install the create-rule skill?

Run npx -y skills add neolabhq/context-engineering-kit --skill create-rule -y in your project to install it. Once installed, the agent gets guidance on turning a recurring agent mistake into a standing rule.

Which skills lead create-rule in the Agent Workflow & Planning category?

create-rule sits in the Agent Workflow & Planning category alongside grill-me, grill-with-docs, setup-matt-pocock-skills, grilling and prototype. It focuses on capturing behavioral fixes as always-loaded rules rather than on planning or interviewing workflows.

When should I use create-rule instead of a skill?

Use create-rule when a behavior must apply to all agent sessions, not just one task, because rules load every session while skills load on demand. Task-specific workflows are better served by a skill.

More from neolabhq/context-engineering-kit

All 62

Similar to Create Rule

More Agent Workflow & Planning