trpc-scaffolder
타입 안전한 tRPC 엔드포인트 생성
tRPC 라우터와 Zod 스키마를 수동으로 구축하면 엔드포인트당 20-30분이 걸리고 타입 오류 및 누락된 export 위험이 있습니다. 이 스킬은 검증 스키마, 예시 패턴, 자동 등록 검사까지 포함한 완전한 타입 안전 엔드포인트를 스캐폴딩합니다.
Télécharger le ZIP du skill
Importer dans Claude
Allez dans Paramètres → Capacités → Skills → Importer un skill
Activez et commencez à utiliser
Tester
Utilisation de "trpc-scaffolder". Create a new tRPC router for analytics with a getDashboardStats query procedure
Résultat attendu:
- Created router file: frontend/src/lib/trpc/routers/analytics.ts
- Procedure snippet generated for getDashboardStats
- Remember to register analyticsRouter in _app.ts
- Next: Create schemas in lib/trpc/schemas/analytics.schema.ts
Utilisation de "trpc-scaffolder". Add a mutation procedure to create new posts in the blogRouter
Résultat attendu:
- Procedure template generated for createPost mutation
- Add to blogRouter inside the router({ ... }) object
- Create input/output schemas: createPostInputSchema, createPostOutputSchema
- Run validation to verify registration
Audit de sécurité
Risque faibleThis skill scaffolds tRPC routers and schemas using bash scripts with standard Unix utilities. All file operations are constrained to predefined project paths. Documentation backticks flagged as command execution are false positives. The '../..' patterns in scripts are controlled project-root navigation. No network calls or credential access. Safe for marketplace publication.
Problèmes à risque faible (1)
Facteurs de risque
⚡ Contient des scripts (4)
📁 Accès au système de fichiers (3)
Score de qualité
Ce que vous pouvez construire
새 API 엔드포인트 추가
Next.js 애플리케이션용 프로젝트 규칙에 따라 타입 안전 tRPC 엔드포인트를 빠르게 스캐폴딩
검증 스키마 생성
입력 및 출력 검증을 위한 올바른 타입 추론의 Zod 스키마 생성
코드 표준 준수
자동 검증 검사로 모든 신규 엔드포인트가 일관된 패턴을 따르도록 보장
Essayez ces prompts
Create a new tRPC router for user management. Use the trpc-scaffolder skill to generate the router file and Zod schemas.
Add a query procedure called getUserProfile to the existing userRouter. Use the add-procedure.sh script from trpc-scaffolder.
Create Zod schemas for a notification entity. Use create-schema.sh to generate the schema file with input and output schemas.
Run the tRPC validation script to check if all routers are properly registered in _app.ts and schemas export types correctly.
Bonnes pratiques
- 새 엔드포인트 생성 후 항상 validate-trpc.sh를 실행하여 올바른 등록 여부를 확인
- 완전한 TypeScript 타입 안전성을 위해 z.infer<typeof schemaName>로 추론된 타입을 export
- GET 작업에는 query 프로시저를, 데이터 수정에는 mutation 프로시저 사용
Éviter
- _app.ts에서 라우터 등록을 건너뜀 - 런타임에 타입 오류 발생
- 추론된 타입을 export하지 않음 - TypeScript 타입 추론이 깨짐
- 읽기 작업에 mutation 사용 - REST 규칙 및 캐싱 동작 위반