Create rule
Create a new memory/instruction rule for whatever AI coding tool a project actually uses, a CLAUDE.md entry or .claude/rules/*.md file for Claude Code, an AGENTS.md entry for Codex/Cursor/Copilot/Gemini-CLI-style tools, or a .cursor/rules/*.mdc file for Cursor. Use when the user runs /create-rule or asks to add a project rule, user/personal rule, coding standard, style guide entry, or workflow instruction to memory, AGENTS.md, or CLAUDE.md. Not for creating skills or slash commands (use create-skill). Not for discovering or installing existing third-party skills (use find-skills).From its SKILL.md
npx -y skills add mgiovani/cc-arsenal --skill create-ruleAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 8 stars8 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.5 KB, as published. Nobody here has run it
Create Rule
Generate a new memory rule (a project instruction, coding standard, or workflow guideline) in whatever format the project's AI tooling actually reads.
This creates memory rules, not skills or commands (use create-skill) and not a
search for existing skills to install (use find-skills).
- Tool conventions, OS-specific paths, and frontmatter formats: references/memory-hierarchy.md
- Worked templates per tool and scope: references/rule-examples.md
- Claude Code memory docs: https://code.claude.com/docs/en/memory
Anti-hallucination guidelines
- Verify existing patterns first: check the actual codebase, don't assume conventions.
- Base rules on real code found in the project, not invented standards.
- If no convention exists, ask the user rather than making one up.
- Check existing CLAUDE.md / AGENTS.md /
.claude/rules/*.md/.cursor/rules/*.mdcfor conflicts before adding a new rule. - Only use
pathsfrontmatter on.claude/rules/*.md(Claude Code) orglobson.cursor/rules/*.mdc(Cursor), never on CLAUDE.md or AGENTS.md, which have no frontmatter.
Steps
- Parse arguments: rule name from
$1(or the first word of the arguments), description from the rest: ask the user if either is missing. - Detect the tool convention by checking what's already in the repo:
CLAUDE.mdor.claude/rules/*.mdpresent → Claude Code.AGENTS.mdpresent (with no Claude-specific files) → Codex/Cursor/Copilot/Gemini-CLI-style tool. This repo's ownAGENTS.md+CLAUDE.mdpair is a live example of the pattern..cursor/rules/*.mdcpresent → Cursor's native format.- More than one convention present → ask which the user wants updated (or write to more than one, if the user says so).
- None present → ask the user which tool/format they use before writing anything.
- Decide type and scope for the detected tool (details and templates in the reference):
- Claude Code: modular
.claude/rules/<name>.mdfor a focused single topic vs. aCLAUDE.mdentry for a short cross-cutting instruction; project (.claude/rules/, git-shared) vs. user (~/.claude/rules/, personal): ask if unclear from context; path-specific rules needpathsfrontmatter. - AGENTS.md-style tools: append a new section to the single root
AGENTS.md, this format has no per-topic file split or frontmatter. - Cursor:
.cursor/rules/<name>.mdcwithdescription/globs/alwaysApplyfrontmatter; scope by directory nesting for path-specific rules.
- Claude Code: modular
- Write the rule, following the matching template in references/rule-examples.md: imperative language, specific expectations, one topic per file, code examples where useful.
Examples
/create-rule api-errors "Standard error handling for API routes"in a Claude Code repo → writes.claude/rules/api-errors.mdwithpaths: src/api/**/*.tsfrontmatter and concrete guidelines./create-rule formatting "2-space indentation, single quotes"in a Claude Code repo, no path scope needed → writes.claude/rules/formatting.mdwith no frontmatter./create-rule --user preferences "Prefer functional patterns, async/await over raw promises"→ writes~/.claude/rules/preferences.md(personal, not git-shared)./create-rule testing "Use table-driven tests and no test interdependence"in a repo with onlyAGENTS.md→ appends a## Testingsection toAGENTS.mdinstead of creating a new file./create-rule react-components "Function components only, props typed with interfaces"in a Cursor repo → writes.cursor/rules/react-components.mdcwithglobs: ["**/*.tsx"]frontmatter.
What ships with it: 4 files
13.3 KB alongside SKILL.md
evals/
- evals.json3.2 KB
- trigger-eval.json1.8 KB
references/
- memory-hierarchy.md4.4 KB
- rule-examples.md3.8 KB
Gives 0 of the 12 instructions most memory context skills give
Counted across 754 of the 1,056 authors here whose files we hold, read 2026-09-06
- Preserve existing content structurein 15 of 754, across 9 files
- Front-load the leading wordin 14 of 754, across 10 files
- Update existing entries instead of duplicatingin 14 of 754, across 7 files
- Keep CLAUDE.md under one hundred linesin 14 of 754, across 12 files
- Read CLAUDE.md at the project rootin 14 of 754
- Keep each meaning in a single source of truthin 12 of 754, across 8 files
- Redact sensitive information before committingin 11 of 754, across 4 files
- Scan for all CLAUDE.md filesin 11 of 754, across 7 files
- Use frontmatter for metadata on filesin 10 of 754, across 3 files
- Repeat user interactions 10 timesin 10 of 754, across 4 files
- Write the CLAUDE.md file into the target folderin 10 of 754, across 8 files
- Use memlab to process snapshotsin 9 of 754, across 3 files
Said here and by no other author read
- Verify existing patterns first.
- Base rules on real code.
- Ask the user if no convention exists.
- Use correct frontmatter per tool.
- Parse arguments for rule name and description.
- Detect the tool convention.
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once.