From 610d3111356a0281a25b0cbe32e345cc2f2245e5 Mon Sep 17 00:00:00 2001 From: Gani Mohamed Parakadhullah Date: Sun, 8 Mar 2026 13:08:03 +0800 Subject: [PATCH] feat: add pi coding agent as supported platform Add pi (provider-agnostic terminal-native AI coding agent) to platform-codes.yaml with native skills format output to .pi/skills/. Pi follows the open Agent Skills specification and uses the same subdirectory/SKILL.md structure that BMAD already generates for other platforms. Fixes #1853 --- test/test-installation-components.js | 41 +++++++++++++++++++ .../installers/lib/ide/platform-codes.yaml | 10 +++++ 2 files changed, 51 insertions(+) diff --git a/test/test-installation-components.js b/test/test-installation-components.js index 56f37b365..012dd7add 100644 --- a/test/test-installation-components.js +++ b/test/test-installation-components.js @@ -1500,6 +1500,47 @@ async function runTests() { console.log(''); + // ============================================================ + // Suite 28: Pi Native Skills + // ============================================================ + console.log(`${colors.yellow}Test Suite 28: Pi Native Skills${colors.reset}\n`); + + try { + clearCache(); + const platformCodes28 = await loadPlatformCodes(); + const piInstaller = platformCodes28.platforms.pi?.installer; + + assert(piInstaller?.target_dir === '.pi/skills', 'Pi target_dir uses native skills path'); + assert(piInstaller?.skill_format === true, 'Pi installer enables native skill output'); + + const tempProjectDir28 = await fs.mkdtemp(path.join(os.tmpdir(), 'bmad-pi-test-')); + const installedBmadDir28 = await createTestBmadFixture(); + + const ideManager28 = new IdeManager(); + await ideManager28.ensureInitialized(); + const result28 = await ideManager28.setup('pi', tempProjectDir28, installedBmadDir28, { + silent: true, + selectedModules: ['bmm'], + }); + + assert(result28.success === true, 'Pi setup succeeds against temp project'); + + const skillFile28 = path.join(tempProjectDir28, '.pi', 'skills', 'bmad-master', 'SKILL.md'); + assert(await fs.pathExists(skillFile28), 'Pi install writes SKILL.md directory output'); + + // Verify name frontmatter matches directory name + const skillContent28 = await fs.readFile(skillFile28, 'utf8'); + const nameMatch28 = skillContent28.match(/^name:\s*(.+)$/m); + assert(nameMatch28 && nameMatch28[1].trim() === 'bmad-master', 'Pi skill name frontmatter matches directory name exactly'); + + await fs.remove(tempProjectDir28); + await fs.remove(installedBmadDir28); + } catch (error) { + assert(false, 'Pi native skills test succeeds', error.message); + } + + console.log(''); + // ============================================================ // Summary // ============================================================ diff --git a/tools/cli/installers/lib/ide/platform-codes.yaml b/tools/cli/installers/lib/ide/platform-codes.yaml index 82d45f562..9d5f171f1 100644 --- a/tools/cli/installers/lib/ide/platform-codes.yaml +++ b/tools/cli/installers/lib/ide/platform-codes.yaml @@ -192,6 +192,16 @@ platforms: skill_format: true ancestor_conflict_check: true + pi: + name: "Pi" + preferred: false + category: cli + description: "Provider-agnostic terminal-native AI coding agent" + installer: + target_dir: .pi/skills + template_type: default + skill_format: true + qwen: name: "QwenCoder" preferred: false