mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-11 12:17:45 +02:00
Skills previously lived as flat `<slug>.md` files injected directly into the user prompt, which bypassed Claude Code CLI's native discovery entirely. Switch to the CLI's expected `<slug>/SKILL.md` layout so the SDK can surface each skill's frontmatter to the model and let it call `Skill(slug)` lazily on its own — without having to eagerly inject every skill body every turn. Key changes: - One-shot startup migration moves existing flat files into the directory layout (idempotent, crash-safe, preserves existing dir if already migrated) - `get_installed_slugs()` with module-level cache (keyed by SKILLS_DIR) so the per-turn allowlist query is effectively free on the hot path - `_ensure_frontmatter()` stamps a valid YAML block on every write so the CLI listing never silently drops a skill with missing frontmatter - `_resolve_sdk_skill_allowlist()` replaces the old `skills=[]` kill-switch: passes only user-installed slugs to the SDK, filtering out bundled Claude Code skills (/init, /review, etc.) by not including them, and dropping manually-attached skills that are already injected into the user message - CRUD endpoints and tests updated to the new directory layout throughout