shep / src
CLAUDE.md262 starsChanged 8 months agoMITView on GitHub
All code under src/ MUST work correctly on Windows, macOS, and Linux. This is not optional. - NEVER assume forward slashes (/) as path separators. Use path.join(), path.resolve(), or path.normalize() for constructing paths. - ALWAYS normalize paths to forward slashes before storing in the database, comparing, or hashing. Windows APIs and dialogs return backslash paths (C:\Users\...), while git and many Node.js APIs use forward slashes. - NEVER use hardcoded path separators in string operations. Use path.sep or normalize first. -…
In this repository23 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/skills/vercel-react-best-practices/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- packages/CLAUDE.mdCLAUDE.md
- architecture-reviewerSkill
- cross-validate-artifactsSkill
- mermaid-diagramsSkill
- react-flowSkill
- shadcn-uiSkill
- shep-kit:commit-prSkill
- shep-kit:fast-loopSkill
- shep-kit:implementSkill
- shep-kit:mergedSkill
- shep-kit:new-feature-fastSkill
- shep-kit:new-featureSkill
- shep-kit:parallel-taskSkill
- shep-kit:planSkill
- shep-kit:researchSkill
- shep-kit:statusSkill
- shep:ui-componentSkill
- shep-workstreamsSkill
- tsp-modelSkill
- vercel-react-best-practicesSkill
The file
We split this CLAUDE.md into the rules it gives an agent
12 rules. About 0 are common, 2 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 3
All code under src/ MUST work correctly on Windows, macOS, and Linux.
- Very specific: line 11
NEVER: use hardcoded path separators in string operations.
- Very specific: line 12
When comparing paths, normalize both sides: p.replace(/\\/g, '/').
- Very specific: line 13
When storing paths in SQLite, normalize to forward slashes on write — see domain/shared/repository-path.ts.
- Very specific: line 20
NEVER: use shell: true with spawn() unless absolutely necessary — it causes argument escaping issues on Windows (DEP0190) and mangles …
- Very specific: line 21
Use windowsHide: true on Windows to prevent blank console windows from flashing.
- Very specific: line 22
Always explicitly set stdio: ['pipe', 'pipe', 'pipe'] when the parent process may disconnect (detached workers, daemon processes).
- Very specific: line 28
Do not assume \n — use os.EOL when writing platform-specific output, or normalize with .replace(/\r\n/g, '\n') when parsing.
- Very specific: line 32
Use os.tmpdir() and fs.mkdtempSync() — never hardcode /tmp or C:\Temp.
- Distinctive: line 49
If a feature genuinely cannot work on a specific platform:
- Very specific: line 58
All tests MUST pass on all platforms.
- Distinctive: line 60
When computing path-dependent hashes in tests, normalize the input path first.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Cross-Platform Development Rules (STRICT)
All code under src/ MUST work correctly on Windows, macOS, and Linux. This is not optional.
Mandatory Requirements
Path Handling
- NEVER assume forward slashes (
/) as path separators. Usepath.join(),path.resolve(), orpath.normalize()for constructing paths. - ALWAYS normalize paths to forward slashes before storing in the database, comparing, or hashing. Windows APIs and dialogs return backslash paths (
C:\Users\...), while git and many Node.js APIs use forward slashes. - NEVER use hardcoded path separators in string operations. Use
path.sepor normalize first. - When comparing paths, normalize both sides:
p.replace(/\\/g, '/'). - When storing paths in SQLite, normalize to forward slashes on write — see
domain/shared/repository-path.ts. Do NOT wrap a path column inREPLACE(column, '\', '/')in a query: any function around a column makes its index unusable, which is what turnedfindByBranchinto a full table scan.
Process Spawning
- NEVER use
shell: truewithspawn()unless absolutely necessary — it causes argument escaping issues on Windows (DEP0190) and mangles prompts with special characters. - Use
windowsHide: trueon Windows to prevent blank console windows from flashing. - Always explicitly set
stdio: ['pipe', 'pipe', 'pipe']when the parent process may disconnect (detached workers, daemon processes). - Native executables (
.exe) on Windows are found byspawn()on PATH withoutshell: true.
Line Endings
- Configure
git config core.autocrlf falsein CI and test setup to prevent phantom modifications. - Do not assume
\n— useos.EOLwhen writing platform-specific output, or normalize with.replace(/\r\n/g, '\n')when parsing.
Temporary Directories
- Use
os.tmpdir()andfs.mkdtempSync()— never hardcode/tmporC:\Temp.
Process Management
process.kill(pid, 0)works on all platforms for checking if a process is alive.pkilldoes not exist on Windows. Use platform-specific process termination or tree-kill utilities.- Exit codes differ: Windows uses unsigned 32-bit codes (e.g.,
0xC0000005= access violation). Check for both Unix and Windows exit code conventions.
File System
- Windows paths are case-insensitive. Use
.toLowerCase()when comparing paths on Windows. - Windows has a 260-character path limit by default. Keep paths short, especially in nested worktrees.
- Windows may use 8.3 short paths (e.g.,
RUNNER~1). Usefs.realpathSync()to resolve to actual paths. - File locks are more aggressive on Windows — a file open for reading may block deletion.
When Cross-Platform Is Not Feasible
If a feature genuinely cannot work on a specific platform:
- Detect the platform using
process.platform('win32','darwin','linux'). - Provide a clear error message explaining the limitation and suggesting alternatives.
- Never silently fail — always warn or error if a platform-specific feature is unavailable.
- Document the limitation in the relevant tool/service JSON metadata (see
openDirectoryfield patterns in tool installer JSONs).
Testing
- All tests MUST pass on all platforms. CI runs on both
ubuntu-latestandwindows-latest. - In test assertions, normalize paths before comparing:
tempRepo.replace(/\\/g, '/'). - When computing path-dependent hashes in tests, normalize the input path first.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

