
create-tests-extract
Move a bulky inline test block out of its source file WITHOUT weakening it — same coverage, same private access: read the source and its inline tests, pick the smallest safe extraction boundary (an adjacent [cfg(test)] mod, not a top-level tests/, when private access matters), move tests and their helpers with names and attributes intact plus the minimal module wiring, then run the narrowest relevant tests. Preserves the original visibility model and touches production code only as far as wiring requires — never silently downgrades private unit tests into weaker public-API integration tests. Use when the user asks to split large inline tests out of a source file.
- Installs
- 113
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/ulpi-io/skills --skill create-tests-extract- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads create-tests-extract automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Non-negotiable rules:
- Read the source file and its inline tests fully before moving anything.
- Preserve the original visibility and helper access model.
- Prefer adjacent test modules over integration tests when private access matters.
- Change production code only as much as module wiring requires.
- Run the narrowest relevant tests after extraction. </EXTREMELY-IMPORTANT>
create-tests-extract
Inputs
$request: Source file, module, or cleanup goal
Goal
Move bulky inline tests into adjacent files while keeping:
- the same effective test coverage
- the same access to private items where needed
- a clearer production file
Step 0: Read and classify the test block
Inspect:
- the production file
- the inline test module
- helper functions or fixtures used only by tests
- whether the tests depend on
super::*or private module items
If the file belongs to a Rust crate, use rust for conventions before changing the module layout.
Success criteria: The tests are classified as local-inline, adjacent-module, or true integration candidates.
Step 1: Choose the smallest safe extraction boundary
Prefer:
foo.rs+#[cfg(test)] mod foo_tests;+foo_tests.rs- or
foo/mod.rs+tests.rsfor directory modules
Avoid pushing tests into top-level tests/ unless they genuinely should become public-API integration tests.
Success criteria: The new layout preserves the intended visibility model.
Step 2: Extract without semantic drift
When moving the tests:
- add the minimal
#[cfg(test)] mod ...;wiring - keep
use super::*;or equivalent imports when needed - preserve test names and attributes
- move test-only helpers with the suite that needs them
Do not rename tests or restructure production modules unless the extraction requires it.
Success criteria: The moved tests still compile in the same effective context.
Step 3: Verify the moved suite
After extraction:
- run the narrowest relevant tests
- check for warnings or visibility regressions
- verify the production file is materially easier to scan
Success criteria: The new layout passes and preserves behavior.
Guardrails
- Do not turn private unit tests into public-only integration tests by accident.
- Do not move tiny, explanatory inline tests that still improve readability where they are.
- Do not broaden the refactor beyond the requested extraction.
- Do not drop fixtures or helper coverage just to shorten the production file.
Output Contract
Report:
- files created or modified
- extraction layout chosen
- any tests intentionally left inline
- validation run after the move
FAQ
What does the create-tests-extract skill do?
Move a bulky inline test block out of its source file WITHOUT weakening it — same coverage, same private access: read the source and its inline tests, pick the smallest safe extraction boundary (an adjacent [cfg(test)] mod, not a top-level tests/, when private access matters), move tests and their helpers with names and attributes intact plus the minimal module wiring, then run the narrowest relevant tests. Preserves the original visibility model and touches production code only as far as wiring requires — never silently downgrades private unit tests into weaker public-API integration tests. Use when the user asks to split large inline tests out of a source file.
How do I install create-tests-extract?
Run npx skills add https://github.com/ulpi-io/skills --skill create-tests-extract in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/create-tests-extract/ (personal) or .claude/skills/create-tests-extract/ (project).
Which AI agents can use create-tests-extract?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is create-tests-extract safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains create-tests-extract?
It is published by ulpi-io in ulpi-io/skills. It has 113 recorded installs.
More from ulpi-io/skills
frontend-design-ui-ux
ulpi-io/skills
Produce a distinctive, LOCKED design language plus an implementation-ready UX/UI spec, written to .ulpi/design/: a per-brief visual identity (palette, type, signature), the design system to build on, user flows and states, component briefs, and accessibility constraints. Commits to a bold aesthetic direction, bans AI-slop by name, and locks the identity so every screen and future session stays consistent. Can visit inspiration links with the browse skill to extract real design DNA. Ends with a build handoff that a delegated engineering agent implements — a DESIGN-SPEC skill that produces the spec, never production UI code. Use for new features, redesigns, or design-system work where the build should follow a locked spec.
laravel-filament
ulpi-io/skills
Open the skill to read its SKILL.md instructions.
git-merge-expert
ulpi-io/skills
Open the skill to read its SKILL.md instructions.
Popular testing & qa skills
tdd
mattpocock/skills
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
grilling
mattpocock/skills
Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.
migrate-to-shoehorn
mattpocock/skills
Migrate test files from as type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace as in tests, or needs partial test data.
run-train
lllllllama/rigorpilot-skills
Rigor Train skill for deep learning research repositories. Use when a documented or selected training command should be run conservatively for startup verification, short-run verification, full kickoff, or resume, with command, config, seed, log, checkpoint, status, and metric evidence written to standardized trainoutputs/. Do not use for environment setup, exploratory sweeps, speculative idea implementation, or end-to-end orchestration.
test-driven-development
obra/superpowers
Use when implementing any feature or bugfix, before writing implementation code
finishing-a-development-branch
obra/superpowers
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work