feat(skills): migrate Gemini CLI to config-driven native skills
Replace TOML-based .gemini/commands output with native SKILL.md output in .gemini/skills/. Gemini CLI confirms native skills support per geminicli.com/docs/cli/skills/. - Update platform-codes.yaml: target_dir, skill_format, legacy_targets - Add test Suite 23: 9 assertions (config, install, legacy, reinstall) - Add Gemini CLI section to migration checklist Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
40d3eb393f
commit
0969983949
|
|
@ -1215,6 +1215,65 @@ async function runTests() {
|
||||||
|
|
||||||
console.log('');
|
console.log('');
|
||||||
|
|
||||||
|
// ============================================================
|
||||||
|
// Suite 23: Gemini CLI Native Skills
|
||||||
|
// ============================================================
|
||||||
|
console.log(`${colors.yellow}Test Suite 23: Gemini CLI Native Skills${colors.reset}\n`);
|
||||||
|
|
||||||
|
try {
|
||||||
|
clearCache();
|
||||||
|
const platformCodes23 = await loadPlatformCodes();
|
||||||
|
const geminiInstaller = platformCodes23.platforms.gemini?.installer;
|
||||||
|
|
||||||
|
assert(geminiInstaller?.target_dir === '.gemini/skills', 'Gemini target_dir uses native skills path');
|
||||||
|
|
||||||
|
assert(geminiInstaller?.skill_format === true, 'Gemini installer enables native skill output');
|
||||||
|
|
||||||
|
assert(
|
||||||
|
Array.isArray(geminiInstaller?.legacy_targets) && geminiInstaller.legacy_targets.includes('.gemini/commands'),
|
||||||
|
'Gemini installer cleans legacy commands output',
|
||||||
|
);
|
||||||
|
|
||||||
|
const tempProjectDir23 = await fs.mkdtemp(path.join(os.tmpdir(), 'bmad-gemini-test-'));
|
||||||
|
const installedBmadDir23 = await createTestBmadFixture();
|
||||||
|
const legacyDir23 = path.join(tempProjectDir23, '.gemini', 'commands');
|
||||||
|
await fs.ensureDir(legacyDir23);
|
||||||
|
await fs.writeFile(path.join(legacyDir23, 'bmad-legacy.toml'), 'legacy\n');
|
||||||
|
|
||||||
|
const ideManager23 = new IdeManager();
|
||||||
|
await ideManager23.ensureInitialized();
|
||||||
|
const result23 = await ideManager23.setup('gemini', tempProjectDir23, installedBmadDir23, {
|
||||||
|
silent: true,
|
||||||
|
selectedModules: ['bmm'],
|
||||||
|
});
|
||||||
|
|
||||||
|
assert(result23.success === true, 'Gemini setup succeeds against temp project');
|
||||||
|
|
||||||
|
const skillFile23 = path.join(tempProjectDir23, '.gemini', 'skills', 'bmad-master', 'SKILL.md');
|
||||||
|
assert(await fs.pathExists(skillFile23), 'Gemini install writes SKILL.md directory output');
|
||||||
|
|
||||||
|
const skillContent23 = await fs.readFile(skillFile23, 'utf8');
|
||||||
|
const nameMatch23 = skillContent23.match(/^name:\s*(.+)$/m);
|
||||||
|
assert(nameMatch23 && nameMatch23[1].trim() === 'bmad-master', 'Gemini skill name frontmatter matches directory name exactly');
|
||||||
|
|
||||||
|
assert(!(await fs.pathExists(path.join(tempProjectDir23, '.gemini', 'commands'))), 'Gemini setup removes legacy commands dir');
|
||||||
|
|
||||||
|
const result23b = await ideManager23.setup('gemini', tempProjectDir23, installedBmadDir23, {
|
||||||
|
silent: true,
|
||||||
|
selectedModules: ['bmm'],
|
||||||
|
});
|
||||||
|
|
||||||
|
assert(result23b.success === true, 'Gemini reinstall/upgrade succeeds over existing skills');
|
||||||
|
assert(await fs.pathExists(skillFile23), 'Gemini reinstall preserves SKILL.md output');
|
||||||
|
|
||||||
|
await fs.remove(tempProjectDir23);
|
||||||
|
await fs.remove(installedBmadDir23);
|
||||||
|
} catch (error) {
|
||||||
|
assert(false, 'Gemini native skills migration test succeeds', error.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('');
|
||||||
|
|
||||||
// ============================================================
|
// ============================================================
|
||||||
// Summary
|
// Summary
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
|
||||||
|
|
@ -120,8 +120,11 @@ platforms:
|
||||||
category: cli
|
category: cli
|
||||||
description: "Google's CLI for Gemini"
|
description: "Google's CLI for Gemini"
|
||||||
installer:
|
installer:
|
||||||
target_dir: .gemini/commands
|
legacy_targets:
|
||||||
template_type: gemini
|
- .gemini/commands
|
||||||
|
target_dir: .gemini/skills
|
||||||
|
template_type: default
|
||||||
|
skill_format: true
|
||||||
|
|
||||||
github-copilot:
|
github-copilot:
|
||||||
name: "GitHub Copilot"
|
name: "GitHub Copilot"
|
||||||
|
|
|
||||||
|
|
@ -221,6 +221,21 @@ Support assumption: full Agent Skills support. BMAD currently uses a custom inst
|
||||||
- [x] Implement/extend automated tests — 11 assertions in test suite 22 (config, fresh install, legacy cleanup, .kilocodemodes cleanup, reinstall)
|
- [x] Implement/extend automated tests — 11 assertions in test suite 22 (config, fresh install, legacy cleanup, .kilocodemodes cleanup, reinstall)
|
||||||
- [ ] Commit
|
- [ ] Commit
|
||||||
|
|
||||||
|
## Gemini CLI
|
||||||
|
|
||||||
|
Support assumption: full Agent Skills support. Gemini CLI docs confirm workspace skills at `.gemini/skills/` and user skills at `~/.gemini/skills/`. Also discovers `.agents/skills/` as an alias. BMAD previously installed TOML files to `.gemini/commands`.
|
||||||
|
|
||||||
|
**Install:** `npm install -g @anthropic-ai/gemini-cli` or see [geminicli.com](https://geminicli.com)
|
||||||
|
|
||||||
|
- [x] Confirm Gemini CLI native skills path is `.gemini/skills/{skill-name}/SKILL.md` (per [geminicli.com/docs/cli/skills](https://geminicli.com/docs/cli/skills/))
|
||||||
|
- [x] Implement native skills output — target_dir `.gemini/skills`, skill_format true, template_type default (replaces TOML templates)
|
||||||
|
- [x] Add legacy cleanup for `.gemini/commands` (via `legacy_targets`)
|
||||||
|
- [x] Test fresh install — skills written to `.gemini/skills/bmad-master/SKILL.md` with correct frontmatter
|
||||||
|
- [x] Test reinstall/upgrade from legacy TOML command output — legacy dir removed, skills installed
|
||||||
|
- [x] Confirm no ancestor conflict protection is needed — Gemini CLI uses workspace > user > extension precedence, no ancestor directory inheritance
|
||||||
|
- [x] Implement/extend automated tests — 9 assertions in test suite 23 (config, fresh install, legacy cleanup, reinstall)
|
||||||
|
- [ ] Commit
|
||||||
|
|
||||||
## Summary Gates
|
## Summary Gates
|
||||||
|
|
||||||
- [ ] All full-support BMAD platforms install `SKILL.md` directory-based output
|
- [ ] All full-support BMAD platforms install `SKILL.md` directory-based output
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue