Instruction file imported from Hemavathi15sg/perltonode (
.github/instructions/enterprise-modernization.instructions.md). Copyright stays with the author.
Enterprise Modernization Coding Standards
- Preserve existing business behavior before improving structure.
- Explain intended behavior preservation and migration risk before modifying code.
- Prefer incremental changes that can coexist with legacy code.
- Keep business logic separate from transport, framework, persistence, and infrastructure code.
- Maintain compatibility with existing API contracts unless a versioned migration path is provided.
- Validate input at trust boundaries.
- Use parameterized queries or safe data access abstractions; never introduce SQL injection risk.
- Do not hardcode secrets, credentials, tokens, connection strings, certificates, or environment-specific values.
- Use secure authentication and authorization patterns appropriate to the target platform.
- Avoid unsafe deserialization and validate untrusted payloads.
- Protect sessions with secure cookie, expiration, and fixation controls where applicable.
- Add structured logging for important business and operational events; avoid logging sensitive data.
- Include unit tests, integration tests, regression tests, edge case checks, and behavioral parity checks where applicable.
- Include rollback or coexistence notes for risky changes.
- Follow existing repository conventions for formatting, dependency injection, tests, naming, and project structure.
- Avoid unrelated refactors during migration work.