From enterprise
Knowledge skill for testing patterns and best practices. Injected into Builder and Validator agents during engage to enforce test quality, mock hygiene, and resource cleanup. Not user-invocable.
How this skill is triggered — by the user, by Claude, or both
Slash command
/enterprise:testing-patternsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This knowledge skill provides context about testing standards and best practices. Injected into Builder (Scotty) and Validator (McCoy) agents during engage.
This knowledge skill provides context about testing standards and best practices. Injected into Builder (Scotty) and Validator (McCoy) agents during engage.
feature.test.ts next to feature.tsdescribe/it blocks with descriptive namesimport { describe, it, expect, beforeEach, afterEach } from 'bun:test';
describe('featureName', () => {
describe('methodName', () => {
it('should handle the happy path', () => {
// arrange, act, assert
});
it('should throw when input is invalid', () => {
expect(() => methodName(null)).toThrow('input is required');
});
});
});
describe blocks: feature or method nameit blocks: should {expected behavior} -- describe the outcome, not the implementationtest() -- use it() for consistencyEvery mock MUST be cleaned up in afterEach. Leaked mocks cause flaky tests.
let mockRestore: () => void;
beforeEach(() => {
const mock = mockStdio();
mockRestore = mock.restore;
});
afterEach(() => {
mockRestore();
});
jest.mock() / mock.module() unless absolutely necessaryafterEachlet cleanup: () => void;
beforeEach(() => {
const tmp = createTempDir();
cleanup = tmp.cleanup;
});
afterEach(() => {
cleanup();
});
If a test spawns a process, kill it in afterEach:
afterEach(() => {
if (proc) proc.kill();
});
Servers, file handles, database connections -- close in afterEach.
describe/it with descriptive namesafterEachcreateTempDir() from core for file system testsafterEach cleanup for mocks, temp dirs, or processestest() instead of it()npx claudepluginhub nathanvale/side-quest-plugins --plugin enterpriseGuides writing and reviewing tests with philosophy, Arrange-Act-Assert structure, condition-based waiting via polling, strategic mocking, and isolation principles.
Provides strategies for writing maintainable unit, integration, and E2E tests using AAA pattern, mocking, test naming, and organization. Useful for TDD and test infrastructure.
Provides Jest testing patterns for unit tests, mocks, spies, snapshots, setup/teardown, and matchers including equality, truthiness, numbers, strings, and arrays.