Skip to content

fix: flatten nested skills to /group-action so Claude Code discovers them#6

Merged
phuthuycoding merged 1 commit into
masterfrom
fix/skill-flatten
Jun 1, 2026
Merged

fix: flatten nested skills to /group-action so Claude Code discovers them#6
phuthuycoding merged 1 commit into
masterfrom
fix/skill-flatten

Conversation

@phuthuycoding
Copy link
Copy Markdown
Owner

Vấn đề

Claude Code chỉ scan skills một cấp (~/.claude/skills/<name>/SKILL.md) và lấy tên thư mục làm slash command — nó không đệ quy vào folder nhóm lồng nhau. Installer hiện symlink/copy nguyên folder nhóm (~/.claude/skills/fixassets/skills/fix), nên toàn bộ 21 skill namespaced biến mất — gõ /fix:root-cause báo No commands match.

Đã verify bằng test thực tế: folder tên có dấu : thì Claude Code nhận, nhưng : cấm trong tên file trên Windows → chọn flatten bằng dấu - cho nhất quán mọi OS.

Thay đổi

  • symlink.tslistSkillsNested flatten <group>/<action><group>-<action> (hyphen, vì : invalid trên Windows); bỏ qua entry không phải thư mục (vd .DS_Store).
  • install/native.ts — Claude install tạo entry skill phẳng 1 cấp thay vì symlink folder nhóm.
  • install/skill-editor.ts — flatten tương tự cho Codex/Antigravity.
  • uninstall.ts — managed-names gồm cả tên phẳng để gỡ đúng (Claude/Codex/Antigravity) + dọn rác nhóm cũ.
  • docs — CLAUDE.md/README đổi sang /<group>-<action> và sửa lại phần giải thích cơ chế (vốn mô tả sai).

Kết quả

21 skill cài ra /docs-sync, /feature-new, /fix-root-cause, /review-branch, ... Verify: 21/21 symlink phẳng, SKILL.md đọc được, frontmatter name: khớp 100% tên phẳng.

Lưu ý cho reviewer

Trong lúc điều tra phát hiện thêm 1 footgun (chưa fix trong PR này): uninstall có nhánh || item.isSymlink nên xoá mọi symlink trong ~/.claude/skills, kể cả skill ngoài moicle. Nên cân nhắc siết lại match theo target nằm trong moicle assets — đề xuất PR riêng.

…rs them

Claude Code scans skills only one level deep and uses the folder name as the
slash-command name; it does not recurse into nested group folders. The installer
symlinked/copied whole group folders (~/.claude/skills/fix -> assets/skills/fix),
so all 21 namespaced skills were invisible (/fix:root-cause returned
"No commands match").

- listSkillsNested: flatten <group>/<action> to <group>-<action> (hyphen, since
  ':' is an invalid filename character on Windows); skip non-dir entries (.DS_Store)
- install/native.ts: install flat single-level skill entries for Claude
- install/skill-editor.ts: same flattening for Codex/Antigravity skill folders
- uninstall.ts: include flattened names in managed-names so they get removed
- docs: switch to /<group>-<action> and correct the skill-discovery explanation
@phuthuycoding phuthuycoding merged commit 233f913 into master Jun 1, 2026
3 checks passed
@phuthuycoding phuthuycoding deleted the fix/skill-flatten branch June 1, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant