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

rust-processes

Skill0 starsChanged 2 months agoMITView on GitHub

Process ownership. Use when a Rust CLI launches commands or pipelines and must manage arguments, environment, captured output, termination, and child cleanup.

The file

Files
SKILL.md

Rust Processes

Process ownership. Account for each child on the affected path from spawn through terminal status and resource release. Honor supplied requirements and preserve settled choices outside the requested change; resolve only what the task leaves open.

Use Command with explicit argument values rather than assembling shell text. Preserve OsStr arguments and choose executable lookup, working directory, and inherited environment intentionally. Literal arguments still enter the child's own option parser; use its supported end-of-options mechanism where needed. Windows batch files and command interpreters require their actual quoting and trust rules.

Choose inherited, discarded, or captured streams according to the task. output and wait_with_output collect output in memory; use bounded streaming for potentially large results. Drain stdout and stderr without letting one fill while waiting on the other. Close every owned stdin writer when input is complete, including handles taken out of Child.

Distinguish failure to spawn from a nonzero exit or signal termination. Inspect status even when output looks valid, and preserve the command's documented pipeline outcome. An error after spawn still requires handling the running child.

Dropping std::process::Child neither stops nor reaps it; check runtime-specific child wrappers rather than assuming identical behavior. Define who requests termination and who waits afterward. A timeout ends waiting, not execution; killing one process may leave descendants. Use platform process groups or job facilities when the requirement covers a process tree.

Keep secrets out of command diagnostics and do not expand ambient authority without a requirement. For review, explain the ownership failure without editing. For implementation, verify the affected argument, pipe, status, or termination property using controlled children; a simple argument change does not require every interruption scenario. Every spawned test child still needs bounded waits and cleanup on assertion failure.

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.