Index of every page on this site: llms.txt
All skills
genericservice avatar

/tina-schema-sync

@b07f28f
Run it yourself

Synchronize TinaCMS schema changes by regenerating local artifacts and committing them. Use when the Tina schema (tina/config.ts) has been modified, when adding new block types or collection fields, or when tinacms build fails with "Unable to seed" errors. Triggers on "sync tina", "rebuild tina", "tina schema changed", "regenerate tina artifacts", "tina lock file", or after any edit to tina/config.ts.

Use this Skill: https://skilld.dev/gh/genericservice/claude-skills/tina-schema-sync

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈106 tokens for metadata: the name and description. ≈987 when used: this file.

Description uses 5.3% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈423 characters, or 5.3%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

TinaCMS Schema Sync

Regenerate TinaCMS artifacts locally and commit them after schema changes. This handles the hybrid deployment strategy where tinacms build is skipped on Vercel and artifacts are pre-committed.

When to Use

  • After editing tina/config.ts (adding fields, blocks, collections)
  • After upgrading @tinacms/cli
  • When pnpm tina:build fails with "Unable to seed" (content references unknown block types)
  • When Vercel deploys succeed but new blocks don't render

Prerequisites

  • TinaCloud credentials in .env.local:
    NEXT_PUBLIC_TINA_CLIENT_ID="..."
    TINA_TOKEN="..."
  • If .env.local doesn't exist, run ./scripts/pull-secrets.sh or copy from .env.example and fill in values from TinaCloud dashboard.

Procedure

Step 1: Source credentials

source .env.local

Verify they're set:

echo $NEXT_PUBLIC_TINA_CLIENT_ID | head -c 10
echo $TINA_TOKEN | head -c 10

Step 2: Run the dev server to regenerate artifacts

NEXT_PUBLIC_TINA_CLIENT_ID="$NEXT_PUBLIC_TINA_CLIENT_ID" \
TINA_TOKEN="$TINA_TOKEN" \
npx tinacms dev --noWatch --noTelemetry

Wait for "TinaCMS Dev Server is active" message, then stop the server (Ctrl+C or kill the process).

Why tinacms dev instead of tinacms build? The build command connects to TinaCloud for indexing. If the content already references new block types that TinaCloud's schema doesn't know about, the build fails with "Unable to seed." The dev server generates artifacts locally without requiring TinaCloud to re-index first.

Step 3: Verify artifacts were regenerated

git status tina/

You should see changes in:

  • tina/__generated__/client.ts
  • tina/__generated__/types.ts
  • tina/tina-lock.json

Also check public/admin/ for changes.

Step 4: Verify new types exist

If you added a new block type (e.g., ContentTypes):

grep "ContentTypes" tina/__generated__/types.ts

Step 5: Commit all three artifact groups

git add tina/__generated__/ tina/tina-lock.json public/admin/
git commit -m "chore(tina): regenerate artifacts for [describe schema change]"

Critical: tina/tina-lock.json is the file TinaCloud reads to understand the schema on deploy. If you commit generated types but forget the lock file, deploys will fail or new block types will not render.

Step 6: Push

git push

TinaCloud picks up the lock file from the pushed commit and indexes the schema correctly.

Agentic Workflow & Vibe Coding

  • Iterative Syncing: Do not expect the schema to sync perfectly on the first try if there are complex field dependencies. If the dev server throws an error or artifacts don't generate, isolate the specific schema error, fix exactly one collection or field definition, and rerun the sync process until successful.
  • Vibe Coding: Create local, semantic commits for your working tina/config.ts changes before running the sync process, and then commit the generated artifacts separately once the sync succeeds. This ensures you can easily roll back if the generation fails.

Troubleshooting

"Unable to seed content/pages/home.mdx"

The content file references a block type the cloud schema doesn't know about. This is the exact scenario this skill handles. Use tinacms dev (Step 2), not tinacms build.

Dev server won't start

  • Check credentials are set (Step 1)
  • Check port 4001 isn't in use: lsof -i :4001
  • Check port 6970 isn't in use: lsof -i :6970

Types generated but lock file unchanged

The schema change may not have been saved. Verify tina/config.ts was written before running the dev server.

Checklist

Before pushing, verify:

  • tina/__generated__/client.ts has changes
  • tina/__generated__/types.ts has new type definitions
  • tina/tina-lock.json has changes
  • public/admin/ updated (if applicable)
  • All four are staged and committed together

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts3mo3 checks · Risk SAFE
  • Gen Agent Trust Hub3mo

    This skill provides a standard developer workflow for synchronizing TinaCMS schema changes. It includes instructions for sourcing environment variables, regenerating code artifacts using the TinaCMS CLI, and committing the results to Git.

  • Socket3mo

    No alerts

  • Snyk3mo

    Risk: LOW · No issues

Signed by skilld at b07f28f. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated 8 months ago
version
1.0.0

README badge

README badge for genericservice/claude-skills/tina-schema-sync