Skip to content

aiskillstore/marketplace / skills/aayushbaniya2006/form-creator

form-creator

Verified

Create forms, validation schemas, and CRUD API endpoints. Use when building new data entry features or managing existing forms.

FileKindSize
SKILL.mdskill md1.1 KB
reference.mdmarkdown991 B
skill-report.jsonconfig17.2 KB

reference.md

View on GitHub
# Form Architecture Reference

## Reference Implementation
**Canonical Example:** `src/components/forms/plan-form.tsx`
Refer to this file for:
- TypeScript interfaces
- Loading states (`isSubmitting`)
- UI layout and Shadcn usage

## Architecture

### 1. Schema
- Handle nullable/optional fields explicitly.
- Reuse DB schemas where possible but prefer specific form schemas.

### 2. Form Component
- **Dependencies**: `react-hook-form`, `@hookform/resolvers/zod`, `lucide-react`, `sonner`.
- **State**: Track `isSubmitting`.
- **Structure**: `<Form {...form}>` wrapper -> `<form>` -> `<FormField>`.

### 3. API Routes
- **GET (List)**: Return `{ data, pagination }`.
- **Error Handling**: Wrap in `try/catch`. Return JSON `{ error: "Message" }` with status code.

## Best Practices
1. **Type Safety**: No `any`. Use Zod inferred types.
2. **DRY Forms**: Use the same component for Create and Edit (differentiate via `initialData`).
3. **UX**: Show loading states. Use toast notifications.

receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall