Repository navigation
feat: add project options for skills - #356
LadyBluenotes wants to merge 1 commit into
Conversation
A skill can ship an options.json file beside its SKILL.md that declares choices, each with a question, the allowed values, and a default. A project records its answers under intent.options in package.json, and intent load appends a Project options section with the recorded choices and the defaults for the rest. intent validate checks the file. Intent reads options.json as data and runs no package code. A skill without the file loads unchanged.
🦋 Changeset detectedLatest commit: e73cd90 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
|
View your CI Pipeline Execution ↗ for commit e73cd90
💡 With Ultracache enabled, Nx Cloud learns each task's file inputs in CI and uses them on later runs. Turn on Ultracache in workspace settings ↗ · Read docs ↗ ☁️ Nx Cloud last updated this comment at |
commit: |
🎯 Changes
Some skills need different guidance depending on choices a project has made, such as its framework. Today the skill has to carry every variant, and the agent has to work out which one applies in every session. This adds a way for a project to record those choices once.
options.jsonfile beside itsSKILL.md. Each option declares aquestion, itschoices, and adefault.intent.optionsinpackage.json, keyed by<package>#<skill>. In a workspace, choices merge from the root to the current package, and the nearest value wins for each option.intent loadappends a## Project optionssection to the skill content. It lists each recorded choice, and for an option the project has not recorded it lists the default with the question and the choices.intent validatechecks the shape ofoptions.json.options.jsonas data and runs no package code. A skill without the file loads byte-for-byte as before.options.jsoneach print a warning on stderr; the skill still loads.intent.optionsis edited by hand.skills/setup/options.jsonin the package:{ "framework": { "question": "Which framework does this app use?", "choices": ["nextjs", "tanstack-start", "other"], "default": "other" }, "fragmentColocation": { "question": "Set up fragment colocation?", "choices": ["yes", "no"], "default": "yes" } }package.jsonin the project:{ "intent": { "options": { "@acme/client#setup": { "framework": "tanstack-start" } } } }End of
intent load @acme/client#setup:loadchecks foroptions.jsonwith oneexistsSyncwhen the skill has none.benchmarks/intent/load.bench.ts, Vitest 4.1.11, macOS arm64, Node 26.10.0)main(755b9b8) mine73cd90) minloads direct dependency content as json(10 loads per iteration)✅ Checklist
pnpm run test:pr(runpnpm build:allfirst).🚀 Release Impact