From zenbu-powers
React IT 的 Schema Analysis。分析 Component Props、API Client 函式簽名、 Zod Schemas、MSW Handler 型別,確保測試基礎建設與規格一致。
npx claudepluginhub zenbuapps/zenbu-powers --plugin zenbu-powersThis skill uses the workspace's default tool permissions.
在 Red 階段開始前,分析 `.feature` + `api.yml` 所需的 API endpoints 與資料結構,
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
Guides code writing, review, and refactoring with Karpathy-inspired rules to avoid overcomplication, ensure simplicity, surgical changes, and verifiable success criteria.
Share bugs, ideas, or general feedback.
在 Red 階段開始前,分析 .feature + api.yml 所需的 API endpoints 與資料結構,
確保現有的 Zod Schemas、API Client 函式、MSW Handlers 能滿足測試需求。
若不一致則修正或委派 /zenbu-powers:aibdd-auto-frontend-msw-api-layer 重建。
| 面向 | Web Backend | React IT |
|---|---|---|
| 資料結構來源 | ORM Models (SQLAlchemy / JPA) | Zod Schemas (src/lib/types/) |
| Migration | Alembic / Flyway | N/A(無 DB) |
| API 層 | FastAPI routes / Spring Controllers | API Client functions (src/lib/api/) + MSW handlers |
| 需要 Schema Analysis? | 是 | 是(驗證前端 API 層) |
.feature — 需要的 Aggregates、UI 操作、驗證條件api.yml — API endpoints、request/response schemaserm.dbml(可選)— Entity 結構參考src/lib/types/ 或 src/lib/schemas/ — Zod Schemassrc/lib/api/ — API client functionssrc/mocks/handlers/ 或 src/test/mocks/handlers/ — MSW Handlerssrc/app/ 或 src/pages/ 或 src/components/ — React Component files| 狀態 | 行動 |
|---|---|
| 全部一致 | GO — 直接進入 Step Template |
| 缺 Zod Schema / API Client / MSW Handler | 委派 /zenbu-powers:aibdd-auto-frontend-msw-api-layer 補齊後 GO |
| 缺 Component Stub | 自動建立最小 stub(<div>TODO</div>)後 GO |
| 有衝突需人工判斷 | 暫停,報告差異 |
→ 呼叫 /zenbu-powers:aibdd-auto-frontend-msw-api-layer,此 skill 會從 api.yml 重新生成 Schemas / Fixtures / Handlers / Client。
→ 直接建立最小 stub:
// src/app/lessons/[id]/progress/page.tsx
'use client';
export default function LessonProgressPage({ params }: { params: { id: string } }) {
return <div>TODO: LessonProgressPage for lesson {params.id}</div>;
}
→ 更新 Zod Schema,確保與 api.yml 一致:
// src/lib/types/lesson-progress.ts
import { z } from 'zod';
export const LessonProgressSchema = z.object({
id: z.string(),
userId: z.string(),
lessonId: z.number(),
progress: z.number().min(0).max(100),
status: z.enum(['NOT_STARTED', 'IN_PROGRESS', 'COMPLETED']),
updatedAt: z.string(),
});
export type LessonProgress = z.infer<typeof LessonProgressSchema>;
Schema Analysis 完成後產出:
npx tsc --noEmit 通過(無型別錯誤)