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

@@ -99,6 +99,43 @@ describe("writeKiroBundle", () => {
expect(mcpContent.mcpServers.playwright.command).toBe("npx")
})
test("transforms Task calls in copied SKILL.md files", async () => {
const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "kiro-skill-transform-"))
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: KiroBundle = {
...emptyBundle,
skillDirs: [{ name: "ce:plan", sourceDir: sourceSkillDir }],
}
await writeKiroBundle(tempRoot, bundle)
const installedSkill = await fs.readFile(
path.join(tempRoot, ".kiro", "skills", "ce:plan", "SKILL.md"),
"utf8",
)
expect(installedSkill).toContain("Use the use_subagent tool to delegate to the repo-research-analyst agent: feature_description")
expect(installedSkill).toContain("Use the use_subagent tool to delegate to the learnings-researcher agent: feature_description")
expect(installedSkill).toContain("Use the use_subagent tool to delegate to the code-simplicity-reviewer agent")
expect(installedSkill).not.toContain("Task compound-engineering:")
})
test("does not double-nest when output root is .kiro", async () => {
const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "kiro-home-"))
const kiroRoot = path.join(tempRoot, ".kiro")