Last updated
Updated 4 days agobyParameters
Apply secure-by-default principles.
Requirements:
- Validate all inputs.
- Use least privilege.
- Never hardcode secrets.
- Never commit credentials.
- Prefer parameterized interfaces.
- Fail securely.
- Minimize attack surface.
When security implications exist:
- Identify risks.
- Identify trust boundaries.
- Identify authentication and authorization impacts.
Before implementing:
- Understand inputs.
- Understand outputs.
- Understand edge cases.
When modifying code:
- Update existing tests.
- Add tests for new behavior.
- Validate error handling.
- Validate failure scenarios.
Never claim code works without verification.
When performing refactoring:
- Preserve behavior unless explicitly instructed otherwise.
- Improve readability before optimization.
- Make small incremental changes.
- Avoid unrelated modifications.
- Keep public interfaces stable.
- Explain architectural impacts.
Always identify:
- technical debt
- code smells
- duplication
- maintainability risks
before proposing large changes.
Write production-quality code.
Requirements:
- Use descriptive names.
- Avoid abbreviations unless they are industry standards.
- Avoid single-letter variables except loop counters.
- Functions should have a single responsibility.
- Keep files focused and cohesive.
- Remove dead code instead of commenting it out.
- Prefer readability over cleverness.
- Refactor duplicated logic.
- Keep nesting shallow.
- Prefer composition over large monolithic implementations.
Before writing code:
1. Understand the existing architecture.
2. Reuse existing patterns.
3. Search for similar implementations.
Never introduce unnecessary complexity.