feat: add layered AI rules system (.claude/rules/)#20
Merged
buddingengineers12345 merged 2 commits intomainfrom Apr 6, 2026
Merged
feat: add layered AI rules system (.claude/rules/)#20buddingengineers12345 merged 2 commits intomainfrom
buddingengineers12345 merged 2 commits intomainfrom
Conversation
…ude/rules/
Adds a plain-Markdown rules system that works with any AI assistant
(Claude Code, Cursor, or any LLM) — no tool-specific frontmatter.
Root .claude/rules/ (template maintainer context):
common/ coding-style, git-workflow, testing, security,
development-workflow, code-review
python/ coding-style, testing, patterns, security, hooks
jinja/ coding-style, testing (Copier template files)
bash/ coding-style, security (hook scripts)
markdown/ file-placement rules, authoring conventions
yaml/ copier.yml and GitHub Actions conventions
copier/ template-conventions (dual-hierarchy, versioning)
template/.claude/rules/ (generated project context):
common/ coding-style, git-workflow, testing, security,
development-workflow, code-review
python/ coding-style (Jinja), testing, patterns (Jinja),
security, hooks
bash/ coding-style, security
markdown/ conventions
Also includes .claude/rules/README.md explaining the structure,
priority rules, and how to write new rules in the future.
CLAUDE.md and template/CLAUDE.md.jinja updated to reference
the new rules directory.
Co-authored-by: buddingengineers12345 <buddingengineers12345@gmail.com>
…te-rules-setup-8f9b Co-authored-by: buddingengineers12345 <buddingengineers12345@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a layered plain-Markdown rules system under
.claude/rules/(template maintainer context) andtemplate/.claude/rules/(generated project context). Rules are tool-agnostic — they work with Claude Code, Cursor, or any LLM that can read context from a directory.What was added
Root
.claude/rules/(template maintainer)template/.claude/rules/(generated projects)Subset covering common, python, bash, and markdown — no Jinja or Copier rules (generated projects do not use those):
common/: coding-style, git-workflow, testing, security, development-workflow, code-reviewpython/: coding-style (Jinja — references{{ package_name }}), testing, patterns (Jinja), security, hooksbash/: coding-style, securitymarkdown/: conventionsTwo Python files use the
.jinjasuffix because they reference{{ package_name }}from Copier variables.CLAUDE.mdandtemplate/CLAUDE.md.jinjaAdded an "AI rules" section pointing to the rules directory and describing the dual-hierarchy.
Design decisions
.mdcfrontmatter, no Cursor-specific fields. Any tool that can read a file benefits from them.# applies-to:comments: optional YAML-comment annotations at the top of language-specific files indicate which glob patterns apply; tools that understand frontmatter can use them, others ignore them.README.mdexplains how to add new rules: covers directory choice, naming, the extending-common pattern, and the dual-hierarchy mirror requirement.