-
Notifications
You must be signed in to change notification settings - Fork 406
coding-agent: add skills_discover hook + upward .pi/skills example #965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Consider this a proposal for some kind of |
49f4f5c to
f228408
Compare
|
I think this should could be even more flexible by simply providing additional paths for extensions, skills, prompt templates, and themes to be loaded along side the default? What do you think? |
|
Yeah, that would work for me. If a startup hook can return additional paths for skills/prompts/themes (and optionally extensions if a second pass or /reload is acceptable), then recursive logic can be implemented entirely in an extension. I’d be happy with that. |
|
I thought a bit harder about it, extensions returning extensions is rather tricky, as extensions can contribute CLI flags (would also need to catch recursiveness here). So I think instead we want extensions to just be able to return additional skills/prompts/themes. I'll fix that on my end! |
|
Sounds good, you get what I'm going after - feel free to close this PR. |
f228408 to
9c17133
Compare
Extensions can now provide additional skill directories via the skills_discover event, which fires during skill discovery before the session starts. This enables use cases like: - Traversing ancestor directories for shared skills - Dynamic skill directories based on project structure - Team/organization skill repositories Changes: - Add SkillsDiscoverEvent and SkillsDiscoverResult types - Add emitSkillsDiscover() method to ExtensionRunner - Reorder sdk.ts to load extensions before skill discovery - Add extensionDirectories option to loadSkills() - Update docs with usage examples feat(coding-agent): allow skills_discover during resource load fix(coding-agent): include extension providers in skills_discover
Required by CONTRIBUTING.md (npm run check)
9c17133 to
4b1427a
Compare
Summary
Add a minimal
skills_discoverextension hook to the ResourceLoader pipeline, plus an example extension that walks upward to discover.pi/skills.Motivation
The v0.50.0 loader architecture (#645) is flexible but still doesn’t allow extensions to contribute additional skill directories during discovery (e.g., ancestor traversal). This hook enables that without changing default discovery rules.
What’s Included
skills_discoverhook surfaced in the extension API and runner.skills_discoverbefore loading skills and merges any returned directories..pi/skillsviaskills_discover.What’s NOT Included
Tests
npm run check(ran; auto‑formatted one comment inextensions/runner.ts)./test.sh(ran; no failed tests, some skipped as expected)npm run build(ran)Note:
npm testoutput includes expected errors from package‑manager tests that hitnonexistent-package/nonexistentgit repo; the test run still completed with no failing test cases.