feat: fix skill transformation pipeline across all targets (#334)
This commit is contained in:
@@ -47,6 +47,44 @@ describe("writeDroidBundle", () => {
|
||||
expect(droidContent).toContain("Droid content")
|
||||
})
|
||||
|
||||
test("transforms Task calls in copied SKILL.md files", async () => {
|
||||
const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "droid-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: DroidBundle = {
|
||||
commands: [],
|
||||
droids: [],
|
||||
skillDirs: [{ name: "ce:plan", sourceDir: sourceSkillDir }],
|
||||
}
|
||||
|
||||
await writeDroidBundle(tempRoot, bundle)
|
||||
|
||||
const installedSkill = await fs.readFile(
|
||||
path.join(tempRoot, ".factory", "skills", "ce:plan", "SKILL.md"),
|
||||
"utf8",
|
||||
)
|
||||
|
||||
expect(installedSkill).toContain("Task repo-research-analyst: feature_description")
|
||||
expect(installedSkill).toContain("Task learnings-researcher: feature_description")
|
||||
expect(installedSkill).toContain("Task code-simplicity-reviewer")
|
||||
expect(installedSkill).not.toContain("Task compound-engineering:")
|
||||
})
|
||||
|
||||
test("writes directly into a .factory output root", async () => {
|
||||
const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "droid-home-"))
|
||||
const factoryRoot = path.join(tempRoot, ".factory")
|
||||
|
||||
Reference in New Issue
Block a user