Test and verify AI orchestrator features using CLI runner, unit tests, and E2E tests. ALWAYS use this skill when: implementing new features, fixing bugs, making changes to agents/orchestrator/TUI, or when asked to verify something works. Claude MUST test changes before marking tasks complete.
Never ship untested code. Before marking ANY task as complete, you MUST:
The CLI lets you send messages and see responses WITHOUT the interactive TUI:
# Basic usage - send a message and see the response
npm run cli -- "Create a PRD for user authentication"
# With verbose output (shows status messages)
npm run cli -- --verbose "Create a PRD for auth"
# JSON output (for programmatic verification)
npm run cli -- --json "Test message"
# Custom timeout (default is 120 seconds)
npm run cli -- --timeout 60000 "Quick test"
Use this to verify:
# Run all unit tests
npm test
# Watch mode during development
npm run test:watch
# With coverage report
npm run test:coverage
Test locations:
packages/shared/src/__tests__/ - Type helpers, event creatorspackages/orchestrator/src/__tests__/ - Router, classificationpackages/agents/src/__tests__/ - Agent logic# Run E2E tests (auto-manages backend lifecycle)
npm run test:e2e
Location: packages/e2e/src/__tests__/
These tests start the backend, send real messages through queues, and verify responses.
Before coding: Understand what tests exist
npm test # See current test status
During development: Use CLI to verify changes
npm run cli -- --verbose "Test the new feature"
After implementation: Add tests
Before completing: Run full test suite
npm test && npm run cli -- "Verify feature works"
npm testnpm test to establish baselinepackages/shared/)src/__tests__/types.test.ts, src/__tests__/events.test.tspackages/orchestrator/)packages/agents/)packages/tui/)Before marking a task complete, verify:
npm test passes (all unit tests)Say you modified the intent classification. Here's how to verify:
# 1. Run unit tests
npm test
# 2. Test classification via CLI
npm run cli -- --verbose "Create a PRD for authentication"
# Should show: [Status] Understanding your request...
# Should route to: product-manager
# 3. Test edge case
npm run cli -- --verbose "random gibberish text"
# Should show error response about not understanding
# 4. If you added new intent type, add test:
# packages/orchestrator/src/__tests__/router.test.ts
import { describe, it, expect } from 'vitest';
describe('MyFeature', () => {
it('does something correctly', () => {
const result = myFunction('input');
expect(result).toBe('expected');
});
it('handles edge cases', () => {
expect(() => myFunction(null)).toThrow();
});
});
import { describe, it, expect } from 'vitest';
import { sendTestMessage } from '@ai-orchestrator/test-utils';
describe('E2E: MyFeature', () => {
it('works end-to-end', async () => {
const response = await sendTestMessage('Test my feature', {
timeout: 60000,
verbose: true,
});
expect(response.status).toBe('complete');
expect(response.parts[0].content).toContain('expected text');
});
});