MCPcopy
hub / github.com/EveryInc/compound-engineering-plugin / cleanupPi

Function cleanupPi

src/commands/cleanup.ts:394–413  ·  view source on GitHub ↗
(plugin: Awaited<ReturnType<typeof loadClaudePlugin>>, piRoot: string)

Source from the content-addressed store, hash-verified

392}
393
394async function cleanupPi(plugin: Awaited<ReturnType<typeof loadClaudePlugin>>, piRoot: string): Promise<CleanupResult> {
395 const bundle = convertClaudeToPi(plugin, {
396 agentMode: "subagent",
397 inferTemperature: true,
398 permissions: "none",
399 })
400 const artifacts = getLegacyPiArtifacts(bundle)
401 const managedDir = path.join(piRoot, "compound-engineering")
402 let moved = 0
403 for (const skillName of artifacts.skills) {
404 moved += await moveLegacySkillIfOwned(managedDir, "skills", path.join(piRoot, "skills"), skillName, "Pi")
405 }
406 for (const promptFile of artifacts.prompts) {
407 moved += await moveIfExists(managedDir, "prompts", path.join(piRoot, "prompts"), promptFile, "Pi")
408 }
409 for (const agentPath of artifacts.agents ?? []) {
410 moved += await moveLegacyAgentIfOwned(managedDir, "agents", path.join(piRoot, "agents"), agentPath, "Pi", ".md")
411 }
412 return { target: "pi", root: piRoot, moved }
413}
414
415async function cleanupKiro(plugin: Awaited<ReturnType<typeof loadClaudePlugin>>, kiroRoot: string): Promise<CleanupResult> {
416 const bundle = convertClaudeToKiro(plugin, {

Callers 1

cleanupTargetFunction · 0.85

Calls 5

convertClaudeToPiFunction · 0.90
getLegacyPiArtifactsFunction · 0.90
moveLegacySkillIfOwnedFunction · 0.85
moveIfExistsFunction · 0.85
moveLegacyAgentIfOwnedFunction · 0.85

Tested by

no test coverage detected