gadget-best-practices
Best practices for building with Gadget. Use when developers need guidance on models, actions, routes, access control, Shopify/BigCommerce integrations, frontend patterns, API usage, testing setup, CI verification, ggt workflows, debugging, or parallel agent development loops. Triggers "model", "action", "route", "permission", "access control", "multi-tenancy", "Shopify", "BigCommerce", "frontend", "API client", "internal API", "filter", "sort", "pagination", "webhook", "background job", "testing", "ci", "ggt", "debugger", "logs", "problems"
What this skill does
## How to use This skill provides quick reference patterns and best practices for building with Gadget. **๐ Resources:** - Full documentation: [docs.gadget.dev](https://docs.gadget.dev) Read individual rule files for detailed explanations and code examples: ### Core Data Modeling - [references/models.md](references/models.md) - Data model design patterns and naming conventions - [references/fields.md](references/fields.md) - Field types, validations, and configuration - [references/relationships.md](references/relationships.md) - Relationship patterns (belongsTo, hasMany, hasManyThrough) - [references/data-access.md](references/data-access.md) - Computed views and computed fields (Gelly aggregates, group by, time-series, access control) ### Backend Logic - [references/actions.md](references/actions.md) - Model actions vs global actions, hooks, and patterns - [references/routes.md](references/routes.md) - HTTP routes and when to use them vs actions - [references/background-jobs.md](references/background-jobs.md) - Enqueueing actions and scheduled tasks ### Access Control & Security - [references/access-control.md](references/access-control.md) - RBAC, permission filters, and Gelly expressions - [references/shopify-multi-tenancy.md](references/shopify-multi-tenancy.md) - Shop isolation patterns for Shopify apps ### Platform Integrations - [references/shopify-integration.md](references/shopify-integration.md) - Shopify app patterns (webhooks, sync triggers, metafields) - [references/bigcommerce-integration.md](references/bigcommerce-integration.md) - BigCommerce app patterns - [references/webhooks.md](references/webhooks.md) - Webhook handling patterns ### Frontend Development - [references/frontend-hooks.md](references/frontend-hooks.md) - React hooks from @gadgetinc/react - [references/frontend-components.md](references/frontend-components.md) - Autocomponents and UI patterns - [references/frontend-forms.md](references/frontend-forms.md) - Form handling and validation ### Development Workflow - [references/ggt-cli.md](references/ggt-cli.md) - Canonical ggt workflow (sync, checks, logs, envs, conflict handling, parallel worktrees) - [references/testing.md](references/testing.md) - Framework-agnostic testing setup, scenarios, and CI gates - [references/deployment.md](references/deployment.md) - Deployment workflows and environments - [references/environments.md](references/environments.md) - Environment variables and multi-environment strategies - [references/project-structure.md](references/project-structure.md) - File organization and conventions ### API & Authentication - [references/api-client.md](references/api-client.md) - Using the Gadget API client (filters, pagination, relationships) - [references/internal-api.md](references/internal-api.md) - Internal API usage, atomic updates, transaction-safe writes, and admin/session context - [references/authentication.md](references/authentication.md) - User authentication patterns - [references/error-codes.md](references/error-codes.md) - Common Gadget API error codes, likely causes, and triage workflow
Related in Web Dev
generating-lwc-components
IncludedLightning Web Components with PICKLES methodology and 165-point scoring. Use this skill when the user creates or edits LWC components, builds wire service patterns, or writes Jest tests for LWC. TRIGGER when: user creates/edits LWC components, touches lwc/**/*.js, .html, .css, .js-meta.xml files, or asks about wire service, SLDS, or Jest LWC tests. DO NOT TRIGGER when: Apex classes (use generating-apex), Aura components, or Visualforce.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Set up queries with useQuery, mutations with useMutation, configure QueryClient caching strategies, implement optimistic updates, and handle infinite scroll with useInfiniteQuery. Use when: setting up data fetching in React projects, migrating from v4 to v5, or fixing object syntax required errors, query callbacks removed issues, cacheTime renamed to gcTime, isPending vs isLoading confusion, keepPreviousData removed problems.
document-processor-api
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
nutrient-document-processing
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Covers useMutationState, simplified optimistic updates, throwOnError, network mode (offline/PWA), and infiniteQueryOptions. Use when setting up data fetching, fixing v4โv5 migration errors (object syntax, gcTime, isPending, keepPreviousData), or debugging SSR/hydration issues with streaming server components.
accelint-nextjs-best-practices
IncludedNext.js performance optimization and best practices. Use when writing Next.js code (App Router or Pages Router); implementing Server Components, Server Actions, or API routes; optimizing RSC serialization, data fetching, or server-side rendering; reviewing Next.js code for performance issues; fixing authentication in Server Actions; or implementing Suspense boundaries, parallel data fetching, or request deduplication.