一键导入
backend-implementation
Implementation conventions for backend API routes and lib utilities. Loaded by tdd-implementer when the layer is backend.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Implementation conventions for backend API routes and lib utilities. Loaded by tdd-implementer when the layer is backend.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | backend-implementation |
| description | Implementation conventions for backend API routes and lib utilities. Loaded by tdd-implementer when the layer is backend. |
When creating or modifying API handlers and library utilities, follow these project-specific patterns.
Wrap all handlers with withErrorHandling from @/lib/api-error-handler:
export default withErrorHandling(async function handler(req, res) {
// handler logic
});
This returns { error: string } JSON on unhandled exceptions. Do not silently swallow errors from external API calls or other dependencies — let them propagate to withErrorHandling.
Write Cypress end-to-end tests for business processes and cross-cutting infrastructure. Use for testing complete business workflows, authentication flows, and UI state verification.
Implementation conventions for frontend React components, hooks, and pages. Loaded by tdd-implementer when the layer is frontend.
Write Jest backend tests for Next.js API routes following established patterns. Use for testing API handlers, lib utilities, and backend logic.
Write Jest frontend tests for React components and hooks using React Testing Library. Use for testing pages, components, and custom hooks.
Outside-In TDD starting from E2E tests, drilling down to unit tests. Auto-triggers for new features. Trigger phrases include "implement", "add feature", "build", "create functionality". Does NOT trigger for bug fixes, documentation, or configuration changes.
Instructions for adjusting outside-in-tdd skills and agents