Alright, who else has had their style guide absolutely *ghosted* by Windsurf? 😅 I set up a `.windsurf/guidelines.md` with crystal clear "do not use" rules, and it's like my AI pair programmer just winks and does it anyway.
My specific pain point: I've got a rule forbidding the use of `any` in TypeScript. It's right there in the guidelines:
```markdown
## TypeScript Style Rules
- NEVER use the `any` type. Use `unknown` or proper generics.
- Avoid console.log in production code. Use the structured logger.
```
Yet, I'll get a suggestion to refactor a function and bam, there's `const data: any = ...` popping up in the diff. It's not just `any`βit happens with other patterns I've explicitly blacklisted.
I've double-checked the config is in the root of my repo, and I've even tried the `@workspace` directive. The weird part? It *sometimes* listens. It's like it respects the style guide when it feels like it, which is honestly more frustrating than it never working.
Is there a hierarchy I'm missing? Does the project config get overridden by some model-level setting? Or is this just a case of the "assistant" part of "AI assistant" deciding it knows better than my team's linting rules?
I'm all for the magic of autocomplete, but not when it actively works against our code quality gates. This feels like a GitOps promise brokenβif the config is declared, it should be enforced.
Anybody cracked the code on making these rules actually stick? Or is this a known bug in the current version?
- tm
The inconsistency you're seeing points toward a potential conflict with the underlying model's pretraining data, which heavily favors common patterns like `any`. While the guidelines file provides a secondary signal, it's often outweighed by the primary objective of producing syntactically correct code quickly. This is especially true in larger context windows where the guideline's token position and frequency might diminish its weight.
You mentioned it *sometimes* listens. That suggests the system might be probabilistically sampling from different interpretations. Have you checked whether the suggestions containing `any` are generated during a 'refactor' action versus a 'generate' action? The underlying API calls might treat context retrieval differently. A workaround I've used is to embed the rule as a comment in the immediate file context, which often has a stronger influence than the project-wide guidelines.
You might also verify there isn't a `.windsurfignore` file or a similar exclusion pattern preventing the guidelines from being fully indexed. The system's architecture likely prioritizes code files over configuration during its embedding step.
Ugh, that's so frustrating. I'm new to Windsurf and had the same thing happen with a rule about arrow functions. It's like the guide is a suggestion box, not a rule. 😅
You mentioned it works *sometimes*. Do you see it listening more at the start of a coding session, then ignoring the rules later? I wonder if the context gets "full" and pushes the guidelines out.
That's exactly the frustration I'm having with my own guidelines. It's especially confusing when it works sometimes, like you said. Makes me wonder if there's a caching issue, or if the model's initial prompt includes the guide but then it "forgets" in longer sessions.
Has anyone tried splitting their rules into multiple, smaller guideline files instead of one big one? I saw a mention of that in another thread but can't find it now.