engineering-conventions

Enforces engineering invariants and safety rules for modifying the opencode-swarm plugin codebase.

Updated Sep 14, 2026
One-click install
npx skills add https://github.com/pandejesal/drone-nav-sar --skill engineering-conventions-pandejesal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: engineering-conventions
Source: https://github.com/pandejesal/drone-nav-sar/tree/main/.swarm/bundled-skills/engineering-conventions
Command: npx skills add https://github.com/pandejesal/drone-nav-sar --skill engineering-conventions-pandejesal

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Contributors modifying the opencode-swarm plugin frequently ship regressions in high-risk areas like plugin initialization, subprocess handling, and runtime portability because critical invariants are scattered across AGENTS.md and docs. This Skill consolidates those non-negotiable rules into a single loadable reference so agents apply them before touching dangerous code paths. ## Core Features & Use Cases - Invariant enforcement: Summarizes the four highest-risk invariants (bounded fail-open plugin init, bounded killable subprocesses, Node-ESM runtime portability, test mock isolation) with links to the authoritative AGENTS.md source. - Deep-dive guidance: Covers init-path-safe imports, sandbox env override escaping, sandbox fallback parity, SAST baseline capture, tool version parity, and the skill mirror contract. - Use Case: Before editing src/index.ts or any subprocess-spawning utility, load this Skill to learn that every spawn needs cwd, stdin ignore, timeout, and proc.kill() in a finally block, preventing the class of hang regressions seen in issues #704 and #1471. ## Quick Start Load the engineering-conventions skill before modifying plugin initialization, subprocess, or tool registration code and follow its invariant checklist.

Frequently Asked Questions about engineering-conventions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely modify plugin initialization code in opencode-swarm?

Wrap every awaited operation on the init path in withTimeout and degrade non-fatally on timeout, keeping total latency under the ~400ms repro-704 deadline. Defer non-critical I/O to the post-resolution task queue rather than queueMicrotask, and verify with node scripts/repro-704.mjs.

What subprocess rules apply when spawning child processes in Bun?

Every bunSpawn call must pass cwd, stdin: 'ignore', a timeout in milliseconds, bounded stdio, and call proc.kill() in a finally block. An outer withTimeout alone is insufficient because it lets the awaiter proceed without aborting the child process.

Why does my agent prompt template literal cause a SyntaxError?

Unescaped backticks inside TypeScript template literals silently terminate the string, producing parse errors at seemingly unrelated lines. Escape backticks as \` and ${ as \${, then run bun run build immediately to catch the error.

Can I use mock.module freely in Bun tests?

No, mock.module leaks across files in Bun's shared test-runner process. Prefer _test_exports for pure functions or _internals dependency-injection seams, reserving mock.module for unavoidable cases with restoration in afterEach.

When should I capture a SAST baseline with sast_scan?

Capture the baseline before any code changes in a phase using capture_baseline: true with a phase parameter, so subsequent scans only fail on new findings. Capturing after edits silently encodes new bugs as pre-existing and defeats the gate.

What are the limitations of the test_runner tool for repo validation?

The test_runner tool is limited to 50 files (MAX_SAFE_TEST_FILES) and is meant for targeted validation with explicit files lists, not full-repo runs. For whole-repo validation, run the shell commands in contributing.md or TESTING.md directly.