Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/matteocervelli/llms/jest-generatornpx skills add matteocervelli/llms --skill jest-generatorgit clone --depth 1 https://github.com/matteocervelli/llmsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/matteocervelli/llms/jest-generator)<a href="https://agentmods.dev/skills/matteocervelli/llms/jest-generator"><img src="https://agentmods.dev/badge/skills/matteocervelli/llms/jest-generator.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00032 | $0.04018 |
| Opus 5 | $0.00016 | $0.02009 |
| Sonnet 5 | $0.00006 | $0.00804 |
| Haiku 4.5 | $0.00003 | $0.00402 |
Grade A, and why
jest-generator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 741 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Jest Generator Skill
Purpose
This skill generates Jest-based unit tests for JavaScript and TypeScript code, following Jest conventions, best practices, and project standards. It creates comprehensive test suites with proper mocking, describe blocks, and code organization.
When to Use
- Generate Jest tests for JavaScript/TypeScript modules
- Create test files for React components
- Add missing test coverage to existing JS/TS code
- Need Jest-specific patterns (mocks, spies, snapshots)
Test File Naming Convention
Source to Test Mapping:
- Source:
src/components/Feature.tsx - Test:
src/components/Feature.test.tsx - Pattern:
<source_filename>.test.tsor<source_filename>.test.js
Examples:
src/utils/validator.ts→src/utils/validator.test.tssrc/models/User.ts→src/models/User.test.tssrc/services/api.js→src/services/api.test.jssrc/components/Button.tsx→src/components/Button.test.tsx
Jest Test Generation Workflow
1. Analyze JavaScript/TypeScript Source Code
Read the source file:
# Read the source to understand structure
cat src/components/Feature.tsx
Identify test targets:
- Exported functions to test
- Classes and methods
- React components (if applicable)
- Error conditions
- Edge cases
- Dependencies and imports
Output: List of functions/classes/components requiring tests
2. Generate Test File Structure
Create test file with proper naming:
/**
* Unit tests for [module name]
*
* Tests cover:
* - [Functionality 1]
* - [Functionality 2]
* - Error handling and edge cases
*/
import { functionToTest, ClassToTest, ComponentToTest } from './Feature';
import { mockDependency } from './__mocks__/dependency';
// Mock external dependencies
jest.mock('./dependency');
jest.mock('external-library');
// ============================================================================
// Test Setup
// ============================================================================
describe('ModuleName', () => {
// Setup before each test
beforeEach(() => {
jest.clearAllMocks();
});
// Cleanup after each test
afterEach(() => {
jest.restoreAllMocks();
});
// ========================================================================
// Class Tests
// ========================================================================
describe('ClassName', () => {
let instance: ClassToTest;
beforeEach(() => {
instance = new ClassToTest();
});
describe('constructor', () => {
it('should initialize with valid parameters', () => {
// Arrange & Act
const instance = new ClassToTest({ param: 'value' });
// Assert
expect(instance.param).toBe('value');
expect(instance.initialized).toBe(true);
});
it('should throw error with invalid parameters', () => {
// Arrange
const invalidParams = null;
// Act & Assert
expect(() => new ClassToTest(invalidParams)).toThrow('Invalid parameters');
});
});
describe('method', () => {
it('should return expected result with valid input', () => {
// Arrange
const input = { name: 'test', value: 123 };
// Act
const result = instance.method(input);
// Assert
expect(result.processed).toBe(true);
expect(result.name).toBe('test');
expect(result.value).toBe(123);
});
it('should throw error with invalid input', () => {
// Arrange
const invalidInput = null;
// Act & Assert
expect(() => instance.method(invalidInput)).toThrow('Invalid input');
});
it('should handle edge case with empty input', () => {
// Arrange
const emptyInput = {};
// Act
const result = instance.method(emptyInput);
// Assert
expect(result).toEqual({});
});
});
});
// ========================================================================
// Function Tests
// ========================================================================
describe('functionToTest', () => {
it('should return expected result with valid input', () => {
// Arrange
const input = { key: 'value' };
const expected = { processed: true, key: 'value' };
// Act
const result = functionToTest(input);
// Assert
expect(result).toEqual(expected);
});
it('should handle null input', () => {
// Arrange
const input = null;
// Act & Assert
expect(() => functionToTest(input)).toThrow('Input cannot be null');
});
it('should handle undefined input', () => {
// Arrange
const input = undefined;
// Act
const result = functionToTest(input);
// Assert
expect(result).toBeUndefined();
});
});
// ========================================================================
// Tests with Mocks
// ========================================================================
describe('functionWithDependency', () => {
it('should call dependency with correct parameters', () => {
// Arrange
const input = { key: 'value' };
const mockDep = jest.fn().mockReturnValue({ status: 'success' });
// Act
const result = functionWithDependency(input, mockDep);
// Assert
expect(mockDep).toHaveBeenCalledWith(input);
expect(mockDep).toHaveBeenCalledTimes(1);
expect(result.status).toBe('success');
});
it('should handle dependency error', () => {
// Arrange
const input = { key: 'value' };
const mockDep = jest.fn().mockRejectedValue(new Error('API error'));
// Act & Assert
await expect(functionWithDependency(input, mockDep))
.rejects.toThrow('API error');
});
});
// ========================================================================
// Async Tests
// ========================================================================
describe('asyncFunction', () => {
it('should resolve with expected result', async () => {
// Arrange
const input = { key: 'value' };
// Act
const result = await asyncFunction(input);
// Assert
expect(result.success).toBe(true);
expect(result.data).toEqual(input);
});
it('should reject with error on failure', async () => {
// Arrange
const invalidInput = null;
// Act & Assert
await expect(asyncFunction(invalidInput))
.rejects.toThrow('Invalid input');
});
it('should handle timeout', async () => {
// Arrange
jest.useFakeTimers();
const promise = asyncFunctionWithTimeout();
// Act
jest.advanceTimersByTime(5000);
// Assert
await expect(promise).rejects.toThrow('Timeout');
jest.useRealTimers();
});
});
// ========================================================================
// Parametrized Tests (using test.each)
// ========================================================================
describe('validation', () => {
it.each([
['[email protected]', true],
['invalid.email', false],
['', false],
[null, false],
['@no-user.com', false],
])('should validate email "%s" as %s', (email, expected) => {
// Act
const result = validateEmail(email);
// Assert
expect(result).toBe(expected);
});
});
describe('permissions', () => {
it.each([
['admin', 'all'],
['moderator', 'edit'],
['user', 'read'],
['guest', 'none'],
])('should return "%s" permission for %s user', (userType, expected) => {
// Arrange
const user = { type: userType };
// Act
const result = getPermissions(user);
// Assert
expect(result).toBe(expected);
});
});
});
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 741 lines · 32 tokens per session scan A 5e5110e8bf1d
jest-generator is a skill published in the GitHub repository matteocervelli/llms (25 stars, last pushed 3mo ago), licensed MIT. It adds 32 tokens to every session and 4,018 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.
Other skills, from other repositories
test-bridge
Bridge Server (TypeScript) のテスト実行・型チェック・テスト記述ガイド.
jest-unit
Unit testing skill using Jest for TypeScript and JavaScript, covering mocking, spies, snapshots, coverage, async testing, and custom matchers.
jest
Jest testing best practices for JavaScript and TypeScript applications, covering test structure, mocking, and assertion patterns.
typescript-testing
Applies repository-aware TypeScript test design, behavior evidence, isolation, and mock-boundary criteria. Use when writing or reviewing unit tests.
vitest-skill
Generates Vitest tests in JavaScript/TypeScript with Vite-native speed. Jest-compatible API with ESM support and HMR. Use when user mentions "Vitest", "vi.mock", "vitest.config". Triggers on: "Vitest", "vi.mock", "vi.fn", "Vite test", "vitest config".
phoenix-client-development
Development guide for the @arizeai/phoenix-client TypeScript SDK — run and resume experiments, manage OpenTelemetry tracer providers with stack-based attach/detach, and write vitest unit and integration tests. Use when adding features to phoenix-client, debugging experiment lifecycle or provider cleanup, modifying…