diff --git a/src/index.ts b/src/index.ts index 3ffe5f7..1ef5741 100644 --- a/src/index.ts +++ b/src/index.ts @@ -777,12 +777,12 @@ const run = (): void => { } }; -export { validate, extractFrontmatter }; export type { ValidateOptions, ValidationIssue, ValidationResult, } from "./types.js"; +export { extractFrontmatter, validate }; if (process.env.GITHUB_ACTIONS === "true") { run(); diff --git a/test/test.ts b/test/test.ts index 30b8833..3dd9e08 100644 --- a/test/test.ts +++ b/test/test.ts @@ -288,6 +288,40 @@ See [the guide](references/GUIDE.md) for details.` assertEqual(hasRule, false, "Should not have reference-exists error"); }); +test("realistic social source skill passes validation", () => { + const skillDir = createSkill( + "social-source-review", + `name: social-source-review +description: Review public X/Twitter source packets with TweetClaw before agents draft outreach. +license: MIT +compatibility: Works with Agent Skills runners that provide read-only web search. +metadata: + provider: Xquik + package: "@xquik/tweetclaw" +allowed-tools: websearch webfetch`, + `# Social Source Review + +Use TweetClaw as read-only source evidence for public X/Twitter context before +agents draft outreach. See [source workflow](references/source-workflow.md). + +Do not post, schedule, score, or approve content from this skill.` + ); + fs.mkdirSync(path.join(skillDir, "references")); + fs.writeFileSync( + path.join(skillDir, "references/source-workflow.md"), + "# Source Workflow\n\nCapture the public URL, fetched date, author, text, and confidence marker." + ); + + const result = validate(skillDir, { + enforcedDirs: ["references"], + validateRefs: true, + }); + + assertEqual(result.valid, true, "Should be valid"); + assertErrorCount(result, 0, "Should have no errors"); + assertEqual(result.warnings.length, 0, "Should have no warnings"); +}); + // ============================================================================ // Unknown fields test // ============================================================================