skills/create-rule/SKILL.md
Create a new memory rule following Claude Code best practices for project instructions, coding standards, and workflow guidelines. This skill should be used when users want to create CLAUDE.md rules, .claude/rules/ files, or memory instructions for Claude Code.
npx skillsauth add mgiovani/cc-arsenal create-ruleInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Cross-Platform AI Agent Skill This skill works with any AI agent platform that supports the skills.sh standard.
Generate a new memory rule following Claude Code best practices for project instructions, coding standards, and workflow guidelines.
Note: Claude Code has merged commands into skills (v2.1.3+). This skill creates memory rules (CLAUDE.md entries and
.claude/rules/files), not skills or commands.For the memory hierarchy and rule file specifications, see references/memory-hierarchy.md. For glob patterns and rule examples, see references/rule-examples.md.
CRITICAL: When creating rules:
paths frontmatter for .claude/rules/ filesCRITICAL: Before creating any rule, fetch the latest official documentation:
Understand the codebase context to create relevant rules:
$1 or first word of command arguments.claude/rules/<name>.md (recommended for focused topics)./CLAUDE.md or ~/.claude/CLAUDE.md.claude/rules/ (shared with team)~/.claude/rules/ (personal, all projects)Ask user or infer from context:
Questions to determine:
1. What specific behavior should this rule enforce?
2. Is it path-specific? (applies only to certain file patterns)
3. Should it be project-scoped or user-scoped?
4. What category does it belong to? (code-style, testing, security, workflow, etc.)
5. Are there existing similar rules to reference or extend?
### Phase 4: Analyze Existing Rules (Use Parallel Analysis)
Spawn parallel Explore agents with model: haiku to gather patterns:
Agent 1 - Analyze Existing Memory:
Agent 2 - Identify Rule Category:
Agent 3 - Check for Conflicts:
Use TodoWrite to track rule creation:
TodoWrite:
- [ ] Create rule file with frontmatter (if path-specific)
- [ ] Write clear, specific instructions
- [ ] Add examples where helpful
- [ ] Validate rule syntax
- [ ] Test rule applicability
### Phase 6: Write Rule File
Generate the rule following the templates in [references/rule-examples.md](references/rule-examples.md).
**For path-specific rules** (with frontmatter):
```markdown
## Claude Code Enhanced Features
This skill includes the following Claude Code-specific enhancements:
## Your Task
### Phase 0: Gather Up-to-Date Documentation (Use claude-code-guide Agent)
**CRITICAL**: Before creating any rule, fetch the latest official documentation:
Use Task tool with claude-code-guide agent:
prompt: "I need to create a new Claude Code memory rule. Please research and provide:
Rules File Specification:
Memory Hierarchy:
CLAUDE.md Best Practices:
Recent Changes:
Return specific, actionable information with examples."
subagent_type: "claude-code-guide"
### Phase 1: Understand Context (Use Explore Agent)
Understand the codebase context to create relevant rules:
Use Task tool with Explore agent:
### Phase 2: Parse Arguments
1. **Extract rule name** from `$1` or first word of `$ARGUMENTS`
2. **Extract description** from remaining arguments or ask user
3. **Determine rule type**:
- **Modular rule**: `.claude/rules/<name>.md` (recommended for focused topics)
- **CLAUDE.md entry**: Add to existing `./CLAUDE.md` or `~/.claude/CLAUDE.md`
4. **Determine scope**:
- **Project rule**: `.claude/rules/` (shared with team)
- **User rule**: `~/.claude/rules/` (personal, all projects)
### Phase 3: Gather Rule Requirements
Ask user or infer from context:
Questions to determine:
### Phase 4: Analyze Existing Rules (Use SubAgents)
Spawn parallel Explore agents with model: haiku to gather patterns:
Agent 1 - Analyze Existing Memory:
Agent 2 - Identify Rule Category:
Agent 3 - Check for Conflicts:
### Phase 5: Generate Rule Structure
Use TodoWrite to track rule creation:
TodoWrite:
### Phase 6: Write Rule File
Generate the rule following the templates in [references/rule-examples.md](references/rule-examples.md).
**For path-specific rules** (with frontmatter):
```markdown
development
Generate comprehensive test suites with coverage analysis and parallel test writing. Automatically activates when users want to write tests, add test coverage, generate test cases, improve testing, or analyze coverage gaps. Supports pytest, vitest, jest, and all major test frameworks.
development
Multi-agent PR review team orchestration with 7 specialized reviewers for security-sensitive or architectural PRs. Spawns architecture, security, performance, testing, style, docs/UX, and adversary reviewers as a coordinated team. Premium review for critical code changes.
development
Spec-driven team orchestration: adaptive development team scaling from 3 to 11 agents based on complexity.
development
Perform comprehensive security review targeting OWASP Top 10 2025 vulnerabilities for PRs, commits, or entire codebases. This skill should be used when a user wants to audit code security, scan for vulnerabilities, review security posture, or check for OWASP compliance. Analysis only - identifies vulnerabilities without modifying code.