一键导入
new-service
Scaffold a service + TanStack Query hook pair for an entity. Use when the user runs /new-service <entity-name>.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Scaffold a service + TanStack Query hook pair for an entity. Use when the user runs /new-service <entity-name>.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Reference for adding AI generation features using the Gemini pipeline. Covers field generation, article generation, and how to create new AI actions. Use when the user wants to add AI-powered functionality.
Reference for auth tokens, cookies, JWE decoding, max-age strategy, and the cookie-deletion pitfalls specific to this project. Apply whenever editing src/proxy.ts, src/proxy/*, src/utils/services/fetcher.ts, src/stores/{permission,user}-store.ts, login or logout flows.
Trigger automatically when adding or removing a page under src/app/(baseLayout)/*. Forces Sidebar.tsx update in the same change so the menu and route stay in lockstep.
Tamamlanan bir geliştirmeyi veya değişikliği otomatik olarak dokümante eder. docs/CHANGELOG.md [Unreleased] bölümünü günceller, gerekirse yeni bir docs/{FEATURE}.md rehber dosyası oluşturur. Commit öncesi veya sonrası, her geliştirmede /doc-changes komutu ile çalıştır.
Systematic debugging and fix workflow. Use when the user runs /debug-fix <description-of-issue>.
Scaffold a complete CRUD module (service, hook, schema, types, pages). Use when the user runs /new-module <entity-name>.
| name | new-service |
| description | Scaffold a service + TanStack Query hook pair for an entity. Use when the user runs /new-service <entity-name>. |
| disable-model-invocation | true |
| allowed-tools | Read, Write, Glob |
Create a service and TanStack Query hook pair for: $ARGUMENTS
Parse $ARGUMENTS:
entity-name — kebab-caseEntityName — PascalCaseRead reference files:
src/app/_services/mail-accounts.services.ts — service patternsrc/app/_hooks/useMailAccounts.ts — hook patternsrc/types/mail-account.ts — type patternCreate type file: src/types/{entity-name}.ts
export interface {EntityName} {
id: string
// TODO: Add entity fields
createdAt: string
updatedAt: string
}
export interface Create{EntityName}DTO {
// TODO: Add create fields
}
export interface Update{EntityName}DTO extends Partial<Create{EntityName}DTO> {}
src/app/_services/{entity-name}.services.tsimport { fetcher } from '@/utils/services/fetcher'
import type { {EntityName}, Create{EntityName}DTO, Update{EntityName}DTO } from '@/types/{entity-name}'
import type { BaseResponse } from '@/types/BaseResponse'
const BASE_URL = '/api/v1/{entity-name}'
export const {entityName}Service = {
getAll: () => fetcher<BaseResponse<{EntityName}[]>>(BASE_URL),
getById: (id: string) => fetcher<BaseResponse<{EntityName}>>(`${BASE_URL}/${id}`),
create: (data: Create{EntityName}DTO) => fetcher<BaseResponse<{EntityName}>>(BASE_URL, { method: 'POST', body: JSON.stringify(data) }),
update: (id: string, data: Update{EntityName}DTO) => fetcher<BaseResponse<{EntityName}>>(`${BASE_URL}/${id}`, { method: 'PUT', body: JSON.stringify(data) }),
delete: (id: string) => fetcher<BaseResponse<void>>(`${BASE_URL}/${id}`, { method: 'DELETE' }),
}
src/app/_hooks/use{EntityName}.tsimport { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
import { {entityName}Service } from '@/app/_services/{entity-name}.services'
const QUERY_KEY = ['{entity-name}']
export function use{EntityName}() {
const queryClient = useQueryClient()
const listQuery = useQuery({ queryKey: QUERY_KEY, queryFn: {entityName}Service.getAll })
const getQuery = (id: string) => useQuery({ queryKey: [...QUERY_KEY, id], queryFn: () => {entityName}Service.getById(id), enabled: !!id })
const createMutation = useMutation({
mutationFn: {entityName}Service.create,
onSuccess: () => queryClient.invalidateQueries({ queryKey: QUERY_KEY }),
})
const updateMutation = useMutation({
mutationFn: ({ id, data }: { id: string; data: Parameters<typeof {entityName}Service.update>[1] }) => {entityName}Service.update(id, data),
onSuccess: () => queryClient.invalidateQueries({ queryKey: QUERY_KEY }),
})
const deleteMutation = useMutation({
mutationFn: {entityName}Service.delete,
onSuccess: () => queryClient.invalidateQueries({ queryKey: QUERY_KEY }),
})
return { listQuery, getQuery, createMutation, updateMutation, deleteMutation }
}