Agent skill
build-tinacms-nextjs
Quellcode ansehen: yigitkonur/skills-by-yigitkonur
Installation
npx skills add yigitkonur/skills-by-yigitkonur --skill build-tinacms-nextjs12
Installationen
EU-hosted inference API
Power your AI agent skills with open-source models.
Drop-in OpenAI-compatible API. No data leaves Europe.
MiniMax
MiniMax M3
$0.40 / $1.40
per M tokens
Z.ai
GLM 5.3 Flash
$0.20 / $0.60
per M tokens
MoonshotAI
Kimi K3
$4.00 / $18.00
per M tokens
DeepSeek
DeepSeek V4.1 Flash
$0.40 / $1.40
per M tokens
Build TinaCMS Next.js
Build, extend, and debug a Next.js App Router site whose content layer is TinaCMS (git-backed MDX/JSON, GraphQL on top, optional visual editing). This file is the router: detect the project shape, pick the lane, jump to the smallest reference set, deliver the change, verify it.
When To Use
- "Add TinaCMS to my Next.js 14/15/16 App Router site."
- "Model a
posts/pages/blockscollection intina/config.ts." - "Render an MDX/
rich-textbody viauseTinaand<TinaMarkdown>inapp/[slug]/page.tsx." - "Wire visual editing, draft mode,
data-tina-field,proxy.ts, or live preview." - "Deploy a TinaCloud site to Vercel" or "self-host the Tina backend with Clerk + MongoDB."
- "Debug
tinacms buildfailures, missing generated client, schema/MDX errors, stale Vercel cache, or admin auth." - "Migrate from Pages Router or from TinaCloud to self-hosted."
Do NOT use this skill for:
- Plain Next.js work with no TinaCMS surface (no
tina/, notinacmsinpackage.json). - Converting a live URL or HTML snapshot to Next.js before CMS modeling — use
convert-url-to-nextjs. - Pages Router as the primary target — App Router is the trigger; Pages references here are legacy.
- Edge-runtime backend deploys (Cloudflare Workers, Vercel Edge). Tina backend requires Node.js.
Detect TinaCMS In The Repo (First Hop)
Before drafting any code, run these scans against the user's project. Strong signals mean the skill is correctly engaged:
| Signal | Meaning |
|---|---|
tina/config.ts or tina/config.tsx |
TinaCMS project — required |
tina/tina-lock.json |
Schema lockfile — must be committed |
tina/__generated__/ or .tina/__generated__/ |
Generated client — must be gitignored |
tinacms, @tinacms/cli in package.json |
TinaCMS install |
tinacms dev -c "next dev" in scripts |
App Router + Tina dev script |
import { useTina } from "tinacms/dist/react" |
Visual-editing hook — Client Component only |
import { client } from "@/tina/__generated__/client" |
Generated GraphQL client |
app/api/tina/[...routes]/route.ts |
Self-hosted backend route |
NEXT_PUBLIC_TINA_CLIENT_ID, TINA_TOKEN, NEXT_PUBLIC_TINA_BRANCH |
TinaCloud env |
proxy.ts (Next 16+) or middleware.ts |
May block /admin, /api/tina/* — inspect |
Optional read-only helpers (do not modify the project):
bash scripts/check-tina-versions.sh /path/to/project— package versions, package manager, App/Pages Router shape, scripts, routes. See scripts/check-tina-versions.md.bash scripts/check-tina-env.sh /path/to/project— env names, config files, generated client, preview/admin/API files, likely lane. See scripts/check-tina-env.md.
Read first: references/setup/01-prerequisites.md, references/setup/04-package-scripts.md, references/setup/05-env-vars.md, references/cli/01-overview.md, references/setup/07-agent-automation.md.
Hard Rules (Top-Loaded)
These rules cause the most expensive failures. Honor them before chasing framework bugs.
- Server vs Client split.
useTina()is a Client hook. The page (Server Component) fetches{ data, query, variables }from the generated client; a"use client"child receives those three props and callsuseTina(props). See references/rendering/01-app-router-pattern.md, references/rendering/03-usetina-hook.md. data-tina-fieldlands on DOM elements, not React component wrappers. Custom components must forward the attribute to a real DOM node, or the visual-editing overlay misses.tinacms buildprecedesnext build. CI runstinacms build && next build. Never ship atinacms devartifact. See references/cli/03-tinacms-build.md.- Pin
tinacms,@tinacms/cli, and all@tinacms/*to the same version and update them together. - Commit
tina/tina-lock.json. Never committina/__generated__/. See references/setup/06-gitignore-and-lockfile.md. - No frontend imports in
tina/config.*. Tina builds the config in a separate Node bundle; UI imports break the build. - Field-name discipline. Alphanumeric + underscore only. No hyphens, spaces, or reserved names:
children(in wrong context),mark,_template,_sys,id,__typename. See references/field-types/11-reserved-names.md, references/schema/03-naming-rules.md. - Use
fields:for one document shape;templates:only when documents genuinely have multiple shapes. See references/schema/02-collection-templates.md. - Vercel + TinaCMS clients must pass explicit revalidation. Pass
fetchOptions: { next: { revalidate: N } }on every Tina query, or content goes stale forever. See references/rendering/11-vercel-cache-caveat.md, references/data-fetching/04-fetch-options-revalidate.md. - Next 15+:
params,searchParams,draftMode(),cookies(),headers()are async. Await them. Never use them inside a"use cache"scope. - No
proxy.ts/middleware.tsrewrites that touch/admin,/api/preview, or/api/tina/*. See references/visual-editing/08-proxy-ts.md. - Self-hosted Tina backend = Node runtime only. Never deploy to Cloudflare Workers, Vercel Edge, or any V8 isolate. See references/deployment/05-edge-runtime-not-supported.md.
- Admin must live at the domain root or its own subdomain. Never
example.com/blog/admin. - Hash self-hosted user passwords. Never commit raw credentials.
- Never edit
tina/__generated__/*or.tina/__generated__/*by hand. - Tina build env reads
.env/ host env, not.env.local. Build env vars must exist where the build actually runs. - Never install with
--no-optional/--omit=optionalwhen debugging Tina module resolution.
Choose Backend Lane Early
| Lane | Choose when | First references | Success check |
|---|---|---|---|
| TinaCloud | Managed auth/API, fastest path, GitHub integration, greenfield default | references/concepts/03-tinacloud-vs-self-hosted.md, references/tinacloud/01-overview.md, references/deployment/01-vercel-tinacloud.md | Admin loads, edits commit to GitHub, queries refresh via revalidate/deploy hook |
| Self-hosted | Custom auth, custom storage, private network, enterprise control, no TinaCloud dependency | references/self-hosted/00-overview.md, references/self-hosted/01-architecture.md, references/deployment/02-vercel-self-hosted.md | /api/tina/gql responds on Node runtime, auth gates writes, DB + git provider configured |
| Unknown | User has not specified | Default to TinaCloud for greenfield unless compliance / auth / storage / network constraints point to self-hosted | State the assumption before scaffolding |
Do not split this skill into Cloud and self-hosted variants. One spine; two lanes.
Detect Intent → First Reference Hop
Preview / Draft Checkpoint
For visual-editing or editorial-preview tasks, verify all of these before chasing framework bugs:
NEXT_PUBLIC_TINA_CLIENT_ID,TINA_TOKEN, branch env, and any self-hosted auth/storage env vars exist in the right environment.tina/config.*declaresui.routerorui.previewUrlfor collections that need live URLs.- App Router has a Draft Mode route; Next 15+ uses async
draftMode(). - Page uses the two-component split: Server fetches, Client calls
useTina(props). - All three of
query,variables, anddataflow to the Client Component. data-tina-fieldlands on DOM elements (or is forwarded by custom components).proxy.ts(Next 16) ormiddleware.tsdoes not redirect/admin,/api/preview, or/api/tina/*.
Debug By Symptom
Debugging should take at most two hops from this file to the specific troubleshooting document.
Defaults
- Greenfield: TinaCloud + Vercel + MDX, App Router,
pnpm. Respect the project's existing package manager when its lockfile is consistent. - Legacy: Pages Router content is fallback only. If the project is Pages-first, defer to official docs.
- Local dev:
tinacms dev -c "next dev". Production build:tinacms build && next build. - Always pass
fetchOptions: { next: { revalidate: N } }for Tina client queries on Vercel unless the route is intentionally static. - Use
ui.routerfor collections that need live preview. - Use
defaultItemfor block templates andui.itemPropsfor list fields editors will manipulate.
Output Contract
For greenfield / build tasks, deliver:
- Code changes for setup, schema, rendering, and deploy lane.
- Commands run with results: install,
tinacms build, typecheck/build, local dev when feasible. - Validation showing generated client, admin route, and at least one rendered Tina-backed route.
For migration / add-to-existing tasks, deliver:
- Touched routes, components, content paths, package scripts, env/config names.
- Version, package-manager, App Router, and backend-lane assumptions.
- Regression checks for existing routes plus the new Tina route.
For deployment tasks, deliver:
- Lane decision and reason.
- Env vars / config names verified without exposing secret values.
- Provider-specific build/runtime checks (Node runtime for self-hosted).
For debugging tasks, deliver:
- Symptom, root cause, exact reference used, fix, verification rung.
- If only static checks passed, say runtime was not exercised.
Verification Rungs
- Skill edit → run
python3 scripts/validate-skills.py; report only target-skill errors. - Static → package versions, lockfile, App Router files,
tina/config.*, env names,.gitignore,tina/tina-lock.json. - Tina →
tinacms auditwhere relevant, thentinacms build; verifytina/__generated__/client.*exists. - App → repo's typecheck/lint/build; verify
tinacms buildprecedesnext build. - Runtime →
tinacms dev -c "next dev", open/admin/index.html, render at least one App Router route. - Visual editing → enable Draft Mode, observe
useTinaupdates, clickdata-tina-fieldtargets, verifyproxy.ts/middleware does not block admin or Tina APIs. - Deployment → env vars at the provider, build logs, Node runtime for self-hosted, content save path, cache/revalidation behavior.
Reference Routing (Exhaustive Catalog)
Use these globs as the catalog. Load only the lane the task needs. Topic catalog: references/00-reference-map.md.
- Concepts and architecture: references/concepts/*.md
- Setup and project integration: references/setup/*.md
- Tina config: references/config/*.md
- Schema modeling: references/schema/*.md
- Field types and MDX: references/field-types/*.md
- Custom field toolkit: references/toolkit-fields/*.md
- App Router rendering: references/rendering/*.md
- Visual editing and preview: references/visual-editing/*.md
- Data fetching and generated clients: references/data-fetching/*.md
- GraphQL operations: references/graphql/*.md
- SEO and metadata: references/seo/*.md
- Media storage: references/media/*.md
- TinaCloud lane: references/tinacloud/*.md
- Self-hosted lane: references/self-hosted/*.md, references/self-hosted/tina-backend/*.md, references/self-hosted/auth-provider/*.md, references/self-hosted/database-adapter/*.md, references/self-hosted/git-provider/*.md
- CLI: references/cli/*.md
- Deployment: references/deployment/*.md
- End-to-end workflows: references/workflows/*.md
- Troubleshooting: references/troubleshooting/*.md
Installationen
Sicherheitsprüfung
Quellcode ansehen
yigitkonur/skills-by-yigitkonur
Mehr aus dieser Quelle
Give agents clean web context
Search and extract the public web as Markdown or structured JSON through one API or hosted MCP server.
Verwandte Skills
Mehr aus dieser Quelle: yigitkonur/skills-by-yigitkonur
So verwenden Sie diesen Skill
Install build-tinacms-nextjs by running npx skills add yigitkonur/skills-by-yigitkonur --skill build-tinacms-nextjs in your project directory. Führen Sie den obigen Installationsbefehl in Ihrem Projektverzeichnis aus. Die Skill-Datei wird von GitHub heruntergeladen und in Ihrem Projekt platziert.
Keine Konfiguration erforderlich. Ihr KI-Agent (Claude Code, Cursor, Windsurf usw.) erkennt installierte Skills automatisch und nutzt sie als Kontext bei der Code-Generierung.
Der Skill verbessert das Verständnis Ihres Agenten für build-tinacms-nextjs, und hilft ihm, etablierte Muster zu befolgen, häufige Fehler zu vermeiden und produktionsreifen Code zu erzeugen.
Was Sie erhalten
Skills sind Klartext-Anweisungsdateien — kein ausführbarer Code. Sie kodieren Expertenwissen über Frameworks, Sprachen oder Tools, das Ihr KI-Agent liest, um seine Ausgabe zu verbessern. Das bedeutet null Laufzeit-Overhead, keine Abhängigkeitskonflikte und volle Transparenz: Sie können jede Anweisung vor der Installation lesen und prüfen.
Kompatibilität
Dieser Skill funktioniert mit jedem KI-Coding-Agenten, der das skills.sh-Format unterstützt, einschließlich Claude Code (Anthropic), Cursor, Windsurf, Cline, Aider und anderen Tools, die projektbezogene Kontextdateien lesen. Skills sind auf Transportebene framework-agnostisch — der Inhalt bestimmt, für welche Sprache oder welches Framework er gilt.