Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/ZaxbyHub/opencode-swarmnpx agentmods add skills/zaxbyhub/opencode-swarm/subprocess-safetyWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/zaxbyhub/opencode-swarm/subprocess-safety)<a href="https://agentmods.dev/skills/zaxbyhub/opencode-swarm/subprocess-safety"><img src="https://agentmods.dev/badge/skills/zaxbyhub/opencode-swarm/subprocess-safety/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/zaxbyhub/opencode-swarm/subprocess-safety"><img src="https://agentmods.dev/badge/skills/zaxbyhub/opencode-swarm/subprocess-safety.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 1 finding, up to medium
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- medium Agent Snooping · line 13 Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.Fix: Remove all code or instructions that list or read other skills' files or directories. Skills should operate independently; cross-skill access is a privilege escalation.
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00061 | $0.02435 |
| Opus 5.5 | $0.00024 | $0.00974 |
| Sonnet 5.5 | $0.00012 | $0.00487 |
| Haiku 4.5 | $0.00006 | $0.00244 |
Grade A, and why
subprocess-safety scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
description: Guidelines for safe subprocess calls in opencode-swarm. Load before adding, modifying, or reviewing any file that calls spawn, spawnSync, bunSpawn, or child_process. Covers the six required properties, Windo How it starts
The opening of the file, as written. The whole thing — 214 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Subprocess Safety
Read, in order:
AGENTS.md(Invariant 3: subprocesses)docs/engineering-invariants.md(subsection 3).agents/skills/writing-tests/SKILL.mdif tests are touched.agents/skills/mock-to-internals-migration/SKILL.mdif converting mock.module to _internals
Codex-specific execution notes:
- This skill consolidates AGENTS.md Invariant 3 into an actionable checklist.
- The canonical spawn shape and six required properties are non-negotiable per AGENTS.md.
- The CI quality job enforces these via
bun run check:invariants(Check 1: subprocess timeout). - Violations are advisory in CI but blocking in code review.
When to use this skill
- You are adding, modifying, or reviewing a subprocess call (
bunSpawn,spawn,spawnSync,child_process.execFile, etc.) - You are writing or updating tests that exercise subprocess-dependent code
- A PR review flags a subprocess call missing timeout, cwd, or cleanup
Scope
This skill applies to all files that spawn child processes:
src/utils/git*.tssrc/hooks/*.tssrc/tools/*.tssrc/services/*.tssrc/plugins/*.tssrc/index.ts(init-path subprocesses)- Any test file (
tests/**) that stubs or exercises subprocess code
Canonical spawn shape
Every subprocess call MUST follow this pattern:
const PER_CALL_TIMEOUT_MS = 10_000; // module-level constant (choose an appropriate value)
const proc = bunSpawn(['git', '-C', dir, 'rev-parse', '--show-toplevel'], {
stdin: 'ignore',
cwd: dir,
timeout: PER_CALL_TIMEOUT_MS,
// stdout/stderr: piped, bounded, or ignored
});
try {
const result = await proc;
// process result
} finally {
proc.kill(); // best-effort cleanup
}
Six required properties
| Property | Required | Rationale |
|---|---|---|
| Array-form args | Yes | No shell-string commands (injection risk, quoting hell) |
cwd or git -C |
Yes | Never rely on inherited process.cwd() |
stdin: 'ignore' |
Yes | A never-closed stdin pipe under Bun/Windows can block child exit (v7.3.3) |
timeout: <ms> |
Yes | No subprocess is "always fast" on every platform |
| stdout/stderr bounded | Yes | Never leave piped stream unattended on long-running child |
proc.kill() in finally |
Yes | Outer withTimeout lets awaiter proceed but doesn't abort child |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago Changed 4a307a67cfc0
- 1mo ago Changed · +1 lines cae534d27aaa
- 3mo ago First seen · 213 lines · 61 tokens per session scan A b675c2c2de60
subprocess-safety is a skill published in the GitHub repository ZaxbyHub/opencode-swarm (549 stars, last pushed today), licensed MIT. It adds 61 tokens to every session and 2,435 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
subprocess-safety compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| subprocess-safetyZaxbyHub/opencode-swarm | Skill | 549 | today | MIT | A | 61 | Claude Code, Codex |
| safeinstall-installMickdownunder/SafeInstall | Skill | 3 | 4d ago | MIT | A | 49 | Codex |
| safeinstall-setupMickdownunder/SafeInstall | Skill | 3 | 4d ago | MIT | A | 49 | Codex |
| safeinstall-checkMickdownunder/SafeInstall | Skill | 3 | 4d ago | MIT | A | 51 | Codex |
| safeinstall-statusMickdownunder/SafeInstall | Skill | 3 | 4d ago | MIT | A | 53 | Codex |
| repo-hygieneQwenLM/qwen-code | Skill | 31k | today | Apache-2.0 | A | 48 | Claude Code, Codex |
| requirements-writermvschwarz/openrig | Skill | 9.0k | today | Apache-2.0 | A | 28 | Claude Code, Codex |