Preserve namespaced skill export paths
Keep readable namespaced skill export folders while replacing managed company UUID segments with the company issue prefix for export-only paths. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -81,6 +81,7 @@ describe("company portability", () => {
|
||||
id: "company-1",
|
||||
name: "Paperclip",
|
||||
description: null,
|
||||
issuePrefix: "PAP",
|
||||
brandColor: "#5c5fff",
|
||||
requireBoardApprovalForNewAgents: true,
|
||||
});
|
||||
@@ -275,11 +276,11 @@ describe("company portability", () => {
|
||||
expect(exported.files["agents/claudecoder/AGENTS.md"]).toContain("skills:");
|
||||
expect(exported.files["agents/claudecoder/AGENTS.md"]).toContain(`- "${paperclipKey}"`);
|
||||
expect(exported.files["agents/cmo/AGENTS.md"]).not.toContain("skills:");
|
||||
expect(exported.files["skills/paperclip/SKILL.md"]).toContain("metadata:");
|
||||
expect(exported.files["skills/paperclip/SKILL.md"]).toContain('kind: "github-dir"');
|
||||
expect(exported.files["skills/paperclip/references/api.md"]).toBeUndefined();
|
||||
expect(exported.files["skills/company-playbook/SKILL.md"]).toContain("# Company Playbook");
|
||||
expect(exported.files["skills/company-playbook/references/checklist.md"]).toContain("# Checklist");
|
||||
expect(exported.files["skills/paperclipai/paperclip/paperclip/SKILL.md"]).toContain("metadata:");
|
||||
expect(exported.files["skills/paperclipai/paperclip/paperclip/SKILL.md"]).toContain('kind: "github-dir"');
|
||||
expect(exported.files["skills/paperclipai/paperclip/paperclip/references/api.md"]).toBeUndefined();
|
||||
expect(exported.files["skills/company/PAP/company-playbook/SKILL.md"]).toContain("# Company Playbook");
|
||||
expect(exported.files["skills/company/PAP/company-playbook/references/checklist.md"]).toContain("# Checklist");
|
||||
|
||||
const extension = exported.files[".paperclip.yaml"];
|
||||
expect(extension).toContain('schema: "paperclip/v1"');
|
||||
@@ -313,12 +314,12 @@ describe("company portability", () => {
|
||||
expandReferencedSkills: true,
|
||||
});
|
||||
|
||||
expect(exported.files["skills/paperclip/SKILL.md"]).toContain("# Paperclip");
|
||||
expect(exported.files["skills/paperclip/SKILL.md"]).toContain("metadata:");
|
||||
expect(exported.files["skills/paperclip/references/api.md"]).toContain("# API");
|
||||
expect(exported.files["skills/paperclipai/paperclip/paperclip/SKILL.md"]).toContain("# Paperclip");
|
||||
expect(exported.files["skills/paperclipai/paperclip/paperclip/SKILL.md"]).toContain("metadata:");
|
||||
expect(exported.files["skills/paperclipai/paperclip/paperclip/references/api.md"]).toContain("# API");
|
||||
});
|
||||
|
||||
it("exports duplicate skill slugs with readable pretty path suffixes", async () => {
|
||||
it("exports duplicate skill slugs into readable namespaced paths", async () => {
|
||||
const portability = companyPortabilityService({} as any);
|
||||
|
||||
companySkillSvc.readFile.mockImplementation(async (_companyId: string, skillId: string, relativePath: string) => {
|
||||
@@ -398,9 +399,9 @@ describe("company portability", () => {
|
||||
},
|
||||
});
|
||||
|
||||
expect(exported.files["skills/release-changelog--local/SKILL.md"]).toContain("# Local Release Changelog");
|
||||
expect(exported.files["skills/release-changelog--paperclip/SKILL.md"]).toContain("metadata:");
|
||||
expect(exported.files["skills/release-changelog--paperclip/SKILL.md"]).toContain("paperclipai/paperclip/release-changelog");
|
||||
expect(exported.files["skills/local/release-changelog/SKILL.md"]).toContain("# Local Release Changelog");
|
||||
expect(exported.files["skills/paperclipai/paperclip/release-changelog/SKILL.md"]).toContain("metadata:");
|
||||
expect(exported.files["skills/paperclipai/paperclip/release-changelog/SKILL.md"]).toContain("paperclipai/paperclip/release-changelog");
|
||||
});
|
||||
|
||||
it("reads env inputs back from .paperclip.yaml during preview import", async () => {
|
||||
|
||||
Reference in New Issue
Block a user