[Feature Request] Add plugin-level rules support for shared code standards
Summary
Allow plugins to define rules (Markdown files with path filters, same mechanism as project-level .claude/rules/) so that any project consuming the plugin automatically inherits them, without manual copy/paste or per-project configuration.
Current Behavior
Rules can currently be defined at two levels:
- Project level:
.claude/rules/ - User level:
~/.claude/rules/
There is no mechanism to attach rules to a plugin itself (as far as I know). Any team wanting consistent rules across multiple projects using the same plugin must duplicate the rule files manually in each project.
Desired Behavior
A plugin should be able to ship its own rules directory (e.g. <plugin-root>/.claude/rules/), which would be automatically loaded and applied to any project that installs/uses the plugin — following the same path-filter mechanism already used for project/user rules.
Motivation / Use Cases
- Consistency across reusable plugins: coding standards tied to a plugin's domain logic travel with the plugin, not with each consuming repo.
- Domain/technology-specific rules without manual setup: e.g. a Symfony-plugin or a security-plugin could ship its own rule set, applied automatically wherever it's installed.
- Onboarding: teams distributing internal plugins could pre-configure rules once, at the source, instead of asking every project to replicate
.claude/rules/.
Open Questions / Design Considerations
- Precedence: how should plugin-level rules interact with project-level and user-level rules when path filters overlap? (Suggest: project > user > plugin, or an explicit override mechanism.)
- Discovery: should this be opt-in (project explicitly references plugin rules) or automatic on plugin install?
- Namespacing: need to avoid path-filter collisions between multiple plugins or between a plugin and the project itself.