mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-22 02:54:31 -07:00
refactor(skills): replace 'project' with 'workspace' scope (#16380)
This commit is contained in:
@@ -35,9 +35,9 @@ describe('SkillManager', () => {
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('should discover skills from extensions, user, and project with precedence', async () => {
|
||||
it('should discover skills from extensions, user, and workspace with precedence', async () => {
|
||||
const userDir = path.join(testRootDir, 'user');
|
||||
const projectDir = path.join(testRootDir, 'project');
|
||||
const projectDir = path.join(testRootDir, 'workspace');
|
||||
await fs.mkdir(path.join(userDir, 'skill-a'), { recursive: true });
|
||||
await fs.mkdir(path.join(projectDir, 'skill-b'), { recursive: true });
|
||||
|
||||
@@ -92,9 +92,9 @@ description: project-desc
|
||||
expect(names).toContain('skill-project');
|
||||
});
|
||||
|
||||
it('should respect precedence: Project > User > Extension', async () => {
|
||||
it('should respect precedence: Workspace > User > Extension', async () => {
|
||||
const userDir = path.join(testRootDir, 'user');
|
||||
const projectDir = path.join(testRootDir, 'project');
|
||||
const projectDir = path.join(testRootDir, 'workspace');
|
||||
await fs.mkdir(path.join(userDir, 'skill'), { recursive: true });
|
||||
await fs.mkdir(path.join(projectDir, 'skill'), { recursive: true });
|
||||
|
||||
|
||||
@@ -39,8 +39,8 @@ export class SkillManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Discovers skills from standard user and project locations, as well as extensions.
|
||||
* Precedence: Extensions (lowest) -> User -> Project (highest).
|
||||
* Discovers skills from standard user and workspace locations, as well as extensions.
|
||||
* Precedence: Extensions (lowest) -> User -> Workspace (highest).
|
||||
*/
|
||||
async discoverSkills(
|
||||
storage: Storage,
|
||||
@@ -62,7 +62,7 @@ export class SkillManager {
|
||||
const userSkills = await loadSkillsFromDir(Storage.getUserSkillsDir());
|
||||
this.addSkillsWithPrecedence(userSkills);
|
||||
|
||||
// 4. Project skills (highest precedence)
|
||||
// 4. Workspace skills (highest precedence)
|
||||
const projectSkills = await loadSkillsFromDir(
|
||||
storage.getProjectSkillsDir(),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user