create-rule skill
✓ VerifiedCreate memory rules, coding standards, and workflow instructions for AI coding tools like Claude Code, Cursor, or AGENTS.md-style tools.
- GitHub stars
- 8
- Files
- 5
- Last commit
- Oct 28, 2026
- License
- MIT
- Allowed tools
- —
What does the create-rule skill do?
create-rule creates memory rules, coding standards, and workflow instructions for AI coding tools like Claude Code, Cursor, or AGENTS.md-style tools.
Summary generated from the skill's SKILL.md.
About the create-rule skill
Generating project-specific memory rules and coding standards for AI coding assistants is what this skill enables. Developers use it to formalize instructions for tools like Claude Code, Cursor, or AGENTS.md-style environments by creating structured documentation that guides AI behavior. When an agent detects existing files like CLAUDE.md, AGENTS.md, or .cursor/rules/*.mdc, it automatically identifies the correct convention to follow.
The tool produces specific files such as .claude/rules/*.md for Claude Code, .cursor/rules/*.mdc for Cursor, or appends sections to an AGENTS.md file for other tools. It handles technical details like adding paths frontmatter for Claude Code or globs frontmatter for Cursor to ensure rules apply to the correct directories. This ensures that coding standards, style guides, and workflow instructions are consistently applied across a codebase without manual formatting errors.
What an agent can do with it
- 1Standardize API error handlingCreate a specific rule for API route error handling that applies only to the source API directory.
- 2Enforce coding style guidesAdd a project-wide rule for indentation and quote usage to the existing memory files.
- 3Define component patterns in CursorEstablish a rule for React components that uses specific file globs for TypeScript files.
- 4Manage personal AI preferencesSave individual coding preferences to a personal directory rather than the shared project repository.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the create-rule skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the create-rule skill in Plugin
/plugin marketplace add mgiovani/cc-arsenal /plugin install cc-arsenal@cc-arsenal-marketplace
Install the create-rule skill in Claude Code
~/.claude/skills/create-rule/SKILL.md
$ npx degit mgiovani/cc-arsenal/skills/create-rule ~/.claude/skills/create-ruleInstall the create-rule skill in Claude Code (project)
.claude/skills/create-rule/SKILL.md
$ npx degit mgiovani/cc-arsenal/skills/create-rule .claude/skills/create-ruleInstall the create-rule skill in Codex
~/.agents/skills/create-rule/SKILL.md
$ npx degit mgiovani/cc-arsenal/skills/create-rule ~/.agents/skills/create-ruleInstall the create-rule skill in Gemini CLI
~/.gemini/skills/create-rule/SKILL.md
$ npx degit mgiovani/cc-arsenal/skills/create-rule ~/.gemini/skills/create-ruleInstall the create-rule skill in Claude.ai
npx degit mgiovani/cc-arsenal/skills/create-rule create-rule && zip -r create-rule.zip create-rule # claude.ai → Customize → Skills → + → Create skill → Upload a skill → create-rule.zip
Automated checks
Ran Nov 15, 2026Full report →Passed our automated checks. That is not a security audit: read the scripts before you let an agent run them. How checks work · What to fix for more points
- Source repository linked and reachablemgiovani/cc-arsenal/skills/create-rule is public and reachablegithub.com/mgiovani/cc-arsenal/tree/HEAD/skills/create-rule ↗Pass
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit 2026-10-28github.com/mgiovani/cc-arsenal/commits ↗Pass
- No download-and-run or credential theft in scriptsNo scripts in the skill folderPass
- No hidden instructions in SKILL.mdNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/mgiovani/cc-arsenal/blob/HEAD/skills/create-rule/ ↗Pass
- Pre-approved tools are scopedNo pre-approved tools; the agent asks before using onegithub.com/mgiovani/cc-arsenal/blob/HEAD/skills/create-rule/ ↗Pass
- SKILL.md follows the Agent Skills formatthe description does not say when to use the skillgithub.com/mgiovani/cc-arsenal/blob/HEAD/skills/create-rule/ ↗Finding
SKILL.md
View on GitHubCreate 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.
Files in this skill
5create-rule skill questions
How do I install the create-rule skill in Claude Code?
Run npx degit mgiovani/cc-arsenal/skills/create-rule ~/.claude/skills/create-rule. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the create-rule skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
What kind of rules can I create with this skill?
You can create memory rules such as project instructions, coding standards, or workflow guidelines tailored to your specific AI coding tool.
How does the tool decide which file format to use?
It detects the convention by checking for existing files like CLAUDE.md, AGENTS.md, or .cursor/rules/*.mdc in your repository.
Can I create personal rules that are not shared in the repository?
Yes, you can create user-specific rules, such as writing to ~/.claude/rules/ for personal Claude Code preferences.