What problem does it solve?
Unsafe child process spawning in OpenCode Swarm code causes silent plugin failures, orphaned background processes, command injection security risks, and cross-platform compatibility issues (especially on Windows) that often leave users with no visible error or working agents.
Core Features & Use Cases
- Mandatory subprocess guardrails: Enforces six non-negotiable properties for all child process calls (array-form arguments, explicit working directory, ignored stdin, per-call timeouts, bounded output streams, and explicit kill in finally blocks) to prevent hangs and resource leaks.
- Cross-platform compatibility guidance: Provides specific fixes for Windows-specific issues like .cmd wrapper PATH resolution, stdin inheritance bugs in Bun v7.3.3, and fs.rename limitations that cause unexpected failures on non-Unix systems.
- Testable subprocess patterns: Replaces leaky mock.module() usage with a dependency injection _internals seam for isolated, reliable testing of subprocess-dependent code.
- Use Case: When adding a new git utility function that spawns child processes to check repository status, this skill ensures the implementation will not cause silent plugin failures on Windows or leave orphaned git processes running in the background.
Quick Start
Use the subprocess-safety skill to audit all subprocess calls in your new git utility module before submitting the pull request for review.