gum-file-paths

Diagnose FilePath comparison, normalization, and cross-platform file-move pitfalls in the Gum codebase.

614|78|Updated Mar 11, 2015
One-click install
npx skills add https://github.com/vchelaru/Gum --skill gum-file-paths
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gum-file-paths
Source: https://github.com/vchelaru/Gum/tree/main/.claude/skills/gum-file-paths
Command: npx skills add https://github.com/vchelaru/Gum --skill gum-file-paths

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

File path bugs in the Gum repository fail silently: comparisons return wrong results without exceptions, and case-only renames pass on Windows but break on macOS CI. This Skill documents the exact semantics of ToolsUtilities.FilePath so you avoid these traps.

Core Features & Use Cases

  • Equality semantics: Explains that FilePath == compares the lowercased Standardized value while FullPath preserves casing, so case-only renames must be detected with ordinal FullPath comparison.
  • Normalization rules: Clarifies that Standardized uses Path.DirectorySeparatorChar (not '/'), collapses '..' but not '.', and mismatches Directory.EnumerateFiles output unless both sides pass through Path.GetFullPath.
  • Cross-platform moves: Documents why File.Move on a case-only rename throws on case-insensitive macOS volumes and requires a two-step move through a temp name.
  • Use Case: You are renaming a screen file from Foo.cs to foo.cs and the rename is silently ignored on Windows while the macOS CI leg fails; this Skill tells you to compare FullPath ordinally and move via a temporary filename.

Quick Start

Ask the AI to review your Gum path-handling code for FilePath equality, Standardized separator, and case-only rename issues before committing.

Frequently Asked Questions about gum-file-paths

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compare file paths in the Gum codebase?

Use ToolsUtilities.FilePath, but know that its == operator compares the lowercased Standardized value, so it is case-insensitive. For case-sensitive logic such as detecting renames, compare FullPath values ordinally instead.

How do I detect a case-only file rename in C#?

Compare the FullPath properties of the old and new FilePath objects with ordinal string comparison. The == operator reports no change for a case-only rename because Standardized is lowercased, so it misses exactly the rename you need to detect.

Why does File.Move fail on macOS for case-only renames?

On case-insensitive macOS volumes, .NET pre-checks the destination and throws an 'already exists' error because the target differs only by case. Move the file to a temporary name first, then to the final name, so the operation works on all platforms.

Why do computed paths not match Directory.EnumerateFiles results?

FilePath collapses '..' but leaves '.' segments, so a CodeProjectRoot of './' produces paths like C:\Proj\.\Screens\X.cs that never equal enumerated paths. Run both sides through Path.GetFullPath before comparing.

Does FilePath.Standardized use forward slashes on all platforms?

No. Standardized normalizes to Path.DirectorySeparatorChar via FileManager.RemoveDotDotSlash, so it uses backslashes on Windows. A hardcoded Contains("/bin/") check works on Unix but is dead code on Windows.