Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/zaxbyhub/opencode-swarm/test-file-splitnpx skills add ZaxbyHub/opencode-swarm --skill test-file-splitgit clone --depth 1 https://github.com/ZaxbyHub/opencode-swarmWrote 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/test-file-split)<a href="https://agentmods.dev/skills/zaxbyhub/opencode-swarm/test-file-split"><img src="https://agentmods.dev/badge/skills/zaxbyhub/opencode-swarm/test-file-split.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 | $0.00077 | $0.01236 |
| Opus 5 | $0.00039 | $0.00618 |
| Sonnet 5 | $0.00015 | $0.00247 |
| Haiku 4.5 | $0.00008 | $0.00124 |
Grade A, and why
test-file-split scanned grade A with 0 findings 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 4d 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 101 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Test File Split Protocol (FR-006)
scripts/check-test-file-cap.ts enforces the 500-line cap per test file (FR-006 / SC-006.1) as a diff-scoped ratchet: new test files over 500 lines and existing over-cap files that grew fail the quality gate and block PR merge. Pre-existing over-cap files not touched by the PR are non-blocking. Escape hatch: TEST_CAP_ENFORCE=0 soft-warns. This skill covers the complete splitting protocol.
Read first: .opencode/skills/writing-tests/SKILL.md (or .claude/skills/writing-tests/SKILL.md) for bun:test framework rules, mock isolation patterns, and file placement conventions.
When to use this skill
- A test file exceeds or approaches 500 lines
- CI fails with an FR-006 file-size violation
- You are adding tests to a file that is already above 400 lines (proactive split)
Step 1 — Measure and identify split boundaries
# Check the file
wc -l tests/unit/scripts/my-module.test.ts
# Find all test files exceeding 400 lines (early warning)
find tests/ -name "*.test.ts" -exec wc -l {} \; | sort -rn | awk '$1 > 400'
Identify natural describe() block boundaries. Group blocks by functional area:
- Each
describe()block should belong to exactly one split file - Shared
beforeEach/afterEachhooks determine which blocks must stay together
Step 2 — Choose a suffix for the new file
| Pattern | Example | When to use |
|---|---|---|
<module>-<area>.test.ts |
release-notes-fragments-sha.test.ts |
Split by functional area (SHA resolution, validation, merge logic) |
<module>-<area>.adversarial.test.ts |
auth-login.adversarial.test.ts |
Split adversarial tests into their own file |
Step 3 — Manage shared imports and helpers
Three options, in order of preference:
-
Extract to shared utility (preferred for complex shared setup): Create
tests/helpers/<module>-shared.tswith shared fixtures, mock factories, and setup functions. Import from both split files. -
Duplicate simple imports (for small overlap): If only
bun:testimports and 1-2 source imports are shared, duplicate them in both files. Simpler than a utility module for trivial cases.
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.
- 4d ago First seen · 101 lines · 77 tokens per session scan A 67bfca7e0d18
test-file-split is a skill published in the GitHub repository ZaxbyHub/opencode-swarm (462 stars, last pushed today), licensed MIT. It adds 77 tokens to every session and 1,236 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. 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…
verify-changes
How to test and verify work in the dev-3.0 repo — which vitest config covers what, how to write a test that fits the house style, mocking Electrobun RPC and i18n providers, what coverage is actually expected, and the browser QA hand-off. Use when writing or fixing tests, deciding what a change needs covered, hitting a…
debug-ui
Drive and visually QA the dev-3.0 UI in a real browser (headless Chromium via agent-browser). Use when verifying a UI/UX change, reproducing a visual bug, taking screenshots of the running app, or self-QA before review. Triggers — "check the UI", "screenshot the app", "does this render", "QA this screen", "verify the…
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…
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.