mcpField
A
appwrite-backend

appwrite-backend

github.com/sgaabdu4Development257 installsUpdated 1d ago
Repository

About appwrite-backend

appwrite-backend is a skill for agents working with Appwrite. It routes tasks to focused guidance and sets rules for safe data operations, SDK selection, and production changes.

Key features

  1. 01Routes Appwrite tasks to specialized guidance
  2. 02Defines safe mutation and migration practices
  3. 03Guides SDK selection by runtime and target
  4. 04Sets rules for ACLs, retries, and limits

Use cases

  1. 01Plan a production schema or data migration
  2. 02Handle bulk writes and transaction boundaries
  3. 03Choose an SDK for an Appwrite runtime

MCP support

For agent operations, the skill requires using MCP server guidance and reporting capability gaps rather than falling back to SDKs, HTTP, or the command line.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/sgaabdu4/appwrite-backend --skill appwrite-backend

After installing, type/appwrite-backendin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
atomic-operators.md
auth-methods.md
authentication.md
avatars.md
bulk-operations.md
chunked-queries.md
cost-optimization.md
destructive-erasure.md
error-handling.md
functions-advanced.md
functions.md
graphql.md
health.md
limits.md
locale.md
mcp-servers.md
messaging.md
pagination-performance.md
performance.md
permissions.md
production-migrations.md
query-optimization.md
realtime.md
relationships.md
schema-management.md
self-hosting-ops.md
self-hosting.md
storage-files.md
teams.md
transactions.md

Details

From the project README

Appwrite Development

Route

Load the owner before acting. Unlisted detail = read the owner, never infer.

TriggerOwner
Any agent operation against Appwrite, MCP server setup, or Appwrite documentation lookupmcp-servers
Production schema/data/ACL/function cutoverproduction-migrations + transactions when writes share a transaction
TablesDB transaction or cross-service consistencytransactions + permissions when ACLs change
Permanent account/subject-data erasure across TablesDB, Auth, Storage, provider data, or retained audit evidencedestructive-erasure + transactions
Mass row create/update/upsert/delete, transaction-limit pressure, per-row write loopbulk-operations + transactions when atomic scope spans requests/tables
Filter by more IDs than the deployed Query.equal() value capchunked-queries
Table/column/index design, encryption at rest, auto-increment, timestamp override, CSV import/exportschema-management
Query shape, select, spatial, time helpers, missing-index suspicionquery-optimization
Counter, array, string, or date field mutated concurrentlyatomic-operators
Relationship modeling or traversalrelationships
List, feed, infinite scroll, or large-offset pagingpagination-performance
Slow path, caching, delta sync, bootstrap orderingperformance
Bandwidth, execution, or storage costcost-optimization
Sessions, MFA, SSR auth, JWT, user labels, security settingsauthentication
OAuth, magic link, email OTP, phone, anonymous, custom token, email verification, password recovery, session list/delete, user preferencesauth-methods
ACL design, lockout, public-leak suspicionpermissions
Team, membership, or multi-tenancyteams
Upload, download, preview, transform, bucket configstorage-files
Function authoring, handler, runtime, cold start, env varsfunctions
Function events, schedules, idempotency, binary payloads, CI/CDfunctions-advanced
Function execution SDK model or response-format parsing failure, execution mode, response retrieval or execution timeoutfunctions-advanced
Realtime subscription, channel, presence, event filteringrealtime
Push, email, or SMS deliverymessaging
Outbound event delivery to an external systemwebhooks
Avatar, initials, QR, flag, faviconavatars
429, retry, typed error, timeout, code-zero transport failure, client request burst, partial-sync reporterror-handling + performance for startup/bootstrap request bursts
Platform ceiling or limit errorlimits
Country, currency, language, or geo lookuplocale
GraphQL endpointgraphql
Self-hosted install, config, security, scaling, SDK version pinsself-hosting
Self-hosted backup, restore, upgrade, data-loss incidentself-hosting-ops
Health check, queue depth, uptime monitoringhealth

