windows-compatibility
Skill3.4k starsChanged 2 months agoMITView on GitHub
Cross-platform path handling and command patterns
3 other projects use a version of this, 3 of them edited.
Adopted by
Most recently taken up by
- microsoft/github-vteam-industry-demosedited, first seen Oct 25, 2026
- github/gh-awedited, first seen May 27, 2026
- Azure/apiops-cliedited, first seen Apr 27, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 3
- github/gh-aw★ 5.6k67% same
- Azure/apiops-cli★ 3292% same
- microsoft/github-vteam-industry-demos★ 267% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository247 other files it gives its agents.
- .github/agents.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- packages/squad-cli/templates/copilot-instructions.mdCopilot instructions
- packages/squad-sdk/templates/copilot-instructions.mdCopilot instructions
- .squad-templates/copilot-instructions.mdCopilot instructions
- .squad/templates/copilot-instructions.mdCopilot instructions
- templates/copilot-instructions.mdCopilot instructions
- action-skill-contractsSkill
- agent-collaborationSkill
- agent-conductSkill
- architectural-proposalsSkill
- architectural-reviewSkill
- archival-integritySkill
- ci-validation-gatesSkill
- client-compatibilitySkill
- cli-wiringSkill
- content-scopeSkill
- distributed-meshSkill
- documentation-maintenanceSkill
- github-multi-accountSkill
- git-workflowSkill
- history-hygieneSkill
- init-modeSkill
- model-selectionSkill
- pr-lifecycleSkill
- protected-filesSkill
- release-processSkill
- reskillSkill
- reviewer-protocolSkill
- secret-handlingSkill
- security-reviewSkill
- squad-conventionsSkill
- test-disciplineSkill
- agentic-workflow-designerSkill
- gh-aw-reliabilitySkill
- iterative-retrievalSkill
- reflectSkill
- {skill-name}Skill
- agent-collaborationSkill
- agent-conductSkill
- architectural-proposalsSkill
- ci-validation-gatesSkill
- client-compatibilitySkill
- cli-wiringSkill
- coordinator-init-modeSkill
- coordinator-response-modeSkill
- coordinator-source-of-truthSkill
- cross-machine-coordinationSkill
- cross-squad-communicationSkill
- cross-squadSkill
- distributed-meshSkill
- docs-standardsSkill
- e2e-template-testingSkill
- economy-modeSkill
- error-recoverySkill
- external-commsSkill
- fact-checkingSkill
- gh-auth-isolationSkill
- gh-aw-enlistmentSkill
- github-multi-accountSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 1 is distinctive, and 4 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
Centralize formatting: Don't inline .toISOString().replace(/:/g, '-') — use the utility
- Very specific: line 27
Use temp file +
-Fflag: Write message to file, commit with git commit -F $msgFile - Very specific: line 30
Never assume CWD is repo root: Always use TEAM ROOT from spawn prompt or run git rev-parse --show-toplevel
- Very specific: line 31
Use path.join() or path.resolve(): Don't manually concatenate with / or \
- Distinctive: line 36
Use filesystem-aware case handling: Only fold case when the relevant volume has been explicitly identified as case-insensitive.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Context
Squad runs on Windows, macOS, and Linux. Several bugs have been traced to platform-specific assumptions: ISO timestamps with colons (illegal on Windows), git -C with Windows paths (unreliable), forward-slash paths in Node.js on Windows.
Patterns
Filenames & Timestamps
- Never use colons in filenames: ISO 8601 format
2026-03-15T05:30:00Zis illegal on Windows - Use
safeTimestamp()utility: Replaces colons with hyphens →2026-03-15T05-30-00Z - Centralize formatting: Don't inline
.toISOString().replace(/:/g, '-')— use the utility
Git Commands
- Never use
git -C {path}: Unreliable with Windows paths (backslashes, spaces, drive letters) - Always
cdfirst: Change directory, then run git commands - Check for changes before commit:
git diff --cached --quiet(exit 0 = no changes)
Commit Messages
- Never embed newlines in
-mflag: Backtick-n (\n) fails silently in PowerShell - Use temp file +
-Fflag: Write message to file, commit withgit commit -F $msgFile
Paths
- Never assume CWD is repo root: Always use
TEAM ROOTfrom spawn prompt or rungit rev-parse --show-toplevel - Use path.join() or path.resolve(): Don't manually concatenate with
/or\
Path Comparison (Case Sensitivity)
- Never use naive prefix checks to confine paths: a bare substring/prefix match can let sibling paths escape the intended root
- Never infer case-insensitive behavior from
process.platformalone: Windows is case-insensitive, but Darwin volumes are not all case-insensitive. APFS and HFS+ can be case-sensitive; a blanket lowercase conversion on macOS can conflate distinct sibling directories. - Use filesystem-aware case handling: Only fold case when the relevant volume has been explicitly identified as case-insensitive. Otherwise, compare the resolved path case-sensitively.
- Current implementation caveat: This is the safe target pattern, not a claim about every existing repository implementation.
FSStorageProvidercurrently folds case for all Darwin paths, so its root confinement is not volume-aware on case-sensitive macOS filesystems. - Resolve first, compare second: resolve both paths before comparing; do not compare user input or unresolved relative segments.
- Root confinement must be exact-match-or-separator: a path is within
rootDironly when it equals the normalized root exactly or starts withrootDir + path.sep; a bare substring/prefix match lets/root-escapeslip past/root. Filesystem roots are valid roots and must remain exact-match-or-separator checks. - Where it matters: security checks such as path-traversal prevention,
rootDirconfinement, and any validation that a resolved path stays under an allowed directory - Pattern:
import path from 'node:path'; function normalizeForRootComparison(value: string, volumeIsCaseInsensitive = false): string { return volumeIsCaseInsensitive ? value.toLowerCase() : value; } function isPathWithin(candidate: string, rootDir: string, volumeIsCaseInsensitive = false): boolean { const a = normalizeForRootComparison(path.resolve(candidate), volumeIsCaseInsensitive); const b = normalizeForRootComparison(path.resolve(rootDir), volumeIsCaseInsensitive); const boundary = b.replace(/[\\/]+$/, '') + path.sep; return a === b || a.startsWith(boundary); } - Resolve first, compare second: compare normalized absolute paths; only treat a case mismatch as equivalent when the relevant filesystem volume has already been confirmed to be case-insensitive
Repairing Stale LF-Pinned Working Trees
An eol=lf attribute affects checkout behavior; it does not repair files that were already
materialized with CRLF. For the known shebang failure mode, use the repository's
scripts/fix-crlf-worktree.mjs rather than a broad renormalization:
- Identify LF-pinned files that are CRLF on disk.
- Exclude files with a real content difference from the index.
- Rewrite only content-clean paths from the index with
git checkout-index -f. - Re-measure the complete repair set and report repaired, skipped, and remaining paths.
This is a local repair, not a source rewrite. Do not use git add --renormalize .; it rewrites
the index and creates unrelated line-ending churn. Do not force-checkout a locally modified file.
Examples
✓ Correct:
# Timestamp utility
$safeTimestamp = (Get-Date).ToUniversalTime().ToString('yyyy-MM-ddTHH-mm-ssZ')
# Git workflow (PowerShell)
cd $teamRoot
# NEVER use `git add .squad/` or broad globs — only stage files you intentionally changed
# Stage only files you actually modified — use git status to build explicit list
$filesToStage = git status --porcelain | Where-Object { $_.Length -gt 3 } | ForEach-Object { $_.Substring(3) -replace '^.* -> ','' } | Where-Object {
$_ -eq '.squad/decisions.md' -or
$_ -eq '.squad/decisions-archive.md' -or
$_ -like '.squad/agents/*/history.md' -or
$_ -like '.squad/agents/*/history-archive.md'
}
if ($filesToStage) { $filesToStage | Where-Object { $_ } | ForEach-Object { git add -- $_ } }
git diff --cached --quiet
if ($LASTEXITCODE -ne 0) {
$msg = @"
docs(ai-team): session log
Changes:
- Added decisions
"@
$msgFile = [System.IO.Path]::GetTempFileName()
Set-Content -Path $msgFile -Value $msg -Encoding utf8
git commit -F $msgFile
Remove-Item $msgFile
}✗ Incorrect:
// Colon in filename
const logPath = `.squad/log/${new Date().toISOString()}.md`; // ILLEGAL on Windows
// git -C with Windows path
exec('git -C C:\\src\\squad add .squad/'); // UNRELIABLE
// Inline newlines in commit message
exec('git commit -m "First line\nSecond line"'); // FAILS silently in PowerShellAnti-Patterns
- Testing only on one platform (bugs ship to other platforms)
- Assuming Unix-style paths work everywhere
- Using
git -Cbecause it "looks cleaner" (it doesn't work) - Skipping
git diff --cached --quietcheck (creates empty commits) - Assuming all Darwin filesystems are case-insensitive for root-confinement checks
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.

