fix(cli): include ~/.codex/skills in user skill discovery (#482) (#487)

The skill listing only scanned ~/.agents/skills and ~/.claude/skills
for user-level skills, ignoring ~/.codex/skills where Codex users
commonly store their skills. Add ~/.codex/skills to getUserSkillsRoots()
so these skills appear in the web UI $ autocomplete.

Hidden directories (starting with .) inside the skills root are still
skipped (e.g., .system/).

via [HAPI](https://hapi.run)

Co-authored-by: HAPI <noreply@hapi.run>
This commit is contained in:
Haoqing Wang
2026-04-17 13:16:45 +08:00
committed by GitHub
co-authored by HAPI
parent f408608db0
commit b9d28f4d30
2 changed files with 4 additions and 2 deletions
+3 -2
View File
@@ -69,14 +69,15 @@ describe('listSkills', () => {
expect(skills.find((s) => s.name === 'alpha')?.description).toBe('Alpha from agents')
})
it('ignores legacy ~/.codex skills', async () => {
it('lists user skills from ~/.codex/skills', async () => {
await writeSkill(join(homeDir, '.agents', 'skills', 'amis'), 'amis', 'AMIS guide')
await writeSkill(join(homeDir, '.codex', 'skills', 'hello-agents'), 'helloagents', 'Main skill')
// Hidden directories (starting with .) are skipped
await writeSkill(join(homeDir, '.codex', 'skills', '.system', 'skill-creator'), 'skill-creator', 'Create skills')
const skills = await listSkills()
expect(skills.map((skill) => skill.name)).toEqual(['amis'])
expect(skills.map((skill) => skill.name)).toEqual(['amis', 'helloagents'])
})
it('falls back to directory name when frontmatter is missing', async () => {
+1
View File
@@ -26,6 +26,7 @@ function getUserSkillsRoots(): string[] {
return [
join(home, '.agents', 'skills'),
join(home, '.claude', 'skills'),
join(home, '.codex', 'skills'),
];
}