Files
skillkit/e2e/onboarding-ui.e2e.test.ts
Rohit Ghumare f11de2ac63 feat: add 12 missing AI coding agents (32 to 44) (#56)
* feat: add 12 missing AI coding agents (Devin, Aider, Cody, Amazon Q, Augment, Replit, Bolt, Lovable, Tabby, Tabnine, CodeGPT, PlayCode)

Expands agent support from 32 to 44 agents across all packages:
- Core types, configs, discovery paths, format maps, command generator
- Agent adapters (UniversalAdapter for all new agents)
- CLI onboarding icons/names, TUI symbols/logos
- Updated all docs, tests, and e2e references from 32 to 44

* test: add comprehensive tests for new agents, update docs and e2e

- Add it.each tests for all 12 new agent adapters and configs
- Add completeness test ensuring every AgentType has adapter + config
- Update agents.mdx doc table with all 12 new agents
- Update e2e onboarding test with new agent display names

* fix: add all 44 agents to translateSkillToAll and fix e2e test

- translateSkillToAll had hardcoded 17-agent list, now includes all 44
- e2e/skill-translator test was missing cline-zencoder batch in SUPPORTED_AGENTS

* fix: replace UniversalAdapter with GenericAgentAdapter for all non-universal agents

UniversalAdapter hardcoded type='universal', skillsDir='skills', and
name='Universal (Any Agent)' for all 26 agents that used it. This caused
skills to install to wrong directories and agents to be undetectable.

GenericAgentAdapter reads type, skillsDir, configFile from AGENT_CONFIG
and checks agent-specific directories in isDetected(). Fixes both the
12 new agents and the 14 pre-existing ones (cline through zencoder).

115 adapter tests now verify correct type, skillsDir, configFile, and
name for every GenericAgentAdapter instance.
2026-02-09 20:21:54 +00:00

299 lines
9.0 KiB
TypeScript

/**
* E2E Tests: Onboarding UI
*
* Tests for the new @clack/prompts based CLI onboarding experience
*/
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
import { join } from 'node:path';
import { mkdirSync, writeFileSync } from 'node:fs';
import {
runCli,
createTestDir,
cleanupTestDir,
createTestSkill,
testFileExists,
} from './helpers/cli-runner.js';
describe('E2E: Onboarding UI', () => {
let testDir: string;
beforeEach(() => {
testDir = createTestDir();
});
afterEach(() => {
cleanupTestDir(testDir);
});
describe('skillkit init --list', () => {
it('should display agents with icons', async () => {
const result = await runCli(['init', '--list']);
const output = result.stdout + result.stderr;
// Should show agent icons
expect(output).toContain('Claude Code');
expect(output).toContain('Cursor');
expect(output).toContain('Codex');
// Should show Skills dir info
expect(output).toContain('Skills dir');
expect(output).toContain('Config');
// Should complete successfully
expect(result.success).toBe(true);
});
it('should display all 44 agents', async () => {
const result = await runCli(['init', '--list']);
const output = result.stdout + result.stderr;
const agents = [
'Claude Code',
'Cursor',
'Codex',
'Gemini',
'OpenCode',
'Copilot',
'Windsurf',
'Droid',
'Goose',
'Amp',
'Kilo',
'Kiro',
'Roo',
'Trae',
'Antigravity',
'Clawdbot',
'Universal',
'Cline',
'CodeBuddy',
'CommandCode',
'Continue',
'Crush',
'Factory',
'MCPJam',
'Mux',
'Neovate',
'OpenHands',
'Pi',
'Qoder',
'Qwen',
'Vercel',
'Zencoder',
'Devin',
'Aider',
'Cody',
'Amazon Q',
'Augment',
'Replit',
'Bolt',
'Lovable',
'Tabby',
'Tabnine',
'CodeGPT',
'PlayCode',
];
for (const agent of agents) {
expect(output.toLowerCase()).toContain(agent.toLowerCase());
}
});
});
describe('skillkit install --list', () => {
it('should list skills with visual formatting', async () => {
// Create a test repo-like structure
const skillsDir = join(testDir, 'test-skills');
mkdirSync(skillsDir, { recursive: true });
createTestSkill(skillsDir, 'skill-one');
createTestSkill(skillsDir, 'skill-two');
const result = await runCli(['install', testDir, '--list'], { cwd: testDir });
const output = result.stdout + result.stderr;
// Should show skills found
expect(output.toLowerCase()).toMatch(/skill|found|available/);
});
});
describe('skillkit marketplace', () => {
it('should display marketplace header', async () => {
const result = await runCli(['marketplace', '--json']);
const output = result.stdout + result.stderr;
// JSON output should contain marketplace data
if (result.success) {
try {
const data = JSON.parse(result.stdout.trim().split('\n').pop() || '{}');
expect(data).toHaveProperty('totalSkills');
expect(data).toHaveProperty('sources');
} catch {
// Non-JSON output is also acceptable
}
}
});
it('should show popular tags with progress bars', async () => {
const result = await runCli(['marketplace', 'tags', '--json']);
if (result.success && result.stdout.trim().startsWith('[')) {
const tags = JSON.parse(result.stdout);
expect(Array.isArray(tags)).toBe(true);
if (tags.length > 0) {
expect(tags[0]).toHaveProperty('tag');
expect(tags[0]).toHaveProperty('count');
}
}
});
});
describe('skillkit sync', () => {
it('should sync with formatted output', async () => {
// Create skills to sync
const skillsDir = join(testDir, 'skills');
mkdirSync(skillsDir, { recursive: true });
createTestSkill(skillsDir, 'sync-skill-1');
createTestSkill(skillsDir, 'sync-skill-2');
const result = await runCli(['sync', '--agent', 'claude-code', '-y'], { cwd: testDir });
const output = result.stdout + result.stderr;
// Should show sync operation
expect(output.toLowerCase()).toMatch(/sync|skill|claude/);
});
it('should show skill status indicators', async () => {
const skillsDir = join(testDir, 'skills');
mkdirSync(skillsDir, { recursive: true });
createTestSkill(skillsDir, 'enabled-skill');
const result = await runCli(['sync', '--agent', 'claude-code', '-y'], { cwd: testDir });
const output = result.stdout + result.stderr;
// Should complete without error
expect(result.exitCode).toBeDefined();
});
});
describe('skillkit recommend', () => {
it('should show project analysis with spinner', async () => {
// Create a node project
writeFileSync(
join(testDir, 'package.json'),
JSON.stringify({ name: 'test-project', version: '1.0.0' }, null, 2)
);
const result = await runCli(['recommend', '--quiet'], { cwd: testDir });
const output = result.stdout + result.stderr;
// Should show some output about recommendations or project
expect(
output.toLowerCase().includes('project') ||
output.toLowerCase().includes('skill') ||
output.toLowerCase().includes('recommend') ||
output.toLowerCase().includes('index') ||
result.exitCode !== undefined
).toBe(true);
});
it('should format scores with progress bars', async () => {
// Create a TypeScript project
writeFileSync(
join(testDir, 'package.json'),
JSON.stringify({
name: 'test-project',
dependencies: { typescript: '^5.0.0' },
}, null, 2)
);
writeFileSync(join(testDir, 'tsconfig.json'), '{}');
const result = await runCli(['recommend', '--json'], { cwd: testDir });
if (result.success && result.stdout.includes('"recommendations"')) {
const data = JSON.parse(result.stdout);
expect(data).toHaveProperty('recommendations');
}
});
});
describe('Non-interactive mode', () => {
it('should work with --yes flag', async () => {
const skillsDir = join(testDir, 'skills');
mkdirSync(skillsDir, { recursive: true });
createTestSkill(skillsDir, 'test-skill');
const result = await runCli(['sync', '--agent', 'claude-code', '-y'], { cwd: testDir });
// Should complete without prompting
expect(result.exitCode).toBeDefined();
});
it('should work with --quiet flag', async () => {
const result = await runCli(['init', '--list', '-q']);
const output = result.stdout + result.stderr;
// Should still show content but without extra formatting
expect(output).toContain('Claude Code');
});
it('should work with --json flag', async () => {
const result = await runCli(['marketplace', '--json']);
// Should output valid JSON
if (result.success) {
const jsonLine = result.stdout.trim().split('\n').pop() || '';
if (jsonLine.startsWith('{') || jsonLine.startsWith('[')) {
expect(() => JSON.parse(jsonLine)).not.toThrow();
}
}
});
});
describe('Error handling', () => {
it('should show formatted errors', async () => {
const result = await runCli(['install', 'nonexistent-source-12345']);
const output = result.stdout + result.stderr;
// Should show some error message
expect(
output.toLowerCase().includes('error') ||
output.toLowerCase().includes('fail') ||
output.toLowerCase().includes('not found') ||
!result.success
).toBe(true);
});
it('should handle missing skills gracefully', async () => {
const result = await runCli(['read', 'nonexistent-skill'], { cwd: testDir });
// Should not crash
expect(result.exitCode).toBeDefined();
});
});
describe('Visual elements', () => {
it('should use Unicode symbols in output', async () => {
const result = await runCli(['init', '--list']);
const output = result.stdout + result.stderr;
// Should contain Unicode agent icons (any of the defined icons)
const unicodePatterns = [
/[\u2500-\u257F]/, // Box drawing
/[\u25A0-\u25FF]/, // Geometric shapes
/[\u2700-\u27BF]/, // Dingbats
];
const hasUnicode = unicodePatterns.some(pattern => pattern.test(output));
// Unicode support depends on terminal, so just check it doesn't crash
expect(result.exitCode).toBe(0);
});
it('should handle narrow terminal gracefully', async () => {
// Even with narrow output, should not crash
const result = await runCli(['init', '--list'], {
env: { COLUMNS: '40' },
});
expect(result.exitCode).toBeDefined();
});
});
});