Instruction file imported from compozy/gograph (
.cursor/rules/quality-security.mdc). Copyright stays with the author.
Quality and Security Standards
Security
<security_requirements type="critical">
- NEVER commit API keys or secrets - use environment variables
- NEVER expose secrets in logs - use structured logging without sensitive data
- Handle redaction markers:
[REDACTED:amp-token]indicates removed secrets - do not overwrite with markers - Use the gosec linter to identify security issues
- Validate all inputs, especially those from external sources
- Follow secure coding practices for authentication and authorization </security_requirements>
Performance
<performance_guidelines>
- Minimize allocations in hot paths
- Consider resource usage and efficiency </performance_guidelines>
Specific Linter Rules to Follow
<linter_rules type="mandatory">
- bodyclose: Always close HTTP response bodies
- errcheck: Check error returns from all function calls
- goconst: Extract repeated string literals into constants
- gocritic: Follow idiomatic Go practices
- staticcheck: Address all static analysis warnings
- unused: Remove unused code
- whitespace: Maintain consistent whitespace </linter_rules>