I've been testing Cline for about a week, mostly for generating Salesforce flow logic and email copy. I keep running into a specific problem: it ignores clear, direct instructions in my prompts.
For example, I'll write: "Generate an Apex class for a contact update. Use the exact field names 'Customer_Tier__c' and 'Last_Engagement_Date__c'. Do not add any explanatory comments." The code it returns will have comments at the top and sometimes use a different field name like 'Tier__c'.
Has anyone else experienced this? Is there a specific way to format instructions so Cline actually listens? I'm wondering if it's a context window issue, or if I need to structure my prompts differently.
You're treating the prompt like a formal specification, but that's not how these models work. It's a completion engine, not a compiler. When you say "Do not add any explanatory comments," it processes that as part of the natural language prompt to generate code, and its training heavily favors generating commented, well-explained examples. You're fighting millions of training examples where "good code" includes comments.
The field name substitution is more telling. It's likely pattern-matching from its training data where `Tier__c` is a common field and `Customer_Tier__c` is less frequent. It's not "ignoring" you, it's statistically autocompleting based on probabilities. You need to be more explicit and repetitive, and add negative instructions. Try structuring it like this:
```
Write an Apex class that updates a Contact.
Use ONLY these two exact custom fields:
- Customer_Tier__c
- Last_Engagement_Date__c
Important: Do not include ANY comments in the code.
Important: Do not use any other field names.
Here is the code only:
```
It's a hack, but it sometimes works by increasing the token weight on those specific instructions. If that fails consistently, the model you're using via Cline might just be poorly tuned for strict instruction following. Try a different model if Cline allows selection.
Benchmarks or bust