.cursor/skills/contract-architect/SKILL.md
Designs clean, stable MVP API and UI contracts: input/output shapes, TypeScript types, sample JSON, required vs optional fields, validation hints, and extension notes. Optimized for one-day builds and card-friendly UIs. Use when defining endpoints, request/response schemas, form models, shared types, or before wiring frontend to backend; when the user mentions contracts, DTOs, API design, or stable JSON shapes for an MVP.
npx skillsauth add Volodymyr199606/payment-risk-reviewer contract-architectInstall 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.
Design minimal, stable contracts for hackathon-style MVPs. Prefer one round-trip, predictable keys, and UI that maps 1:1 to typed fields—no speculative nested graphs.
null or empty arrays instead of omitting keys when the UI expects them.meta only if needed for pagination or request IDs.Produce all of the following unless the user opts out:
| # | Deliverable |
|---|-------------|
| 1 | Input contract — fields, types, constraints, auth/context assumptions |
| 2 | Output contract — success payload; error shape(s) |
| 3 | UI contract — which fields drive which components (cards, lists, badges) |
| 4 | TypeScript interfaces — type/interface for input, output, and nested objects |
| 5 | Sample JSON — minimal valid request and response (and one error example if applicable) |
| 6 | Required vs optional — explicit per field; note defaults |
| 7 | Frontend validation — sync rules, what to validate before submit, what to trust from server |
| 8 | Extension ideas — additive-only patterns (new optional fields, version, feature flags) |
Use this structure in replies (adjust headings if the user wants a shorter answer):
## Summary
[One sentence: what boundary this contract defines]
## Input contract
- Purpose:
- Transport: [POST JSON / form / query]
- Fields: [table or list]
## Output contract
- Success:
- Errors: [HTTP + body shape]
## UI contract
| Field | Component | Notes |
|-------|-----------|-------|
## TypeScript
\`\`\`ts
// types here
\`\`\`
## Sample JSON
**Request**
\`\`\`json
\`\`\`
**Response**
\`\`\`json
\`\`\`
## Required vs optional
| Field | Required | Default | Server validation |
|-------|----------|---------|-------------------|
## Frontend validation
- Before submit:
- Display-only / trust server for:
## Future-safe extensions
- [ ] Optional fields only; never repurpose meanings
- [ ] Version or `schemaVersion` if multiple clients
- [ ] ...
camelCase JSON for TS-first stacks unless API already uses snake_case).amount vs value)."approve" | "review" | "block") over free strings.{ code: string; message: string }[] or string[]—pick one and keep it.meta only for: requestId, timestamp, durationMs, or pagination—never business logic in meta.{ error: { code: string; message: string } } plus optional details.Card body; cap length in contract with maxLength if user-generated.schemaVersion (number) when backward compatibility might break.Record<string, unknown> for core domain objectsFor this product family, contracts often include: transaction identifiers, amount/currency, merchant/category, geography, velocity hints, account age, dispute history, signals (list), recommendation, short explanation. Keep signals and recommendation machine-friendly enums where the UI must render consistently.
development
Builds Next.js + TypeScript UIs with modular components, clear layout hierarchy, card-based results, polished spacing and typography, async states (loading, empty, success, error), responsive behavior, and thin API integration. Use when implementing or polishing screens, building feature UI from scratch, wiring components to backend routes, or when the user asks for clean minimal UI, demo-ready pages, or step-by-step UI construction with manual test steps.
tools
Designs hackathon-ready frontend architecture: folder layout, page shell, component boundaries, state flow, API touchpoints, TypeScript types, async UI states, and responsive patterns. Optimized for Next.js MVPs, speed, and demo quality. Use when scaffolding or refactoring UI, planning pages and components, wiring client to API, or when the user mentions frontend structure, layout, state management, or implementation order for an MVP.
development
Audits an existing MVP for demo readiness: user flow clarity, visible value, visual polish, information scanability, first impression, and what to cut or simplify. Produces a prioritized list of practical, quick-win improvements only. Use when polishing for a demo, hackathon presentation, stakeholder walkthrough, or when the user asks for demo readiness, first impression, or what to remove before showing the product.
tools
Connects Next.js frontends to backend Route Handlers with centralized fetch wrappers, TypeScript response types, simple async state (loading / empty / success / error), and debug-friendly single-module API code. Use when wiring client components to `app/api`, refactoring scattered fetch calls, defining request/response typing for API calls, or when the user mentions API integration, fetch patterns, or keeping the frontend decoupled from backend internals.