Commit ebe5c4e
fix: make rule scoping match the documented scope (#197)
All nine rules carried `alwaysApply: true` alongside `globs`. In Cursor,
`alwaysApply: true` loads the rule regardless of globs, so the per-rule Scope
column in CLAUDE.md described behavior that never happened: every rule
entered every context, and the globs were decorative.
The frontmatter was wrong, not the documentation. Set `alwaysApply: false` on
all nine so each one loads from its globs.
Glob coverage verified before flipping, not after. For each rule, every
tracked file in the tree carrying the rule's trigger API was enumerated and
checked against the glob:
| Rule | Scope | Glob | Trigger-bearing files | Glob fixed |
| --- | --- | --- | --- | --- |
| prefer-data-over-ops-in-loops | `*.py` (was "Always on") | `**/*.py` | 103 .py | no |
| always-free-bmesh | `*.py` | `**/*.py` | 86 .py | no |
| target-extensions-platform-format | Add-on roots | `**/__init__.py`, `**/blender_manifest.toml` | 1 .py | no |
| type-annotate-props-and-defend-context | `*.py` | `**/*.py` | 24 .py | no |
| prefer-temp-override-over-context-copy | `*.py` | `**/*.py` | 11 .py | no |
| use-foreach-set-for-bulk-data | `*.py` | `**/*.py` | 15 .py | no |
| validate-imported-mesh-scale | `*.py` | `**/*.py` | 4 .py | no |
| no-unapplied-modifiers-on-export | `*.py` | `**/*.py` | 41 .py | no |
| use-correct-axis-rna-per-exporter | `*.py` | `**/*.py` | 41 .py | no |
No glob needed correcting. Every trigger-bearing file outside the globs was a
`rules/*.mdc` quoting its own anti-pattern, which is rule text, not code to
guard. `**/*.py` matches all 133 tracked Python files;
`**/__init__.py` + `**/blender_manifest.toml` match exactly the one add-on
root in the tree, and the only `bl_info`-bearing file
(`templates/extension-addon-template/__init__.py`) is inside it.
`prefer-data-over-ops-in-loops` was the one rule documented as "Always on".
Its anti-pattern — `bpy.ops.*` inside iteration — cannot occur outside Python,
so `*.py` is its real scope and the CLAUDE.md cell was corrected rather than
the frontmatter left as-is.
Known boundary, stated rather than left silent: a single-file legacy add-on
(`my_addon.py` carrying `bl_info`, no package) is not matched by
`target-extensions-platform-format`. Widening it to `**/*.py` was rejected —
that fires the rule on every Blender script including snippets and examples
that are not add-ons, which is the over-application the Scope column exists to
prevent. Cursor globs match paths, not content, and the only path-identifiable
add-on-root markers are `__init__.py` and `blender_manifest.toml`. That case
is served by the `bl-info-migration` skill, invoked by name.
Also update the authoring templates that taught the broken pattern:
CONTRIBUTING.md and AGENTS.md both showed `alwaysApply: true`, and AGENTS.md
omitted `globs` entirely. Both now show the scoping contract and say why the
two keys do not compose.
Closes #189
Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent c6a7951 commit ebe5c4e
12 files changed
Lines changed: 31 additions & 12 deletions
File tree
- rules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
146 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
147 | 154 | | |
148 | 155 | | |
149 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
55 | 59 | | |
56 | 60 | | |
57 | | - | |
| 61 | + | |
58 | 62 | | |
59 | 63 | | |
60 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
87 | 95 | | |
88 | 96 | | |
89 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
0 commit comments