Skip to content

feat: add project options for skills - #356

Draft
LadyBluenotes wants to merge 1 commit into
mainfrom
feat/skill-options
Draft

LadyBluenotes wants to merge 1 commit into
mainfrom
feat/skill-options

Conversation

@LadyBluenotes

Copy link
Copy Markdown
Member

🎯 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.

  • A skill can ship an options.json file beside its SKILL.md. Each option declares a question, its choices, and a default.
  • A project records its answers under intent.options in package.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 load appends a ## Project options section 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 validate checks the shape of options.json.
  • Intent reads options.json as data and runs no package code. A skill without the file loads byte-for-byte as before.
  • A recorded value that is not a declared choice, a recorded option the skill does not declare, and an invalid options.json each print a warning on stderr; the skill still loads.
  • There is no command or install prompt to record answers yet; intent.options is edited by hand.

skills/setup/options.json in 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.json in the project:

{
  "intent": {
    "options": {
      "@acme/client#setup": { "framework": "tanstack-start" }
    }
  }
}

End of intent load @acme/client#setup:

## Project options

Choices this project made for `@acme/client#setup`, from `intent.options` in `package.json`. Follow the guidance that matches them.

- framework: tanstack-start
- fragmentColocation: yes (default, not recorded). Set up fragment colocation? Choices: yes, no.

load checks for options.json with one existsSync when the skill has none.

Benchmark (benchmarks/intent/load.bench.ts, Vitest 4.1.11, macOS arm64, Node 26.10.0) main (755b9b8) min PR (e73cd90) min
loads direct dependency content as json (10 loads per iteration) 1.774 ms, 1.812 ms, 1.814 ms 1.793 ms, 1.802 ms

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr (run pnpm build:all first).

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

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-bot

changeset-bot Bot commented Nov 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e73cd90

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@tanstack/intent Patch

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

@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@nx-cloud

nx-cloud Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit e73cd90

Command Status Duration Result
nx affected --targets=test:eslint,test:sherif,t... ✅ Succeeded 40s View ↗
nx run-many --targets=build ✅ Succeeded 2s View ↗

💡 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 2026-11-22 19:00:37 UTC

@pkg-pr-new

pkg-pr-new Bot commented Nov 22, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@tanstack/intent@356

commit: e73cd90

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant