feat: fix skill transformation pipeline across all targets (#334)

This commit is contained in:
Trevin Chow
2026-03-21 19:45:20 -07:00
committed by GitHub
parent 0f6448d81c
commit 4087e1df82
33 changed files with 624 additions and 86 deletions

View File

@@ -50,6 +50,46 @@ describe("writePiBundle", () => {
expect(agentsContent).toContain("MCPorter")
})
test("transforms Task calls in copied SKILL.md files", async () => {
const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "pi-skill-transform-"))
const outputRoot = path.join(tempRoot, ".pi")
const sourceSkillDir = path.join(tempRoot, "source-skill")
await fs.mkdir(sourceSkillDir, { recursive: true })
await fs.writeFile(
path.join(sourceSkillDir, "SKILL.md"),
`---
name: ce:plan
description: Planning workflow
---
Run these research agents:
- Task compound-engineering:research:repo-research-analyst(feature_description)
- Task compound-engineering:research:learnings-researcher(feature_description)
- Task compound-engineering:review:code-simplicity-reviewer()
`,
)
const bundle: PiBundle = {
prompts: [],
skillDirs: [{ name: "ce:plan", sourceDir: sourceSkillDir }],
generatedSkills: [],
extensions: [],
}
await writePiBundle(outputRoot, bundle)
const installedSkill = await fs.readFile(
path.join(outputRoot, "skills", "ce:plan", "SKILL.md"),
"utf8",
)
expect(installedSkill).toContain('Run subagent with agent="repo-research-analyst" and task="feature_description".')
expect(installedSkill).toContain('Run subagent with agent="learnings-researcher" and task="feature_description".')
expect(installedSkill).toContain('Run subagent with agent="code-simplicity-reviewer".')
expect(installedSkill).not.toContain("Task compound-engineering:")
})
test("writes to ~/.pi/agent style roots without nesting under .pi", async () => {
const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "pi-agent-root-"))
const outputRoot = path.join(tempRoot, "agent")