TanStack Intent
repository·main·Indexed 43 days ago
https://github.com/tanstack/intentA CLI tool for library maintainers to manage Agent Skills. It enables developers to auto-discover, validate, and ship skills compatible with the Agent Skills standard, ensuring they are versioned alongside library code. Features include skill loading guidance for agent configuration files, maintainer workflows for authoring and syncing skills, and an evaluation suite for measuring Copilot discovery and invocation.
What's inside TanStack Intent
- TanStack Intent is a CLI designed for library maintainers to generate, validate, and ship Agent Skills alongside their npm packages. It features auto-discovery of skills, versioning that stays in sync with your code, and compatibility with the open Agent Skills standard.
Decide between Core and Framework skill content
mainWhen planning your file tree, use the following criteria to decide if content belongs in a
coreskill or aframeworkskill.Content Goes in... Mental models, concepts, lifecycle Core Configuration options and their effects Core Type system, generics, inference Core Common mistakes that apply to all frameworks Core Hooks ( useX,createX)Framework Components ( <Link>,<Outlet>)Framework Provider setup and wiring Framework SSR/hydration patterns specific to a framework Framework Framework-specific gotchas Framework Important Rules:
- Framework Decomposition: If a library has separate framework adapter packages (e.g., React, Vue), do not create one monolithic framework skill. Decompose it into per-framework skills co-located with each adapter package.
- Adapter-heavy Domains: For domains covering multiple adapters with distinct configs, use one
SKILL.mdfor shared patterns and separatereferences/[adapter].mdfiles for specific details.
Understand the Intent skill lifecycle
mainIntent operates across six lifecycle stages. It can observe and verify the first four stages, but the final two depend entirely on the agent's behavior.
State Meaning Observable by Intent 1. Available Skill discovered from an installed or workspace package. Yes 2. Permitted Project policy allows the package/skill to surface (not removed by intent.exclude).Yes 3. Loaded A supported load path resolved the skill and returned its content. Yes 4. Delivered Intent placed guidance where an agent can access it (e.g., session hook context). Yes (output only) 5. Activated The agent selected or received the skill for a task. No 6. Applied The model followed the skill correctly. No Note: Observing an
intent loadcommand does not guarantee the skill was relevant or that the model successfully used the guidance.Understand the default Skill Loading guidance output
mainBy default,
intent installcreates a guidance block that instructs agents to discover skills and load matching guidance on demand. This block is inserted into supported config files likeAGENTS.md.Default Block Structure:
<!-- intent-skills:start --> ## Skill Loading Before editing files for a substantial task: - Run `npx @tanstack/intent@latest list` from the workspace root to see available local skills. - If a listed skill matches the task, run `npx @tanstack/intent@latest load <package>#<skill>` before changing files. - Use the loaded `SKILL.md` guidance while making the change. - Monorepos: when working across packages, run the skill check from the workspace root and prefer the local skill for the package being changed. - Multiple matches: prefer the most specific local skill for the package or concern you are changing; load additional skills only when the task spans multiple packages or concerns. <!-- intent-skills:end -->Tip: Keep the
intent-skillsblock near the top of your guidance file (e.g.,AGENTS.md) so agents read it before task-specific instructions.Maintain the library planning record
mainEvery authoring batch in TanStack Intent must incrementally maintain three cumulative planning documents. These documents serve as the official record of library domains, developer tasks, maintainer decisions, coverage, and remaining work. Do not replace these documents with only the tasks from a single batch; they must be cumulative.
The Three Planning Documents
domain_map.yaml: Manages domain/task relationships, supported failure modes, cross-references, tensions, and knowledge gaps. It ensures task slugs and package ownership stay aligned with skills.skill_spec.md: A human-readable record of coverage and decisions. It must include a Coverage and batch history section recording assessed scope, completed batches (with source revision/version), consequential decisions, check outcomes, and remaining work. Distinguish between implemented guidance and planned work.skill_tree.yaml: Manages skill identities, paths, prerequisites, source mappings, and package placement. It tracksplannedorretiredstatuses and maintains links to the other artifacts.
Note:
.intent/review-state.jsonrecords review evidence but is not a replacement for these three documents.Ensure cross-model compatibility for skill output
mainTo ensure that generated skill content is consistently consumed by all major AI coding agents, follow these formatting rules:
- Format: Use Markdown with YAML frontmatter.
- Tags: Do not use XML tags in generated content.
- Code Blocks: Use triple backticks with language annotations (e.g.,
```ts). - Headers: Use
##for section boundaries. - Descriptions: State distinct loading conditions.
- Examples: Show concrete values; never use placeholders.
- Instruction Style: Use positive instructions (e.g., "Use X") rather than negative ones (e.g., "Don't use Y").
- Information Hierarchy: Place critical information at the start or end of sections, never buried in the middle.
- Self-containment: Each
SKILL.mdmust be self-contained, except for dependencies declared in therequiresfield.
Understand intent.skills special forms and notices
mainThe state of your
intent.skillsconfiguration changes how Intent behaves and what notices it emits tostderr:Form Result Notice Absent (no key) Discovery commands surface every discovered package. Deprecation notice until configured. Empty ( "skills": [])Surfaces no packages. Info notice on stderr. Wildcard ( "skills": ["*"])Permits every discovered package across all scopes/kinds. Acknowledged-risk notice (unvetted skills may reach your agent). Discovery Notices
- Unpermitted package: Human output names omitted packages; agent sessions receive only counts.
- Configured but not discovered: Reports that the package was not found.
- Explicitly excluded: No unlisted-source notice is emitted.
Identify cross-skill tensions and references
mainTo improve agent output, identify how different skills interact through tensions and references.
Cross-skill Tensions
Identify structural pulls where optimizing for one task makes another harder. A tension is not a failure mode, but a design tradeoff.
- Example: "SSR correctness requires patterns that hurt client-side performance."
- Goal: Target 2–4 tensions. Name the skills in conflict, describe the pull, and state what an agent gets wrong when only considering one side.
Cross-references
Identify skills that illuminate each other without conflicting. These become "See also" pointers.
- Example: A state management skill referencing an SSR skill ("state hydration requires understanding SSR lifecycle").
- Output: Note which skill references which and why awareness of the other improves output.
How the Agent Skills Registry discovery works
mainThe Agent Skills Registry automatically indexes npm packages that include thetanstack-intentkeyword. The registry periodically searches npm for this keyword, downloads the package tarball, extracts allskills/**/SKILL.mdfiles, and indexes their contents. Every new version you publish is automatically indexed.Understand how `intent.skills` permissions work
mainThe
intent.skillsconfiguration in yourpackage.jsondetermines which packages and specific skills are visible to Intent. The nearest configured list (including inherited workspace permissions) applies.Supported Rule Patterns
Rule Pattern Effect "*"Enables all discovered npm and workspace sources (all packages and skills). "@tanstack/query"Enables all skills within that specific npm package. "@tanstack/*"Enables all skills in any matching npm packages. "@tanstack/query#fetching"Enables only the fetchingskill within that package."workspace:@scope/internal"Enables all skills in a specific workspace package. "workspace:@scope/internal#testing"Enables only the testingskill in a specific workspace package.Key Behaviors
- Wildcards: Package patterns support
*. Individual skill entries require an exact package and skill name. - No Configuration: If no list is configured, all discovered sources appear (with a migration notice).
- Empty List (
[]): No sources are permitted; an informational notice is shown. - Scope: Permissions select sources and skill names but do not freeze skill content when dependencies are updated. Git sources are not supported.
- Wildcards: Package patterns support
Managing skill versions and updates
mainWhen distributing skills, be aware of how versioning works across different installers:
- Command Pinning: Generated commands do not automatically pin a release. Each installer resolves its own default source. To pin a version, use
--pin <tag-or-sha>withgh skill addor use a specific reference likeowner/repo@<tag>for Claude marketplace sources. - Plugin Versions: If a Claude plugin declares a
versionfield, you must manually bump this version on every plugin release. If no version is declared, Git-based Claude installs default to the source commit. - NPM vs. Plugins: Changing an npm package version does not automatically update plugin metadata.
- Compatibility: Always check implementation guidance against the application's actual dependencies. Record supported package versions within the skill itself; do not assume repository distribution automatically matches the installed package version.
- Command Pinning: Generated commands do not automatically pin a release. Each installer resolves its own default source. To pin a version, use
How the skill staleness check workflow works
mainThe
skill-staleness-checkis an autonomous workflow triggered by upstream TanStack webhooks. It ensures thatSKILL.mdfiles remain accurate when source code changes. The workflow follows these logical steps:- Match: Compares
changed_filesfrom a webhook against thesourcesdefined inSKILL.mdfrontmatter (usingOwner/repo:relative-pathand glob patterns). - Evaluate: Performs a two-pass classification of the diff:
- Pass 1 (Quick scan): Analyzes the diff summary to identify potentially affected sections.
- Pass 2 (Detail evaluation): Compares full diff hunks against skill content to determine if the change actually impacts documented behavior.
- Classify: Changes are categorized as No impact, Version bump only, Content update, or Breaking change.
- Update:
- Content updates use the
generate-skillmeta-skill in "regeneration mode" (surgical updates rather than full rewrites). - Version bumps are handled manually by editing the
library_versionin frontmatter.
- Content updates use the
- Cross-skill Check: A single-level cascade checks if updated skills affect other skills that
requirethem. - Sync: The
skills/sync-state.jsonfile is updated with the newlibrary_versionand source file SHAs. - PR: Opens a Pull Request with a structured body describing the trigger, source changes, skill edits, and cross-skill impact.
- Match: Compares