csharpfritz/myfirsttextgame/directory-tree-path-resolution
Claude Code and agent skill by csharpfritz/myfirsttextgame
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Walk up directory tree to resolve resource paths for dev and distribution
Install
npx vskill@latest install csharpfritz/myfirsttextgame/directory-tree-path-resolutionSKILL.md
Context
Applications often need to find resource files (configs, data, assets) that exist at project root during development but may be in different locations when distributed. Walking up the directory tree provides a robust fallback that works in both scenarios.
Patterns
Directory Walk-Up Resolution
When a relative path might exist in an ancestor directory, walk up from the executable location checking each level. This handles:
- Running from nested bin/Debug/netX.0 folders during development
- Running from project root (e.g., via IDE)
- Packaged distributions where resources are bundled with the executable
Implementation Strategy
- Start from
AppContext.BaseDirectory(or equivalent) - Walk up parent directories checking for the relative path
- Return first match found
- Fall back to original resolution strategy if not found
Examples
Benefits
- Development-friendly: Works from any subdirectory during development
- Distribution-ready: Falls back to bundled resources
- No configuration required: Automatic path discovery
- Cross-platform: Uses platform-appropriate path APIs
Anti-Patterns
- Don't hardcode depth limits — Walk until parent is null/root
- Don't check directories if expecting files — Use appropriate existence checks (File.Exists vs Directory.Exists)
- Don't ignore fallback — Always have a fallback strategy if walk-up fails
Security
- Security scanPassed, 95 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.ai-team/skills/directory-tree-path-resolution/SKILL.md
Popularity
- 7-day trend score
- 0
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/csharpfritz/myfirsttextgame/directory-tree-path-resolution)