Modify AI code prompt to not include comments and logging statements#1178
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR modifies the AI code generation prompt to explicitly forbid comments and logging statements in generated code. The change moves these restrictions from a quality requirement to the forbidden operations list to ensure better compliance from LLM responses.
- Adds explicit prohibitions against comments and logging statements in the FORBIDDEN section
- Removes the instruction to add comments from the Code Quality Requirements section
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| - **NO** file system operations | ||
| - **NO** network requests, meaning we can't use libraries that rely on HTTP requests like `aws-sdk` | ||
| - **NO** environment variables access | ||
| - **NO** comments in the code (do not add inline, block, or documentation comments) |
There was a problem hiding this comment.
[nitpick] Prohibiting all comments including documentation comments may reduce code maintainability. Consider allowing documentation comments for public APIs while restricting inline comments.
| - **NO** comments in the code (do not add inline, block, or documentation comments) | |
| - **NO** inline or block comments in the code (do not add `//` or `/* ... */` comments) |
| - **NO** file system operations | ||
| - **NO** network requests, meaning we can't use libraries that rely on HTTP requests like `aws-sdk` | ||
| - **NO** environment variables access | ||
| - **NO** comments in the code (do not add inline, block, or documentation comments) |
There was a problem hiding this comment.
can add to both "unless explicitly requested by the user"
bigfluffycookie
left a comment
There was a problem hiding this comment.
Looks good, besides ritas comment.
|



Fixes OPS-2328.
Additional Notes
I've tried to put it under Code Quality Requirements as Clean: Generate code without any comments or logging statements. But LLM didn't always follow these instructions. So I put them under FORBIDDEN
After changes to the prompt
Before making changes to the prompt