feat: add native on-demand skill loading with core/non-core skills#33038
feat: add native on-demand skill loading with core/non-core skills#33038m-faizan-tariq wants to merge 1 commit into
Conversation
- add type: core|non-core skill metadata support - add skills.autoLoad config for startup filtering - add /skills picker for on-demand loading - load non-core skills into session on selection - add tests and docs for new behavior
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
The following comment was made by an LLM, it may be inaccurate: Related PRs FoundI found a potentially related PR that should be checked: PR #33019: feat(tui): add inline skill picker This PR appears to add skill picker functionality to the TUI, which relates to your PR #33038's Also worth noting:
However, the main current PR (#33038) appears to be the only one comprehensively addressing native on-demand skill loading with the core/non-core type system and autoLoad configuration that you've described. |
|
if u want a skill to be omitted from context, just delete the description field, make it empty. it wont be presented to the agent but youll be able to invoke urself |
Summary
Adds native on-demand skill loading to OpenCode by introducing:
type: core | non-corefrontmatter in skillsskills.autoLoadconfiguration (all,core,none)/skillsTUI dialog for browsing and loading skills on demandWhy
OpenCode currently injects all discovered skill metadata into the prompt at startup,
which creates unnecessary token overhead for users with many installed skills. This
change keeps essential skills available while reducing startup prompt size.
Behavior
type: coreskills load automatically whenskills.autoLoadis set tocoretype: non-coreskills stay out of the startup prompt and are loaded via/skillsautoLoadisallImpact
In the tested environment, startup skill overhead drops from roughly 12,000+ tokens
to roughly 2,600 tokens by loading only core skills at startup.
Compatibility
Changes
packages/core/src/v1/config/skills.ts— autoLoad config schema (all/core/none)packages/opencode/src/skill/index.ts— skill type frontmatter, loadIntoSession, isLoadedpackages/opencode/src/skill/scanner.ts— scanAvailableSkills with type metadatapackages/opencode/src/session/system.ts— autoLoad filtering in system promptpackages/opencode/src/server/routes/instance/httpapi/handlers/skill.ts— skill API handlerspackages/opencode/src/server/routes/instance/httpapi/groups/skill.ts— API route declarationspackages/app/src/components/skill-picker.tsx— /skills TUI dialogpackages/app/src/pages/session/use-session-commands.tsx— /skills slash commandpackages/opencode/test/skill/skill.test.ts— tests for type parsing, scanning, loadingpackages/opencode/test/session/system.test.ts— tests for autoLoad filteringpackages/opencode/test/cli/run/footer.view.test.tsx— tests for /skills slashdocs/adr/002-on-demand-skill-loading.md— architectural decision recordTests
Notes for review