/core:test-seamsfrom core
Introduces minimal test seams (enabling points) to isolate hidden dependencies in legacy code for testing, without breaking existing callers.
Ships in core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Introduce the smallest explicit substitution point needed to put untestable existing code under test without changing existing production callers.
When placing legacy code under test, establish separation first so tests run deterministically, then add sensing where observable behaviour requires it.
Rule: if a test can call the code directly without setup or teardown, it needs no seam.
Create a seam only when a dependency:
Refuse to add seams for pure, fast, deterministic same-module helpers or standard-library operations. Test pure code directly through its public signature with plain inputs and observable outputs.
Complete all four steps before expanding a test suite:
Start with the most explicit, type-safe option the target language supports:
A test seam is not automatically a public module interface, a permanent port, or a lasting abstraction.
| Mistake | Fix |
|---|---|
| Passing the real collaborator through the new seam | Pass a hand-written fake that implements only the seam's narrow contract. |
| Stopping after the first hidden dependency and patching the rest with global test hooks | Audit every hidden dependency in step 1 and move all of them to explicit enabling points. |
| Adding seams around pure, deterministic same-module helpers | Apply the seam granularity rule and test the unit directly. |
| Keeping old module mocks after introducing an explicit seam | Delete the superseded mocks immediately so the seam owns test isolation. |
| Breaking many unrelated units in one edit | Break one unit's dependencies, verify its tests pass, then move to the next unit. |
| Leaking implementation details or wide external types across a seam | Narrow the seam contract to plain domain inputs and outputs describing what the unit needs, not how the collaborator works. |
Load the matching reference before writing language-specific seams or tests:
| Reference | Load when... |
|---|---|
| references/typescript-seams.md | Working in TypeScript, JavaScript, Node.js, or React codebases (default parameters, higher-order factories, narrow types, global wrappers, sensing closures, async/stream seams, React props/Context and MSW, legacy class seams, and temporary module-mock scaffolding). |
| references/swift-seams.md | Working in Swift or iOS codebases under Swift 6 strict concurrency (@Sendable closure defaults, narrow Sendable protocols or witness structs, wrapping Apple singletons, SwiftUI @Environment seams without ViewModels, custom URLProtocol HTTP boundary seams, isolated actor/Mutex stateful fakes in Swift Testing, and Swift static-compilation limits). |
Stop when hidden dependencies are broken, tests run in isolation through the new enabling points, and superseded mocks are removed. Hand follow-on work to the owning skill:
refactoring — characterisation-test-backed structural cleanup and behaviour-preserving refactoring once seams make the code testable.tdd — greenfield Red-Green-Refactor development for new behaviour without legacy hidden dependencies.hexagonal-architecture — promoting a temporary test seam into a permanent driven port with adapters, inside/outside boundaries, and a composition root.architect — designing a module's durable caller-facing contract and boundaries when not adopting full ports and adapters.swift-testing — authoring full Swift Testing suites (parameterised tests, tags, isolated fixtures) on Apple platforms.react-testing — authoring React Testing Library component and hook tests.frontend-testing — authoring non-React DOM UI tests with DOM Testing Library.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
legacy-code, test-seams, dependency-injection, unit-testing, testability
npx claudepluginhub mintuz/skills --plugin core37 skills in this plugin
/acceptance-reviewWHEN deciding whether a PR, branch, diff, or current code satisfies an authoritative issue, specification, or decision contract; NOT for reconstructing meetings, tracing decision lineage, general code review, or implementation; returns a criterion-by-criterion proof and acceptance verdict./adam-modeWHEN explicitly invoked as /adam-mode or asked to work in Adam's style; NOT for automatic invocation; routes the task to a playbook, loads the principle and domain skills it needs, delegates through adam-agent and proves the result before it reports./architectWHEN shaping non-trivial code whose types, signatures, non-type contracts or module boundaries are not settled, before implementation; NOT for edits inside one function, read-only explanation, repo-wide hotspot scans, physical folder/package layout, or work whose design is already agreed; sketches caller usage, types, dependencies and module boundaries through arena, then implements against the agreed sketch when authorised/arenaWHEN choosing between alternative shapes for a non-trivial artifact (code, interface, prompt, document or visual direction) by producing several independent attempts in one pass, judging them against a rubric, picking a base and grafting in the best parts of the others; NOT for raising one artifact to a confirmed external bar over repeated rounds (gauntlet-loop), tasks with one obvious answer, or broad coverage or exploration partitions; returns one synthesised artifact and a synthesis note/babysitUSE WHEN a branch with committed work must reach green CI and merge while the user is away, or WHEN you are about to write a loop that polls or re-runs CI for one branch; NOT WHEN you watch many PRs as an agent inbox (github-monitor), only draft a PR description (pr), write commit messages (commit-messages), or write a poller that ships as product or repository code. Pushes the branch, opens the PR, watches checks with gh (GitHub) or tea (Forgejo, Gitea), fixes branch failures and merge conflicts, merges only after the user says yes, and reports each transition./benchmark-checklistWHEN validating a benchmark or measured performance claim; NOT for an unmeasured optimization guess; checks completed work, fairness and repeatabilityOther plugins' skills for the same job