chore(claude-rules): add paths frontmatter for conditional loading#804
Conversation
📝 WalkthroughWalkthroughThis PR adds YAML front-matter metadata with Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Scopes platform/domain rule files to only load when editing matching
paths. Keeps overview/commands/troubleshooting always-on. Saves ~25-30k
tokens per session when working outside the scoped areas.
Files scoped:
- 03/04 platform-setup (Windows/macOS) → tauri src
- 05/06 platform-setup (Android/iOS) → gen/{android,apple}
- 07 rust-backend-guide → rust + Cargo
- 08 frontend-guide → app/src
- 09 permissions-capabilities → capabilities + tauri.conf.json
- 12 design-system → tsx/css/tailwind
- 13 backend-auth-implementation → auth files
- 14 deep-link-platform-guide → deep-link + tauri.conf.json
- 15 settings-modal-system → components/settings
- 16 macos-background-execution → lib.rs + Info.plist
- 17 skills-memory-inference-flow → skills + memory + providers
Always-loaded (no frontmatter): 00 vision, 01 overview, 02 commands,
10 troubleshooting, 11 tech-stack.
Follow-up candidates (separate PR): several rule files reference stale
architecture (MTProto, pre-app/ layout, crypto-first framing). Content
refresh recommended but out of scope here.
e5803bf to
9286d47
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.claude/rules/14-deep-link-platform-guide.md (1)
3-3: Consider refining the overly broad glob patternThe pattern
**/*deep*link*will match any path containing both "deep" and "link" (in any order, anywhere in the path). This could inadvertently match unrelated files like:
deep-dive/linking-strategies.mddeeply/integrated/link.tslink/to/deep/files.txtConsider using a more specific pattern:
**/*deep-link*(hyphenated)**/*deeplink*(one word)- Or list specific known files/directories if the scope is well-defined
📝 Suggested refinement
--- paths: - - "**/*deep*link*" + - "**/*deep-link*" + - "**/*deeplink*" - "**/tauri.conf.json" - "app/src-tauri/**" ---🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.claude/rules/14-deep-link-platform-guide.md at line 3, The glob pattern "**/*deep*link*" is too broad and will match any path containing both "deep" and "link" in any order; update the rule in .claude/rules to a more specific pattern such as "**/*deep-link*" or "**/*deeplink*" (or enumerate explicit file paths) by replacing the existing pattern string "**/*deep*link*" with the chosen narrower pattern so unrelated files no longer match.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.claude/rules/03-platform-setup-windows.md:
- Around line 1-5: Update the YAML frontmatter in
.claude/rules/03-platform-setup-windows.md by removing the legacy path entry
"src-tauri/**" so only "app/src-tauri/**" remains under paths; locate the
frontmatter block that currently lists both "- \"app/src-tauri/**\"" and "-
\"src-tauri/**\"" and delete the line containing "src-tauri/**", leaving the
frontmatter with a single paths entry.
---
Nitpick comments:
In @.claude/rules/14-deep-link-platform-guide.md:
- Line 3: The glob pattern "**/*deep*link*" is too broad and will match any path
containing both "deep" and "link" in any order; update the rule in .claude/rules
to a more specific pattern such as "**/*deep-link*" or "**/*deeplink*" (or
enumerate explicit file paths) by replacing the existing pattern string
"**/*deep*link*" with the chosen narrower pattern so unrelated files no longer
match.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 5cfc4d4a-85d1-4728-a475-8dd1a40e3d1f
📒 Files selected for processing (13)
.claude/rules/03-platform-setup-windows.md.claude/rules/04-platform-setup-macos.md.claude/rules/05-platform-setup-android.md.claude/rules/06-platform-setup-ios.md.claude/rules/07-rust-backend-guide.md.claude/rules/08-frontend-guide.md.claude/rules/09-permissions-capabilities.md.claude/rules/12-design-system.md.claude/rules/13-backend-auth-implementation.md.claude/rules/14-deep-link-platform-guide.md.claude/rules/15-settings-modal-system.md.claude/rules/16-macos-background-execution.md.claude/rules/17-skills-memory-inference-flow.md
| --- | ||
| paths: | ||
| - "app/src-tauri/**" | ||
| - "src-tauri/**" | ||
| --- |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check which Tauri source directory exists in the repository
echo "=== Checking for Tauri source directories ==="
echo ""
echo "Checking app/src-tauri/:"
if [ -d "app/src-tauri" ]; then
echo "✓ app/src-tauri/ exists"
echo "Sample contents:"
ls -la app/src-tauri/ | head -10
else
echo "✗ app/src-tauri/ does not exist"
fi
echo ""
echo "Checking src-tauri/:"
if [ -d "src-tauri" ]; then
echo "✓ src-tauri/ exists"
echo "Sample contents:"
ls -la src-tauri/ | head -10
else
echo "✗ src-tauri/ does not exist"
fi
echo ""
echo "=== Searching for Cargo.toml in both locations ==="
fd -t f "Cargo.toml" app/src-tauri src-tauri 2>/dev/null || echo "No Cargo.toml found in either location"Repository: tinyhumansai/openhuman
Length of output: 881
Remove legacy path pattern src-tauri/**
The src-tauri/ directory no longer exists in the repository. Keep only app/src-tauri/** in the paths frontmatter:
Current configuration
---
paths:
- "app/src-tauri/**"
- "src-tauri/**"
---
Change to:
---
paths:
- "app/src-tauri/**"
---
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.claude/rules/03-platform-setup-windows.md around lines 1 - 5, Update the
YAML frontmatter in .claude/rules/03-platform-setup-windows.md by removing the
legacy path entry "src-tauri/**" so only "app/src-tauri/**" remains under paths;
locate the frontmatter block that currently lists both "- \"app/src-tauri/**\""
and "- \"src-tauri/**\"" and delete the line containing "src-tauri/**", leaving
the frontmatter with a single paths entry.
Summary
Adds `paths:` YAML frontmatter to 13 of the 18 files in `.claude/rules/` so they load conditionally based on what files the AI assistant is editing, instead of every session loading all ~55k tokens of rules unconditionally.
Impact
Scope map
Always-loaded (no frontmatter, unchanged): `00-project-vision`, `01-project-overview`, `02-development-commands`, `10-troubleshooting`, `11-tech-stack-detailed`.
Follow-up (not in this PR)
Several rule files reference stale architecture (e.g. MTProto references, pre-`app/` layout, crypto-platform framing from early 2026) that doesn't match the current repo. A content refresh is warranted but separate from this mechanical frontmatter change.
Test plan
Summary by CodeRabbit