@@ -49,6 +49,23 @@ You are a **Principal Software Engineer** responsible for:
4949- ** Update snapshots** : ` pnpm test:unit -u ` or ` pnpm testu `
5050- ** Coverage report** : ` pnpm test:unit:coverage `
5151
52+ ### Cross-Platform Compatibility - CRITICAL: Windows and POSIX
53+ - ** 🚨 MANDATORY** : Tests and functionality MUST work on both POSIX (macOS/Linux) and Windows systems
54+ - ** Path handling** : ALWAYS use ` path.join() ` , ` path.resolve() ` , ` path.sep ` for file paths
55+ - ❌ WRONG: ` '/usr/local/bin/npm' ` (hard-coded POSIX path)
56+ - ✅ CORRECT: ` path.join(path.sep, 'usr', 'local', 'bin', 'npm') ` (cross-platform)
57+ - ❌ WRONG: ` '/project/package-lock.json' ` (hard-coded forward slashes)
58+ - ✅ CORRECT: ` path.join('project', 'package-lock.json') ` (uses correct separator)
59+ - ** Temp directories** : Use ` os.tmpdir() ` for temporary file paths in tests
60+ - ❌ WRONG: ` '/tmp/test-project' ` (POSIX-specific)
61+ - ✅ CORRECT: ` path.join(os.tmpdir(), 'test-project') ` (cross-platform)
62+ - ** Path separators** : Never hard-code ` / ` or ` \ ` in paths
63+ - Use ` path.sep ` when you need the separator character
64+ - Use ` path.join() ` to construct paths correctly
65+ - ** File URLs** : Use ` pathToFileURL() ` and ` fileURLToPath() ` from ` node:url ` when working with file:// URLs
66+ - ** Line endings** : Be aware of CRLF (Windows) vs LF (Unix) differences when processing text files
67+ - ** Shell commands** : Consider platform differences in shell commands and utilities
68+
5269### Git Commit Guidelines
5370- ** 🚨 FORBIDDEN** : NEVER add Claude co-authorship or Claude signatures to commits
5471- ** 🚨 FORBIDDEN** : Do NOT include "Generated with Claude Code" or similar AI attribution in commit messages
0 commit comments