wasp-operations

Automate WASP backend operations with type annotations and authentication checks.

2|1|Updated Nov 24, 2025
One-click install
npx skills add https://github.com/ToonVos/empty-opensaas --skill wasp-operations
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wasp-operations
Source: https://github.com/ToonVos/empty-opensaas/tree/main/.claude/skills/wasp-operations
Command: npx skills add https://github.com/ToonVos/empty-opensaas --skill wasp-operations

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a comprehensive guide to building robust and secure backend operations (queries and actions) in Wasp applications. It simplifies client-server communication, enforces best practices, and leverages Wasp's auto-invalidation, saving significant development time.

Core Features & Use Cases

  • Standardized Operation Patterns: Offers ready-to-use templates for creating, reading, updating, and deleting data, including auth checks, validation, and permission handling.
  • Auto-Invalidation Magic: Explains how to leverage Wasp's automatic cache invalidation, eliminating the need for manual cache management in the client.
  • Type-Safe Development: Emphasizes critical type annotations for context.entities access, preventing runtime errors and improving code reliability.
  • Use Case: Create a new Wasp query getTasks that fetches all tasks for the authenticated user, and an action createTask that adds a new task. This Skill ensures both operations are type-safe, include auth checks, and that getTasks automatically refetches after createTask completes.

Quick Start

Create a new Wasp query getTasks that fetches all tasks for the authenticated user. Ensure it includes an auth check and returns a list of Task entities.

Frequently Asked Questions about wasp-operations

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build type-safe backend operations in Wasp applications?

Type-safe backend operations in Wasp require explicit type annotations for `context.entities` access and proper TypeScript setup in your operations.ts file. This prevents runtime errors and ensures the compiler catches type mismatches before deployment, making queries and actions reliable and predictable.

What's the best way to implement authentication checks in Wasp queries and actions?

Authentication checks must be the first step in every backend operation. Wasp enforces this pattern through its operation structure, allowing you to validate user identity before accessing protected data or executing privileged operations, preventing unauthorized access at the entry point.

How does Wasp's auto-invalidation work for client-server synchronization?

Wasp automatically refetches queries after actions complete, eliminating manual cache invalidation. When an action like `createTask` finishes, dependent queries such as `getTasks` are automatically re-executed on the client, keeping UI state synchronized without extra code.

Can I use structured error handling with HttpError in Wasp backend operations?

Yes, Wasp operations support HttpError for structured error handling. This allows you to throw semantic HTTP errors from your backend code, which are automatically serialized and transmitted to the client, enabling consistent error workflows across your application.

What patterns should I follow when creating CRUD operations in Wasp?

Standardized CRUD patterns in Wasp include auth checks as the first step, type-annotated `context.entities` access, HttpError handling, and action-query wiring. These conventions ensure consistency across create, read, update, and delete operations while maintaining security and type safety.

Do I need to manually wire server-side code to the client in Wasp applications?

No, Wasp automates the client-server wiring. Define your queries and actions in main.wasp with their corresponding TypeScript implementations, and Wasp generates the necessary API endpoints and client functions, reducing boilerplate and integration overhead.