feat(skills): add info command for skill inspection
This commit is contained in:
+34
-1
@@ -1,5 +1,5 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { toSkillListRows, renderSkillsTable } from './skills.js';
|
||||
import { toSkillListRows, renderSkillsTable, renderSkillInfo } from './skills.js';
|
||||
import type { Skill } from '../skills/index.js';
|
||||
|
||||
function buildSkill(overrides: Partial<Skill>): Skill {
|
||||
@@ -58,4 +58,37 @@ describe('skills CLI helpers', () => {
|
||||
it('renders a no-skills message when empty', () => {
|
||||
expect(renderSkillsTable([])).toBe('No skills found.');
|
||||
});
|
||||
|
||||
it('renders detailed skill info for available skill', () => {
|
||||
const output = renderSkillInfo(
|
||||
buildSkill({
|
||||
manifest: {
|
||||
name: 'deploy',
|
||||
description: 'Deployment helper',
|
||||
version: '2.0.0',
|
||||
tier: 'bundled',
|
||||
author: 'Flynn',
|
||||
tools: ['shell.exec', 'git.status'],
|
||||
},
|
||||
directory: '/opt/flynn/skills/deploy',
|
||||
}),
|
||||
);
|
||||
|
||||
expect(output).toContain('Name: deploy');
|
||||
expect(output).toContain('Status: available');
|
||||
expect(output).toContain('Tools: shell.exec, git.status');
|
||||
expect(output).toContain('Directory: /opt/flynn/skills/deploy');
|
||||
});
|
||||
|
||||
it('renders unavailable reasons when skill is unavailable', () => {
|
||||
const output = renderSkillInfo(
|
||||
buildSkill({
|
||||
available: false,
|
||||
unavailableReasons: ['Required binary not found'],
|
||||
}),
|
||||
);
|
||||
|
||||
expect(output).toContain('Status: unavailable');
|
||||
expect(output).toContain('Unavailable reasons: Required binary not found');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user