Skip to main content
skill CX Codex

tanstack-cli · oakoss — Claude Code skill: what it does, how to install

tanstack-cli configures TanStack library build tooling, Vite dual ESM/CJS outputs, and conventional-commit publishing.

MIT 115 installs ★ 29 updated 2026-08-17

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add oakoss/agent-skills --skill tanstack-cli -a claude-code
Open on GitHub

What tanstack-cli does

This skill guides agents in configuring JavaScript and TypeScript libraries according to TanStack project conventions. It provides patterns for @tanstack/vite-config, covering dual ESM and CJS compilation alongside TypeScript declaration emission. It also provides workflows for @tanstack/publish-config to automate releases across branch channels like main, beta, and alpha.

Designed strictly for package maintainers, it does not support full-stack application builds or alternative bundlers. It requires pnpm v8+, Node.js v18.17+, Git CLI, and Vite as a peer dependency. Packaging issues are caught using publint --strict immediately following vite build.

What it helps with

  • configure dual ESM/CJS library builds with Vite
  • set up TypeScript declaration bundling and exclusions
  • automate versioning and publishing from conventional commits
  • validate package export mappings with publint

Example prompts for the agent

  • Configure a library build using @tanstack/vite-config with entry ./src/index.ts
  • Validate package.json exports and mergeConfig setup for Vite
  • Set up branchConfigs for automated publishing using @tanstack/publish-config

How to install tanstack-cli

1Skills CLI (Vercel)

npx skills add oakoss/agent-skills --skill tanstack-cli -a claude-code

2Manually: put the files in place

~/.claude/skills/tanstack-cli/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/tanstack-cli/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about tanstack-cli

How to install tanstack-cli in Claude Code?

Run npx skills add oakoss/agent-skills --skill tanstack-cli -a claude-code to install it into ~/.claude/skills/tanstack-cli/SKILL.md.

What does tanstack-cli do?

It equips the agent with guidelines to build libraries via Vite and manage npm releases using TanStack Config conventions.

Can I use this skill on npm or yarn projects?

No, the tooling explicitly requires pnpm v8 or newer; npm and yarn are unsupported.

Source text

SKILL.md · MIT
---
name: tanstack-cli
description: >
  TanStack Config for shared build tooling, Vite plugins, and package configuration across TanStack projects.
  Use when configuring TanStack library builds or contributing to TanStack packages.
  Use for tanstack-config, tanstack-cli, vite-plugin, package-config, library-build.
license: MIT
metadata:
  author: oakoss
  version: '1.0'
  source: 'https://tanstack.com/config/latest'
user-invocable: false
---

# TanStack Config

## Overview

TanStack Config provides opinionated tooling to build, version, and publish JavaScript/TypeScript packages with minimal configuration and consistent results. It uses Vite for library builds with automatic dual ESM/CJS output and type generation, plus automated publishing with conventional-commit-based versioning.

**When to use:** Building TanStack libraries or packages that follow TanStack conventions, contributing to TanStack open-source projects, setting up dual ESM/CJS library builds with Vite, automating package publishing with conventional commits.

**When NOT to use:** Application builds (use framework-specific tooling), non-library projects, projects not using pnpm, projects that need non-Vite build pipelines.

## Quick Reference

| Pattern            | API / Package                                       | Key Points                                              |
| ------------------ | --------------------------------------------------- | ------------------------------------------------------- |
| Vite build config  | `tanstackViteConfig()` from `@tanstack/vite-config` | Merge with `defineConfig` via `mergeConfig`             |
| Entry point        | `entry: './src/index.ts'`                           | Single file or array of entry files                     |
| Source directory   | `srcDir: './src'`                                   | Used for declaration file generation                    |
| CJS output         | `cjs: true` (default)                               | Generates `.cjs` and `.d.cts` alongside ESM             |
| External deps      | `externalDeps: [/^@internal\//]`                    | Auto-detected from `package.json`, extend with patterns |
| Bundled deps       | `bundledDeps: ['tiny-invariant']`                   | Bundle instead of externalize                           |
| Exclude from types | `exclude: ['./src/**/*.test.ts']`                   | Patterns to skip during type generation                 |
| Custom tsconfig    | `tsconfigPath: './tsconfig.build.json'`             | Override default tsconfig for builds                    |
| Declaration hook   | `beforeWriteDeclarationFile(path, content)`         | Transform `.d.ts` content before write                  |
| Publish automation | `publish()` from `@tanstack/publish-config`         | Conventional commits drive versioning                   |
| Branch configs     | `branchConfigs: { main, beta, alpha }`              | Control prerelease and stable channels                  |
| Package list       | `packages: [{ name, packageDir }]`                  | Monorepo package definitions                            |
| Build script       | `vite build && publint --strict`                    | Standard build with strict linting                      |

## Common Mistakes

