Agent skill

Tanstack Vue Router Skilld

by skilld-dev in skilld-dev/vue-ecosystem-skills

A skill your agent uses when writing, debugging, or refactoring code that imports @tanstack/vue-router (TanStack Router for Vue).

MITAuto-check passedDevelopment

Install Tanstack Vue Router Skilld

skills CLI
$ npx skills add skilld-dev/vue-ecosystem-skills --skill tanstack-vue-router-skilld -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install skilld-dev/vue-ecosystem-skills tanstack-vue-router-skilld --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/skilld-dev/vue-ecosystem-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/tanstack-vue-router-skilld .claude/skills/tanstack-vue-router-skilld && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
tanstack-vue-router-skilld
GitHub stars
181
Token cost
~2.9k tokens
SKILL.md length
686 words
Files
9 (incl. references)
Skills in repo
34
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when writing, debugging, or refactoring code that imports @tanstack/vue-router (TanStack Router for Vue).

  • Works in 6 steps: Most composables return Ref — use .value… → Never cast or annotate inferred… → Register the router for type safety —… → …
  • Refactoring code that imports @tanstack/vue-router (TanStack Router for Vue)
  • SKILL.md covers Hard rules, Setup with Vite (file-based…, Code-based routing and Composables, plus 6 more sections
  • Calls npm

What it does

Tanstack Vue Router Skilld is an agent skill from skilld-dev/vue-ecosystem-skills. Use when writing, debugging, or refactoring code that imports @tanstack/vue-router (TanStack Router for Vue). Covers setup, file-based and code-based routes, composables returning Ref, Link, loaders, search params, SSR, and v1.170.x deprecations.

Its SKILL.md is about 2.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 9 other files, including reference files (for example `references/api-surface.md`, `references/composables.md` and `references/data-loading.md`).

It sits in Development, covering Refactoring. It works with TanStack, Vue.js and npm. The repository describes itself as: Agent Skills for the Vue ecosystem, written from current docs, issues, and releases. The licence is MIT.

When your agent uses it

  • Refactoring code that imports @tanstack/vue-router (TanStack Router for Vue)
  • Tasks that involve Refactoring

Example prompts

  • “/tanstack-vue-router-skilld”

Requirements

  • Node.js

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Most composables return Ref — use .value in script; templates auto-unwrap. useRouter(), useNavigate(), useLinkProps(), useAwaited() do NOT…
  2. Never cast or annotate inferred route/router types. Types come from the route tree and the Register declaration.
  3. Register the router for type safety — without this, Link/useNavigate/useSearch accept any string
  4. Not vue-router. Never import useRoute/useRouter from vue-router, never use /.
  5. beforeLoad/loader are plain async functions. Vue composables (ref, computed, lifecycle hooks) cannot run inside them. Pass state through…
  6. Route options accept Vue SFCs: component, errorComponent, notFoundComponent, pendingComponent and the default*Component router options…

What it can do on your machine

Read from SKILL.md and the folder at commit c8994af. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • tanstack.com
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Tanstack Vue Router Skilld loads about 2.9k tokens when it runs, and up to ~10k if it reads all its reference files. Until then it costs about 68 tokens; SKILL.md has 686 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~68
When it runs · the whole SKILL.md, loaded when a task matches
~2.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~10k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from skilld-dev/vue-ecosystem-skills at commit c8994af, republished under its MIT licence (© skilld-dev). 686 words, ~2,899 tokens.

Download SKILL.mdSave it as .claude/skills/tanstack-vue-router-skilld/SKILL.md (or your agent's skills folder). This skill also uses 8 other files; get the full folder from GitHub.
name
tanstack-vue-router-skilld
description
Use when writing, debugging, or refactoring code that imports @tanstack/vue-router (TanStack Router for Vue). Covers setup, file-based and code-based routes, composables returning Ref, Link, loaders, search params, SSR, and v1.170.x deprecations.

@tanstack/vue-router

Type-safe router for Vue. Prepared source: version 1.170.35 (package.json:3).

  • Requires vue >= 3.3.0 (peer), Node >= 20.19 (package.json:59-88)
  • Runtime deps: @tanstack/router-core@1.171.32, @tanstack/history@1.162.4, @tanstack/vue-store@^0.11.0
  • ESM-only ("type": "module"), no main/CJS entry
  • Entry points: @tanstack/vue-router, @tanstack/vue-router/ssr/server, @tanstack/vue-router/ssr/client (package.json:29-50)

Docs: https://tanstack.com/router (framework pages verified at /router/latest/docs/framework/vue/...)

Hard rules

  1. Most composables return Ref<T> — use .value in script; templates auto-unwrap. useRouter(), useNavigate(), useLinkProps(), useAwaited() do NOT return refs. Full table in references/composables.md.
  2. Never cast or annotate inferred route/router types. Types come from the route tree and the Register declaration.
  3. Register the router for type safety — without this, Link/useNavigate/useSearch accept any string:
ts
declare module '@tanstack/vue-router' {
  interface Register {
    router: typeof router
  }
}
  1. Not vue-router. Never import useRoute/useRouter from vue-router, never use <router-view>/<router-link>.
  2. beforeLoad/loader are plain async functions. Vue composables (ref, computed, lifecycle hooks) cannot run inside them. Pass state through router context.
  3. Route options accept Vue SFCs: component, errorComponent, notFoundComponent, pendingComponent and the default*Component router options take .vue files or h()-style function components (src/route.ts:54-58, src/router.ts:26-65).

Setup with Vite (file-based routing)

bash
npm install @tanstack/vue-router
npm install -D @tanstack/router-plugin @vitejs/plugin-vue @vitejs/plugin-vue-jsx
ts
// vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import { tanstackRouter } from '@tanstack/router-plugin/vite'

export default defineConfig({
  plugins: [
    tanstackRouter({ target: 'vue', autoCodeSplitting: true }), // before vue()
    vue(),
    vueJsx(), // needed for .tsx route files
  ],
})

Source: official Vue example, https://github.com/TanStack/router/blob/main/examples/vue/basic-file-based-sfc/vite.config.ts

ts
// src/main.ts
import { createApp, h } from 'vue'
import { RouterProvider, createRouter } from '@tanstack/vue-router'
import { routeTree } from './routeTree.gen'

const router = createRouter({
  routeTree,
  defaultPreload: 'intent',
  scrollRestoration: true,
})

declare module '@tanstack/vue-router' {
  interface Register {
    router: typeof router
  }
}

createApp({ setup: () => () => h(RouterProvider, { router }) }).mount('#app')

File naming, split-file conventions (.route.ts, .component.vue, .lazy.ts), and the generated routeTree.gen.ts: references/file-based-routing.md.

Code-based routing

ts
import { h } from 'vue'
import { createRootRouteWithContext, createRoute, createRouter, Outlet } from '@tanstack/vue-router'

interface RouterContext { auth: { isAuthenticated: boolean } }

const rootRoute = createRootRouteWithContext<RouterContext>()({ component: () => h(Outlet) })

const postsRoute = createRoute({
  getParentRoute: () => rootRoute,
  path: 'posts',
  loader: ({ context }) => fetchPosts(context.auth),
})

const routeTree = rootRoute.addChildren([postsRoute])
const router = createRouter({
  routeTree,
  context: { auth: { isAuthenticated: false } },
})

Route options, hooks on route objects, and property-order rules: references/routes.md.

Composables

ComposableReturnsNotes
useRouter()router instancenot a ref
useRouterState({ select })Ref<T>pass select to avoid re-renders
useNavigate({ from? })functionnot a ref
useSearch({ from })Ref<T>throws unless from matches
useParams({ from })Ref<T>
useMatch({ from })Ref<T>
useLoaderData({ from })Ref<T>
useLoaderDeps({ from })Ref<T>
useRouteContext({ from })Ref<T>
useLocation()Ref<ParsedLocation>
useMatches() / useParentMatches() / useChildMatches()Ref<Array<Match>>accepts select
useMatchRoute()functioncalling it returns Ref<false | params> (src/Matches.tsx:148-172)
useLinkProps(options)link props objectfor custom anchors
useBlocker({ shouldBlockFn })void or Ref<BlockerResolver>resolver only with withResolver: true
useCanGoBack()Ref<boolean>location.state.__TSR_index !== 0 (src/useCanGoBack.ts:4-10)
useAwaited({ promise })[data, promise] tuplefor deferred data

Route objects and getRouteApi('/path') expose the same hooks pre-scoped: Route.useSearch(), Route.useLoaderData(), Route.useNavigate(), Route.Link (src/route.ts:72-80).

Details and select/strict semantics: references/composables.md.

Components

ComponentPurpose
<RouterProvider :router="router" />mounts the router; extra attrs update router options (src/RouterProvider.tsx:60-95)
<Link to="..." :params="..." :search="...">type-safe anchor; active state sets data-status="active" + aria-current="page" (src/link.tsx:522-525); default slot receives { isActive } (src/link.tsx:918)
<Outlet />renders matched child route (src/Match.tsx:275)
<Navigate to="..." />declarative redirect, fires in onMounted (src/useNavigate.tsx:24-40)
<MatchRoute to="..." :fuzzy="true">renders slot when matched; scoped slot receives params
<Await :promise="p">deferred data with <Suspense> (src/awaited.tsx:26-43)
<Block :should-block-fn="fn">navigation blocking; scoped slot receives resolver (src/useBlocker.tsx:470-491)
<CatchBoundary> / <ErrorComponent>error boundary via onErrorCaptured
<ClientOnly>renders children only after mount
<HeadContent>, <Scripts>, <Html>, <Body>, <Asset>, <ScriptOnce>SSR document shell

Link options, activeProps (defaults to { class: 'active' }, src/link.tsx:477), preloading (intent/viewport/render), linkOptions(), and createLink(): references/navigation-links.md.

Show full SKILL.md (281 more words)Show less

Data loading and redirects

ts
const route = createFileRoute('/posts/$postId')({
  beforeLoad: async ({ context, params }) => {
    if (!context.auth.isAuthenticated) {
      throw redirect({ to: '/login', search: { from: params.postId } })
    }
  },
  loaderDeps: ({ search: { page } }) => ({ page }),
  loader: ({ deps, params }) => fetchPost(params.postId, deps.page),
  pendingComponent: PendingSpinner, // .vue file works too
})

throw redirect(), isRedirect(), deferred streaming with defer(), and context typing: references/data-loading.md.

Search params

ts
import { z } from 'zod' // or plain validators
const route = createFileRoute('/posts')({
  validateSearch: z.object({ page: z.number().default(1) }),
  search: {
    middlewares: [stripSearchParams({ page: 1 })],
  },
})

Validators, input/output schemas, retainSearchParams/stripSearchParams, and custom serialization: references/search-params.md.

Deprecations in 1.170.x (use instead)

DeprecatedReplacementProof
Route, RootRoute, FileRoute, RouteApi classescreateRoute, createRootRoute, createFileRoute, getRouteApisrc/route.ts:95, src/route.ts:220, src/route.ts:460, src/fileRoute.ts:57
rootRouteWithContextcreateRootRouteWithContextsrc/route.ts:414
NotFoundRoute / routerOptions.notFoundRoutenotFoundComponent route option / defaultNotFoundComponent router optionhttps://tanstack.com/router/latest/docs/framework/vue/guide/not-found-errors
<ScrollRestoration />scrollRestoration: true in createRoutersrc/ScrollRestoration.tsx:18
opts.navigate in beforeLoad/loaderthrow redirect({ to })https://tanstack.com/router/latest/docs/framework/vue/api/router/RouteOptionsType
parseParams/stringifyParamsparams.parse/params.stringifysame RouteOptionsType doc
preSearchFilters/postSearchFilterssearch.middlewaressame RouteOptionsType doc
FileRouteLoader / separate .lazy.ts loader fileskeep the loader in the route filesrc/fileRoute.ts:153
useBlocker(fn, condition) legacy signatures{ shouldBlockFn } objectsrc/useBlocker.tsx:139-151

Best practices

References

© skilld-dev, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 8 other files (references) in skills/tanstack-vue-router-skilld of skilld-dev/vue-ecosystem-skills.

  • SKILL.md
  • references/api-surface.md
  • references/composables.md
  • references/data-loading.md
  • references/file-based-routing.md
  • references/navigation-links.md
  • references/routes.md
  • references/search-params.md
  • references/ssr.md

Open the folder on GitHubat commit c8994af

Compare with similar skills

Tanstack Vue Router Skilld next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Tanstack Vue Router Skilld compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Tanstack Vue Router Skilld this skillskilld-dev/vue-ecosystem-skills181—~2.9kAutomated safety check: PassMIT
Cabloy Frontend Scaffoldcabloy/cabloy982—~4.1kAutomated safety check: PassMIT
Wagmi Feature Developmentwevm/wagmi6.8k—~3.8kAutomated safety check: PassMIT
Vue Best Practicesoyjt/uniapp-vue3-template6273 repos~667Automated safety check: PassMIT
Markbind Typescript MigrationMarkBind/markbind158—~2kAutomated safety check: PassMIT
Enforce Rules For Typescriptmoeru-ai/airi50k—~3.4kAutomated safety check: PassMIT

Similar skills

  • A skill your agent uses whenever the user wants the Zova frontend path in this Cabloy repo: create or extend pages, components, api or model beans, route/query/params work, metadata refresh…

    982 GitHub stars~4.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Walks through adding a Wagmi feature across its layers: a Viem-based core action, TanStack Query options, and React and Vue bindings.

    6.8k GitHub stars~3.8k tokensUpdated 6 days ago
    DevelopmentAuto-check passed
  • Vue Best Practices

    oyjt/uniapp-vue3-template

    Vue 3 and Vue.js best practices for TypeScript, vue-tsc, and Volar.

    627 GitHub starsUsed in 3 repos~667 tokens
    DevelopmentAuto-check passed
  • Complete guide for migrating JavaScript files to TypeScript in the MarkBind project, including the two-commit strategy, import/export syntax conversion, and best practices.

    158 GitHub stars~2k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Enforce AIRI's TypeScript and Vue source rules for imports, naming, comments, JSDoc, fallbacks, stateful and protocol code, and module design.

    50k GitHub stars~3.4k tokensUpdated today
    DevelopmentAuto-check passed
  • A workflow for implementing a Verdaccio bug fix, feature or refactor: pick the release lines, check existing options, edit the owning layer, test and add a changeset.

    18k GitHub stars~1.3k tokensUpdated yesterday
    DevelopmentAuto-check passed

More from skilld-dev/vue-ecosystem-skills

All 34 skills in this repo
  • Floating UI Vue Skilld

    skilld-dev/vue-ecosystem-skills

    Floating UI for Vue (@floating-ui/vue@2.0.1). An agent skill from skilld-dev/vue-ecosystem-skills.

    181 GitHub stars~1.3k tokensUpdated 16 days ago
    Auto-check passed
  • Formkit Core Skilld

    skilld-dev/vue-ecosystem-skills

    A skill your agent uses whenever writing, debugging, or reviewing code that imports @formkit/core — FormKit's framework-agnostic core (node trees, values, events, hooks, message stores, ledgers…

    181 GitHub stars~2.1k tokensUpdated 16 days ago
    Auto-check passed
  • Pinia Colada Skilld

    skilld-dev/vue-ecosystem-skills

    Data fetching layer for Vue built on Pinia. An agent skill from skilld-dev/vue-ecosystem-skills.

    181 GitHub stars~1.9k tokensUpdated 16 days ago
    Auto-check passed
  • Pinia Skilld

    skilld-dev/vue-ecosystem-skills

    A skill your agent uses when writing, debugging, or refactoring code that imports "pinia", the Vue 3 store library.

    181 GitHub stars~1.5k tokensUpdated 16 days ago
    Auto-check passed
  • Primevue Skilld

    skilld-dev/vue-ecosystem-skills

    A skill your agent uses when writing, debugging, or updating code that imports primevue (PrimeVue v5, UI component library for Vue 3).

    181 GitHub stars~1.9k tokensUpdated 16 days ago
    Auto-check passed
  • Quasar Skilld

    skilld-dev/vue-ecosystem-skills

    Build, configure, and debug apps with the Quasar framework (quasar npm package, v2.33.1).

    181 GitHub stars~1.6k tokensUpdated 16 days ago
    Auto-check passed

Categories

Questions about Tanstack Vue Router Skilld

What does Tanstack Vue Router Skilld do?

A skill your agent uses when writing, debugging, or refactoring code that imports @tanstack/vue-router (TanStack Router for Vue). Tanstack Vue Router Skilld is an agent skill from skilld-dev/vue-ecosystem-skills. Use when writing, debugging, or refactoring code that imports @tanstack/vue-router (TanStack Router for Vue).

When should I use Tanstack Vue Router Skilld?

Tanstack Vue Router Skilld fits situations like: refactoring code that imports @tanstack/vue-router (TanStack Router for Vue); tasks that involve Refactoring.

How do I install Tanstack Vue Router Skilld in Claude Code?

Run `npx skills add skilld-dev/vue-ecosystem-skills --skill tanstack-vue-router-skilld -a claude-code`. Or copy the skill folder (skills/tanstack-vue-router-skilld in skilld-dev/vue-ecosystem-skills) into .claude/skills/tanstack-vue-router-skilld in your project. Claude Code loads it when a task matches its description.

How do I install Tanstack Vue Router Skilld in Codex?

Run `npx skills add skilld-dev/vue-ecosystem-skills --skill tanstack-vue-router-skilld -a codex`. Or copy the skill folder (skills/tanstack-vue-router-skilld in skilld-dev/vue-ecosystem-skills) into .agents/skills/tanstack-vue-router-skilld in your project. Codex loads it when a task matches its description.

Can I use Tanstack Vue Router Skilld in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add skilld-dev/vue-ecosystem-skills --skill tanstack-vue-router-skilld -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tanstack-vue-router-skilld, .gemini/skills/tanstack-vue-router-skilld, .github/skills/tanstack-vue-router-skilld and .opencode/skills/tanstack-vue-router-skilld in your project.

What does Tanstack Vue Router Skilld need to run?

Going by SKILL.md and its folder, Tanstack Vue Router Skilld needs the command-line tools its instructions call (npm). Our summary lists: Node.js.

Does Tanstack Vue Router Skilld access the network?

SKILL.md names 2 domains. As links in the text: tanstack.com and github.com. This is read from the text; nothing was executed.

Is Tanstack Vue Router Skilld safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Tanstack Vue Router Skilld use?

Tanstack Vue Router Skilld is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Tanstack Vue Router Skilld use?

About 2.9k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 7.2k tokens, read only when the agent opens those files.

What are the alternatives to Tanstack Vue Router Skilld?

Skills that share tags, products or a category with Tanstack Vue Router Skilld: Cabloy Frontend Scaffold (cabloy/cabloy, 982 stars), Wagmi Feature Development (wevm/wagmi, 6.8k stars), Vue Best Practices (oyjt/uniapp-vue3-template, 627 stars) and Markbind Typescript Migration (MarkBind/markbind, 158 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Tanstack Vue Router Skilld?

skilld-dev (a GitHub organization) maintains it in skilld-dev/vue-ecosystem-skills, which has 181 GitHub stars. The repository holds 34 skills in this directory. The repository was last updated on September 22, 2026.

Source: skilld-dev/vue-ecosystem-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.