data-data-api
Use when the user asks about an instant API over a database: Hasura GraphQL, PostgREST, WunderGraph, a data gateway, real-time subscriptions or row-level…
от j4flmao★ 47 звёзд на GitHub
Установить data-data-api в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Data Data API
Purpose
Design and deploy data APIs using Hasura (GraphQL) or PostgREST (REST) with authorization, real-time subscriptions, performance optimization, and security patterns.
Agent Protocol
Trigger
Exact user phrases: "data API", "Hasura", "PostgREST", "WunderGraph", "GraphQL for data", "REST API for data", "instant API", "database API", "real-time API", "data authorization", "data gateway", "auto-generated API".
Input Context
- Database(s) to expose (PostgreSQL, MySQL, SQL Server)
- API style preference (GraphQL, REST, both)
- Authentication provider (Auth0, Keycloak, Cognito, custom)
- Authorization model (RBAC, column-level, row-level)
- Real-time requirements (subscriptions, webhooks)
- Performance requirements (latency, throughput, caching)
- API consumers (frontend, mobile, external, internal services)
- Rate limiting and throttling needs
Output Artifact
Data API architecture with tool selection (Hasura/PostgREST/WunderGraph), authorization model (row-level, column-level, session), real-time subscription setup, and performance strategy.
Response Format
# API tool selection
# Hasura/PostgREST configuration
# Authorization rules (row + column level)
# Real-time subscription config
# Caching and performance tuning
No preamble. No postamble. No explanations. No filler/hedging/transitions. Compress output — why use many token when few do trick.
Completion Criteria
- API tool selected with rationale
- Database connected and tables tracked
- Row-level security (RLS) configured for all tables
- Column-level permissions set per role
- Real-time subscriptions enabled where needed
- Caching and rate limiting configured
- API monitoring and logging set up
- Error handling and mutation constraints defined
Max Response Length
350 lines of configuration.
Workflow
Step 1: Select API Tool
Tool Comparison Matrix
| Tool | API Style | Database Support | Real-time | Auth |
|---|---|---|---|---|
| Hasura | GraphQL + REST | Postgres, MySQL, SQL Server, BigQuery, Snowflake | Subscriptions, live queries | JWT, Webhook, OIDC |
| PostgREST | REST | PostgreSQL only | Webhooks (trigger) | JWT, API key, OAuth |
| WunderGraph | GraphQL + REST + RPC | Postgres + any OpenAPI/gRPC | Server-sent events | JWT, OIDC, API key |
Decision Tree
API style preference?
├── GraphQL (client-driven queries, subscriptions)
│ ├── PostgreSQL database → Hasura
│ ├── Multiple databases (MySQL, SQL Server, etc.) → Hasura
│ └── Polyglot backend (DB + external APIs) → WunderGraph
├── REST (simpler, broader client compatibility)
│ ├── PostgreSQL only → PostgREST
│ └── PostgreSQL with GraphQL also → Hasura (also serves REST)
└── RPC / serverless functions
├── Database-centric → PostgREST with stored procedures
└── Polyglot → WunderGraph with TypeScript operations
Default: Hasura for GraphQL (native subscriptions, broad DB support, built-in auth). PostgREST for REST-only PostgreSQL stack. WunderGraph for polyglot backends combining data APIs with external services.
Step 2: Hasura Configuration
# docker-compose.hasura.yaml
version: "3.8"
services:
postgres:
image: postgres:16
environment:
POSTGRES_PASSWORD: ${PG_PASSWORD}
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
hasura:
image: hasura/graphql-engine:v2.40.0
ports:
- "8080:8080"
depends_on:
postgres:
condition: service_healthy
environment:
HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:${PG_PASSWORD}@postgres:5432/postgres
HASURA_GRAPHQL_ENABLE_CONSOLE: "true"
HASURA_GRAPHQL_ADMIN_SECRET: ${HASURA_ADMIN_SECRET}
HASURA_GRAPHQL_JWT_SECRET: '{"type":"HS256","key":"${JWT_SECRET}"}'
HASURA_GRAPHQL_UNAUTHORIZED_ROLE: anonymous
HASURA_GRAPHQL_ENABLE_REMOTE_SCHEMAS: "true"
HASURA_GRAPHQL_CACHE_MAX_ENTRIES: 5000
HASURA_GRAPHQL_DEV_MODE: "false"
HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, websocket-log
HASURA_GRAPHQL_STRINGIFY_NUMERIC_TYPES: "true"
HASURA_GRAPHQL_LIVE_QUERIES_MULTIPLEXED: "true"
Step 3: Authorization Model
Role-Based Access Design
| Role | Row Filter | Column Mask | Rate Limit | Use Case |
|---|---|---|---|---|
| anonymous | None (no access) | None | 10 req/min | Unauthenticated visitors |
| authenticated | User sees own data | Full access | 100 req/min | Logged-in users |
| data_analyst | All rows, no PII | Exclude PII columns | 1000 req/min | Internal analysts |
| data_owner | Own domain only | Full access | 500 req/min | Domain data stewards |
| admin | All rows | All columns | 5000 req/min | Platform admins |
| service | All rows (machine) | Full access | 10000 req/min | Backend services |
Hasura Metadata Authorization
# Hasura metadata authorizatio
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/data-api-error-handling.md
- references/data-api-patterns.md
- references/data-api-security.md
- references/data-api-versioning.md
- references/graphql-for-data.md
- references/hasura-postgrest.md
FAQ
Что делает скилл data-data-api?
Use when the user asks about an instant API over a database: Hasura GraphQL, PostgREST, WunderGraph, a data gateway, real-time subscriptions or row-level authorization for data APIs. Produces API layer config with JWT/RBAC permissions, caching and rate limits. Not for hand-written REST/GraphQL services (use backend-api-design) or federation (use api-graphql-federation).
Как установить скилл data-data-api?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл data-data-api запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…