meziantou/meziantou.framework/use-fullpath
Claude Code and agent skill by meziantou/meziantou.framework
- community
Checking that the SKILL.md file is still in the repository.
Ensure .NET projects use `Meziantou.Framework.FullPath` for local file path manipulation instead of raw strings. Use when: reviewing or writing code that constructs, combines, compares, or passes around local file/directory paths as strings in .NET/C# projects.
Install
npx vskill@latest install meziantou/meziantou.framework/use-fullpathSKILL.md
Use FullPath for Local Path Manipulation
Use this skill when reviewing or writing .NET code that manipulates local file or directory paths.
Why
Raw string paths are a common source of bugs:
- A path can be absolute or relative (
c:\a\bvs.\a\b) - A path that looks absolute can actually be relative (
c:ais relative) - Paths may contain
.or..segments that aren't resolved - Trailing directory separators cause inconsistent comparisons (
c:\avsc:\a\) - Path comparison must be case-insensitive on Windows and case-sensitive on Linux
- Reserved device names on Windows (
CON,PRN,NUL) can cause subtle failures - When a
FileNotFoundExceptionoccurs, relative paths make debugging difficult - A
stringparameter gives no signal whether a full path or a relative path is expected
The FullPath struct from Meziantou.Framework.FullPath solves these problems by guaranteeing the stored value is always a fully-resolved absolute path with normalized separators.
Installation
The namespace is Meziantou.Framework.
Core Patterns
Creating a FullPath
Combining Paths
Use the / operator or FullPath.Combine — never string.Concat or string interpolation.
Comparing Paths
Comparisons are case-insensitive on Windows/macOS and case-sensitive on Linux by default. Navigation segments and trailing separators are already resolved, so equality just works.
Navigating the Path Tree
Checking Hierarchy
Making a Relative Path
Walking Up the Tree
Interop with System.IO
FullPath has an implicit conversion to string, so it works directly with File, Directory, and most APIs that accept a string path.
When you need the raw string explicitly (e.g., for logging or interpolation):
Ensuring the Parent Directory Exists
JSON Serialization
FullPath has a built-in System.Text.Json converter. It serializes to a plain JSON string and deserializes back through FullPath.FromPath.
Using FullPath in Method Signatures
Prefer FullPath over string in APIs that expect an absolute path. This makes intent explicit at the type level.
Collections and Dictionaries
Use FullPathComparer when storing paths in sets or dictionaries to get correct OS-aware equality.
What to Look For in Reviews
| Smell | Refactor to | |
|---|---|---|
string filePath = Path.Combine(root, "sub", "file.txt"); | FullPath filePath = root / "sub" / "file.txt"; | |
string fullPath = Path.GetFullPath(relative); | FullPath fullPath = FullPath.FromPath(relative); | |
if (path1.Equals(path2, StringComparison.OrdinalIgnoreCase)) | if (path1 == path2) (with FullPath) | |
path.StartsWith(root) to check containment | path.IsChildOf(root) | |
Path.GetDirectoryName(path) | path.Parent | |
Path.GetFileName(path) | path.Name | |
Path.GetExtension(path) | path.Extension | |
Path.ChangeExtension(path, ext) | path.ChangeExtension(ext) | |
Directory.CreateDirectory(Path.GetDirectoryName(path)) | path.CreateParentDirectory() | |
void Foo(string path) for an absolute-path parameter | void Foo(FullPath path) |
Scope
This skill targets local file-system paths only. It does not apply to:
- URLs or URIs
- Cloud/blob storage paths
- Database connection strings
- Paths that must remain relative by design (e.g., entries inside a ZIP archive)
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/use-fullpath/SKILL.md
Popularity
- Repository stars
- 845
- Repository forks
- 115
- 7-day trend score
- 34
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/meziantou/meziantou.framework/use-fullpath)