Getting it into your agent
There is no command for this one: it runs only inside a plugin, and the catalogue could not identify which plugin ships it. The source is linked below.
Wrote 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.svg" alt="Measured on agentmods" height="20"></a>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 | $0.00030 | $0.01218 |
| Sonnet 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 6d 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 — 213 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.opencode/skills/generated/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.
- 6d 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 (464 stars, last pushed yesterday), licensed MIT. It adds 61 tokens to every session and 2,435 once invoked, about $0.0003 per session on Opus 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.
Other skills, from other repositories
ux-create-manifest
Create the initial Product UX Bible for an existing web or full-screen web app by deeply auditing the repository, using sub-agents when available, and generating docs/ux manifests, schemas, budgets, surface maps, action taxonomy, and design-token policies from observed code.
ux-principal
Principal UX architect skill for deciding WHERE a UI feature belongs, before it is implemented. Reads and maintains docs/ux manifests, classifies the feature, decides placement, navigation, surface, action hierarchy and complexity budgets, and produces a precise implementation brief without coding unless explicitly…
full_unpackd_rep
Use when the task is to unpack a local reference repository into a Chinese structural topic page, update site navigation, stamp dates, and leave behind a reusable deconstruction note for the repo.
gen-zhihu-article
Generate Zhihu article in the style of 22-庖丁解牛专题页-知乎图文终版.md.
loloop
Use when a task should advance through repeated plan-driven loop cycles for an engineering project, paper, or long-running repo change. loloop wraps the official /loop idea with the repo's loop-in-loop method: read the current plan, inspect prior evolution notes, execute the current iteration, write a new evolution…
zhihu-publish
Use when the task is to publish a Zhihu article from Markdown using the local browser-automation pipeline in this repo. Covers the text-only publishing chain, the multimodal chain that uploads Markdown images into the Zhihu editor, cookie-based login checks, and choosing between the stable text script and the richer…