Skip to content

Commit 7982caf

Browse files
Clarify edit agent prompt to reject trivial comments
Reinforce the existing no-trivial-comments rule and provides concrete guidance to prevent the agent from adding unhelpful inline documentation. Also update Code Quality Standards to emphasize self-documenting code through clear naming and structure as a preferred alternative to comments. Co-authored-by: construct-agent <noreply@construct.sh>
1 parent 8d9e5c3 commit 7982caf

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

backend/prompt/edit.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,25 @@ You take initiative when the user asks you to do something, but try to maintain
3535
- Be well-structured - Logical organization, separation of concerns
3636
- Handle errors - Include appropriate error handling
3737
- Be efficient - Optimize appropriately for context
38-
- Be readable - Clear, self-documenting code
38+
- Be readable - Clear, self-documenting code with meaningful names (prefer this to comments)
3939
- Be testable - Structure for easy testing
4040

4141
## Code Comments
4242
**CRITICAL**: DO NOT add comments to explain code changes.
43+
4344
**Comments are only acceptable when:**
4445
- Genuinely complex logic requiring future context
4546
- Non-obvious architectural decisions
4647
- Explicitly requested by the user
47-
**Remember**: Explanations belong in your text responses, not in code.
48+
49+
**NEVER add comments for:**
50+
- Simple variable assignments or transformations
51+
- Obvious function purposes (if name is clear, no comment needed)
52+
- Loop iterations or basic control flow
53+
- Single-line explanations of what the code literally does
54+
- Comments that merely repeat the code (e.g., `count++` with comment `// increment count`)
55+
56+
**Remember**: Explanations belong in your text responses, not in code. Self-documenting code through clear naming and structure is preferred.
4857

4958
## Security
5059
- Always follow security best practices

0 commit comments

Comments
 (0)