Skip to content

Use intent discovery mode instead of inlining the skill map into AGENTS.md - #497

Open
WaryaWayne wants to merge 3 commits into
TanStack:mainfrom
WaryaWayne:fix/intent-skill-mappings-context-cost
Open

Use intent discovery mode instead of inlining the skill map into AGENTS.md#497
WaryaWayne wants to merge 3 commits into
TanStack:mainfrom
WaryaWayne:fix/intent-skill-mappings-context-cost

Conversation

@WaryaWayne

@WaryaWayne WaryaWayne commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

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 --map writes the full skill to task table into AGENTS.md. That's
99 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 list reads it
on 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 --map so intent uses its own default mode: a 10-line pointer telling the
agent to run intent list / intent load <package>#<skill> when a task actually
calls 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.

Lines Bytes Skills
Default app (query only) 99 14,157 31
15-add-on app 157 26,777 51
After this PR 10 721

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-map flag if you'd rather keep the eager table
available 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

    • Updated AI agent setup to use on-demand skill discovery instead of generating complete skill mappings.
    • Added guidance to list available skills and load specific skills as needed.
    • Added package-manager-aware commands for installing and using TanStack Intent.
  • Documentation

    • Updated generated setup instructions and next steps with Intent discovery commands and examples.

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.
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

TanStack Intent setup now installs skill discovery without generating mappings. Project creation output provides package-manager-specific intent list and intent load <package>#<skill> commands, and a patch changeset documents the updated guidance.

Changes

Intent discovery integration

Layer / File(s) Summary
Intent command abstraction
packages/create/src/package-manager.ts
Adds the shared Intent package constant and helper for generating package-manager-specific commands.
Discovery installation flow
packages/create/src/integrations/intent.ts, packages/create/src/edge-create-app.ts
Changes Intent installation from skill mappings to skill discovery and updates fallback commands.
Agent guidance output
packages/create/src/create-app.ts, packages/create/src/edge-create-app.ts, .changeset/lean-intent-skill-guidance.md
Updates generated next steps and changeset documentation with on-demand list and load commands.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • TanStack/cli#496: Modifies the same Intent setup and next-step messaging paths with different install behavior.

Suggested reviewers: tannerlinsley

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: switching from inline skill maps to Intent discovery mode in AGENTS.md.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between efbc8d5 and 73d4df9.

📒 Files selected for processing (5)
  • .changeset/lean-intent-skill-guidance.md
  • packages/create/src/create-app.ts
  • packages/create/src/edge-create-app.ts
  • packages/create/src/integrations/intent.ts
  • packages/create/src/package-manager.ts

Comment on lines +64 to +76
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(' ')
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg -n 'nodeModulesDir|node_modules|SUPPORTED_PACKAGE_MANAGERS|deno' packages/create

Repository: 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/**' || true

Repository: 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:


🌐 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:


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

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