MCPcopy Index your code
hub / github.com/CopilotKit/CopilotKit / findPackageSkills

Function findPackageSkills

scripts/sync-plugin-skills.ts:48–72  ·  view source on GitHub ↗
(cwd: string)

Source from the content-addressed store, hash-verified

46}
47
48async function findPackageSkills(cwd: string): Promise<PackageSkill[]> {
49 const packagesDir = join(cwd, "packages");
50 if (!existsSync(packagesDir)) return [];
51
52 const pkgs = await readdir(packagesDir, { withFileTypes: true });
53 const out: PackageSkill[] = [];
54
55 for (const pkg of pkgs) {
56 if (!pkg.isDirectory()) continue;
57 const skillsDir = join(packagesDir, pkg.name, "skills");
58 if (!existsSync(skillsDir)) continue;
59 const slugs = await readdir(skillsDir, { withFileTypes: true });
60 for (const slug of slugs) {
61 if (!slug.isDirectory()) continue;
62 const sourceDir = join(skillsDir, slug.name);
63 if (!existsSync(join(sourceDir, "SKILL.md"))) continue;
64 out.push({
65 slug: slug.name,
66 sourceDir,
67 mirrorDir: join(cwd, "skills", slug.name),
68 });
69 }
70 }
71 return out;
72}
73
74async function listFilesRec(dir: string, base = dir): Promise<string[]> {
75 const out: string[] = [];

Callers 1

syncPluginSkillsFunction · 0.85

Calls 1

pushMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…