Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

backend-service-implement后端服务实现

Agent Skill

backend-service-implement 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

501

周安装

8

GitHub Stars

11

下载量

65
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:backend-service-implement(后端服务实现)
来源仓库:https://github.com/parhumm/jaan-to
仓库路径:skills/backend-service-implement
安装命令:
npx skills add https://github.com/parhumm/jaan-to --skill backend-service-implement
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/parhumm/jaan-to --skill backend-service-implement

简介

backend-service-implement 将 TODO 存根和上游需求转换为完整服务实现,支持多技术栈。

  • 适用于业务逻辑编码、ORM 映射和事务处理,需配合 tech.md 定义技术上下文。
  • 通过 npx skills add 安装,需准备 config.md 和模板文件作为输入。
  • 生成的代码需根据实际数据库 Schema 调整实体关系。
  • 建议分阶段提交并运行冒烟测试验证核心路径。

SKILL.md

backend-service-implement

Bridge spec to code — generate full service implementations with business logic from TODO stubs and upstream specs.

Context Files

  • $JAAN_CONTEXT_DIR/tech.md - Tech stack context (CRITICAL — determines framework, ORM, patterns)

- Uses sections: #current-stack, #frameworks, #constraints, #patterns

  • $JAAN_CONTEXT_DIR/config.md - Project configuration
  • $JAAN_TEMPLATES_DIR/jaan-to-backend-service-implement.template.md - Output template
  • $JAAN_LEARN_DIR/jaan-to-backend-service-implement.learn.md - Past lessons (loaded in Pre-Execution)
  • ${CLAUDE_PLUGIN_ROOT}/docs/extending/language-protocol.md - Language resolution protocol
  • ${CLAUDE_PLUGIN_ROOT}/docs/research/70-dev-backend-service-implementation-generation.md - Research: service layer architecture, ORM queries, RFC 9457 errors, pagination, transactions, idempotency, JWT lifecycle

Input

Upstream Artifacts: $ARGUMENTS

Accepts 1-4 file paths or directory references:

  • backend-scaffold — Path to scaffold output (route handlers with TODO stubs, service stubs, ORM schema)
  • backend-api-contract — Path to OpenAPI 3.1 YAML (endpoint specs, request/response schemas, error codes)
  • backend-data-model — Path to data model document (table definitions, relationships, constraints, indexes)
  • backend-task-breakdown — Path to BE task breakdown (vertical slices with implementation notes)
  • Empty — Interactive wizard prompting for each artifact

Pre-Execution Protocol

MANDATORY — Read and execute ALL steps in: ${CLAUDE_PLUGIN_ROOT}/docs/extending/pre-execution-protocol.md Skill name: backend-service-implement Execute: Step 0 (Init Guard) → A (Load Lessons) → B (Resolve Template) → C (Offer Template Seeding)

Also read context files if available:

  • $JAAN_CONTEXT_DIR/tech.md — Know the tech stack for framework-specific service generation
  • $JAAN_CONTEXT_DIR/config.md — Project configuration

Language Settings

Read and apply language protocol: ${CLAUDE_PLUGIN_ROOT}/docs/extending/language-protocol.md Override field for this skill: language_backend-service-implement

Language exception: Generated code output (variable names, code blocks, schemas, SQL, API specs) is NOT affected by this setting and remains in the project's programming language.

PHASE 1: Analysis (Read-Only)

Thinking Mode

ultrathink

Use extended reasoning for:

  • Cross-referencing scaffold TODO stubs against API contract + data model + task breakdown
  • Deriving business logic from endpoint relationships and status code semantics
  • Planning service implementation order (dependency graph)
  • Identifying state machines, transactions, and idempotency requirements

Step 1: Validate & Parse Inputs

For each provided path:

  • backend-scaffold: Read route handlers, service stubs, ORM schema. Extract all // TODO comments and map to endpoint operations
  • backend-api-contract: Read api.yaml. Extract paths, schemas, error responses, security schemes, pagination config
  • backend-data-model: Read data model doc. Extract table definitions, constraints, indexes, relationships, migration notes
  • backend-task-breakdown: Read task breakdown. Extract vertical slices, implementation notes, acceptance criteria, business rules

