一键导入
testing-helper
Create comprehensive tests for elizaOS plugins, characters, and actions. Triggers on "create tests", "test elizaOS plugin", or "write agent tests"
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create comprehensive tests for elizaOS plugins, characters, and actions. Triggers on "create tests", "test elizaOS plugin", or "write agent tests"
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Helps create, analyze, and maintain Architecture Decision Records
Generates comprehensive API documentation including OpenAPI/Swagger specs, endpoint descriptions, request/response examples, and integration guides. Use when documenting APIs.
Generate complete elizaOS character configurations with personality, knowledge, and plugin setup. Triggers when user asks to "create character", "generate agent config", or "build elizaOS character"
Execute the proper Drizzle Kit workflow for database schema migrations in asset-forge. Use this when the user asks to create a database migration, update the database schema, or when schema changes need to be applied to the database.
Integrates Lighthouse CI for automated performance testing, Core Web Vitals tracking, and regression detection in CI/CD pipelines. Use when user asks to "setup Lighthouse CI", "add performance testing", "monitor Core Web Vitals", or "prevent performance regressions".
Sets up visual regression testing using Percy, Chromatic, or Playwright to catch unintended UI changes through screenshot comparison. Use when user asks to "setup visual testing", "add screenshot tests", "prevent visual bugs", or "setup Percy/Chromatic".
| name | testing-helper |
| description | Create comprehensive tests for elizaOS plugins, characters, and actions. Triggers on "create tests", "test elizaOS plugin", or "write agent tests" |
| allowed-tools | ["Write","Read","Edit"] |
Generate comprehensive test suites for elizaOS components with unit, integration, and E2E tests.
__tests__/
├── unit/
│ ├── actions.test.ts
│ ├── providers.test.ts
│ ├── evaluators.test.ts
│ └── services.test.ts
├── integration/
│ ├── plugin.test.ts
│ └── character.test.ts
└── e2e/
└── agent-flow.test.ts
import { describe, it, expect, beforeEach } from 'vitest';
import { myAction } from '../src/actions/myAction';
import { createMockRuntime, createMockMessage } from '@elizaos/core/test';
describe('MyAction', () => {
let runtime: any;
let message: any;
beforeEach(() => {
runtime = createMockRuntime();
message = createMockMessage();
});
it('validates correct input', async () => {
const valid = await myAction.validate(runtime, message);
expect(valid).toBe(true);
});
it('rejects invalid input', async () => {
message.content = {};
const valid = await myAction.validate(runtime, message);
expect(valid).toBe(false);
});
it('executes successfully', async () => {
const result = await myAction.handler(runtime, message);
expect(result).toBeDefined();
});
it('handles errors gracefully', async () => {
runtime.createMemory = () => { throw new Error('Test error'); };
const result = await myAction.handler(runtime, message);
expect(result).toContain('failed');
});
});
describe('MyProvider', () => {
it('returns valid data', async () => {
const result = await myProvider.get(runtime, message);
expect(result).toHaveProperty('values');
expect(result).toHaveProperty('data');
expect(result).toHaveProperty('text');
expect(typeof result.text).toBe('string');
});
it('handles missing data', async () => {
const result = await myProvider.get(runtime, null);
expect(result.text).toBe('');
});
});
describe('Character Configuration', () => {
it('has required fields', () => {
expect(character.name).toBeDefined();
expect(character.bio).toBeDefined();
});
it('has valid plugins', () => {
expect(character.plugins).toContain('@elizaos/plugin-bootstrap');
});
it('has valid message examples', () => {
character.messageExamples?.forEach(conversation => {
expect(Array.isArray(conversation)).toBe(true);
conversation.forEach(msg => {
expect(msg).toHaveProperty('name');
expect(msg).toHaveProperty('content');
});
});
});
});
describe('Plugin Integration', () => {
let runtime: AgentRuntime;
beforeAll(async () => {
runtime = new AgentRuntime({
character: testCharacter,
plugins: [myPlugin]
});
await runtime.initialize();
});
afterAll(async () => {
await runtime.stop();
});
it('loads plugin correctly', () => {
expect(runtime.plugins).toContain(myPlugin);
});
it('registers actions', () => {
const action = runtime.actions.find(a => a.name === 'MY_ACTION');
expect(action).toBeDefined();
});
});
describe('Agent Flow', () => {
it('processes message end-to-end', async () => {
const response = await runtime.processMessage({
content: { text: 'Hello' },
senderId: 'user-1',
roomId: 'room-1'
});
expect(response.content.text).toBeDefined();
});
});