write-tests
Skill15 starsChanged 5 months agoMITView on GitHub
Add or expand unit/integration tests for existing code (when testing is configured). Use proactively when tests need to be added or expanded.
76 other projects use a version of this.
Adopted by
Most recently taken up by
- Doist/todoist-aitheir own version, first seen Nov 9, 2026
- CheckPickerUpper/skillstheir own version, first seen Nov 8, 2026
- Doist/todoist-clitheir own version, first seen Nov 8, 2026
- aniketshukla1/sdlc-kittheir own version, first seen Nov 8, 2026
- helmut-hoffer-von-ankershoffen/heinzeltheir own version, first seen Nov 8, 2026
- unlockers-ai/unlockers-skills-librarytheir own version, first seen Nov 8, 2026
Used with
Projects with it also use close-spec, design-with-images 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.
dzhngSkillclose-spec
When a spec under specs/<feature>/ is done shipping (a write-spec build, or any planned task that produced a spec), archive it to specs/done/ and rewrite it from a build-plan into a durable rationale — the why, the principles, the invariants — pointing back to the real code for the how. Use when implementation has landed and the plan no longer matches what shipped, or the user says a feature/spec is finished. Pairs with [write-spec](../write-spec/SKILL.md) (the plan this closes) and [review](../review/SKILL.md) (run before closing).
Also in 5 projects that use this
dzhngSkilldesign-with-images
Explore UI and visual design with image generation, then iterate the real implementation against the user-selected concept. Use when brainstorming visual directions, offering mockup variants, or implementing an approved generated design; do not stop at the mockups or the first code approximation.
Also in 5 projects that use this
transitive-bullshitSkillcompare-screenshots
Compare screenshots against the intended design, distinguishing approved references from historical baselines. Use for iterative implementation matching, before/after visual review, objective image telemetry, or checking a lone capture for flat, empty, or badly framed content.
Also in 5 projects that use this
LucasMatuszewskiSkillaudit-agents
Audit and maintain agent configuration files (.claude/agents, AGENTS.md, CLAUDE.md, agent-memory). Checks for duplicates, outdated info, naming conflicts, wrong technical facts, and files over 200 lines. Fixes all issues and commits.
Also in 5 projects that use this
wolverin0Skillaudit-decisions
Standardize remediation decisions, baseline-policy entries, and legal-review banners for accepted, deferred, or policy-blocked audit findings.
Also in 4 projects that use this
rhnfzlSkillexplore-unknowns
Walk the user through mapping the unknowns of a task before, during, and after they build it, and hand them a four-quadrant map (settled ground, open decisions, taste, and landmines) they keep. Reach for this eagerly whenever a request is ambiguous or underspecified, the codebase or domain is unfamiliar, the user will "know it when they see it", a reference implementation must be understood before porting, a build-queue or architecture-changing task is about to start, a mid-build deviation needs capturing, or a finished change needs buy-in or verified understanding before merge. Trigger even when the skill is not named: "do a blindspot pass", "find my unknown unknowns", "interview me about this change", "brainstorm the approach for a task I am about to build", "help me scope this", "what am I missing here", "plan this before I build", "I know nothing about X in this codebase". When a territory profile is present it reads memory and the graph first and feeds the map into the build pipeline; without one it degrades to a plain general map. Not for trivial or mechanical tasks with clear acceptance criteria, single-fact lookups, pure debugging of a known symptom, or pure code review, those have their own tools. Do not use it to run the build itself; the map is the deliverable and implementation remains a separate task, whether it has not started or is already underway.
Also in 5 projects that use this
- +5 more from dzhng
Other versions76 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 76
- remix-run/remix★ 33ksame name
- elie222/inbox-zero★ 13ksame name
- getsentry/sentry-javascript★ 8.8ksame name
- dzhng/jevgrep★ 3.2ksame name
- meta-pytorch/OpenEnv★ 2.8ksame name
- huggingface/OpenEnv★ 2.8ksame name
- JamieMason/syncpack★ 2.1ksame name
- dzhng/skills★ 1.5ksame name
- clice-io/clice★ 1.4ksame name
- ryokun6/ryos★ 1.3ksame name
66 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 repository21 other files it gives its agents.
- AGENTS.mdAGENTS.md
- public/llms-full.txtllms.txt
- public/llms.txtllms.txt
- add-componentSkill
- add-diagram-componentSkill
- add-languageSkill
- add-pageSkill
- ai-diff-reviewerSkill
- dailybotSkill
- deepworkplanSkill
- doc-editSkill
- fix-lintSkill
- git-commit-pushSkill
- pr-review-liteSkill
- quick-fixSkill
- refactor-safeSkill
- responsive-lighthouse-auditSkill
- security-checkSkill
- translate-syncSkill
- type-fixSkill
- update-stylesSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. 0 are common, 10 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 71 edited versions we read keep these.
10
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 20
Add or expand tests for existing code.
- Distinctive: line 32
Does NOT implement new production code
- Distinctive: line 33
Does NOT refactor production logic
- Distinctive: line 34
Does NOT change function signatures for the sake of testability without agreement
- Distinctive: line 35
Does NOT set up E2E tests (Playwright not configured)
- Very specific: line 119
Use as never cast for mock entries passed to functions expecting a CollectionEntry
- Very specific: line 121
Do NOT test async functions that depend on astro:content directly — mock the collection instead
- Distinctive: line 127
Read the target file(s) and identify public behavior to test
- Very specific: line 128
Check for existing tests in tests/unit/
- Very specific: line 139
Create or update test file in tests/unit/
- Distinctive: line 140
Use Vitest (describe, it, expect)
- Very specific: line 141
Import fixtures from tests/fixtures/ when applicable
- Distinctive: line 142
Keep tests focused; avoid testing implementation details
- Distinctive: line 185
Stop and escalate: if:
- Distinctive: line 201
Escalate to Tier 3: if: integration/E2E design needed, or test architecture decisions.
“Common” is measured: kept by at least 6 in 10 of the 71 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
Skill: Write Tests
Objective
Add or expand tests for existing code. This skill creates or extends test files with meaningful cases, edge cases, and mocks.
Current Status
- Testing Framework: Vitest 4.x (configured and active)
- Component Testing: @testing-library/svelte 5.x
- DOM Environment: happy-dom
- Coverage: V8 provider, 80%+ threshold on
src/lib/ - Test file naming:
*.test.ts
Non-Goals
- Does NOT implement new production code
- Does NOT refactor production logic
- Does NOT change function signatures for the sake of testability without agreement
- Does NOT set up E2E tests (Playwright not configured)
Tier Classification
Tier: 2 - Standard
Reasoning: Writing tests requires moderate reasoning (understanding behavior, edge cases, mocks). Scope typically 1-10 files, 100-500 LOC; standard development work.
Inputs
Required Parameters
$TARGET: File(s) or module to add tests for (e.g.,src/lib/i18n.ts)$SCOPE: What to cover (e.g., "unit for props", "interaction tests", "edge cases for null")
Optional Parameters
$EXISTING: Path to existing test file to extend
Prerequisites
- Target code is stable (no pending refactors)
- Test fixtures understood (
tests/fixtures/) - Vitest config reviewed if testing new module types
Test Infrastructure
Configuration
- Config:
vitest.config.tsat project root - Environment: happy-dom
- Path aliases:
@/maps tosrc/(matches tsconfig) - Svelte:
@sveltejs/vite-plugin-sveltewithhot: false - Browser resolve:
conditions: ['browser']for Svelte 5 component tests - astro:content mock:
tests/mocks/astro-content.ts(aliased in vitest config)
Test File Structure
tests/
├── unit/
│ ├── lib/ # Utility function tests
│ │ ├── i18n.test.ts
│ │ ├── markdown-for-agents.test.ts
│ │ └── translations.test.ts
│ └── components/ # Svelte component tests
├── fixtures/ # Shared mock data
├── helpers/
│ └── setup.ts # Test setup (jest-dom matchers)
└── mocks/
└── astro-content.ts # Mock for astro:content virtual moduleKey Patterns
Utility function tests:
import { describe, expect, it } from 'vitest';
import { getUrlPrefix } from '@/lib/i18n';
describe('getUrlPrefix', () => {
it('returns /es for Spanish', () => {
expect(getUrlPrefix('es')).toBe('/es');
});
});Svelte component tests:
import { render, screen } from '@testing-library/svelte';
import { describe, expect, it } from 'vitest';
import MethodologyCard from '@/components/MethodologyCard.svelte';
const doc = { data: { title: 'Introduction', order: 1, lang: 'en' } };
describe('MethodologyCard', () => {
it('renders doc title', () => {
render(MethodologyCard, { props: { doc: doc as never } });
expect(screen.getByText('Introduction')).toBeDefined();
});
});Important notes:
- Use
as nevercast for mock entries passed to functions expecting aCollectionEntry - Svelte 5 components require
resolve.conditions: ['browser']in vitest config - Do NOT test async functions that depend on
astro:contentdirectly — mock the collection instead
Steps
Step 1: Understand Target
- Read the target file(s) and identify public behavior to test
- Check for existing tests in
tests/unit/ - Review testing patterns in existing test files
Step 2: Plan Cases
- List unit cases (happy path, edge cases, errors)
- Identify dependencies to mock
- Decide: new file or extend existing test
Step 3: Implement Tests
- Create or update test file in
tests/unit/ - Use Vitest (describe, it, expect)
- Import fixtures from
tests/fixtures/when applicable - Keep tests focused; avoid testing implementation details
Step 4: Validate
pnpm run test # Run tests
pnpm run biome:check # Lint checkOutput Format
Success Output
## Tests Added/Updated
### Target
{What was tested}
### Files
- `tests/.../foo.test.ts`: {created|updated} — {brief description}
### Coverage
- {list of cases covered}
### Validation
- pnpm run test: pass
- pnpm run biome:check: pass
### Commit Message
test: add|expand tests for {target}Guardrails
Scope Limits
- Maximum files: 10 (test files + any small test helpers)
- Maximum LOC: 500 (test code)
- Naming:
*.test.ts
Stop Conditions
Stop and escalate if:
- Target is auth/security-critical (coordinate with team)
- Requires new test infrastructure not in project
- Scope exceeds 10 files or 500 LOC
- Need to mock
astro:contentbeyond the existing stub
Definition of Done
- New or updated test files
- All tests pass (
pnpm run test) pnpm run biome:checkpasses- Tests are meaningful (not only coverage padding)
Escalation Conditions
Escalate to Tier 3 if: integration/E2E design needed, or test architecture decisions.
Related
- quick-fix - Small fixes
- reviewer - Review test quality
- docs/TESTING_GUIDE.md - Full testing conventions and setup
Changelog
- 2026-02-17: Updated from placeholder to actual Vitest setup. Removed "NOT CONFIGURED" status. Added real patterns, config details, and Svelte 5 compatibility notes.
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.