Report which inputs found vs missing; suggest fallback for missing:

  • Missing scaffold: generate service implementations from API contract + data model (scaffold-less mode)
  • Missing API contract: derive endpoints from scaffold route definitions
  • Missing data model: derive from Prisma/Eloquent schema in scaffold
  • Missing task breakdown: derive business rules from API contract status codes and schema differences

Present input summary:

INPUT SUMMARY
─────────────
Sources Found:    {list}
Sources Missing:  {list with fallback suggestions}
Entities:         {extracted entity/resource names}
TODO Stubs:       {count from scaffold}
Endpoints:        {count from API contract}
Tables:           {count from data model}
Task Slices:      {count from task breakdown}
Business Rules:   {count of derived rules}

Step 2: Detect Tech Stack

Read $JAAN_CONTEXT_DIR/tech.md:

  • Extract framework from #current-stack (default: Fastify v5+)
  • Extract ORM from #current-stack (default: Prisma)
  • Extract DB from #current-stack (default: PostgreSQL)
  • Extract patterns from #patterns (auth, error handling, logging)
  • If tech.md missing: ask framework/ORM/DB via AskUserQuestion

Multi-Stack Detection:

tech.md valueFrameworkORM/DBService PatternOutput
Node.js / TypeScriptFastify v5+PrismaPlain exported functions + Prisma singleton.ts files
PHPLaravel 12 / Symfony 7Eloquent / DoctrineService classes + Repository pattern.php files
GoChi / stdlib (Go 1.22+)sqlc / GORMFeature-based internal packages.go files

Step 3: Map TODOs to Implementation Plan

3.1: TODO Inventory

Parse all // TODO: implement stubs from scaffold. For each:

  1. Identify the endpoint (method + path)
  2. Match to API contract operation (request/response schemas, error codes)
  3. Match to data model tables (required queries, relationships)
  4. Match to task breakdown slice (business rules, acceptance criteria)

3.2: Business Logic Derivation

Derive implementation patterns from API spec semantics:

Reference: See ${CLAUDE_PLUGIN_ROOT}/docs/extending/backend-service-implement-reference.md section "Business Logic Derivation Patterns" for HTTP status code patterns, schema difference analysis, endpoint relationship patterns, and task breakdown derivation rules.

3.3: State Machine Detection

When API specs include status fields with constrained transitions:

  • Extract enum values from schema
  • Map action endpoints to transitions (e.g., POST /orders/{id}/confirm)
  • Generate transition map and validation function

3.4: Dependency Graph

  1. Shared helpers (error factory, pagination, cursor encoding)
  2. Auth service (JWT lifecycle — if auth endpoints exist)
  3. Independent resource services (no cross-service dependencies)
  4. Dependent resource services (reference other services)
  5. Cross-cutting middleware (idempotency, rate limiting)

Step 4: Clarify Implementation Scope

Use AskUserQuestion:

  1. Scope question:

- Question: "Implement all TODOs or select vertical slices?" - Header: "Scope" - Options: - "All TODOs" — Implement every TODO stub found - "Select slices" — Choose specific vertical slices from task breakdown - "Priority subset" — Start with core CRUD, add complex logic later

  1. Auth question (if auth endpoints detected):

- Question: "What JWT library should be used for authentication?" - Header: "Auth" - Options: - "jose (Recommended)" — Modern JWT with Web Crypto API, edge-compatible - "jsonwebtoken" — Legacy but widely used - "Already implemented" — Auth service exists, skip generation - "No auth" — Skip auth implementation

  1. Pagination question (if list endpoints detected):

- Question: "Which pagination strategy for list endpoints?" - Header: "Pagination" - Options: - "Cursor-based (Recommended)" — Stable under writes, O(1) seek, opaque cursor - "Offset-based" — Simple page + limit, for admin/dashboard endpoints - "Both" — Cursor for public API, offset for admin - "Already implemented" — Pagination helpers exist

  1. Transaction depth (if multi-step operations detected):