| Mistake                                          | Correct Pattern                                                            |
| ------------------------------------------------ | -------------------------------------------------------------------------- |
| Missing `"type": "module"` in `package.json`     | Set `"type": "module"` for ESM-first builds                                |
| Using `defineConfig` alone without `mergeConfig` | Use `mergeConfig(defineConfig({...}), tanstackViteConfig({...}))`          |
| Forgetting `entry` or `srcDir` options           | Both are required for `tanstackViteConfig` to work                         |
| Missing `exports` field in `package.json`        | Define `import` and `require` conditions with types                        |
| Not awaiting `publish()` promise                 | Handle with `.then()` and `.catch()` for error reporting                   |
| Using npm or yarn instead of pnpm                | pnpm is the only supported package manager                                 |
| Omitting `publint --strict` from build script    | Add `publint --strict` after `vite build` to catch packaging issues        |
| Setting `tag` without `v` prefix                 | Manual version tags must start with `v` (e.g., `v1.0.0`)                   |
| Wrong commit type for release level              | `fix`/`refactor`/`perf` = patch, `feat` = minor, `BREAKING CHANGE` = major |

## Requirements

- Node.js v18.17+
- pnpm v8+
- Git CLI
- GitHub CLI (pre-installed on GitHub Actions)
- Vite (peer dependency for build config)
- publint (recommended for build validation)

## Delegation

- **Build configuration review**: Use `Task` agent to verify Vite config and `package.json` exports
- **Publishing workflow setup**: Use `Explore` agent to check CI/CD integration patterns
- **Package validation**: Run `publint --strict` after builds to catch packaging issues

## References

- [Configuration and Vite plugin setup](references/configuration.md)
- [Publishing and version management](references/publishing.md)

© oakoss · MIT · oakoss/agent-skills

Similar skills

All skills for Frontend and UI →

tanstack-cli by other authors comes first.

tanstack-cli tanstack-skills tanstack-cli — a skill that walks the agent through TanStack Start project creation: picks integrations, generates the structure, and covers deployment. CX Codex +1 1,700installs clerk-tanstack-patterns clerk The clerk-tanstack-patterns Claude Code skill covers Clerk authentication patterns for TanStack React Start. It activates for work with createServerFn, beforeLoad route protection, and request middleware. CX Codex +1 16,400installs tanstack-vue-router-skilld skilld-dev tanstack-vue-router-skilld — a skill for working with @tanstack/vue-router, the type-safe Vue router. Teaches the agent setup rules, file-based routes, composables returning Ref, links and loaders. CX Codex +1 101installs tanstack-config tanstack-skills Guides agent setup for building, versioning, and publishing TypeScript packages using the @tanstack/config toolkit. Useful when setting up pnpm and Nx monorepos. CX Codex +1 1,500installs tanstack-start tanstack-skills Guides agents through building full-stack React apps with TanStack Start, streaming SSR, and type-safe server functions. CX Codex +1 4,000installs tanstack-integration-best-practices DeckardGer tanstack-integration-best-practices — a skill that hands the agent rules for wiring TanStack Query, Router and Start together: loaders, SSR hydration, cache ownership. Useful once all three live in one codebase. CX Codex +1 3,100installs tanstack-ai-migration TanStack tanstack-ai-migration is a Claude Code skill that migrates apps from Vercel AI SDK to TanStack AI or upgrades version 0.x to 1.0 during library switches or package updates. CX Codex +1 505installs

From the same set106

The whole set →
svelte A reference sheet that teaches a coding agent Svelte 5 runes and SvelteKit routing, plus a table for moving Svelte 4 code onto the new API. CX Codex +1 117installs react-native Guides agents in building React Native and Expo apps for iOS, Android, and web using file-based routing, EAS workflows, and native device modules. CX Codex +1 117installs tiptap This skill guides React editor setup with Tiptap, including extensions, SSR, image uploads, and Y.js collaboration. Use it when adding rich-text editing to an app. CX Codex +1 117installs agent-patterns Multi-agent architecture patterns, subagent delegation, and context hygiene for Claude Code and coding agents. CX Codex +1 115installs better-auth Hands the agent a reference for better-auth: config, plugins, session strategies and the usual mistakes. Useful when a project needs login, 2FA or multi-tenant organizations. CX Codex +1 114installs meta-skill-creator The meta-skill-creator skill guides you through building and validating agent skills that follow the Agent Skills open standard. Use it to plan a SKILL.md and organize supporting files. CX Codex +1 114installs figma-developer figma-developer pulls colours, type styles and icons out of Figma over the REST API and turns them into CSS variables and React components. Useful when the design file moves faster than your code. CX Codex +1 114installs tanstack-store A reference skill that teaches the agent how TanStack Store works: stores, derived values, batching, effects. Useful when state is shared across components. CX Codex +1 113installs

Project sponsors

Companies that keep this analytics open