test-file-split

test-file-split is a skill for Claude Code, Codex from ZaxbyHub/opencode-swarm. It costs 77 tokens per session (1,238 once invoked), scanned A, original, MIT.

A procedure for splitting test files that are near or above a 500-line limit enforced by the project’s checks.

In plain words
What is it for?
Use it when a test file exceeds or approaches 500 lines, or when a continuous-integration check reports a test-file-size violation.
Why use it?
It helps reduce oversized test files without losing coverage, shared helpers, mock isolation, or the project’s required checks.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths; positional $N argument; installed under .agents/ (shared by several agents).

Good fit Use it when a test file exceeds or approaches 500 lines, or when a continuous-integration check reports a test-file-size violation.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zaxbyhub/opencode-swarm/test-file-split
Install

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.

Any agent
npx skills add ZaxbyHub/opencode-swarm --skill test-file-split
Clone the repo
git clone --depth 1 https://github.com/ZaxbyHub/opencode-swarm

Made for: Claude Code, Codex.

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.

agentmods badge for test-file-split

README.md
[![agentmods](https://agentmods.dev/badge/skills/zaxbyhub/opencode-swarm/test-file-split/github.svg)](https://agentmods.dev/skills/zaxbyhub/opencode-swarm/test-file-split)
Your own site
<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/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.

agentmods 80×15 button for test-file-split

Your own site · 80×15
<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="Reviewed on agentmods" width="80" height="20"></a>
Per session 77 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,238 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, 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 11
    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.
  • medium Agent Snooping · line 81
    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.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00077 $0.01238
Opus 5.5 $0.00031 $0.00495
Sonnet 5.5 $0.00015 $0.00248
Haiku 4.5 $0.00008 $0.00124

Measured 5d ago against content hash 96fe9a0b2acd, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 5d 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.

.agents/skills/test-file-split/SKILL.md · 102 lines

How it starts

The opening of the file, as written. The whole thing — 102 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/afterEach hooks 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:

  1. Extract to shared utility (preferred for complex shared setup): Create tests/helpers/<module>-shared.ts with shared fixtures, mock factories, and setup functions. Import from both split files.

  2. Duplicate simple imports (for small overlap): If only bun:test imports and 1-2 source imports are shared, duplicate them in both files. Simpler than a utility module for trivial cases.

Read the full file on GitHub · 102 lines

Changes

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.

  1. 5d ago Changed · +1 lines 96fe9a0b2acd
  2. 1mo ago First seen · 101 lines · 77 tokens per session scan A 67bfca7e0d18

Subscribe to this mod's changes

test-file-split is a skill published in the GitHub repository ZaxbyHub/opencode-swarm (506 stars, last pushed today), licensed MIT. It adds 77 tokens to every session and 1,238 once invoked, about $0.0003 per session on Opus 5.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.

Related

Other skills, from other repositories

e2e-testing

Guide for running end-to-end tests of the Qwen Code CLI, including headless mode, MCP server testing, and API traffic inspection. Use this skill whenever you need to verify CLI behavior with real model calls, reproduce user-reported bugs end-to-end, test MCP tool integrations, or inspect raw API request/response…

QwenLM/qwen-code · 94 tokens

terminal-capture

Automates terminal UI screenshot testing for CLI commands. Applies when reviewing PRs that affect CLI output, testing slash commands (/about, /context, /auth, /export), generating visual documentation, or when 'terminal screenshot', 'CLI test', 'visual test', or 'terminal-capture' is mentioned.

QwenLM/qwen-code · 66 tokens

tmux-real-user-testing

A real-user test workflow for Qwen Code's terminal interface, using tmux to drive the program and capture readable screen snapshots. tmux is a tool for running and observing terminal sessions.

QwenLM/qwen-code · 98 tokens

agent-reproduce-align

Use after a Codex or Claude Code feature has been implemented in Qwen Code to run the selected reference agent and Qwen Code under the same scenario, capture HTTP and terminal traces, compare request bodies, tool/function schemas, outputs, and iterate until the reproduced behavior is close enough.

QwenLM/qwen-code · 62 tokens

test-failure-explorer

Import and query an existing Vitest 3.2 JSON report to explore test failures, file-level errors and original diagnostic evidence.

QwenLM/qwen-code · 32 tokens

deflake

Stabilize a flaky test with a minimal, assertion-preserving fix — never by weakening or deleting the check.

QwenLM/qwen-code · 26 tokens