- Question: "How should multi-step operations be handled?" - Header: "Transactions" - Options: - "Interactive transactions (Recommended)" — Prisma $transaction with isolation levels - "Sequential batch" — Simple array transactions for independent writes - "Optimistic concurrency" — Version-based updates with conflict detection - "Mix by operation" — Choose per operation based on complexity

  1. Idempotency question (if POST/PUT endpoints exist):

- Question: "Should POST/PUT endpoints support idempotency keys?" - Header: "Idempotency" - Options: - "Yes (Recommended)" — Idempotency-Key header with DB storage, 24h TTL - "Critical endpoints only" — Only for payment/order creation - "No" — Skip idempotency support

Step 5: Present Implementation Plan

IMPLEMENTATION PLAN
═══════════════════

STACK: {framework} + {orm} + {database}

TODO COVERAGE
─────────────
Total TODOs:     {count}
Implementing:    {count} ({scope choice})
Skipping:        {count} (if partial scope)

SERVICES ({count})
──────────────────
{For each service:}
  {resource}.service.ts
    - {method}: {description} ({status codes})
    ...

SHARED HELPERS
──────────────
  - error-factory.ts (RFC 9457 problem details, error type registry)
  - pagination.ts ({strategy} pagination helper)
  {- cursor.ts (cursor encode/decode) — if cursor pagination}
  {- auth.service.ts (JWT lifecycle with jose) — if auth}
  {- idempotency.ts (Idempotency-Key middleware) — if enabled}

STATE MACHINES ({count if any})
───────────────────────────────
  {resource}: {state1} → {state2} → ...

DEPENDENCY ORDER
────────────────
1. Shared helpers
2. {ordered service list}

HARD STOP — Review Implementation Plan

Use AskUserQuestion:

  • Question: "Proceed with generating service implementations?"
  • Header: "Generate"
  • Options:

- "Yes" — Generate all planned service files - "No" — Cancel - "Edit" — Let me revise the scope or architecture first

Do NOT proceed to Phase 2 without explicit approval.


PHASE 2: Generation (Write Phase)

Phase 2 Output — Flat folder (no nested subfolder)

All files in $JAAN_OUTPUTS_DIR/backend/service-implement/{id}-{slug}/:

{id}-{slug}/
├── {id}-{slug}.md                        # Implementation guide + decisions log
├── {id}-{slug}-services/                  # Service files by domain
│   ├── {resource}.service.ts              # Per-resource service implementation
│   ├── auth.service.ts                    # Auth/JWT service (if applicable)
│   └── ...
├── {id}-{slug}-helpers/                   # Shared helper files
│   ├── error-factory.ts                   # RFC 9457 error creation
│   ├── pagination.ts                      # Pagination utility
│   ├── cursor.ts                          # Cursor encode/decode (if cursor pagination)
│   └── idempotency.ts                     # Idempotency middleware (if enabled)
└── {id}-{slug}-readme.md                  # Integration instructions
File extensions adapt to detected stack (.ts for Node.js,.php for PHP,.go for Go).

Step 6: Generate Shared Helpers

Generate helpers in dependency order (these are used by services):

Reference: See ${CLAUDE_PLUGIN_ROOT}/docs/extending/backend-service-implement-reference.md section "Helper Generation Patterns" for Error Factory (RFC 9457), Pagination Helper, Auth Service, and Idempotency Middleware generation templates.

Step 7: Generate Service Implementations

7.1: Service Structure

Node.js/TypeScript (Fastify + Prisma):

// Plain exported functions importing Prisma singleton
// Module caching acts as built-in singleton (no DI container needed)
// Testable via vi.mock()

import { prisma } from '../lib/prisma.js';
import { createProblemDetail, BusinessError } from '../helpers/error-factory.js';
import { paginateWithCursor } from '../helpers/pagination.js';
import type { RequestContext } from '../types.js';

PHP (Laravel + Eloquent):

// Service class with constructor injection
// Repository pattern optional (Eloquent IS the repository)
// API Resources for response transformation

Go (Chi/stdlib + sqlc):

// Feature-based internal package
// Constructor injection with small interfaces (1-3 methods)
// Accept interfaces, return structs

7.2: Per-Method Implementation

For each TODO stub, generate the full implementation:

Reference: See ${CLAUDE_PLUGIN_ROOT}/docs/extending/backend-service-implement-reference.md section "Per-Method Implementation Patterns" for CREATE, READ, LIST, UPDATE, DELETE, and ACTION operation implementation steps.

7.3: State Machine Generation

Reference: See ${CLAUDE_PLUGIN_ROOT}/docs/extending/backend-service-implement-reference.md section "State Machine Generation" for transition map template and validation function code.

7.4: Cross-Service Operations

For operations spanning multiple services:

  • Use Prisma interactive $transaction with explicit isolation level
  • Pass tx (transaction client) to all participating service methods
  • Keep transactions short — move side effects outside
  • Set maxWait: 5000 and timeout: 10000

Step 8: Generate Implementation Guide

8.1: Executive Summary

1-2 sentences: resource count, stack, key patterns implemented (pagination, auth, idempotency).

8.2: Implementation Decisions Log

For each decision made during generation:

DecisionChoiceRationale
PaginationCursor-basedStable under concurrent writes, O(1) seek
Authjose JWTWeb Crypto API, edge-compatible
TransactionsInteractiveMulti-step inventory reservation
.........

8.3: TODO Coverage Report

ServiceTODOs FoundTODOs ImplementedCoverage
user.service.ts55100%
order.service.ts88100%
............
Total{n}{n}100%

8.4: Service Dependency Map

Mermaid diagram showing service dependencies and shared helpers.

Step 9: Generate Integration README

  1. Setup — How to integrate generated services into the scaffold project
  2. File Placement — Where each generated file goes relative to the project root
  3. Dependencies — NPM packages to install (jose, etc.)
  4. Configuration — Environment variables needed (JWT_SECRET, etc.)
  5. Testing — How to test individual services (vi.mock() pattern)
  6. Next Steps — Downstream skills:

- /jaan-to:qa-test-generate — Generate tests for these implementations - /jaan-to:sec-audit-remediate — Security audit the implementations

Step 10: Quality Check

Before preview, verify every item in the checklist (coverage, error handling, patterns, security, code quality).

Reference: See ${CLAUDE_PLUGIN_ROOT}/docs/extending/backend-service-implement-reference.md section "Quality Check Checklist" for the full verification checklist.

If any check fails, fix before preview.

Step 11: Preview & Approval

Present generated output summary:

  • File count and total lines
  • TODO coverage percentage
  • Service list with method counts
  • Helpers generated

Use AskUserQuestion:

  • Question: "Write service implementation files to output?"
  • Header: "Write Files"
  • Options:

- "Yes" — Write the files - "No" — Cancel - "Refine" — Make adjustments first

Step 12: Generate ID and Folder Structure

source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/id-generator.sh"
SUBDOMAIN_DIR="$JAAN_OUTPUTS_DIR/backend/service-implement"
mkdir -p "$SUBDOMAIN_DIR"
NEXT_ID=$(generate_next_id "$SUBDOMAIN_DIR")
slug="{project-name-slug}"
OUTPUT_FOLDER="${SUBDOMAIN_DIR}/${NEXT_ID}-${slug}"

Preview output configuration:

Output Configuration - ID: {NEXT_ID} - Folder: $JAAN_OUTPUTS_DIR/backend/service-implement/{NEXT_ID}-{slug}/ - Main file: {NEXT_ID}-{slug}.md

Step 13: Write Output

  1. Create output folder: mkdir -p "$OUTPUT_FOLDER"
  2. Create services subdirectory: mkdir -p "$OUTPUT_FOLDER/${NEXT_ID}-${slug}-services"
  3. Create helpers subdirectory: mkdir -p "$OUTPUT_FOLDER/${NEXT_ID}-${slug}-helpers"
  4. Write all files:

- Main doc: $OUTPUT_FOLDER/${NEXT_ID}-${slug}.md - Service files: $OUTPUT_FOLDER/${NEXT_ID}-${slug}-services/{resource}.service.ts - Helper files: $OUTPUT_FOLDER/${NEXT_ID}-${slug}-helpers/{helper}.ts - Integration readme: $OUTPUT_FOLDER/${NEXT_ID}-${slug}-readme.md

  1. Update subdomain index:
source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/index-updater.sh"
add_to_index \
  "$SUBDOMAIN_DIR/README.md" \
  "$NEXT_ID" \
  "${NEXT_ID}-${slug}" \
  "{Project Title} Service Implementations" \
  "{Executive summary — 1-2 sentences}"
  1. Confirm completion:
Service implementations written to: $JAAN_OUTPUTS_DIR/backend/service-implement/{NEXT_ID}-{slug}/ Index updated: $JAAN_OUTPUTS_DIR/backend/service-implement/README.md

Step 14: Suggest Next Actions

Service implementations generated successfully! TODO Coverage: {n}/{n} (100%) Next Steps: - Copy service files to your project (see integration readme for placement) - Run /jaan-to:qa-test-generate to generate tests for these implementations - Run /jaan-to:sec-audit-remediate to audit the implementations for security issues - Run your existing test suite to verify integration

Step 15: Capture Feedback

Use AskUserQuestion:

  • Question: "How did the service implementations turn out?"
  • Header: "Feedback"
  • Options:

- "Perfect!" — Done - "Needs fixes" — What should I improve? - "Learn from this" — Capture a lesson for future runs

If "Learn from this": Run /jaan-to:learn-add backend-service-implement "{feedback}"


Key Generation Rules — Node.js/TypeScript (Research-Informed)

Reference: See ${CLAUDE_PLUGIN_ROOT}/docs/extending/backend-service-implement-reference.md section "Key Generation Rules — Node.js/TypeScript (Research-Informed)" for the full rules list covering Service Layer, Prisma Queries, Error Handler, RFC 9457, JWT, Cursor Pagination, Idempotency, Transactions, Import Extensions, and DTO Mapping.

Multi-Stack Support (Research-Informed)

Reference: See ${CLAUDE_PLUGIN_ROOT}/docs/extending/backend-service-implement-reference.md section "Multi-Stack Service Patterns" for PHP (Laravel + Symfony) and Go stack-specific service patterns.

Anti-Patterns to NEVER Generate

Reference: See ${CLAUDE_PLUGIN_ROOT}/docs/extending/backend-service-implement-reference.md section "Anti-Patterns" for per-stack anti-pattern lists (All Stacks, Node.js, PHP, Go).

Skill Alignment

  • Two-phase workflow with HARD STOP for human approval
  • Multi-stack support via tech.md detection
  • Template-driven output structure
  • Output to standardized $JAAN_OUTPUTS_DIR path

Definition of Done

  • All TODO stubs from scaffold have corresponding implementations
  • Every API contract endpoint has service method coverage
  • RFC 9457 error handling implemented with type registry
  • Pagination helper generated and used in all list endpoints
  • Auth service generated (if auth endpoints exist) with JWT lifecycle
  • Idempotency middleware generated (if enabled) for POST/PUT
  • State machines generated for resources with status transitions
  • Transactions used for multi-step operations with side effects outside
  • Quality checks passed (coverage, error handling, patterns, security, code quality)
  • Implementation guide with decisions log and TODO coverage report
  • Integration readme with setup instructions and next steps
  • Output follows v3.0.0 structure (ID, folder, index)
  • Index updated with executive summary
  • User approved final result

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.1%
按下载量换算23

Claude

33.14%
按下载量换算22

Cursor

19.57%
按下载量换算13

Gemini CLI

9.11%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills