.claude/skills/add-prisma-model/SKILL.md
Add or modify a Prisma model/table for the PostgreSQL database. Use when creating tables like markets, signals, orders, trades, positions, risk_config, etc.
npx skillsauth add HadiAlizade77/poly add-prisma-modelInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Create or modify model: $ARGUMENTS
packages/backend/prisma/schema.prismaprisma-client)Add model to schema.prisma:
@id, @unique, @default, @relation annotations@@index for query patterns (especially timestamp-based)Json type for JSONB columnsDecimal for financial values (not Float)created_at / updated_at fields with defaultsCreate migration:
npx prisma migrate dev --name add_$0
Generate client:
npx prisma generate
Add seed data in packages/backend/prisma/seed.ts if applicable
Export types from packages/shared/src/types/ for frontend/backend sharing
market_snapshots, risk_events)MarketSnapshot, RiskEvent)Decimal(20,6) for monetary/financial valuesDecimal(10,6) for prices/probabilitiesDecimal(5,4) for confidence/percentages (0 to 1)Json) for flexible payloads@updatedAt for automatic update timestampsNEVER use Float for financial values. Always use Decimal with appropriate precision:
Decimal(20,6)Decimal(10,6)Decimal(5,4) or Decimal(8,6)development
Wire up a new WebSocket event channel between backend and frontend. Use when adding real-time events like price updates, order fills, alerts, regime changes, etc.
development
Validate risk governor checks and risk configuration changes. Use when modifying risk parameters, adding new risk checks, or reviewing risk logic.
development
Scaffold a new backend service/process for the Polymarket platform. Use when creating a new PM2-managed service like market-scanner, data-ingestion, strategy-runner, etc.
testing
Run tests for the Polymarket platform. Supports unit, integration, and E2E tests. Use after implementing features or fixing bugs.