add-test
Skill234 starsChanged 3 months agoMITView on GitHub
Add tests following project test patterns
18 other projects use a version of this.
Adopted by
Most recently taken up by
- microsoft/veronatheir own version, first seen Nov 8, 2026
- TidalPaladin/skillstheir own version, first seen Nov 8, 2026
- flavien-ia/hypervibe-crafttheir own version, first seen Oct 25, 2026
- flavien-ia/hypervibe-harnesstheir own version, first seen Oct 23, 2026
- WhatIfWeDigDeeper/claude-code-courseratheir own version, first seen Oct 20, 2026
- nativewind/react-native-csstheir own version, first seen Oct 9, 2026
Used with
Projects with it also use triage and review.
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.Other versions18 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 18
- gitkraken/vscode-gitlens★ 10ksame name
- nativewind/nativewind★ 8.1ksame name
- microsoft/verona★ 3.7ksame name
- The-OpenROAD-Project/OpenROAD★ 3.3ksame name
- OpenAEV-Platform/openaev★ 1.8ksame name
- DexForce/EmbodiChain★ 240same name
- nativewind/react-native-css★ 167same name
- osmandapp/web★ 63same name
- flavien-ia/hypervibe-craft★ 50same name
- flavien-ia/hypervibe-harness★ 50same name
8 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 repository29 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- add-aspire-depSkill
- add-background-jobSkill
- add-ci-areaSkill
- add-email-templateSkill
- add-env-varSkill
- add-options-classSkill
- add-permissionSkill
- add-rate-limitSkill
- address-reviewSkill
- backend-conventionsSkill
- create-issueSkill
- create-prSkill
- create-releaseSkill
- frontend-conventionsSkill
- gen-typesSkill
- infra-conventionsSkill
- init-verifySkill
- manage-file-storageSkill
- new-endpointSkill
- new-entitySkill
- new-featureSkill
- new-pageSkill
- polish-uiSkill
- review-dependabotSkill
- review-designSkill
- review-prSkill
- security-conventionsSkill
- verifySkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 2 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 17 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
No mocking, no DI - test pure inputs and outputs
- Distinctive: line 23
Create mocks in constructor:
- Very specific: line 58
If service interface not mocked in CustomWebApplicationFactory, add it there first
- Very specific: line 67
Use TestValidate + assertion helpers:
- Very specific: line 96
Create src/frontend/src/lib/{module}/{file}.test.ts (co-located with source)
- Very specific: line 98
Default environment is node.
- Very specific: line 107
Add // @vitest-environment jsdom at top of file
“Common” is measured: kept by at least 6 in 10 of the 17 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
Adds tests. Specify test type or infer from context.
Unit Test
For pure logic in Shared, Domain, or Application layers.
- Create
src/backend/tests/MyProject.Unit.Tests/{Layer}/{ClassUnderTest}Tests.cs - Structure:
{Method}_{Scenario}_{Expected}naming - No mocking, no DI - test pure inputs and outputs
- Verify:
dotnet test src/backend/tests/MyProject.Unit.Tests -c Release
Component Test
For service business logic with mocked dependencies.
- Create
src/backend/tests/MyProject.Component.Tests/Services/{Service}Tests.cs - Create mocks in constructor:
private readonly MyProjectDbContext _dbContext = TestDbContextFactory.Create(); private readonly IOrderRepository _orderRepo = Substitute.For<IOrderRepository>(); private readonly HybridCache _cache = Substitute.For<HybridCache>(); - For Identity:
IdentityMockHelpers.CreateMockUserManager()/CreateMockRoleManager() - Assert on
Result:Assert.True(result.IsSuccess); Assert.Equal(expectedId, result.Value); - Verify:
dotnet test src/backend/tests/MyProject.Component.Tests -c Release
API Integration Test
For testing the full HTTP pipeline (routes, auth, validation, status codes).
- Create
src/backend/tests/MyProject.Api.Tests/Controllers/{Controller}Tests.cs - Structure:
public class OrdersControllerTests : IClassFixture<CustomWebApplicationFactory>, IDisposable { private readonly CustomWebApplicationFactory _factory; private readonly HttpClient _client; public OrdersControllerTests(CustomWebApplicationFactory factory) { _factory = factory; _client = factory.CreateClient(); } public void Dispose() => _client.Dispose(); } - Auth per-request via
Authorizationheader:"Test"- basic authenticated userTestAuth.WithPermissions(AppPermissions.Users.View)- specific permissionsTestAuth.Superuser()- bypasses all checks- No header - unauthenticated (401)
- Configure mock returns:
_factory.AdminService.Method(...).Returns(...); - If service interface not mocked in
CustomWebApplicationFactory, add it there first - For 200/201 responses, add response contract assertions using frozen records in
Contracts/ResponseContracts.cs - Verify:
dotnet test src/backend/tests/MyProject.Api.Tests -c Release
Validator Test
For FluentValidation rules without starting the test server.
- Create
src/backend/tests/MyProject.Api.Tests/Validators/{Validator}Tests.cs - Use
TestValidate+ assertion helpers:using FluentValidation.TestHelper; public class OrderRequestValidatorTests { private readonly OrderRequestValidator _validator = new(); [Fact] public void ValidRequest_ShouldPassValidation() { var result = _validator.TestValidate(new OrderRequest { Name = "Widget", Quantity = 1 }); result.ShouldNotHaveAnyValidationErrors(); } [Fact] public void MissingName_ShouldFail() { var result = _validator.TestValidate(new OrderRequest { Name = "", Quantity = 1 }); result.ShouldHaveValidationErrorFor(x => x.Name); } } - Verify:
dotnet test src/backend/tests/MyProject.Api.Tests -c Release
Frontend Unit Test
For utility functions, state modules, and pure logic in $lib/.
- Create
src/frontend/src/lib/{module}/{file}.test.ts(co-located with source) - Import explicitly:
import { describe, it, expect, vi } from 'vitest' - Default environment is
node. For DOM tests, add// @vitest-environment jsdomat top of file restoreMocks: trueis configured globally - no manual cleanup needed- Verify:
cd src/frontend && pnpm run test
Frontend Component Test
For Svelte components with DOM interactions.
- Create
src/frontend/src/lib/components/{feature}/{Component}.test.ts(co-located) - Add
// @vitest-environment jsdomat top of file - Mock SvelteKit modules as needed:
vi.mock('$app/navigation', () => ({ goto: vi.fn(), invalidateAll: vi.fn() })); vi.mock('$lib/paraglide/messages', () => new Proxy({}, { get: (_, key) => () => String(key) })); - Verify:
cd src/frontend && pnpm run test
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.

