/** * Skill Test Framework * * Comprehensive testing framework for skills. * Validates SKILL.md format, dependencies, security, and examples. */ import type { SkillMetadata } from './types.js'; export type TestStatus = 'pass' | 'fail' | 'warn' | 'skip'; export interface TestResult { name: string; status: TestStatus; message?: string; details?: string[]; duration?: number; } export interface SkillTestReport { skillName: string; skillPath: string; timestamp: number; results: TestResult[]; summary: { total: number; passed: number; failed: number; warnings: number; skipped: number; }; passed: boolean; } export interface TestOptions { /** Skip security tests */ skipSecurity?: boolean; /** Skip dependency tests */ skipDeps?: boolean; /** Skip example tests */ skipExamples?: boolean; /** Strict mode - fail on warnings */ strict?: boolean; /** Timeout for example tests (ms) */ exampleTimeout?: number; /** Working directory for example tests */ cwd?: string; } export declare class SkillTestFramework { private options; constructor(options?: TestOptions); /** * Run all tests for a skill */ testSkill(skillDir: string): Promise; /** * Test SKILL.md format */ testSkillMdFormat(filePath: string): TestResult; /** * Test dependencies */ testDependencies(metadata: SkillMetadata): Promise; /** * Test security */ testSecurity(skillDir: string): Promise; /** * Test metadata */ testMetadata(metadata: SkillMetadata, _skillDir: string): TestResult; /** * Test code examples */ testExamples(content: string, _skillDir: string): Promise; private validateInstallSpec; private extractCodeBlocks; private validateShellSyntax; private createReport; private createFailureReport; } export interface TestRunnerOptions extends TestOptions { /** Skills directory to test */ skillsDir: string; /** Output format */ format?: 'text' | 'json' | 'tap'; /** Verbose output */ verbose?: boolean; } export declare class SkillTestRunner { private options; private framework; constructor(options: TestRunnerOptions); run(): Promise<{ reports: SkillTestReport[]; passed: boolean; }>; private findSkillDirectories; } /** * Format test results as text */ export declare function formatTestResults(reports: SkillTestReport[], verbose?: boolean): string; /** * Format test results as JSON */ export declare function formatTestResultsJson(reports: SkillTestReport[]): string; /** * Format test results as TAP (Test Anything Protocol) */ export declare function formatTestResultsTap(reports: SkillTestReport[]): string;