agentleFS
DankosikDankosik/rust-cli-skills/skills/rust-filesystem/SKILL.md

rust-filesystem

Skill0 starsChanged 2 months agoMITView on GitHub

File identity. Use when Rust CLI traversal, paths, temporary files, replacement, or deletion must preserve data and behave correctly across filesystem boundaries.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use Path and OsStr through filesystem operations.

    line 10
  2. Distinctive:

    When traversal changes, preserve or define its relevant policy for symlinks, hidden entries, ignored paths, cycles, and errors from …

    line 12
  3. Distinctive:

    Do not truncate an input through an aliased output path before processing it.

    line 18

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Rust Filesystem

File identity. Distinguish a path spelling from the object the operation actually opens or changes. Honor supplied requirements and preserve settled choices outside the requested change; resolve only what the task leaves open.

Use Path and OsStr through filesystem operations; lossy display is not a round-trip representation. Preserve the supported platforms' path, case, permission, and link behavior. Directory iteration order is not a sorting guarantee; make deterministic output explicit only where required.

When traversal changes, preserve or define its relevant policy for symlinks, hidden entries, ignored paths, cycles, and errors from individual entries. Bound open handles and retained traversal state. Reuse existing traversal facilities when their semantics match rather than rebuilding their policy accidentally.

Choose open options from the intended effect. Check-then-create can race; use atomic exclusive creation when replacing an existing object is forbidden. Lexical normalization or a prior canonicalization does not by itself enforce containment against concurrent path changes. Use handle-relative or platform facilities when the threat model requires them.

For replacement that must preserve the old file on failure, stage through a securely created temporary file on the destination filesystem and use the appropriate commit operation. Inspect replacement, metadata, and platform semantics. Atomic visibility and crash durability are separate promises; flush buffers and perform the required file and directory synchronization for the latter.

Do not truncate an input through an aliased output path before processing it. Keep cleanup ownership explicit, including errors during staging or commit; retain recoverable data when recovery is the contract.

For review, explain the file-identity or preservation risk without editing. For implementation, exercise the relevant existing-target, link, alias, permission, or interrupted-write case in owned fixtures and inspect resulting files independently. Read-only traversal does not require a replacement or crash-durability campaign. When durability is promised, retain its real requirements and name the platform and failure boundary actually exercised; ordinary success is not crash proof.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.