dir

Define Java directory structures as interfaces with compile-time-checked Path leaves.

2|Updated Feb 18, 2026
One-click install
npx skills add https://github.com/tomitribe/claude-plugins --skill dir
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dir
Source: https://github.com/tomitribe/claude-plugins/tree/main/plugins/tomitribe-util-dir/skills/dir
Command: npx skills add https://github.com/tomitribe/claude-plugins --skill dir

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

References to filesystem paths are error-prone when done with strings; Dir proxies let you model directory structures as interfaces and resolve leaf paths with compile-time checks.

Core Features & Use Cases

  • Define interfaces that mirror directory trees and use Dir.of() to obtain a dynamic proxy that resolves to Path objects.
  • Navigate subdirectories as nested interfaces and apply @Name annotations to non-identifier filenames.
  • Benefit from lazy directory creation and flexible path composition for project scaffolding and resource access.

Quick Start

Create a Dir proxy from your base folder with Dir.of(YourInterface.class, baseDir) and access paths like yourInterface.src().main().resources().

Frequently Asked Questions about dir

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

FAQPage Schema
How do I get compile-time checks for filesystem paths in Java?

You can get compile-time checks for filesystem paths by defining directory structures as Java interfaces and accessing them via Dir.of to obtain strongly typed Path leaves. This replaces error-prone string references with interface navigation.

What is the best way to model nested directory trees as interfaces in Java?

The best way to model nested directory trees is using dynamic proxies where subdirectories are represented as nested interfaces. Calling Dir.of on your base folder resolves these nested interface methods into actual Path objects for project scaffolding.

How do I handle non-identifier filenames when using typed path proxies?

You can handle non-identifier filenames by applying the @Name annotation to your interface methods. This allows the Dir proxy to correctly resolve paths that contain characters invalid for standard Java identifiers.

Can I automatically create directories when accessing a Path proxy?

Yes, you can automatically create directories because the Dir proxy supports lazy directory creation. When you navigate nested interfaces and access leaf paths, the underlying directory structure is created on demand.

Does the Dir proxy support listing and manipulating files?

Yes, the Dir proxy supports listing and manipulating files through built-in Dir methods. Beyond resolving typed Path leaves, you can perform operations directly on the directories modeled by your interfaces.

Why should I use interfaces instead of strings for filesystem path references?

You should use interfaces instead of strings because string references are error-prone and lack validation. Interfaces mirror directory trees to provide compile-time checks, ensuring path references are valid before runtime execution.