Why it matters
This rule is injected into the AI's context for C# work and tells it to use language features Unity 6 cannot compile. Every file the AI writes with these patterns fails to build, and it contradicts the project's own "must compile on Unity 6.x" standard.
Evidence
rules/csharp-unity-conventions.mdc:23-24:
- Use file-scoped namespaces to reduce nesting
- Prefer primary constructors for simple data types
Unity 6.x compiles C# 9. File-scoped namespaces are C# 10 and primary constructors for classes/structs are C# 12. Every snippet in the repo also uses block-scoped namespaces, so the rule contradicts the snippets.
Suggested approach
- Remove both lines; replace with "Unity 6 uses C# 9: do not use file-scoped namespaces, primary constructors,
required members, raw string literals, or collection expressions".
- Add a CI grep guard for
^namespace .*;$ in .cs files and these phrases in rules/skills.
Done when
No rule or skill recommends C# features above C# 9, and CI guards against regressions.
Why it matters
This rule is injected into the AI's context for C# work and tells it to use language features Unity 6 cannot compile. Every file the AI writes with these patterns fails to build, and it contradicts the project's own "must compile on Unity 6.x" standard.
Evidence
rules/csharp-unity-conventions.mdc:23-24:Unity 6.x compiles C# 9. File-scoped namespaces are C# 10 and primary constructors for classes/structs are C# 12. Every snippet in the repo also uses block-scoped namespaces, so the rule contradicts the snippets.
Suggested approach
requiredmembers, raw string literals, or collection expressions".^namespace .*;$in.csfiles and these phrases in rules/skills.Done when
No rule or skill recommends C# features above C# 9, and CI guards against regressions.