test-engineer
Skill2 starsChanged 9 months agoMITView on GitHub
Write meaningful tests for TypeScript/React (Vitest) and Rust (cargo test) code.
15 other projects use a version of this.
Adopted by
Most recently taken up by
- raphaeltm/simple-agent-managertheir own version, first seen Sep 29, 2026
- Vinix24/vnx-orchestrationtheir own version, first seen Sep 29, 2026
- smitshivalkar-spectims4567/hsj-agent-skillstheir own version, first seen Sep 29, 2026
- mcabreradev/hermes-sdd-agencytheir own version, first seen Sep 17, 2026
- alizafarbati/opencode-agents-mcptheir own version, first seen Sep 8, 2026
- neeraj181-dot/ClaudeSkillstheir own version, first seen Aug 25, 2026
Used with
Projects with it also use system-architect and security-auditor.
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.
nahisahoSkillsystem-architect
Copilot agent that assists with architecture design, C4 model diagrams, ADR creation, and tradeoff analysis
Also in 3 projects that use this
alirezarezvaniSkillsecurity-auditor
Continuous security vulnerability scanning for OWASP Top 10, common vulnerabilities, and insecure patterns. Use when reviewing code, before deployments, or on file changes. Scans for SQL injection, XSS, secrets exposure, auth issues. Triggers on file changes, security mentions, deployment prep.
Also in 4 projects that use this
Other versions15 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 15
- nahisaho/MUSUBI★ 77same name
- Vinix24/vnx-orchestration★ 62same name
- raphaeltm/simple-agent-manager★ 60same name
- Aizaz-Noor/Agent-Startup-Skills★ 2same name
- batterfried-philosophy172/Agent-Startup-Skills★ 2same name
- JohnJBoren/claude-skills-ecosystem★ 2same name
- ultimatevegance/test-engineer-skill★ 2same name
- alizafarbati/opencode-agents-mcp★ 1same name
- exzm/skills★ 1same name
- mcabreradev/hermes-sdd-agency★ 1same name
5 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.
- vercel-react-best-practices/AGENTS.mdAGENTS.md
- audit-as-a11y-engSkill
- audit-as-backend-engSkill
- audit-as-design-engSkill
- audit-as-dx-engSkill
- audit-as-frontend-engSkill
- audit-as-perf-engSkill
- audit-as-prod-readinessSkill
- audit-as-repo-maintainerSkill
- audit-as-structural-engSkill
- audit-as-ux-engSkill
- blueprint-firstSkill
- component-testSkill
- fazxesSkill
- full-auditSkill
- mosaicSkill
- problem-clarifierSkill
- stress-testSkill
- uiSkill
- vercel-react-best-practicesSkill
- web-design-guidelinesSkill
The file
We split this skill into the rules it gives an agent
11 rules. 0 are common, 4 are distinctive, and 7 are very specific to this project.
0
Common
Most of the 14 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Write tests that fail when implementation breaks.
- Very specific: line 14
Use Read tool to read the entire file.
- Distinctive: line 24
Before writing ANY test code, output:
- Distinctive: line 64
Before writing any assertion, ask: "If I delete the implementation, will this fail?"
- Very specific: line 104
persist: Test partialize returns correct subset, merge handles corruption
- Very specific: line 105
Computed getters: Test functions like getContextPercentage() with known inputs
- Distinctive: line 110
No shared mutable state between tests
- Very specific: line 137
Important: Do NOT use setState(partial, true) unless you're passing the full initial state including actions.
- Very specific: line 141
Immer + Set/Map: If the store uses Set or Map with immer middleware, add at top of test file:
- Very specific: line 175
Key principle: Only mock Tauri if the code under test calls invoke directly.
- Distinctive: line 209
Use the right query for the situation:
“Common” is measured: kept by at least 6 in 10 of the 14 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
Test Engineer Skill
Write tests that fail when implementation breaks. No placeholders, no expect(true).toBe(true).
Process
Step 1: Read the File
Use Read tool to read the entire file. Identify:
- Type: React component, Zustand store, Zod schema, Rust module, Tauri command
- Public API: Exported functions, actions, props, methods
- Dependencies: Imports, external calls (Tauri invoke, APIs)
- Middleware: persist, immer, devtools (for Zustand stores)
- Side effects: API calls, state mutations, filesystem operations
Step 2: Output Analysis (MANDATORY)
Before writing ANY test code, output:
## Analysis: [filename]
**Type:** [React Component | Zustand Store | Zod Schema | Rust Module | Tauri Command]
**Purpose:** [1-2 sentences]
**Middleware:** [persist | immer | none] (if Zustand)
**Public API:**
- `functionName`: [what it does]
**Test Scenarios:**
1. [Happy path]
2. [Edge case]
3. [Error case]
**Skip Testing:**
- [Any pass-through functions or trivial code]Step 3: Write Tests
See references/templates.md for framework-specific templates.
Framework Selection
| File Type | Framework | Mock Strategy |
Zustand Store (/stores/*.ts) | Vitest | Mock @tauri-apps/api/core if store calls invoke |
| Zustand + persist | Vitest | Test partialize and merge callbacks |
React Component (*.tsx) | Vitest + RTL | Custom render with providers |
Zod Schema (/schemas/*.ts) | Vitest | None needed |
Rust Module (*.rs) | cargo test | tempfile for filesystem |
Tauri Command (/commands/*.rs) | #[tokio::test] | tempfile, real backend |
Critical Rules
1. Every Assertion Must Be Meaningful
Before writing any assertion, ask: "If I delete the implementation, will this fail?"
- No → Delete the test or rewrite it
- Yes → Keep it
2. What NOT to Test
Skip these entirely:
- Pure re-exports or pass-through functions
- Type definitions and interfaces
- Constants (unless they affect behavior)
- Auto-generated code
- Private/internal functions (test through public API)
- Logging statements (don't test
logger.debugwas called) - Simple getters/setters with no logic
- Selector hooks that just re-export store slices (e.g.,
useInputMode = () => useStore(s => s.inputMode)) - Third-party library wrappers that add no logic
3. Test Behaviors, Not Implementation
// BAD: Testing internal state shape
expect(store.getState()._internal.cache).toHaveLength(3);
// GOOD: Testing observable behavior
expect(store.getState().items).toHaveLength(3);4. Coverage Requirements
For each public function, test:
- Happy path: Valid input → expected output
- Edge cases: Empty, null, undefined, boundaries, deduplication
- Error cases: Invalid input, failures, exceptions
- Async (if applicable): Loading states, error states, race conditions
For Zustand stores with middleware:
- persist: Test
partializereturns correct subset,mergehandles corruption - Computed getters: Test functions like
getContextPercentage()with known inputs
5. Test Independence
- Reset state in
beforeEach - No shared mutable state between tests
- Each test must pass when run alone
Zustand Reset Pattern:
beforeEach(() => {
// Prefer reset() if the store exports it
const store = useStore;
const state = store.getState();
if ('reset' in state && typeof state.reset === 'function') {
state.reset();
} else if (typeof store.getInitialState === 'function') {
// Zustand v5: restores full initial state including actions
store.setState(store.getInitialState(), true);
} else {
// Last resort: reset known fields WITHOUT replace (avoid dropping actions)
store.setState({
items: [],
isLoading: false,
error: null,
});
}
vi.clearAllMocks();
});Important: Do NOT use setState(partial, true) unless you're passing the full
initial state including actions. Replacing with a partial object will drop
actions and break the store.
Immer + Set/Map: If the store uses Set or Map with immer middleware, add at top of test file:
import { enableMapSet } from 'immer';
enableMapSet();Anti-Patterns (Never Do These)
See references/anti-patterns.md for detailed examples.
// NEVER: Always-passing assertion
it('should work', () => {
const store = useStore.getState();
expect(store).toBeDefined(); // Passes even if store is broken
});
// NEVER: Testing implementation details
it('should set internal flag', () => {
action();
expect(store.getState()._hasLoaded).toBe(true);
});
// NEVER: Placeholder test
it('should handle edge cases', () => {
// TODO: implement
});Tauri-Specific Patterns
See references/tauri-mocks.md for composable mock patterns.
Key principle: Only mock Tauri if the code under test calls invoke directly. Many Zustand stores don't.
Composable invoke mock (accumulates, doesn't overwrite):
import { vi } from 'vitest';
import { invoke } from '@tauri-apps/api/core';
vi.mock('@tauri-apps/api/core', () => ({ invoke: vi.fn() }));
// In test setup file - creates composable mock
const commandMocks = new Map<string, unknown>();
export function mockCommand(cmd: string, response: unknown | Error) {
commandMocks.set(cmd, response);
}
export function clearCommandMocks() {
commandMocks.clear();
}
// Set up once globally
vi.mocked(invoke).mockImplementation(async (cmd: string) => {
if (commandMocks.has(cmd)) {
const response = commandMocks.get(cmd);
if (response instanceof Error) throw response;
return response;
}
throw new Error(`Unmocked command: ${cmd}`);
});React Testing Library Query Guide
Use the right query for the situation:
| Query Type | When to Use | Throws if Missing? |
getBy* | Element should exist NOW | Yes |
findBy* | Element will appear ASYNC | Yes (after timeout) |
queryBy* | Element might NOT exist | No (returns null) |
// Element exists synchronously
expect(screen.getByRole('button')).toBeInTheDocument();
// Element appears after async operation
await waitFor(() => {
expect(screen.getByText('Loaded')).toBeInTheDocument();
});
// OR
const button = await screen.findByRole('button', { name: 'Submit' });
// Assert element does NOT exist
expect(screen.queryByText('Error')).not.toBeInTheDocument();Custom Render with Providers
Most components need providers. Create a custom render:
// src/test/utils.tsx
import { render, type RenderOptions } from '@testing-library/react'
import { ThemeProvider } from '@/providers/theme-provider'
const AllProviders = ({ children }: { children: React.ReactNode }) => (
<ThemeProvider>
{children}
</ThemeProvider>
)
const customRender = (
ui: React.ReactElement,
options?: Omit<RenderOptions, 'wrapper'>
) => render(ui, { wrapper: AllProviders, ...options })
export * from '@testing-library/react'
export { customRender as render }Self-Check Before Finishing
- Every test has meaningful assertion that tests real behavior
- No
expect(true).toBe(true)orexpect(x).toBeDefined()without follow-up - No placeholder/TODO tests
- All public API covered
- Edge cases tested (empty, null, boundaries, deduplication)
- Error cases tested
- State reset in
beforeEach(usingreset()or manual setState) - Tests independent (no shared mutable state)
- Middleware tested if applicable (persist partialize/merge)
- Computed getters tested if they have logic
Running Tests
Frontend Apps (Vitest):
bun run test # Run all frontend tests
bun run test apps/agent/src/path/to/test.ts # Run specific file
bun run test:watch # Watch mode
bun run test:coverage # With coverage reportNote: Uses Vitest with jsdom for DOM/React testing. Config:
vitest.config.ts
agent-bridge (Bun Test):
cd agent-bridge && bun test # Bun runtime tests (no jsdom)Rust Backend (Cargo):
cargo test # Run all Rust tests
cargo test test_function_name # Run specific test
cargo test -- --nocapture # Show println! outputDoes 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.

