Chuyển đến nội dung
Skillpedia
Website và giao diện (frontend)5.2k · #15030

build-with-tinybase

Skill này làm gì

Skill này giải thích cách thiết lập TinyBase để dữ liệu được lưu trên thiết bị, với đồng bộ giữa các thiết bị là tùy chọn. Skill dành cho lập trình viên xây dựng ứng dụng JavaScript hoặc TypeScript bằng TinyBase.

Khi nào nên dùng

  • ✓Khi bạn muốn xây dựng ứng dụng JavaScript hoặc TypeScript giữ dữ liệu trong trình duyệt hoặc trên thiết bị.
  • ✓Khi bạn muốn thiết lập lưu trữ hoặc đồng bộ cho một store TinyBase.
  • ✓Khi bạn muốn tạo một ứng dụng TinyBase mới từ mẫu được sinh ra.

Liên kết skill

https://github.com/tinyplex/tinybase/blob/main/docs/skills/build-with-tinybase/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/tinyplex/tinybase/blob/main/docs/skills/build-with-tinybase/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Xây dựng một ứng dụng việc cần làm nhỏ bằng TinyBase, lưu dữ liệu trong trình duyệt và đồng bộ giữa hai thiết bị của tôi.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent đọc các hướng dẫn tham chiếu của TinyBase trước khi viết mã, rồi thiết lập store, lớp lưu trữ và lớp đồng bộ theo đúng thứ tự. Sau đó agent kiểm tra xem hành vi có hoạt động đúng không.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Build With TinyBase

Prefer a current generated application over reconstructing TinyBase setup from memory. Preserve persistence and synchronization lifecycle ordering, and verify the behavior the user actually needs.

Read The References

Do not recall TinyBase API details from memory. Read the reference covering the task before writing code:

Reference Read it when
references/architecture.md Choosing between Store and MergeableStore, a persistence backend, a synchronization approach, or UI bindings
references/import-paths.md Importing anything outside the tinybase root, or checking which Persisters accept a MergeableStore
references/lifecycle.md Creating, starting, reconnecting, or destroying a Persister or Synchronizer, or setting WebSocket paths and channel Ids
references/durable-objects.md Building or debugging a Cloudflare Durable Object sync server

Select The Architecture

Read references/architecture.md when choosing between Store and MergeableStore, persistence backends, synchronization, or UI bindings.

Confirm that TinyBase fits the task:

  • Keep the active application dataset in a JavaScript runtime.
  • Use TinyBase for reactive tabular or key-value data, local-first behavior, persistence, synchronization, or framework bindings.
  • Do not present TinyBase as a hosted database service.
  • Pair it with another database or service when the authoritative dataset is unbounded, primarily queried on a server, or requires managed backend facilities.

Scaffold A New Application

Inspect the installed generator contract first:

npm create tinybase@latest -- --list-options

Translate the user's requirements into explicit values. Generate unattended projects with every applicable option and always disable automatic installation and server startup:

npm create tinybase@latest -- \
  --non-interactive \
  --projectName my-tinybase-app \
  --appType todos \
  --language typescript \
  --framework react \
  --tinyWidgets false \
  --schemas true \
  --syncType none \
  --persistenceType local-storage \
  --prettier true \
  --eslint true \
  --installAndRun false

Run the generator in the parent directory that should contain the new project. Do not overwrite an existing directory. After generation:

  1. Read the generated AGENTS.md and README.md.
  2. Inspect the primary Store file before modifying application code.
  3. Install dependencies only when authorized and required.
  4. Make application-specific changes within the generated architecture.
  5. Run the generated client build.
  6. Run the server build when server code changed.

Extend An Existing Application

Inspect package.json, TinyBase imports, Store creation, Persister setup, and Synchronizer setup before editing. Use documentation matching the installed TinyBase version. Start at https://tinybase.org/llms.txt or retrieve current TinyBase documentation through Context7 when available.

Keep these boundaries clear:

  • Store creation and schemas
  • persistence startup and teardown
  • synchronization startup and teardown
  • framework Provider or context wiring
  • application-specific data and UI

Reuse existing imports and patterns when they are current. Import integrations from their specific tinybase/... subpaths. Avoid adding a second source of truth in component state for data already owned by TinyBase.

Avoid These Errors

These account for most incorrect TinyBase code. Each is covered in detail by a reference above.

  • Passing a Store where a MergeableStore is required. Every Synchronizer, and every Durable Object Persister, requires createMergeableStore().
  • Importing an integration from tinybase instead of its own tinybase/persisters/..., tinybase/synchronizers/..., or tinybase/schematizers/... subpath.
  • Starting auto-saving before loading, which overwrites stored data wi
Câu hỏi thường gặp

Agent có dựa vào trí nhớ về chi tiết TinyBase không?

Không. Skill nói rằng phải đọc các hướng dẫn tham chiếu trước khi viết mã.

Dữ liệu có thể đồng bộ giữa các thiết bị không?

Có. Skill bao gồm việc đồng bộ một store qua WebSocket hoặc Cloudflare Durable Objects.

Skill có bao gồm việc lưu dữ liệu vào cơ sở dữ liệu không?

Có. Nó bao gồm cấu hình lưu trữ bền vững trên trình duyệt hoặc cơ sở dữ liệu.

Chi tiết

Mô tả gốc của tác giả

Scaffold, extend, and verify reactive local-first JavaScript or TypeScript applications with TinyBase. Use when choosing TinyBase for in-memory tabular or key-value state, generating an app with create-tinybase, adding schemas or UI bindings, resolving TinyBase import paths, configuring browser or database persistence, configuring MergeableStore synchronization over WebSockets or Cloudflare Durable Objects, or diagnosing an existing TinyBase application.

repo: tinyplex/tinybase

Độ phổ biến

Sao GitHub
5.2k
Vị trí xếp hạng
#15030
Giấy phép
MIT
Cập nhật
22/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Skill tương tự