- Integrated the @radix-ui/react-alert-dialog package for improved alert dialog functionality. - Updated SkillImportService to include a new inspectSourceDir method for enhanced file inspection and warning generation during skill imports. - Refactored existing methods to streamline file reading and directory walking processes, improving overall performance and error handling. - Added new SkillPlanService to manage skill upsert plans, enhancing the skills mutation workflow. - Updated UI components to support new features and improve user experience in the skills management interface.
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import { describe, expect, it } from 'vitest';
|
|
|
|
import {
|
|
buildSkillTemplate,
|
|
readSkillTemplateInput,
|
|
} from '../../../../../src/renderer/components/extensions/skills/skillDraftUtils';
|
|
|
|
describe('skillDraftUtils', () => {
|
|
it('builds and parses structured sections for guided editing', () => {
|
|
const template = buildSkillTemplate({
|
|
name: 'Review Helper',
|
|
description: 'Helps with code review',
|
|
license: 'MIT',
|
|
compatibility: 'claude-code',
|
|
invocationMode: 'manual-only',
|
|
whenToUse: 'Use this when a PR needs review.',
|
|
steps: '1. Read the diff.\n2. Call out the biggest risk first.',
|
|
notes: '- Prefer concrete findings over summaries.',
|
|
});
|
|
|
|
const parsed = readSkillTemplateInput(template);
|
|
|
|
expect(parsed).toMatchObject({
|
|
name: 'Review Helper',
|
|
description: 'Helps with code review',
|
|
license: 'MIT',
|
|
compatibility: 'claude-code',
|
|
invocationMode: 'manual-only',
|
|
whenToUse: 'Use this when a PR needs review.',
|
|
steps: '1. Read the diff.\n2. Call out the biggest risk first.',
|
|
notes: '- Prefer concrete findings over summaries.',
|
|
});
|
|
});
|
|
});
|