mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-01 15:34:29 -07:00
feat(skills): implement linking for agent skills (#18295)
This commit is contained in:
@@ -121,10 +121,12 @@ export async function loadSkillsFromDir(
|
||||
return [];
|
||||
}
|
||||
|
||||
const skillFiles = await glob(['SKILL.md', '*/SKILL.md'], {
|
||||
const pattern = ['SKILL.md', '*/SKILL.md'];
|
||||
const skillFiles = await glob(pattern, {
|
||||
cwd: absoluteSearchPath,
|
||||
absolute: true,
|
||||
nodir: true,
|
||||
ignore: ['**/node_modules/**', '**/.git/**'],
|
||||
});
|
||||
|
||||
for (const skillFile of skillFiles) {
|
||||
@@ -171,8 +173,11 @@ export async function loadSkillFromFile(
|
||||
return null;
|
||||
}
|
||||
|
||||
// Sanitize name for use as a filename/directory name (e.g. replace ':' with '-')
|
||||
const sanitizedName = frontmatter.name.replace(/[:\\/<>*?"|]/g, '-');
|
||||
|
||||
return {
|
||||
name: frontmatter.name,
|
||||
name: sanitizedName,
|
||||
description: frontmatter.description,
|
||||
location: filePath,
|
||||
body: match[2]?.trim() ?? '',
|
||||
|
||||
Reference in New Issue
Block a user