Add skill slash-command autocomplete

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
dotta 2026-04-04 17:00:40 -05:00
parent fe61e650c2
commit 94d4a01b76
9 changed files with 271 additions and 48 deletions

View file

@ -2,10 +2,13 @@ import { describe, expect, it } from "vitest";
import {
buildAgentMentionHref,
buildProjectMentionHref,
buildSkillMentionHref,
extractAgentMentionIds,
extractProjectMentionIds,
extractSkillMentionIds,
parseAgentMentionHref,
parseProjectMentionHref,
parseSkillMentionHref,
} from "./project-mentions.js";
describe("project-mentions", () => {
@ -26,4 +29,13 @@ describe("project-mentions", () => {
});
expect(extractAgentMentionIds(`[@CodexCoder](${href})`)).toEqual(["agent-123"]);
});
it("round-trips skill mentions with slug metadata", () => {
const href = buildSkillMentionHref("skill-123", "release-changelog");
expect(parseSkillMentionHref(href)).toEqual({
skillId: "skill-123",
slug: "release-changelog",
});
expect(extractSkillMentionIds(`[/release-changelog](${href})`)).toEqual(["skill-123"]);
});
});