Skip to content

Commit 52bb8ca

Browse files
committed
Update claude.md
1 parent 2c12eb9 commit 52bb8ca

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

CLAUDE.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)