Use when adding a public teaching example or a docs tutorial. Don't use for an internal Nx playground (that is new-react-playground), for a package API change with no walkthrough, or for a docs-only copy edit.
72
90%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
The canonical home for this skill is add-example-tutorial in TanStack/ai
Start from the Nx React app generator. Land at examples/react/<slug>/. Then slim the generated lab to the one scenario this tutorial teaches. examples/react/basic-chat and docs/tutorials/basic-chat.md show a finished public example. Do not copy that app. Use the generator as the starting tree.
Load docs, simple-english, and i-have-adhd before writing tutorial pages. Load pr-description before gh pr create and after an agent push on an open PR.
examples/react/<slug>/ (not examples/<slug>/, not examples/ts-*).pnpm-workspace.yaml includes examples/react/*.docs/tutorials/<slug>.md on "tab": "tutorial".framework/react/examples/<slug> in docs/config.json.https://github.com/TanStack/ai/tree/main/examples/react/<slug>.slug.pnpm nx g @tanstack/workspace-plugin:react-app <slug>. The files land at examples/react/<slug>/.workspace:* for @tanstack/ai* deps. Do not add @tanstack/ai-client (framework packages re-export the client and /byok).chat-model.ts, a handle-chat-post.ts, or any other one-off helper for the model or the POST body. The route file owns chat().Do not commit the unused generator extras (every adapter, PKCE, model picker, thinking UI) unless this tutorial teaches them.
Match Basic Chat only for the Start routes folder:
src/routes/index.tsx is the page.src/routes/api.chat.ts is the server route (next to index.tsx). Start maps api.chat.ts to /api/chat.tsconfig.json is self-contained (Start-style). Do not extend the repo root.Add other files only when this tutorial needs them (a key form, a tool, a store). Many examples will not use BYOK. Do not add BYOK files by default.
Load docs. Run its persona and tone gates unless this conversation already chose them.
Open with the problem the reader has, why it matters, and how this tutorial solves it (one short block). Then walk through steps. Each step teaches one piece of that solution and says why that piece exists.
Typical shape (adapt to the scenario; do not force BYOK):
npx @tanstack/cli@latest create) and install with package-manager tabs. React-only line, no @tanstack/ai-client: react: @tanstack/ai @tanstack/ai-react @tanstack/ai-<adapter>.src/routes/api.chat.ts and say that.Put the sandbox comment and the GitHub link on the page (see End state). Do not add a numbered "try it" step that only repeats those.
Sandbox comment:
<!-- ::client-example library=ai framework=react slug=<slug> -->Do not mention Nx, generators, or PRs in the tutorial. Code on the page must match the example files.
Install tabs: <!-- ::start:tabs variant="package-manager" mode="install" -->. See the docs skill.
docs/config.json:
"tab": "tutorial", child tutorials/<slug>."tab": "examples", child framework/react/examples/<slug>.Point Overview and Quick Start at the tutorial. Cross-link any recipe that covers the same UI.
examples/README.md: list the new example.
docs/superpowers/, plans, screenshots, or .agent/.Co-authored-by.test:pr if it was not run.| Mistake | Fix |
|---|---|
| Copy Basic Chat file-for-file | Generate, then slim to this scenario |
Generate under examples/<slug> | The generator writes examples/react/<slug>/ |
| Model const or extra handler file | Inline the latest model id in the route |
| BYOK files on a tutorial that does not need keys | Skip them |
| Tutorial is only commands and code | Problem, why, how, then each step as one piece |
| Skip nav or the sandbox comment | Add the Examples tab child and the ::client-example comment |
tsconfig.json extends ../../../tsconfig.json | Keep a self-contained Start-style tsconfig in the example |
7fb4a5f
Canonical home
since Sep 23, 2026
Also appears in
since Sep 23, 2026
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.