feat(core): support shipping built-in skills with the CLI (#16300)

This commit is contained in:
N. Taylor Mullen
2026-01-12 15:44:08 -08:00
committed by GitHub
parent 57d4cd6357
commit d4d2cd3de9
4 changed files with 75 additions and 3 deletions
+12 -3
View File
@@ -4,6 +4,8 @@
* SPDX-License-Identifier: Apache-2.0
*/
import * as path from 'node:path';
import { fileURLToPath } from 'node:url';
import { Storage } from '../config/storage.js';
import { type SkillDefinition, loadSkillsFromDir } from './skillLoader.js';
import type { GeminiCLIExtension } from '../config/config.js';
@@ -56,9 +58,16 @@ export class SkillManager {
* Discovers built-in skills.
*/
private async discoverBuiltinSkills(): Promise<void> {
// Built-in skills can be added here.
// For now, this is a placeholder for where built-in skills will be loaded from.
// They could be loaded from a specific directory within the package.
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const builtinDir = path.join(__dirname, 'builtin');
const builtinSkills = await loadSkillsFromDir(builtinDir);
for (const skill of builtinSkills) {
skill.isBuiltin = true;
}
this.addSkillsWithPrecedence(builtinSkills);
}
private addSkillsWithPrecedence(newSkills: SkillDefinition[]): void {