# Cross-Platform Thinking Guide

> Use this for scripts, paths, encodings, SQL dialects, timestamps, and build commands.

---

## Risks to Check

| Area | Rule |
| --- | --- |
| Paths | Do not hardcode Windows separators in generated scripts unless the project is Windows-only |
| Encoding | Preserve existing file encoding; default new text files to UTF-8 |
| Line endings | Do not churn line endings in unrelated files |
| Shell commands | Prefer project-defined scripts (`mvn`, `gradle`, `dotnet`, `make`, `bun`) over OS-specific wrappers |
| SQL dialect | Default only after confirming DB type; KSQL docs may say PostgreSQL, but target DB wins |
| Time | Use explicit timezone and precision for audit fields and generated data scripts |
| Locale | Do not parse localized captions as stable identifiers |

---

## Generated Script Rules

- Put environment assumptions in comments at the top.
- Use parameters for user input and filter values.
- Include a dry-run or impact query before data-changing statements.
- Include verification and rollback when data is modified.
- Avoid destructive DDL unless the user explicitly approves it.

---

## Validation

For cross-platform changes, validate at least one of:

- Project build command on the current machine
- Script syntax parsing or dry-run
- Unit tests for path/timestamp/encoding helpers
- Manual review of generated SQL/KSQL against target dialect

