test-specialist
Skill1 starsChanged 3 months agoMITView on GitHub
This skill should be used when writing test cases, fixing bugs, analyzing code for potential issues, or improving test coverage for JavaScript/TypeScript applications. Use this for unit tests, integration tests, end-to-end tests, debugging runtime errors, logic bugs, performance issues, security vulnerabilities, and systematic code analysis.
- Deletes or force-pushes
2 other projects use a version of this.
Adopted by
Most recently taken up by
- daryllundy/claude-skills-librarytheir own version, first seen Mar 20, 2026
- travisjneuman/.claudetheir own version, first seen Feb 25, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- travisjneuman/.claude★ 101same name
- daryllundy/claude-skills-library★ 1same name
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 repository198 other files it gives its agents.
- activecampaignSkill
- adcp-advertisingSkill
- admapixSkill
- aegis-auditSkill
- afrexai-compliance-auditSkill
- afrexai-seo-content-engineSkill
- agent-browserSkill
- Agentic CodingSkill
- agent-overflowSkill
- agent-skills-toolsSkill
- ai-ppt-generatorSkill
- airdrop-hunterSkill
- ai-web-automationSkill
- alicloud-ai-video-wan-r2vSkill
- alpha-finderSkill
- amap-trafficSkill
- amazon-product-api-skillSkill
- apertureSkill
- api-developmentSkill
- api-gatewaySkill
- asterSkill
- auto-replySkill
- auto-updater-gatewaySkill
- aviation-weatherSkill
- awwwards-designSkill
- base-8004Skill
- bioskillsSkill
- brainrepoSkill
- browserless-agentSkill
- browser-secureSkill
- btc15-autonomous-marketSkill
- buy-anythingSkill
- byteroverSkill
- cal-com-automationSkill
- capability-evolverSkill
- catalogSkill
- chargebeeSkill
- clawcostSkill
- clawdbot-documentation-expertSkill
- clawdbot-for-vcsSkill
- clawddocsSkill
- claw-syncSkill
- claw-trader-liteSkill
- clean-codeSkill
- cloudphoneSkill
- codebergSkill
- code-mentorSkill
- commit-analyzerSkill
- competitor-analysis-reportSkill
- content-ideas-generatorSkill
- content-ideasSkill
- contract-generatorSkill
- conventional-commitsSkill
- copywritingSkill
- crypto-payments-ecommerceSkill
- custom-smtp-senderSkill
- dashboard-manager2Skill
- data-analystSkill
- docker-sandboxSkill
- elite-longterm-memorySkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
29 rules. About 0 are common, 27 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈27
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Write comprehensive tests covering unit, integration, and end-to-end scenarios.
- Distinctive: line 56
Test one behavior per test
- Distinctive: line 58
Use descriptive test names that explain the scenario
- Distinctive: line 59
Keep tests independent and isolated
- Distinctive: line 63
Test how components work together, including database, API, and service interactions:
- Distinctive: line 105
Test complete user workflows using tools like Playwright or Cypress:
- Distinctive: line 132
Document exact steps to trigger
- Distinctive: line 138
Create minimal reproduction case
- Distinctive: line 143
Check assumptions and preconditions
- Distinctive: line 147
Write failing test first (TDD)
- Distinctive: line 152
Run full test suite
- Distinctive: line 205
Test for common security issues:
- Distinctive: line 233
Test for performance problems:
- Distinctive: line 253
Use parameterized tests to catch edge cases:
- Distinctive: line 271
Use automated tools to identify gaps in test coverage.
- Distinctive: line 275
Run the provided script to identify source files without tests:
- Distinctive: line 296
Run the coverage analysis script after generating coverage:
- Distinctive: line 319
Ensure tests remain valuable and maintainable.
- Distinctive: line 381
Follow this decision tree to determine the testing approach:
- Distinctive: line 394
Write failing test demonstrating bug
- Very specific: line 401
Run find_untested_code.py to identify gaps
- Very specific: line 402
Run analyze_coverage.py on coverage reports
- Distinctive: line 404
Write tests for untested code
- Distinctive: line 409
Check for security vulnerabilities
- Distinctive: line 410
Test edge cases and error handling
- Distinctive: line 491
Test file coverage percentage
- Distinctive: line 499
Keep tests independent: - no shared state between tests
- Distinctive: line 500
Use descriptive names: - test names should explain the scenario
- Distinctive: line 504
Fix failing tests immediately: - never commit broken tests
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Test Specialist
Overview
Apply systematic testing methodologies and debugging techniques to JavaScript/TypeScript applications. This skill provides comprehensive testing strategies, bug analysis frameworks, and automated tools for identifying coverage gaps and untested code.
Core Capabilities
1. Writing Test Cases
Write comprehensive tests covering unit, integration, and end-to-end scenarios.
Unit Testing Approach
Structure tests using the AAA pattern (Arrange-Act-Assert):
describe('ExpenseCalculator', () => {
describe('calculateTotal', () => {
test('sums expense amounts correctly', () => {
// Arrange
const expenses = [
{ amount: 100, category: 'food' },
{ amount: 50, category: 'transport' },
{ amount: 25, category: 'entertainment' }
];
// Act
const total = calculateTotal(expenses);
// Assert
expect(total).toBe(175);
});
test('handles empty expense list', () => {
expect(calculateTotal([])).toBe(0);
});
test('handles negative amounts', () => {
const expenses = [
{ amount: 100, category: 'food' },
{ amount: -50, category: 'refund' }
];
expect(calculateTotal(expenses)).toBe(50);
});
});
});Key principles:
- Test one behavior per test
- Cover happy path, edge cases, and error conditions
- Use descriptive test names that explain the scenario
- Keep tests independent and isolated
Integration Testing Approach
Test how components work together, including database, API, and service interactions:
describe('ExpenseAPI Integration', () => {
beforeAll(async () => {
await database.connect(TEST_DB_URL);
});
afterAll(async () => {
await database.disconnect();
});
beforeEach(async () => {
await database.clear();
await seedTestData();
});
test('POST /expenses creates expense and updates total', async () => {
const response = await request(app)
.post('/api/expenses')
.send({
amount: 50,
category: 'food',
description: 'Lunch'
})
.expect(201);
expect(response.body).toMatchObject({
id: expect.any(Number),
amount: 50,
category: 'food'
});
// Verify database state
const total = await getTotalExpenses();
expect(total).toBe(50);
});
});End-to-End Testing Approach
Test complete user workflows using tools like Playwright or Cypress:
test('user can track expense from start to finish', async ({ page }) => {
// Navigate to app
await page.goto('/');
// Add new expense
await page.click('[data-testid="add-expense-btn"]');
await page.fill('[data-testid="amount"]', '50.00');
await page.selectOption('[data-testid="category"]', 'food');
await page.fill('[data-testid="description"]', 'Lunch');
await page.click('[data-testid="submit"]');
// Verify expense appears in list
await expect(page.locator('[data-testid="expense-item"]')).toContainText('Lunch');
await expect(page.locator('[data-testid="total"]')).toContainText('$50.00');
});2. Systematic Bug Analysis
Apply structured debugging methodology to identify and fix issues.
Five-Step Analysis Process
- Reproduction: Reliably reproduce the bug
- Document exact steps to trigger
- Identify required environment/state
- Note expected vs actual behavior
- Isolation: Narrow down the problem
- Binary search through code path
- Create minimal reproduction case
- Remove unrelated dependencies
- Root Cause Analysis: Determine underlying cause
- Trace execution flow
- Check assumptions and preconditions
- Review recent changes (git blame)
- Fix Implementation: Implement solution
- Write failing test first (TDD)
- Implement the fix
- Verify test passes
- Validation: Ensure completeness
- Run full test suite
- Test edge cases
- Verify no regressions
Common Bug Patterns
Race Conditions:
// Test concurrent operations
test('handles concurrent updates correctly', async () => {
const promises = Array.from({ length: 100 }, () =>
incrementExpenseCount()
);
await Promise.all(promises);
expect(getExpenseCount()).toBe(100);
});Null/Undefined Errors:
// Test null safety
test.each([null, undefined, '', 0, false])
('handles invalid input: %p', (input) => {
expect(() => processExpense(input)).toThrow('Invalid expense');
});Off-by-One Errors:
// Test boundaries explicitly
describe('pagination', () => {
test('handles empty list', () => {
expect(paginate([], 1, 10)).toEqual([]);
});
test('handles single item', () => {
expect(paginate([item], 1, 10)).toEqual([item]);
});
test('handles last page with partial items', () => {
const items = Array.from({ length: 25 }, (_, i) => i);
expect(paginate(items, 3, 10)).toHaveLength(5);
});
});3. Identifying Potential Issues
Proactively identify issues before they become bugs.
Security Vulnerabilities
Test for common security issues:
describe('security', () => {
test('prevents SQL injection', async () => {
const malicious = "'; DROP TABLE expenses; --";
await expect(
searchExpenses(malicious)
).resolves.not.toThrow();
});
test('sanitizes XSS in descriptions', () => {
const xss = '<script>alert("xss")</script>';
const expense = createExpense({ description: xss });
expect(expense.description).not.toContain('<script>');
});
test('requires authentication for expense operations', async () => {
await request(app)
.post('/api/expenses')
.send({ amount: 50 })
.expect(401);
});
});Performance Issues
Test for performance problems:
test('processes large expense list efficiently', () => {
const largeList = Array.from({ length: 10000 }, (_, i) => ({
amount: i,
category: 'test'
}));
const start = performance.now();
const total = calculateTotal(largeList);
const duration = performance.now() - start;
expect(duration).toBeLessThan(100); // Should complete in <100ms
expect(total).toBe(49995000);
});Logic Errors
Use parameterized tests to catch edge cases:
test.each([
// [input, expected, description]
[[10, 20, 30], 60, 'normal positive values'],
[[0, 0, 0], 0, 'all zeros'],
[[-10, 20, -5], 5, 'mixed positive and negative'],
[[0.1, 0.2], 0.3, 'decimal precision'],
[[Number.MAX_SAFE_INTEGER], Number.MAX_SAFE_INTEGER, 'large numbers'],
])('calculateTotal(%p) = %p (%s)', (amounts, expected, description) => {
const expenses = amounts.map(amount => ({ amount, category: 'test' }));
expect(calculateTotal(expenses)).toBeCloseTo(expected);
});4. Test Coverage Analysis
Use automated tools to identify gaps in test coverage.
Finding Untested Code
Run the provided script to identify source files without tests:
python3 scripts/find_untested_code.py srcThe script will:
- Scan source directory for all code files
- Identify which files lack corresponding test files
- Categorize untested files by type (components, services, utils, etc.)
- Prioritize files that need testing most
Interpretation:
- API/Services: High priority - test business logic and data operations
- Models: High priority - test data validation and transformations
- Hooks: Medium priority - test stateful behavior
- Components: Medium priority - test complex UI logic
- Utils: Low priority - test as needed for complex functions
Analyzing Coverage Reports
Run the coverage analysis script after generating coverage:
# Generate coverage (using Jest example)
npm test -- --coverage
# Analyze coverage gaps
python3 scripts/analyze_coverage.py coverage/coverage-final.jsonThe script identifies:
- Files below coverage threshold (default 80%)
- Statement, branch, and function coverage percentages
- Priority files to improve
Coverage targets:
- Critical paths: 90%+ coverage
- Business logic: 85%+ coverage
- UI components: 75%+ coverage
- Utilities: 70%+ coverage
5. Test Maintenance and Quality
Ensure tests remain valuable and maintainable.
Test Code Quality Principles
DRY (Don't Repeat Yourself):
// Extract common setup
function createTestExpense(overrides = {}) {
return {
amount: 50,
category: 'food',
description: 'Test expense',
date: new Date('2024-01-01'),
...overrides
};
}
test('filters by category', () => {
const expenses = [
createTestExpense({ category: 'food' }),
createTestExpense({ category: 'transport' }),
];
// ...
});Clear test data:
// Bad: Magic numbers
expect(calculateDiscount(100, 0.15)).toBe(85);
// Good: Named constants
const ORIGINAL_PRICE = 100;
const DISCOUNT_RATE = 0.15;
const EXPECTED_PRICE = 85;
expect(calculateDiscount(ORIGINAL_PRICE, DISCOUNT_RATE)).toBe(EXPECTED_PRICE);Avoid test interdependence:
// Bad: Tests depend on execution order
let sharedState;
test('test 1', () => {
sharedState = { value: 1 };
});
test('test 2', () => {
expect(sharedState.value).toBe(1); // Depends on test 1
});
// Good: Independent tests
test('test 1', () => {
const state = { value: 1 };
expect(state.value).toBe(1);
});
test('test 2', () => {
const state = { value: 1 };
expect(state.value).toBe(1);
});Workflow Decision Tree
Follow this decision tree to determine the testing approach:
- Adding new functionality?
- Yes → Write tests first (TDD)
- Write failing test
- Implement feature
- Verify test passes
- Refactor
- No → Go to step 2
- Yes → Write tests first (TDD)
- Fixing a bug?
- Yes → Apply bug analysis process
- Reproduce the bug
- Write failing test demonstrating bug
- Fix the implementation
- Verify test passes
- No → Go to step 3
- Yes → Apply bug analysis process
- Improving test coverage?
- Yes → Use coverage tools
- Run
find_untested_code.pyto identify gaps - Run
analyze_coverage.pyon coverage reports - Prioritize critical paths
- Write tests for untested code
- Run
- No → Go to step 4
- Yes → Use coverage tools
- Analyzing code quality?
- Yes → Systematic review
- Check for security vulnerabilities
- Test edge cases and error handling
- Verify performance characteristics
- Review error handling
- Yes → Systematic review
Testing Frameworks and Tools
Recommended Stack
Unit/Integration Testing:
- Jest or Vitest for test runner
- Testing Library for React components
- Supertest for API testing
- MSW (Mock Service Worker) for API mocking
E2E Testing:
- Playwright or Cypress
- Page Object Model pattern
Coverage:
- Istanbul (built into Jest/Vitest)
- Coverage reports in JSON format
Running Tests
# Run all tests
npm test
# Run with coverage
npm test -- --coverage
# Run specific test file
npm test -- ExpenseCalculator.test.ts
# Run in watch mode
npm test -- --watch
# Run E2E tests
npm run test:e2eReference Documentation
For detailed patterns and techniques, refer to:
references/testing_patterns.md- Comprehensive testing patterns, best practices, and code examplesreferences/bug_analysis.md- In-depth bug analysis framework, common bug patterns, and debugging techniques
These references contain extensive examples and advanced techniques. Load them when:
- Dealing with complex testing scenarios
- Need specific pattern implementations
- Debugging unusual issues
- Seeking best practices for specific situations
Scripts
analyze_coverage.py
Analyze Jest/Istanbul coverage reports to identify gaps:
python3 scripts/analyze_coverage.py [coverage-file]Automatically finds common coverage file locations if not specified.
Output:
- Files below coverage threshold
- Statement, branch, and function coverage percentages
- Priority files to improve
find_untested_code.py
Find source files without corresponding test files:
python3 scripts/find_untested_code.py [src-dir] [--pattern test|spec]Output:
- Total source and test file counts
- Test file coverage percentage
- Untested files categorized by type (API, services, components, etc.)
- Recommendations for prioritization
Best Practices Summary
- Write tests first (TDD) when adding new features
- Test behavior, not implementation - tests should survive refactoring
- Keep tests independent - no shared state between tests
- Use descriptive names - test names should explain the scenario
- Cover edge cases - null, empty, boundary values, error conditions
- Mock external dependencies - tests should be fast and reliable
- Maintain high coverage - 80%+ for critical code
- Fix failing tests immediately - never commit broken tests
- Refactor tests - apply same quality standards as production code
- Use tools - automate coverage analysis and gap identification
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.

