feat(skills): migrate Cline to config-driven native skills
Move Cline installer from .clinerules/workflows to .cline/skills with SKILL.md directory output. Add legacy cleanup and 9 test assertions.
This commit is contained in:
parent
288d2e9bc4
commit
cbeb7e8556
|
|
@ -893,6 +893,68 @@ async function runTests() {
|
|||
|
||||
console.log('');
|
||||
|
||||
// ============================================================
|
||||
// Test 18: Cline Native Skills Install
|
||||
// ============================================================
|
||||
console.log(`${colors.yellow}Test Suite 18: Cline Native Skills${colors.reset}\n`);
|
||||
|
||||
try {
|
||||
clearCache();
|
||||
const platformCodes18 = await loadPlatformCodes();
|
||||
const clineInstaller = platformCodes18.platforms.cline?.installer;
|
||||
|
||||
assert(clineInstaller?.target_dir === '.cline/skills', 'Cline target_dir uses native skills path');
|
||||
|
||||
assert(clineInstaller?.skill_format === true, 'Cline installer enables native skill output');
|
||||
|
||||
assert(
|
||||
Array.isArray(clineInstaller?.legacy_targets) && clineInstaller.legacy_targets.includes('.clinerules/workflows'),
|
||||
'Cline installer cleans legacy workflow output',
|
||||
);
|
||||
|
||||
const tempProjectDir18 = await fs.mkdtemp(path.join(os.tmpdir(), 'bmad-cline-test-'));
|
||||
const installedBmadDir18 = await createTestBmadFixture();
|
||||
const legacyDir18 = path.join(tempProjectDir18, '.clinerules', 'workflows', 'bmad-legacy-dir');
|
||||
await fs.ensureDir(legacyDir18);
|
||||
await fs.writeFile(path.join(tempProjectDir18, '.clinerules', 'workflows', 'bmad-legacy.md'), 'legacy\n');
|
||||
await fs.writeFile(path.join(legacyDir18, 'SKILL.md'), 'legacy\n');
|
||||
|
||||
const ideManager18 = new IdeManager();
|
||||
await ideManager18.ensureInitialized();
|
||||
const result18 = await ideManager18.setup('cline', tempProjectDir18, installedBmadDir18, {
|
||||
silent: true,
|
||||
selectedModules: ['bmm'],
|
||||
});
|
||||
|
||||
assert(result18.success === true, 'Cline setup succeeds against temp project');
|
||||
|
||||
const skillFile18 = path.join(tempProjectDir18, '.cline', 'skills', 'bmad-master', 'SKILL.md');
|
||||
assert(await fs.pathExists(skillFile18), 'Cline install writes SKILL.md directory output');
|
||||
|
||||
// Verify name frontmatter matches directory name
|
||||
const skillContent18 = await fs.readFile(skillFile18, 'utf8');
|
||||
const nameMatch18 = skillContent18.match(/^name:\s*(.+)$/m);
|
||||
assert(nameMatch18 && nameMatch18[1].trim() === 'bmad-master', 'Cline skill name frontmatter matches directory name exactly');
|
||||
|
||||
assert(!(await fs.pathExists(path.join(tempProjectDir18, '.clinerules', 'workflows'))), 'Cline setup removes legacy workflows dir');
|
||||
|
||||
// Reinstall/upgrade: run setup again over existing skills output
|
||||
const result18b = await ideManager18.setup('cline', tempProjectDir18, installedBmadDir18, {
|
||||
silent: true,
|
||||
selectedModules: ['bmm'],
|
||||
});
|
||||
|
||||
assert(result18b.success === true, 'Cline reinstall/upgrade succeeds over existing skills');
|
||||
assert(await fs.pathExists(skillFile18), 'Cline reinstall preserves SKILL.md output');
|
||||
|
||||
await fs.remove(tempProjectDir18);
|
||||
await fs.remove(installedBmadDir18);
|
||||
} catch (error) {
|
||||
assert(false, 'Cline native skills migration test succeeds', error.message);
|
||||
}
|
||||
|
||||
console.log('');
|
||||
|
||||
// ============================================================
|
||||
// Summary
|
||||
// ============================================================
|
||||
|
|
|
|||
|
|
@ -57,8 +57,11 @@ platforms:
|
|||
category: ide
|
||||
description: "AI coding assistant"
|
||||
installer:
|
||||
target_dir: .clinerules/workflows
|
||||
template_type: windsurf
|
||||
legacy_targets:
|
||||
- .clinerules/workflows
|
||||
target_dir: .cline/skills
|
||||
template_type: default
|
||||
skill_format: true
|
||||
|
||||
codex:
|
||||
name: "Codex"
|
||||
|
|
|
|||
|
|
@ -64,18 +64,18 @@ Support assumption: full Agent Skills support. Windsurf docs confirm workspace s
|
|||
|
||||
## Cline
|
||||
|
||||
Support assumption: full Agent Skills support. BMAD currently installs workflow files to `.clinerules/workflows`; target should move to the platform's native skills directory.
|
||||
Support assumption: full Agent Skills support. Cline docs confirm workspace skills at `.cline/skills/<skill-name>/SKILL.md` and global skills at `~/.cline/skills/`. BMAD has now migrated from `.clinerules/workflows` to `.cline/skills`.
|
||||
|
||||
**Install:** VS Code extension `saoudrizwan.claude-dev` — search "Cline" in Extensions or `code --install-extension saoudrizwan.claude-dev`
|
||||
|
||||
- [ ] Confirm current Cline skills path and whether `.cline/skills` is the correct BMAD target
|
||||
- [ ] Implement installer migration to native skills output
|
||||
- [ ] Add legacy cleanup for `.clinerules/workflows`
|
||||
- [ ] Test fresh install
|
||||
- [ ] Test reinstall/upgrade from legacy workflow output
|
||||
- [ ] Confirm ancestor conflict protection where applicable
|
||||
- [ ] Implement/extend automated tests
|
||||
- [ ] Commit
|
||||
- [x] Confirm current Cline skills path is `.cline/skills/{skill-name}/SKILL.md` with YAML frontmatter (name + description)
|
||||
- [x] Implement installer migration to native skills output
|
||||
- [x] Add legacy cleanup for `.clinerules/workflows`
|
||||
- [x] Test fresh install — 43 skills installed to `.cline/skills/`
|
||||
- [x] Test reinstall/upgrade from legacy workflow output
|
||||
- [x] Confirm no ancestor conflict protection is needed because Cline only scans workspace-local `.cline/skills/` and global `~/.cline/skills/`, with no ancestor directory inheritance
|
||||
- [x] Implement/extend automated tests — 9 assertions in test suite 18
|
||||
- [x] Commit
|
||||
|
||||
## Google Antigravity
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue