المهارات backend-dev-guidelines
⚙️

backend-dev-guidelines

آمن ⚙️ الأوامر الخارجية🔑 متغيرات البيئة📁 الوصول إلى نظام الملفات

應用後端開發最佳實踐

متاح أيضًا من: Dimon94,BrianDai22,DojoCodingLabs,sickn33

使用經過驗證的 Node.js/Express/TypeScript 模式建立一致且易於維護的後端服務。此技能提供架構指導、程式碼模板和具有安全意識的微服務開發模式。

يدعم: Claude Codex Code(CC)
📊 70 كافٍ
1

تنزيل ZIP المهارة

2

رفع في Claude

اذهب إلى Settings → Capabilities → Skills → Upload skill

3

فعّل وابدأ الاستخدام

اختبرها

استخدام "backend-dev-guidelines". Create a POST /posts endpoint with authentication

النتيجة المتوقعة:

  • 完整的路由定義與 SSO 中介軟體
  • 具有麵包屑追蹤的 BaseController
  • 具有依賴注入的 PostService
  • 具有 Prisma 查詢的 PostRepository
  • 用於貼文資料的 Zod 驗證綱要
  • 使用 Sentry 捕獲的錯誤處理

استخدام "backend-dev-guidelines". Convert legacy callback code to async/await

النتيجة المتوقعة:

  • 使用 try/catch 更新的服務方法
  • AsyncErrorWrapper 工具程式用法
  • Sentry 錯誤捕獲整合
  • 用於平行操作的 Promise.all()
  • 適當的錯誤傳播到控制器

استخدام "backend-dev-guidelines". Add input validation to existing endpoint

النتيجة المتوقعة:

  • 具有型別推斷的 Zod 綱要定義
  • 在服務呼叫前在控制器中驗證
  • 驗證失敗時回傳 400 狀態碼
  • 回應中的錯誤詳情
  • 無效輸入的測試案例

التدقيق الأمني

آمن
v4 • 1/17/2026

All 555 static findings are FALSE POSITIVES. This is a documentation/guide skill containing educational code examples. The detected patterns (shell commands, environment variables, path traversal, crypto algorithms) are in markdown code blocks demonstrating best practices and anti-patterns. The skill actively promotes secure coding - it teaches AGAINST vulnerabilities like path traversal and weak cryptography, not exploits them.

13
الملفات التي تم فحصها
5,537
الأسطر التي تم تحليلها
3
النتائج
4
إجمالي عمليات التدقيق

عوامل الخطر

تم تدقيقه بواسطة: claude عرض سجل التدقيق →

درجة الجودة

38
الهندسة المعمارية
100
قابلية الصيانة
87
المحتوى
21
المجتمع
100
الأمان
91
الامتثال للمواصفات

ماذا يمكنك بناءه

新功能實作

遵循架構模式為新 API 端點生成控制器、服務和儲存庫程式碼。

程式碼庫標準化

使用 BaseController 和 unifiedConfig 在多個微服務中建立一致的模式。

Express API 開發

建立具有適當中介軟體、驗證和錯誤追蹤整合的 Express 路由。

جرّب هذه الموجهات

建立新端點
Create a new /users/:id endpoint with UserController that extends BaseController, includes Zod validation, and proper error handling with Sentry.
服務模式
Generate a UserService with dependency injection pattern, including repository calls and async error handling wrapper.
儲存庫模式
Create a UserRepository pattern with PrismaService usage, transaction support, and query optimization examples.
完整功能
Generate complete feature with routes, BaseController, service with DI, repository layer, Zod validation schemas, and Jest tests.

أفضل الممارسات

  • 使用分層架構:路由委派給控制器,控制器呼叫服務,服務使用儲存庫。
  • 始終擴展 BaseController 以實現一致的錯誤處理、麵包屑和 Sentry 整合。
  • 在業務邏輯前使用 Zod 綱要驗證所有輸入 - 儘早拒絕無效資料。

تجنب

  • 永遠不要在路由處理程序中放置業務邏輯 - 委派給控制器。
  • 永遠不要直接使用 process.env - 使用 unifiedConfig 以獲得型別安全和測試。
  • 永遠不要跳過錯誤處理 - 所有非同步操作都需要 try/catch 與 Sentry 捕獲。

الأسئلة المتكررة

此技能使用什麼架構模式?
分層架構,具有 routes → controllers → services → repositories 的關注點分離。
此技能可以生成測試嗎?
是的,包含具有模擬策略的 Jest 單元和整合測試模式。
此技能適用於其他框架嗎?
專注於 Express/Node.js/TypeScript - 模式可適應類似框架。
此技能如何處理錯誤?
BaseController 提供 handleError、handleSuccess、withTransaction 和 Sentry 整合。
我可以將此用於現有程式碼庫嗎?
是的,提供從舊版模式到現代架構的重構指南。
使用什麼驗證函式庫?
Zod 用於執行時期 TypeScript 驗證,具有從綱要推斷型別的功能。