# query-docs-library-metadata

Fetches machine-readable TanStack library, docs, and add-on metadata from the CLI so an agent can check options before writing code.

Skill by TanStack. Category: Knowledge.

## Install

Project (for this project only):

```sh
npx skills add tanstack/cli --skill query-docs-library-metadata
```

Works with: Claude Code, Codex CLI, Cursor, Antigravity, Copilot CLI, opencode.

Global (for every project on this machine):

```sh
npx skills add tanstack/cli --skill query-docs-library-metadata -g
```

Works with: Claude Code, Codex CLI, Cursor, Antigravity, Copilot CLI, opencode.

## Tags

- Runs on your computer: It runs as a program on your machine, with your access.

## Security audits

- Gen Agent Trust Hub: Pass
- Socket: Pass
- Snyk: Pass
- Runlayer: Pass

Installs: 40. Installs counted by skills.sh. [Open on skills.sh](https://www.skills.sh/site/tanstack.cli/query-docs-library-metadata)

## Source

[Open the source](https://github.com/tanstack/cli/tree/HEAD/packages/cli/skills/query-docs-library-metadata). Checked 2026-10-10. This summary may contain AI-generated text, so it can be wrong. Check the source before you rely on it.

## SKILL.md

````markdown
---
name: query-docs-library-metadata
description: >
  Retrieve machine-readable context with tanstack libraries, tanstack doc,
  tanstack search-docs, tanstack create --list-add-ons --json, and
  --addon-details for agent-safe discovery and preflight validation.
metadata:
  type: core
  library: tanstack-cli
  library_version: "0.62.1"
---

# Query Docs And Library Metadata

Use this skill to collect authoritative context before code generation or integration selection.

## Setup

```bash
npx @tanstack/cli libraries --json
```

## Core Patterns

### Resolve valid library ids before doc fetch

```bash
npx @tanstack/cli libraries --json
```

### Fetch a specific docs page with explicit version

```bash
# Syntax: tanstack doc <library-id> <path> [--docs-version <version>]
npx @tanstack/cli doc router framework/react/guide/routing
npx @tanstack/cli doc router framework/react/guide/routing --docs-version latest
```

### Search docs for implementation targets

```bash
npx @tanstack/cli search-docs "server functions" --library start --json
```

## Common Mistakes

### HIGH Use invalid library id/version/path for doc fetch

Wrong:
```bash
# Wrong: --library and --version are not flags on doc; path must not include /docs/ prefix
npx @tanstack/cli doc --library router --version latest --path /docs/framework/react/guide/routing
```

Correct:
```bash
# Step 1: resolve a valid library id
npx @tanstack/cli libraries --json
# Step 2: fetch using positional args — library id then doc path (no /docs/ prefix)
npx @tanstack/cli doc router framework/react/guide/routing
```

`doc` takes `<library>` and `<path>` as positional arguments (not flags), and the path must not include a leading `/docs/` segment. Use `--docs-version` (not `--version`) to pin a specific version.

Source: packages/cli/src/cli.ts:746

### MEDIUM Rely on deprecated create alias for discovery

Wrong:
```bash
npx create-tsrouter-app --list-add-ons
```

Correct:
```bash
npx @tanstack/cli create --list-add-ons --json
```

Legacy alias workflows can produce confusing outputs that do not match current CLI discovery behavior. Fixed in newer versions, but agents trained on older examples may still generate this pattern.

Source: https://github.com/TanStack/cli/issues/93

### HIGH Tension: Single-command convenience vs integration precision

This domain's patterns conflict with create-app-scaffold and choose-ecosystem-integrations. Skipping discovery to run one-shot scaffold commands tends to lock in plausible defaults that miss architecture constraints.

See also: create-app-scaffold/SKILL.md § Common Mistakes

## References

- [Discovery command output schemas](references/discovery-command-output-schemas.md)
````

- Previous: [x-mastery-mentor](https://syn4pse.dev/terminal/x-mastery-mentor.md)
- Next: [create-app-scaffold](https://syn4pse.dev/terminal/tanstack-create-app-scaffold.md)
- [Terminal](https://syn4pse.dev/terminal.md)
- [Suggest a change](mailto:terminal@syn4pse.dev?subject=Terminal%20suggestion)
