The Dual Frontmatter Trap
Day 21 · Week 5 · Skills — Advanced
Slack Message — copy & paste
🤖 Tip #21 — Rules that work in one AI tool but not the other? You're missing dual frontmatter. Claude Code reads `paths:`, Copilot CLI reads `applyTo:` — you need both.
#21 Claude Code · CLI
The Silent Failure
- **The problem** — Claude Code reads `paths:` from rule frontmatter. Copilot CLI reads `applyTo:`. They ignore each other's field completely. A rule with only one field silently doesn't load in the other tool.
- **Why this is dangerous** — There's no error message, no warning. The rule just doesn't load. You think the AI is ignoring your conventions, but actually it never received them.
- **Silent failures waste hours** — Teams have spent hours debugging why the AI ignores their coding conventions, only to discover the rule file was missing one frontmatter field.
paths applyTo Gotcha
#21 Skills — Advanced
Fix and Prevent
- 1 Always use dual frontmatter in rule files
- › `paths: ["**/*.scss"]` — for Claude Code
- › `applyTo: "**/*.scss"` — for Copilot CLI
- › Both fields, same glob pattern, every rule file
- 2 **Audit right now** — Grep your `.claude/rules/` directory for files that have `paths:` but not `applyTo:` (or vice versa). Fix them immediately.
- 3 **Automate the check** — Add a CI check or validation script that flags rule files missing either `paths:` or `applyTo:`. We caught 12 missing fields this way. Prevent the trap from recurring.
paths applyTo Gotcha
Your screenshot here Optional — add a screenshot from your own workflow