$npx -y skills add TanStack/cli --skill query-docs-library-metadataRetrieve 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.
| 1 | # Query Docs And Library Metadata |
| 2 | |
| 3 | Use this skill to collect authoritative context before code generation or integration selection. |
| 4 | |
| 5 | ## Setup |
| 6 | |
| 7 | ```bash |
| 8 | npx @tanstack/cli libraries --json |
| 9 | ``` |
| 10 | |
| 11 | ## Core Patterns |
| 12 | |
| 13 | ### Resolve valid library ids before doc fetch |
| 14 | |
| 15 | ```bash |
| 16 | npx @tanstack/cli libraries --json |
| 17 | ``` |
| 18 | |
| 19 | ### Fetch a specific docs page with explicit version |
| 20 | |
| 21 | ```bash |
| 22 | # Syntax: tanstack doc <library-id> <path> [--docs-version <version>] |
| 23 | npx @tanstack/cli doc router framework/react/guide/routing |
| 24 | npx @tanstack/cli doc router framework/react/guide/routing --docs-version latest |
| 25 | ``` |
| 26 | |
| 27 | ### Search docs for implementation targets |
| 28 | |
| 29 | ```bash |
| 30 | npx @tanstack/cli search-docs "server functions" --library start --json |
| 31 | ``` |
| 32 | |
| 33 | ## Common Mistakes |
| 34 | |
| 35 | ### HIGH Use invalid library id/version/path for doc fetch |
| 36 | |
| 37 | Wrong: |
| 38 | ```bash |
| 39 | # Wrong: --library and --version are not flags on doc; path must not include /docs/ prefix |
| 40 | npx @tanstack/cli doc --library router --version latest --path /docs/framework/react/guide/routing |
| 41 | ``` |
| 42 | |
| 43 | Correct: |
| 44 | ```bash |
| 45 | # Step 1: resolve a valid library id |
| 46 | npx @tanstack/cli libraries --json |
| 47 | # Step 2: fetch using positional args — library id then doc path (no /docs/ prefix) |
| 48 | npx @tanstack/cli doc router framework/react/guide/routing |
| 49 | ``` |
| 50 | |
| 51 | `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. |
| 52 | |
| 53 | Source: packages/cli/src/cli.ts:746 |
| 54 | |
| 55 | ### MEDIUM Rely on deprecated create alias for discovery |
| 56 | |
| 57 | Wrong: |
| 58 | ```bash |
| 59 | npx create-tsrouter-app --list-add-ons |
| 60 | ``` |
| 61 | |
| 62 | Correct: |
| 63 | ```bash |
| 64 | npx @tanstack/cli create --list-add-ons --json |
| 65 | ``` |
| 66 | |
| 67 | 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. |
| 68 | |
| 69 | Source: https://github.com/TanStack/cli/issues/93 |
| 70 | |
| 71 | ### HIGH Tension: Single-command convenience vs integration precision |
| 72 | |
| 73 | 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. |
| 74 | |
| 75 | See also: create-app-scaffold/SKILL.md § Common Mistakes |
| 76 | |
| 77 | ## References |
| 78 | |
| 79 | - [Discovery command output schemas](references/discovery-command-output-schemas.md) |