Invariants

  1. MCP for agent operations; official SDKs for application code — agent reads, mutations, deployments, and diagnosis use mcp-servers. Missing MCP capability → report the gap; no direct SDK, HTTP, or command-line fallback for agent operations. Application code uses official SDKs; raw Appwrite HTTP (fetch, requests, dio, package:http, curl) requires a missing SDK endpoint or an isolated, tested Client.call model-parsing workaround.
  2. Pin SDKs by target and call shape — Cloud: latest stable official SDK. Self-hosted: exact release-matched pins for the deployed server version (2.x or 1.9.x) in self-hosting. “Compatible with 1.9.x” does not mean release-matched. Before changing a pin, audit every intervening breaking change and prove the repository's real SDK calls against the candidate; version resolution alone is insufficient. A verified repository SDK pin outranks a skill pin.
  3. TablesDB, not the legacy Databases service — its Collections/Documents API is deprecated since 1.8.0. DocumentsDB and VectorsDB are separate services, not that legacy API.
  4. Allocate Appwrite IDs once with ID.unique() — retryable create: call ID.unique() before the first attempt → persist the returned ID in the durable draft/intent → reuse that exact ID for every retry/reconciliation. A fresh ID.unique() on retry creates a second resource. Business/natural identity remains in indexed columns; never derive resource IDs from names, timestamps, slugs, hashes, or custom generators.
  5. Explicit ACL — server SDK/Console create = empty resource ACL; client SDK create = creator read/update/delete. Pass explicit Permission/Role whenever ACL correctness matters.
  6. Bind limits to the deployed target — page size, bulk rows/request, transaction operations, and Query.equal() value cap come from the deployed server source/config, never from memory.
  7. Choose execution mode by the required result — response data → synchronous createExecution within its 30-second limit. Async background work → bounded status monitoring + source-of-truth reconciliation; execution polling/realtime cannot return the response body or headers. Long-running results need an authorized durable result read. Report destructive failure only after reconciliation proves the entity still exists. Consume synchronous responses directly; ambiguous status/404 → reconcile before retrying. Use functions-advanced.
  8. Prove destructive scope — schema/access contraction requires complete live inventory + exact approved resource IDs + backup/recovery proof. Missing fields, incomplete pagination, or unknown access effects fail closed. Use production-migrations.
  9. Stage production migrations — additive expand → type-aware resumable backfill → compatible deployment → contract/read-back → consumer activation. Partial data/schema never activates downstream code. Use production-migrations.
  10. Preserve write intent before optimizing — update-only work never routes through upsertRow/upsertRows; a pre-read, existence check, or full payload does not remove create-on-missing semantics. Same patch across rows → updateRows; heterogeneous per-row updates → createOperations with action: update inside the verified transaction budget, or redesign. Transaction pressure never authorizes upsert. Use bulk-operations.
  11. Batch collection writes before coding — target count can exceed one or is data-dependent → inventory the full mutation set + deployed limits before implementation. Compatible server bulk method exists → per-row write loop is forbidden. Bulk is unsupported → complete operation budget + atomic late-failure proof required. Full plan over cap → redesign or resumable fixed-point workflow; never split one atomic invariant across committed batches. Use bulk-operations + transactions.
  12. Preserve failure causality — cleanup, compensation, or rollback failure never replaces the primary exception. Retain both errors + stack traces + execution/transaction IDs, report the operation failed, then reconcile the exact postcondition. Use transactions.
  13. Coordinate client demand and uncertain outcomes — one endpoint/project-scoped coordinator owns foreground, sync, auth, and retry traffic. Bound concurrency; share 429/transport cooldowns; classify code-zero network failures; retry reads within one deadline; reconcile writes/transactions before any repeat; report one incident per failed operation; and never advance a sync checkpoint after partial failure. Use error-handling.

SDK Routing

RuntimePackage
Web TypeScript/JavaScript/Reactappwrite
Node.js/Deno/TypeScript SSR/Functionsnode-appwrite
Flutter clientappwrite
Dart server/Functionsdart_appwrite
Python server/Functionsappwrite
  • Call style: TypeScript object parameters, Python keyword arguments, Dart named parameters. Positional only when matching existing code or on explicit request.
  • Client SDKs use account sessions and user-scoped APIs. Server SDKs use API keys. SSR uses two clients: a reusable admin client for session creation, and a per-request session client via setSession(...) — never shared.
  • Cloud project endpoint = https://<REGION>.cloud.appwrite.io/v1.
  • Initialize clients outside warm Function handlers where the runtime allows.

Resources

Docs https://appwrite.io/docs · API https://appwrite.io/docs/apis/rest · SDKs https://github.com/appwrite

Comments

Markdown supported