testing-patterns
Skill1 starsChanged 6 months agoMITView on GitHub
Use when adding, refactoring, reviewing, or debugging tests in Theseus, especially package-local test placement, characterization tests, Effect service tests, fixtures, mocks, and deciding how broad verification should be.
44 other projects use a version of this.
Adopted by
Most recently taken up by
- xsovad06/sovatheir own version, first seen Nov 8, 2026
- gopalparashar421/agent-skillstheir own version, first seen Nov 8, 2026
- soilmass/motion-design-agenttheir own version, first seen Nov 8, 2026
- seandkendall/kiro-configtheir own version, first seen Nov 1, 2026
- svngoku/coding-agents-skillstheir own version, first seen Nov 1, 2026
- piomin/claude-ai-spring-boottheir own version, first seen Oct 25, 2026
Used with
Projects with it also use intelligent-routing, bash-linux and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
SKB3002Skillintelligent-routing
Automatic agent selection and intelligent task routing. Analyzes user requests and automatically selects the best specialist agent(s) without requiring explicit user mentions.
Also in 5 projects that use this
xenitV1Skillbash-linux
Bash/Linux terminal patterns. Critical commands, piping, error handling, scripting. Use when working on macOS or Linux systems.
Also in 6 projects that use this
xenitV1Skillred-team-tactics
Red team tactics principles based on MITRE ATT&CK. Attack phases, detection evasion, reporting.
Also in 6 projects that use this
ChrisWilesSkillformik-patterns
Formik form handling with validation patterns. Use when building forms, implementing validation, or handling form submission.
Also in 3 projects that use this
SKB3002Skillnextjs-react-expert
React and Next.js performance optimization from Vercel Engineering. Use when building React components, optimizing performance, eliminating waterfalls, reducing bundle size, reviewing code for performance issues, or implementing server/client-side optimizations.
Also in 3 projects that use this
adybaSkillsafe-workflow
SAFe Agentic Workflow orchestrator. Teaches the full SAFe methodology adapted for AI agents: pattern discovery, exit states, quality gates, agent personas, and specs-driven development. Use when setting up a project with SAFe workflow, understanding the multi-agent methodology, or coordinating work across agent personas. Triggers: "SAFe workflow", "agent workflow", "safe harness", "specs-driven", "exit states", "quality gates", "multi-agent workflow".
Also in 3 projects that use this
- +4 more from xenitV1
Other versions44 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 44
- vudovn/ag-kit★ 8.2ksame name
- vudovn/antigravity-kit★ 8.2ksame name
- ChrisWiles/claude-code-showcase★ 6.1ksame name
- ag2ai/faststream★ 5.4ksame name
- piomin/claude-ai-spring-boot★ 1.4ksame name
- bybren-llc/safe-agentic-workflow★ 405same name
- dilolabs/nosia★ 211same name
- xenitV1/Antigravity-Workflows★ 130same name
- langchain-ai/skills-benchmarks★ 116same name
- leather-io/mono★ 28same name
34 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository28 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-self-checkSkill
- biome-grit-rulesSkill
- biome-toolingSkill
- bun-testSkill
- bun-workspaceSkill
- cleanup-auditSkill
- code-reviewSkill
- dispatch-satelliteSkill
- docs-managementSkill
- docs-readingSkill
- effect-concurrency-lifecycleSkill
- effect-errors-schemaSkill
- effect-observability-timeSkill
- effect-services-layersSkill
- effect-testing-runtimeSkill
- effect-v4Skill
- jsx-md-authoringSkill
- monorepo-maintenanceSkill
- refactoring-disciplineSkill
- roadmap-managementSkill
- runtime-engineSkill
- server-runtimeSkill
- theseus-designSkill
- tool-authoringSkill
- typescript-strictSkill
- ui-layout-disciplineSkill
- theseus-designSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
28 rules. 0 are common, 20 are distinctive, and 8 are very specific to this project.
0
Common
Most of the 29 edited versions we read keep these.
20
Distinctive
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use this skill for deciding what to test, where tests belong, and how broad verification should be.
- Very specific: line 10
Do not use this skill for web-only packages/icarus-web testing unless the user explicitly asks to cover web.
- Distinctive: line 14
Put tests near the package that owns the behavior.
- Very specific: line 15
Prefer package-local src//*.test.ts or src//*.test.tsx patterns already used by the package.
- Distinctive: line 16
Keep reusable test helpers under a package-local test utility module.
- Very specific: line 37
Keep Effect at the boundary of the test.
- Distinctive: line 38
Prefer test layers and fake services over global mutation.
- Distinctive: line 39
Keep typed expected failures in the error channel when that is the contract being tested.
- Distinctive: line 40
Test defect paths separately from expected domain failures.
- Distinctive: line 41
When a service requires time, randomness, IDs, storage, or a language model, inject a deterministic test service instead of relying on …
- Very specific: line 45
Import test APIs from bun:test.
- Distinctive: line 46
Prefer direct assertions for small units and table tests for closed protocol variants.
- Distinctive: line 47
Use mocks and spies only at process or dependency boundaries.
- Distinctive: line 48
Keep snapshots for stable rendered output or protocol artifacts.
- Distinctive: line 49
Avoid broad root test runs while iterating when a package-local test reproduces the issue.
- Distinctive: line 54
Keep fixtures small and local until multiple tests need the same object.
- Very specific: line 55
Use constructors or builders for protocol variants with required defaults.
- Distinctive: line 56
Do not make a shared fixture so configurable that each test has to mentally execute a framework.
- Distinctive: line 60
Run the narrowest useful test during iteration.
- Very specific: line 61
Run bun run typecheck when changing public types, package exports, Effect environments, schemas, or cross-package signatures.
- Distinctive: line 62
Run broader tests when behavior crosses package boundaries or when a refactor moves ownership.
- Very specific: line 65
Do not add broad runtime/server/web E2E tests without explicit user confirmation or an explicit wiring-proof request.
- Distinctive: line 71
Do not add tests only around mocks while leaving the real behavior unexercised.
- Distinctive: line 72
Do not hide flaky timing with sleeps.
- Distinctive: line 73
Do not test through the server when the owning primitive can be tested directly.
- Distinctive: line 74
Do not create one giant integration test for several unrelated behaviors.
- Distinctive: line 75
Do not use broad E2E as the first proof for behavior that has a clear owner.
- Distinctive: line 76
Do not leave TODO comments for obvious missing tests.
“Common” is measured: kept by at least 6 in 10 of the 29 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Testing Patterns
Use this skill for deciding what to test, where tests belong, and how broad verification should be. Use the bun-test skill for Bun test runner mechanics.
Do not use this skill for web-only packages/icarus-web testing unless the user explicitly asks to cover web.
Placement
- Put tests near the package that owns the behavior.
- Prefer package-local
src/**/*.test.tsorsrc/**/*.test.tsxpatterns already used by the package. - Keep reusable test helpers under a package-local test utility module. Do not leak helpers into public exports unless they are intended public test utilities.
- Cross-package behavior should be tested at the lowest package that can observe it. Use server-level tests only for real wiring, persistence, transport, or runtime assembly.
What Needs Tests
- New runtime behavior needs focused tests.
- Runtime behavior owners need isolated tests by default. Effect DI should be used to cut the graph and replace dependencies with fake layers/services.
- Services with behavior need direct tests: registries, stores, parsers, dispatch loops, satellite rings, tool execution boundaries, persistence adapters, and protocol serializers.
- Systems should test command/control/event/lifecycle behavior.
- Projections should test derivation from stored events.
- Sinks should test curation and side effects.
- Tool/model catalog modules should test selection and hydration.
- Codecs should test
_taground trips and unknown boundary handling. - Constructors for exported protocol variants need tests when they apply defaults, normalize input, or enforce invariants.
- Boundary adapters that translate external/provider data into internal data need focused tests for the translation shape.
- Pure type surfaces and thin barrels do not need runtime tests unless they contain constructors or behavior.
- Refactors of working behavior should start with characterization tests when the current behavior is not already pinned down.
Effect Tests
- Keep Effect at the boundary of the test. Build the program, provide test layers, then run with
Effect.runPromiseor the repo's existing test helper. - Prefer test layers and fake services over global mutation.
- Keep typed expected failures in the error channel when that is the contract being tested.
- Test defect paths separately from expected domain failures.
- When a service requires time, randomness, IDs, storage, or a language model, inject a deterministic test service instead of relying on ambient behavior.
Bun Test Style
- Import test APIs from
bun:test. - Prefer direct assertions for small units and table tests for closed protocol variants.
- Use mocks and spies only at process or dependency boundaries. Prefer fake services for domain logic.
- Keep snapshots for stable rendered output or protocol artifacts. Avoid snapshots for logic that would be clearer as explicit assertions.
- Avoid broad root test runs while iterating when a package-local test reproduces the issue.
Fixtures
- Name fixtures by the behavior they support, not by incidental data shape.
- Keep fixtures small and local until multiple tests need the same object.
- Use constructors or builders for protocol variants with required defaults. Do not duplicate
_tagliterals and default fields across tests. - Do not make a shared fixture so configurable that each test has to mentally execute a framework.
Verification Scope
- Run the narrowest useful test during iteration.
- Run
bun run typecheckwhen changing public types, package exports, Effect environments, schemas, or cross-package signatures. - Run broader tests when behavior crosses package boundaries or when a refactor moves ownership.
- Narrow package integration tests are allowed when they prove local assembly of a few services.
- Do not add broad runtime/server/web E2E tests without explicit user confirmation or an explicit wiring-proof request.
- In reviews, missing tests are findings. Either add the test, defer it explicitly, or explain why the changed surface is type-only.
Anti-Patterns
- Do not add tests only around mocks while leaving the real behavior unexercised.
- Do not hide flaky timing with sleeps; inject clocks or await deterministic signals.
- Do not test through the server when the owning primitive can be tested directly.
- Do not create one giant integration test for several unrelated behaviors.
- Do not use broad E2E as the first proof for behavior that has a clear owner.
- Do not leave TODO comments for obvious missing tests; either write them or call out the gap.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

