Use intent discovery mode instead of inlining the skill map into AGENTS.md - #497
Use intent discovery mode instead of inlining the skill map into AGENTS.md#497WaryaWayne wants to merge 3 commits into
Conversation
Generated projects ran `intent install --map`, which writes the complete skill-to-task table for every installed package into AGENTS.md. In a default app that is 99 lines; it grows with each add-on, and agents re-read all of it on every invocation regardless of whether the task touches those libraries. Plain `intent install` emits a 12-line pointer instructing the agent to run `intent list` / `intent load <package>#<skill>` on demand. Same capability, paid for only when used. Also updates the now-inaccurate "explicit skill mappings" copy to surface the two discovery commands, rendered for the project's package manager.
The changeset said the discovery-mode block is 12 lines; the generated AGENTS.md block is 10 lines including the intent-skills markers.
📝 WalkthroughWalkthroughTanStack Intent setup now installs skill discovery without generating mappings. Project creation output provides package-manager-specific ChangesIntent discovery integration
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/create/src/package-manager.ts`:
- Around line 64-76: Update intentCommand to include explicit Deno guidance
alongside the generated command: document that TanStack Intent’s Deno support is
best-effort, requires npm interoperability with node_modules enabled via
deno.json nodeModulesDir: "auto" or the relevant
--node-modules-dir/--allow-install flags, and may require the permissions needed
by the Deno CLI.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 74bb6804-05d6-44d0-9923-4bdad4694d56
📒 Files selected for processing (5)
.changeset/lean-intent-skill-guidance.mdpackages/create/src/create-app.tspackages/create/src/edge-create-app.tspackages/create/src/integrations/intent.tspackages/create/src/package-manager.ts
| export const INTENT_PACKAGE = '@tanstack/intent' | ||
|
|
||
| export function intentCommand( | ||
| packageManager: PackageManager, | ||
| args: Array<string>, | ||
| ) { | ||
| const { command, args: commandArgs } = getPackageManagerExecuteCommand( | ||
| packageManager, | ||
| INTENT_PACKAGE, | ||
| args, | ||
| ) | ||
| return [command, ...commandArgs].join(' ') | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
rg -n 'nodeModulesDir|node_modules|SUPPORTED_PACKAGE_MANAGERS|deno' packages/createRepository: TanStack/cli
Length of output: 5169
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== package-manager.ts =="
sed -n '1,170p' packages/create/src/package-manager.ts | cat -n
echo
echo "== relevant references to INTENT/expect commands =="
rg -n "INTENT|intentonCommand|intentCommand|list|load|npm:.*intent|command: 'intent'" packages/create/src packages/create/tests || true
echo
echo "== template/deno files mentioning nodeModulesDir or deno config =="
rg -n "nodeModulesDir|allow-net|allow-env|allow-read|allow-run|allow-write|`@tanstack/intent`|deno.lock" packages/create/src packages/create/tests -g '!*assets/**' || trueRepository: TanStack/cli
Length of output: 50368
🌐 Web query:
TanStack Intent Deno npm interop node_modules support deno run npm:
💡 Result:
Deno provides native support for npm packages, including TanStack libraries, through npm specifiers (e.g., npm:@tanstack/react-query) [1][2][3]. You do not need a node_modules directory by default [1][2][4]. NPM Interop and node_modules Support: - Default Behavior: By default, Deno resolves npm packages from a central global cache, which keeps your project directory clean and avoids the creation of a node_modules folder [5][6][4]. - Opt-in node_modules: Some packages or tools (like certain bundlers) require a node_modules directory [6][7][4]. You can enable this behavior by setting "nodeModulesDir": "auto" in your deno.json configuration file or by using the --node-modules-dir flag when running commands [8][6][7]. - Running with npm: When using npm specifiers (e.g., deno run npm:package), Deno automatically handles the download and resolution of dependencies [1][4]. If you have a package.json file present in your project, Deno defaults to creating a local node_modules directory, though this can be controlled via configuration [6][2][9]. TanStack Support: - TanStack libraries are fully compatible with Deno's npm specifier system [3][10]. Official Deno documentation and community contributions confirm that you can install and use packages like @tanstack/react-query directly via deno install npm:@tanstack/react-query or by referencing them in your imports [3][10]. Summary of Configuration: - To use npm packages without node_modules: Use the default Deno behavior (no extra configuration needed) [5][4]. - To force node_modules creation: Set "nodeModulesDir": "auto" in deno.json [6][7]. - For existing Node.js projects: You can run them in Deno by referencing dependencies in package.json and optionally setting the node_modules mode to manual or auto depending on your requirements [5][6][4].
Citations:
- 1: https://github.com/denoland/manual/blob/main/node/npm_specifiers.md
- 2: https://deno.com/blog/not-using-npm-specifiers-doing-it-wrong
- 3: https://docs.deno.com/examples/tanstack_tutorial/
- 4: https://deno.land/manual@v1.33.1/node/npm_specifiers
- 5: https://docs.deno.com/runtime/fundamentals/node/
- 6: https://docs.deno.com/runtime/fundamentals/node.md
- 7: https://docs.deno.com/runtime/packages/
- 8: https://docs.deno.com/runtime/reference/cli/run/
- 9: https://denoland.deno.dev/blog/not-using-npm-specifiers-doing-it-wrong
- 10: docs: add Deno to installation instructions query#10971
🌐 Web query:
TanStack Intent Deno Deno.run permissions --allow-net allow-env allow-read
💡 Result:
TanStack Intent is a CLI tool designed to ship and consume AI agent skills via npm packages [1][2]. While TanStack Intent lists Deno as a supported environment, it currently operates on a best-effort basis requiring npm interop with node_modules support enabled [3][4]. Regarding your query on Deno APIs and permissions: 1. Deno.run Deprecation: The Deno.run API is deprecated and has been soft-removed in Deno 2 [5][6]. You should replace it with the Deno.Command API [5][7]. - Example migration: // Instead of Deno.run const process = new Deno.Command("command_name", { args: ["arg1"], stdout: "piped", }); const { success, stdout } = await process.output; 2. Deno Permissions: To use APIs that require net, env, read, or run access, you must explicitly grant these permissions at runtime using command-line flags [8][9]. - Flag usage: - --allow-net: Grants network access (can be scoped to specific hosts) [8][10]. - --allow-env: Grants access to environment variables (can be scoped to specific variables) [8][10]. - --allow-read: Grants file system read access (can be scoped to specific paths) [8][10]. - --allow-run: Required for executing subprocesses, such as when using Deno.Command [8][11]. To grant all these permissions at once for a script, you can use: deno run --allow-net --allow-env --allow-read --allow-run script.ts For stricter security, it is highly recommended to scope these permissions (e.g., --allow-read=./data or --allow-net=example.com) rather than granting full access [9].
Citations:
- 1: https://tanstack.com/intent/latest
- 2: https://tanstack.com/intent/latest/docs/overview
- 3: https://registry.npmjs.org/%40tanstack%2Fintent
- 4: https://npmx.dev/package/@tanstack/intent
- 5: https://docs.deno.com/runtime/reference/migration_guide.md
- 6: denoland/deno@195b17a
- 7: https://denoland.medium.com/deno-2-0-release-candidate-bd2aa8623053
- 8: https://docs.deno.com/runtime/reference/permissions/
- 9: https://docs.deno.com/runtime/fundamentals/security/
- 10: https://docs.deno.com/api/deno/permissions
- 11: https://docs.deno.com/api/deno/subprocess/
Add explicit Deno guidance for TanStack Intent.
intentCommand returns deno run npm:@tanstack/intent ..., which works with Deno npm specifiers, but TanStack Intent documents Deno as best-effort and requiring npm interop with node_modules support. Add install/create guidance that Deno needs nodeModulesDir: "auto" in deno.json or --node-modules-dir/--allow-install, and any permissions the Deno CLI may need.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/create/src/package-manager.ts` around lines 64 - 76, Update
intentCommand to include explicit Deno guidance alongside the generated command:
document that TanStack Intent’s Deno support is best-effort, requires npm
interoperability with node_modules enabled via deno.json nodeModulesDir: "auto"
or the relevant --node-modules-dir/--allow-install flags, and may require the
permissions needed by the Deno CLI.
Source: MCP tools
Hey folks, I spun up a project with a lot of integrations and noticed my agent
constantly surfacing TanStack Intent skills. Great feature, but I have a concern
about how it's delivered.
intent install --mapwrites the full skill to task table into AGENTS.md. That's99 lines / ~14 KB on a default app before any add-ons. My project (15 add-ons:
query, table, db, better-auth, drizzle, sentry, mcp, shadcn and others) came out
at 157 lines / 26.8 KB / 51 skills.
AGENTS.md is re-read on essentially every invocation, so that catalog gets paid
for on every turn regardless of whether the task touches those libraries. In my
case the agent kept pulling frontend router/query skills while I was working on
unrelated backend code.
The catalog already lives in the installed packages, and
intent listreads iton demand. Inlining it into AGENTS.md duplicates it into the one file that's most
expensive to bloat. Growth also tracks TanStack packages that ship skills, and
the ones people actually reach for (db, table, query, router, start) all do.
What this PR does
Drops
--mapso intent uses its own default mode: a 10-line pointer telling theagent to run
intent list/intent load <package>#<skill>when a task actuallycalls for one.
Also updates the now-inaccurate "explicit skill mappings" copy in the next-steps
output to surface the two discovery commands, rendered for the project's package
manager.
26,777 → 721 bytes on my project, a 97% cut. 99 → 10 lines on a default app.
Worth noting this doesn't remove any information: the catalog stays exactly where
it already is, in the installed packages. It just stops being copied into the
context on every turn.
Happy to add an opt-in
--intent-mapflag if you'd rather keep the eager tableavailable for people who want it, same as the prompt for initializing a git repo
at the end of the create CLI.
Summary by CodeRabbit
New Features
Documentation