Creates new .claude/rules/ files following best practices, or audits existing rules for quality and effectiveness. Supports interactive creation with context gathering and template selection.
Ships in ai-asset-pricing. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Two modes: Create a new rule or Audit an existing one.
/rule-create -- create a new rule (interactive)/rule-create database patterns for PostgreSQL -- create with topic description/rule-create audit .claude/rules/validation.md -- audit a specific rule/rule-create audit all -- audit all rules with summary tableParse $ARGUMENTS:
new, or a topic description → Create modeaudit, audit <path>, or audit all → Audit modeFour phases: Gather → Draft → Write → Verify.
List all files in .claude/rules/ to understand what rules already exist. This prevents creating duplicates and helps identify the right scope.
If $ARGUMENTS contains a topic description (anything beyond new), use it as the domain. Otherwise, use AskUserQuestion with all of the following:
**/*.py, src/api/**/*.ts) or say "always load" if it applies everywhere.Compare the user's answers against existing rules. If there's significant overlap with an existing rule, warn the user and ask whether to:
Based on the domain, select the best body pattern from the reference:
| Domain Type | Template Pattern | Best For |
|---|---|---|
| Code conventions | Quick Reference + Sections | Naming, formatting, architecture patterns |
| Security / correctness | Do / Don't / Why / Refs | Vulnerability prevention, data integrity |
| Writing / style | Banned/Required + Examples | Prose style, documentation standards |
| Data / schema | Schema + Query + Gotchas | Database conventions, data pipelines |
Build the rule file with these requirements:
Frontmatter:
---
description: [Specific, keyword-rich — Claude uses this to assess relevance]
paths: # Omit entirely if the rule should always load
- "[glob patterns from user input]"
---
Description quality check:
Scope-gating decision (paths: field):
| Rule type | Scope | Rationale |
|---|---|---|
| File conventions (naming, docstrings, formatting) | paths: ["**/*.py"] | Only relevant when editing those files |
| Workflow behavior (always save results, always use turnover=True) | Unscoped (omit paths:) | Must be active even during ad-hoc script execution |
| API gotchas (parameter validation, common mistakes) | Unscoped | Needed whenever writing API calls, not just editing source |
Key lesson: Path-scoped rules are invisible when the LLM isn't editing files matching those globs. If a rule governs behavior (not just file conventions), it must be unscoped.
Body:
Filename:
database-patterns.md, api-security.md, testing-conventions.mdShow the complete rule to the user before writing. Ask if they want changes.
Write the file to .claude/rules/{name}.md using the Write tool.
Print confirmation:
Rule created: .claude/rules/{name}.md
Lines: {count}
Path scope: {paths or "always loaded"}
Run the full audit checklist (from Audit Mode below) against the newly created rule. Report results inline. If any checks fail, offer to fix them immediately.
Three phases: Read → Analyze → Report.
audit <path> → read that specific file (e.g., audit .claude/rules/security.md)audit all → list and read all .md files in .claude/rules/audit (no target) → list all rules as a numbered list, ask which to audit (or offer all)CLAUDE.md (for duplication checks)Run 10 checks against the rule file. For each, determine PASS, WARN, or FAIL.
Does the rule cover one coherent topic?
Count total lines (including frontmatter and blank lines).
description that is specific and keyword-rich; paths scope matches rule type (file conventions → scoped; workflow/behavior rules → unscoped)description but it's vague (e.g., "Development standards"), or workflow rule is path-scoped (may be invisible during ad-hoc execution)description, or missing paths for a clearly file-specific rule, or behavior rule scoped to paths it won't match during normal workflowDoes the rule contain concrete, implementable guidance?
Does the rule repeat content from CLAUDE.md or other rule files?
Does the rule contain step-by-step workflows that belong in a skill?
Does the rule duplicate what linters, formatters, or CI already enforce?
Are the most important rules near the top?
Do examples clearly show the right patterns?
Is anything obviously missing for this domain?
Print the structured report:
RULE AUDIT REPORT
=================
File: {path}
Lines: {count}
Domain: {detected domain}
Path scope: {paths from frontmatter, or "always loaded"}
CHECKLIST:
[PASS] Focus: {brief explanation}
[WARN] Length: {line count} lines — {explanation}
[PASS] Frontmatter: {brief explanation}
[FAIL] Actionability: {brief explanation with specific section references}
[PASS] Duplication: {brief explanation}
[PASS] No procedures: {brief explanation}
[PASS] No tool overlap: {brief explanation}
[WARN] Front-loading: {brief explanation}
[PASS] Examples: {brief explanation}
[PASS] Completeness: {brief explanation}
SUGGESTIONS:
1. {Specific, actionable suggestion with section reference}
2. {Another suggestion}
3. ...
OVERALL: {N}/10 passed, {W} warnings, {F} failures
After printing the report, offer to fix any FAIL or WARN items if the user wants.
For all mode, after all individual reports, print a summary table:
SUMMARY: {N} rules audited
==============================
| Rule | Pass | Warn | Fail |
|------------------------|------|------|------|
| academic-writing | 9 | 1 | 0 |
| latex-citations | 10 | 0 | 0 |
| latex-compile | 9 | 0 | 1 |
| latex-conventions | 10 | 0 | 0 |
| presentation-rules | 9 | 1 | 0 |
Reading best practices reference...What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/ai-asset-pricing:rule-create [new | audit [<path> | all]]from ai-asset-pricing
ai-asset-pricing@fin-skills is listed by howard-lynn-ye/fin-rsi — review the source before installing
npx claudepluginhub howard-lynn-ye/fin-rsi --plugin ai-asset-pricing38 skills in this plugin
/bond-dataReference for the Dickerson corporate bond dataset: column mappings between WRDS and PyBondLab, rating encoding, return definitions, signal clusters, and data gotchas. Auto-apply when loading bond data for PyBondLab analysis.Other plugins' skills for the same job