Skip to content

feat(skills): discover Claude Code skills from .claude/skills - #43

Merged
aakashrajput merged 1 commit into
KlaatAI:mainfrom
syf2211:feat/compat-claude-skills-discovery
Jul 21, 2026
Merged

feat(skills): discover Claude Code skills from .claude/skills#43
aakashrajput merged 1 commit into
KlaatAI:mainfrom
syf2211:feat/compat-claude-skills-discovery

Conversation

@syf2211

@syf2211 syf2211 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Add compatibility discovery for Claude Code skills stored under ~/.claude/skills and .claude/skills/<name>/SKILL.md, gated by compat.importClaudeSkills (default on). Native .klaatai/skills entries continue to win on name collisions.

Motivation

Many developers already maintain Claude Code skill libraries. KlaatCode should discover those skills without manual migration so users can invoke them via /skill or /<name>.

Fixes #38

Changes

  • Extract skill loading into src/skills/loader.ts with shared frontmatter parsing
  • Discover Claude-format skills from project and user skill directories
  • Add compat.importClaudeSkills config flag (opt-out)
  • Show scope and source directory in /skill list (e.g. project · .claude/skills)
  • Add fixture-based unit tests for discovery, global paths, collision precedence, and opt-out

Tests

  • bun run typecheck — pass
  • bun test — pass (159 tests, including 6 new loader tests)

Notes

  • Skill config is read from the REPL session snapshot at startup (same pattern as other config flags)
  • Frontmatter parser matches the existing single-line YAML style used for native skills

Import skills from ~/.claude/skills and .claude/skills when
compat.importClaudeSkills is enabled (default on). Native
.klaatai/skills entries win on name collisions. /skill list
shows scope and source directory.

Fixes KlaatAI#38
@github-actions

Copy link
Copy Markdown
Contributor

🤖 KlaatAI Review Bot (powered by Klaatu, advisory only — a maintainer makes the real call)

Issue match
Fully addresses #38. Discovers project and global Claude skills, parses frontmatter, enforces native-wins collision, displays source in /skill list, and adds the compat.importClaudeSkills config flag. All acceptance criteria are met.

Test coverage
src/skills/loader.test.ts covers frontmatter parsing, project/global discovery, collision precedence, and the opt-out flag. Missing coverage: the expandSkill fallback path (when $ARGUMENTS is absent but args are passed) and integration tests for the /skill list UI output formatting in repl.ts.

Correctness concerns
Collision precedence in loadSkills correctly relies on insertion order (Claude loaded first, native overwrites via Map.set). Error handling for missing SKILL.md files in loadClaudeSkillDir safely catches read errors. One note: loadSkills performs synchronous filesystem I/O on every slash-command invocation in repl.ts. This mirrors the pre-existing pattern but now scans four directories instead of two; flag for human judgment on performance if user skill libraries grow large.

Verdict
Ready to merge as-is.

This is an automated review to help triage faster, not a gate. Nothing here blocks merging.

@aakashrajput

Copy link
Copy Markdown
Member

@syf2211
Thanks a lot for your contribution! 🎉

Really appreciate you taking the time to improve KlaatCode. Your contribution helps make the project better for everyone.

If you haven't already, we'd love it if you could ⭐ star the repository and follow https://github.com/KlaatAI on GitHub to stay updated with new features and releases.

Feel free to keep using KlaatAI for your projects, and don't hesitate to open more issues, suggest ideas, or submit future PRs—we're always happy to have contributors like you in the community.

Looking forward to seeing your next contribution. Meantime please follow KlaatAI socials and if ok you can join discord too for suggestions on project, thanks Happy coding! 🚀

@aakashrajput
aakashrajput merged commit 76a4858 into KlaatAI:main Jul 21, 2026
2 checks passed
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.

Compat: discover skills from .claude/skills

2 participants