Skip to content

Commit 0cec826

Browse files
committed
feat(cli): add published skill tree for agent workflows
1 parent 62c718f commit 0cec826

16 files changed

Lines changed: 830 additions & 0 deletions

File tree

.changeset/cli-skills-minor.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/cli': minor
3+
---
4+
5+
Add a published skill tree for TanStack CLI workflows and include `skills` in package files so agent guidance ships in npm installs.

packages/cli/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
"type": "module",
66
"main": "./dist/index.js",
77
"types": "./dist/types/index.d.ts",
8+
"files": [
9+
"dist",
10+
"skills"
11+
],
812
"bin": {
913
"tanstack": "./dist/bin.js"
1014
},

packages/cli/skills/CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## 2026-03-02
2+
3+
### Updated for @tanstack/cli v0.61.0
4+
5+
**Breaking changes:**
6+
- create-app-scaffold: documents router-only compatibility behavior where template/deployment/add-on intent is ignored.
7+
- add-addons-existing-app: enforces `.cta.json` metadata precondition for add flows.
8+
9+
**Deprecation updates:**
10+
- create-app-scaffold: `--no-tailwind` treated as deprecated/ignored; recommends post-scaffold removal flow.
11+
- query-docs-library-metadata: deprecated alias discovery patterns replaced with `tanstack` command namespace.
12+
13+
**New skills:**
14+
- create-app-scaffold: deterministic app generation and flag compatibility.
15+
- add-addons-existing-app: add-on layering into existing repos.
16+
- query-docs-library-metadata: JSON discovery/doc retrieval for agents.
17+
- choose-ecosystem-integrations: partner-to-add-on mapping and exclusivity handling.
18+
- maintain-custom-addons-dev-watch: custom add-on authoring and dev-watch lifecycle.
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
---
2+
name: add-addons-existing-app
3+
description: >
4+
Apply integrations to existing projects with tanstack add, including
5+
add-on id resolution, dependency chains, option prompts, and .cta.json
6+
project metadata preconditions.
7+
type: core
8+
library: tanstack-cli
9+
library_version: "0.61.0"
10+
---
11+
12+
# Add Add-ons To Existing App
13+
14+
Use this skill when the project already exists and you need to layer add-ons safely without breaking dependency or metadata assumptions.
15+
16+
## Setup
17+
18+
```bash
19+
npx @tanstack/cli add clerk drizzle
20+
```
21+
22+
## Core Patterns
23+
24+
### Add multiple integrations in one pass
25+
26+
```bash
27+
npx @tanstack/cli add tanstack-query drizzle
28+
```
29+
30+
### Resolve candidate ids before applying
31+
32+
```bash
33+
npx @tanstack/cli create --list-add-ons --json
34+
```
35+
36+
### Validate optionized add-ons before install
37+
38+
```bash
39+
npx @tanstack/cli create --addon-details prisma --json
40+
```
41+
42+
## Common Mistakes
43+
44+
### CRITICAL Run tanstack add without .cta.json
45+
46+
Wrong:
47+
```bash
48+
npx @tanstack/cli add clerk
49+
```
50+
51+
Correct:
52+
```bash
53+
# Run in a project scaffolded by TanStack CLI (contains .cta.json), then:
54+
npx @tanstack/cli add clerk
55+
```
56+
57+
Add flows depend on persisted scaffold metadata, so commands can fail or apply incomplete config when `.cta.json` is missing.
58+
59+
Source: packages/create/src/custom-add-ons/shared.ts:158
60+
61+
### HIGH Use invalid add-on id
62+
63+
Wrong:
64+
```bash
65+
npx @tanstack/cli add drizle
66+
```
67+
68+
Correct:
69+
```bash
70+
npx @tanstack/cli add drizzle
71+
```
72+
73+
Unknown ids stop resolution and force manual correction before any add-on work proceeds.
74+
75+
Source: packages/create/src/add-ons.ts:44
76+
77+
### HIGH Ignore add-on dependency requirements
78+
79+
Wrong:
80+
```bash
81+
npx @tanstack/cli add custom-addon-with-missing-deps
82+
```
83+
84+
Correct:
85+
```bash
86+
npx @tanstack/cli add required-dependency custom-addon-with-missing-deps
87+
```
88+
89+
Add-ons with `dependsOn` can fail during finalization if required dependencies are not present.
90+
91+
Source: packages/create/src/add-ons.ts:48
92+
93+
### MEDIUM Assume old Windows path bug still present
94+
95+
Wrong:
96+
```bash
97+
# Avoid tanstack add on Windows and patch manually
98+
```
99+
100+
Correct:
101+
```bash
102+
npx @tanstack/cli add clerk
103+
```
104+
105+
Avoiding supported workflows based on historical bug reports causes unnecessary manual drift. Fixed in newer versions, but agents trained on older threads may still avoid this path.
106+
107+
Source: https://github.com/TanStack/cli/issues/329
108+
109+
### HIGH Tension: Backwards support vs deterministic automation
110+
111+
This domain's patterns conflict with maintain-custom-addons-dev-watch. Automation that assumes universal add flows tends to fail because legacy compatibility still relies on hidden scaffold metadata.
112+
113+
See also: maintain-custom-addons-dev-watch/SKILL.md § Common Mistakes
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
---
2+
name: choose-ecosystem-integrations
3+
description: >
4+
Map tanstack ecosystem partner metadata to installable add-on ids using
5+
tanstack ecosystem --json, tanstack create --list-add-ons --json, and
6+
tanstack create --addon-details --json. Covers exclusive categories,
7+
provider options, and router-only compatibility constraints.
8+
type: composition
9+
library: tanstack-cli
10+
library_version: "0.61.0"
11+
requires:
12+
- create-app-scaffold
13+
- query-docs-library-metadata
14+
---
15+
16+
This skill requires familiarity with scaffold and discovery workflows. Read `create-app-scaffold` and `query-docs-library-metadata` first.
17+
18+
# Choose Ecosystem Integrations
19+
20+
Use this skill at the seam between user requirements and valid CLI integration choices.
21+
22+
## Setup
23+
24+
```bash
25+
npx @tanstack/cli ecosystem --json
26+
npx @tanstack/cli create --list-add-ons --json
27+
```
28+
29+
## Core Patterns
30+
31+
### Map partner intent to add-on ids explicitly
32+
33+
```bash
34+
npx @tanstack/cli ecosystem --category database --json
35+
npx @tanstack/cli create --list-add-ons --json
36+
```
37+
38+
### Inspect option surfaces before final provider choice
39+
40+
```bash
41+
npx @tanstack/cli create --addon-details drizzle --json
42+
npx @tanstack/cli create --addon-details prisma --json
43+
```
44+
45+
### Enforce one choice per exclusive category
46+
47+
```bash
48+
npx @tanstack/cli create my-app \
49+
--framework react \
50+
--add-ons clerk,drizzle \
51+
--deployment cloudflare \
52+
-y
53+
```
54+
55+
## Common Mistakes
56+
57+
### HIGH Treat ecosystem partner id as add-on id
58+
59+
Wrong:
60+
```bash
61+
npx @tanstack/cli add <partner-id-from-ecosystem>
62+
```
63+
64+
Correct:
65+
```bash
66+
npx @tanstack/cli ecosystem --json
67+
npx @tanstack/cli create --list-add-ons --json
68+
npx @tanstack/cli add <mapped-addon-id>
69+
```
70+
71+
`ecosystem` includes partners that are not directly installable add-ons, so direct reuse of partner ids can fail late in add/apply flows.
72+
73+
Source: tanstack ecosystem --json output + tanstack create --list-add-ons --json output
74+
75+
### HIGH Skip addon-details before choosing provider
76+
77+
Wrong:
78+
```bash
79+
npx @tanstack/cli create my-app --add-ons prisma -y
80+
```
81+
82+
Correct:
83+
```bash
84+
npx @tanstack/cli create --addon-details prisma --json
85+
npx @tanstack/cli create my-app --add-ons prisma -y
86+
```
87+
88+
Optionized providers can default silently, producing the wrong data-layer stack for the requested integration.
89+
90+
Source: tanstack create --addon-details prisma --json
91+
92+
### HIGH Select multiple exclusive integrations together
93+
94+
Wrong:
95+
```bash
96+
npx @tanstack/cli create my-app --add-ons clerk,workos -y
97+
```
98+
99+
Correct:
100+
```bash
101+
npx @tanstack/cli create my-app --add-ons clerk -y
102+
```
103+
104+
Exclusive categories permit only one active choice, so multi-select commands can drop or replace intended providers.
105+
106+
Source: packages/create/src/frameworks/*/*/info.json
107+
108+
### CRITICAL Assume router-only supports deployment integration
109+
110+
Wrong:
111+
```bash
112+
npx @tanstack/cli create my-app --router-only --deployment cloudflare -y
113+
```
114+
115+
Correct:
116+
```bash
117+
npx @tanstack/cli create my-app --router-only -y
118+
```
119+
120+
Router-only mode ignores deployment integration, so the command succeeds without applying the intended ecosystem target.
121+
122+
Source: packages/cli/src/command-line.ts:349
123+
124+
### HIGH Tension: Compatibility mode vs explicit intent
125+
126+
This domain's patterns conflict with create-app-scaffold. Integration planning tends to over-assume command intent is preserved, but compatibility mode silently strips integration flags.
127+
128+
See also: create-app-scaffold/SKILL.md § Common Mistakes
129+
130+
### HIGH Tension: Single-command convenience vs integration precision
131+
132+
This domain's patterns conflict with query-docs-library-metadata. Integration choices tend to drift when discovery metadata is skipped in favor of one-shot scaffold commands.
133+
134+
See also: query-docs-library-metadata/SKILL.md § Common Mistakes
135+
136+
## References
137+
138+
- [Authentication providers](references/authentication-providers.md)
139+
- [Data layer providers](references/data-layer-providers.md)
140+
- [Deployment targets](references/deployment-targets.md)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Authentication Providers
2+
3+
Use `tanstack ecosystem --category authentication --json` for partner discovery, then map to installable add-on ids via `tanstack create --list-add-ons --json`.
4+
5+
## Common add-ons
6+
7+
- `clerk`
8+
- `workos`
9+
- `better-auth`
10+
11+
## Selection pattern
12+
13+
```bash
14+
npx @tanstack/cli ecosystem --category authentication --json
15+
npx @tanstack/cli create --list-add-ons --json
16+
npx @tanstack/cli create my-app --add-ons clerk -y
17+
```
18+
19+
Authentication providers are typically exclusive; select one unless metadata explicitly allows combination.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Data Layer Providers
2+
3+
Inspect each provider's options before generation to avoid defaulting to an unintended backend.
4+
5+
## Common add-ons
6+
7+
- `prisma`
8+
- `drizzle`
9+
- `convex`
10+
- `neon`
11+
12+
## Selection pattern
13+
14+
```bash
15+
npx @tanstack/cli create --addon-details prisma --json
16+
npx @tanstack/cli create --addon-details drizzle --json
17+
npx @tanstack/cli create my-app --add-ons drizzle -y
18+
```
19+
20+
Database/ORM categories can be exclusive depending on framework template metadata.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Deployment Targets
2+
3+
Map deployment intent to one supported target and include it in scaffold commands only outside router-only mode.
4+
5+
## Common targets
6+
7+
- `cloudflare`
8+
- `netlify`
9+
- `railway`
10+
- `nitro`
11+
12+
## Selection pattern
13+
14+
```bash
15+
npx @tanstack/cli ecosystem --category deployment --json
16+
npx @tanstack/cli create my-app --deployment cloudflare -y
17+
```
18+
19+
Deployment target selection is exclusive and ignored when `--router-only` is active.

0 commit comments

Comments
 (0)