Repository navigation
feat(skills): import a directory of skills by picking from a discovered list - #9
Conversation
…ed list
Importing a GitHub URL that points at a CONTAINER directory (e.g.
github.com/larksuite/cli/tree/main/skills) failed with "SKILL.md not found",
because the importer treats the URL as one skill and there was no way to import
a parent directory holding many skills — the user had to paste each sub-skill
URL (…/skills/lark-base) individually.
Now, when the pointed directory has no SKILL.md of its own but its immediate
subdirectories do, the import returns the discovered sub-skills instead of an
error, and the create dialog presents them as a checklist for the user to pick
which to import. Each candidate re-imports as a normal single skill (its own
/tree/<ref>/<dir>/<sub> URL), so provenance + hourly origin sync work per skill.
Backend:
- discoverGitHubDirectorySkills: one recursive git-trees request, filtered to
immediate subdirectories containing a SKILL.md (immediateSubSkillDirs). Stays
within GitHub's rate limit vs N per-subdir contents calls.
- ImportSkill: on a GitHub single-skill miss, fall back to discovery and return
SkillImportResult{status:"multiple", candidates:[…]} (HTTP 200) rather than
failing.
Frontend:
- api.importSkill now returns Skill | {status:"multiple", candidates}.
- URL import form renders a select-all checklist and imports the selected
candidates, reporting per-skill success/failure. i18n across en/zh/ja/ko.
Tests: immediateSubSkillDirs (container filtering, nested/own SKILL.md excluded)
and buildGitHubTreeURL round-trip through parseGitHubURL. Verified live against
larksuite/cli (27 sub-skills discovered).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NYStwEXJFCJLokYqKVUBUg
|
Warning Review limit reached
Next review available in: 19 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (10)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ed list (#9) Importing a GitHub URL that points at a CONTAINER directory (e.g. github.com/larksuite/cli/tree/main/skills) failed with "SKILL.md not found", because the importer treats the URL as one skill and there was no way to import a parent directory holding many skills — the user had to paste each sub-skill URL (…/skills/lark-base) individually. Now, when the pointed directory has no SKILL.md of its own but its immediate subdirectories do, the import returns the discovered sub-skills instead of an error, and the create dialog presents them as a checklist for the user to pick which to import. Each candidate re-imports as a normal single skill (its own /tree/<ref>/<dir>/<sub> URL), so provenance + hourly origin sync work per skill. Backend: - discoverGitHubDirectorySkills: one recursive git-trees request, filtered to immediate subdirectories containing a SKILL.md (immediateSubSkillDirs). Stays within GitHub's rate limit vs N per-subdir contents calls. - ImportSkill: on a GitHub single-skill miss, fall back to discovery and return SkillImportResult{status:"multiple", candidates:[…]} (HTTP 200) rather than failing. Frontend: - api.importSkill now returns Skill | {status:"multiple", candidates}. - URL import form renders a select-all checklist and imports the selected candidates, reporting per-skill success/failure. i18n across en/zh/ja/ko. Tests: immediateSubSkillDirs (container filtering, nested/own SKILL.md excluded) and buildGitHubTreeURL round-trip through parseGitHubURL. Verified live against larksuite/cli (27 sub-skills discovered). Claude-Session: https://claude.ai/code/session_01NYStwEXJFCJLokYqKVUBUg Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Problem
Importing a GitHub URL that points at a container directory —
github.com/larksuite/cli/tree/main/skills— fails with "SKILL.md not found". The importer treats the URL as a single skill, so the user has to paste each sub-skill URL (…/skills/lark-base) one by one (27 of them for that repo).Data structure (for context)
A skill is a single-skill entity:
skill(one row:nameunique per workspace,content=SKILL.md,configJSONB withorigin+sync metadata) +skill_file(supporting files) +agent_skill(M2M). The GitHub importer fetches<dir>/SKILL.md— a container dir has none, hence the failure.Change
When the pointed directory has no SKILL.md but its immediate subdirectories do, the import now returns the discovered sub-skills and the create dialog shows a checklist to pick which to import (select-all by default). Each candidate re-imports as a normal single skill via its own
/tree/<ref>/<dir>/<sub>URL, so provenance and hourly origin-sync keep working per skill.Backend
discoverGitHubDirectorySkills: one recursive git-trees request, filtered to immediate subdirs with a SKILL.md (immediateSubSkillDirs) — avoids N per-subdir contents calls / rate limits.ImportSkill: on a GitHub single-skill miss, falls back to discovery and returnsSkillImportResult{status:"multiple", candidates:[…]}(HTTP 200) instead of erroring.Frontend
api.importSkill→Skill | {status:"multiple", candidates}.Verification
go build,go vet, unit tests forimmediateSubSkillDirs(own/nested SKILL.md excluded) +buildGitHubTreeURLround-trip. Verified live againstlarksuite/cli→ 27 sub-skills discovered with correct URLs.core+viewstypecheck; full@multica/viewsvitest suite (2914 tests) incl. locale parity.🤖 Generated with Claude Code