Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
34 changes: 34 additions & 0 deletions test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
// ============================================================================
Expand Down