Agent Skills
› biersoeckli/QuickStack
› backend-services
backend-services
GitHub指导在QuickStack项目中创建和更新后端服务、适配器及服务器操作,遵循单例模式、适配器路由、缓存失效及异常处理等既定架构规范。
Trigger Scenarios
创建或修改 src/server/services 下的业务逻辑代码
实现或调整 src/server/adapter 中的外部集成适配层
编写需要遵循特定后端架构规范的服务器端功能
Install
npx skills add biersoeckli/QuickStack --skill backend-services -g -y
SKILL.md
Frontmatter
{
"name": "backend-services",
"description": "Create and update QuickStack backend services, adapters, standalone services, and server actions using the project's established singleton, adapter, caching, and error-handling patterns. Use when editing files under src\/server\/services, src\/server\/adapter, src\/server\/utils, src\/server.ts, or related server-side actions and backend utilities."
}
Backend Services
Quick Start
For QuickStack backend work, follow the existing service architecture:
- Use one class per file with a default-exported singleton instance.
- Keep service dependencies as module imports of other singleton services or adapters.
- Route Prisma and external API access through adapters, not directly from services.
- Throw
ServiceExceptionorFormValidationExceptionfor expected domain failures. - After a mutation affecting cached reads, invalidate the matching tags in
finally.
Service Pattern
When creating or editing a service:
- Put business logic in
src/server/services/. - Export a singleton instance as the file default export.
- Accept primitives or shared model types as inputs.
- Import dependencies at module scope; do not instantiate sibling services.
Adapters And Actions
- Put external integrations in
src/server/adapter/using the same singleton export pattern. - Use adapters for Prisma, Kubernetes, S3, and Longhorn access.
- Wrap server actions with
simpleActionorsaveFormAction. - Perform authorization checks inside the action callback before calling the service.
Mutation Rules
- After a mutation affecting cached reads, call
revalidateTag()infinally. - Use the matching
Tags.*helper; never hardcode cache tag strings. - Use transactions when multiple writes must succeed or fail together.
Standalone Services
- Place cron and background jobs in
src/server/services/standalone-services/. - Register cron jobs with
scheduleService. - Wrap cron callback bodies in
try/catchand log errors instead of rethrowing. - Initialize standalone services from
src/server.ts.
Reference
See REFERENCE.md for concrete patterns covering adapters, actions, authorization, Prisma, caching, naming, and startup wiring.
Version History
- 0.0.13 Current 2026-08-20 14:27


