360 Secure SkillHub
360 安全技能中心

Microservices

核心功能为分6阶段提供微服务落地全流程指导:从目标与约束论证(先考量模块化单体)、服务边界与数据确权,到集成模式选择、合约版本管理、可靠性设计及运维治理,输出实体-服务映射、序列图等交付物与检查清单。典型场景包括拆分耦合单体、排查分布式故障、对齐团队与服务边界,需先确认组织成熟度与平台能力。

clawkk
clawkk
热度 54.18
最近更新 2026-05-11 17:36:11
分类:开发依赖:纯提示词应用场景:调试排错 / API 集成 / DevOps / 工作流 ...

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add microservices
Metadata
name
microservices
description
Deep microservices workflow—service boundaries, data ownership, synchronous vs async integration, contracts, deployment independence, and operational complexity. Use when splitting a monolith, reviewing service boundaries, or debugging distributed failures.

Microservices (Deep Workflow)

Microservices trade code simplicity for operational and contract complexity. Justify each boundary with ownership and data isolation—not fashion.

When to Offer This Workflow

Trigger conditions:

  • Splitting the monolith; coupling blocks independent deploys
  • Latency cascades, partial failures, contract breaks
  • Conway’s law alignment between teams and services

Initial offer:

Use six stages: (1) goals & constraints, (2) boundaries & data ownership, (3) integration patterns, (4) contracts & versioning, (5) reliability patterns, (6) ops & governance). Confirm org maturity and platform capabilities.


Stage 1: Goals & Constraints

Goal: Why not a modular monolith first?

Valid drivers

  • Independent deploy cadence per team
  • Different scaling profiles or stacks
  • Clear domain ownership and blast-radius isolation

Costs

  • Distributed transactions, harder debugging, broader test matrix

Exit condition: Explicit assumption that modular monolith was considered.


Stage 2: Boundaries & Data Ownership

Goal: One service owns each aggregate’s write path; no shared writable tables across services.

Practices

  • Bounded contexts from DDD when helpful

Exit condition: Entity → owning service map.


Stage 3: Integration Patterns

Goal: Sync HTTP/gRPC vs async events—match consistency needs.

Patterns

  • Sagas or outbox for multi-step business processes

Exit condition: Sequence diagrams for top three flows.


Stage 4: Contracts & Versioning

Goal: Backward-compatible evolution; consumer-driven contracts optional.

Practices

  • Deprecation policy published

Stage 5: Reliability Patterns

Goal: Timeouts, retries with backoff, circuit breakers, bulkheads; idempotent handlers for retries.


Stage 6: Ops & Governance

Goal: Service catalog, SLIs on dependency edges, golden paths for new services.


Final Review Checklist

  • Boundary and data ownership clear
  • Integration style matches consistency needs
  • Contract versioning policy exists
  • Reliability patterns applied at boundaries
  • Ops ownership and catalog in place

Tips for Effective Guidance

  • Microservices without delivery maturity often fail—say so explicitly.
  • Shared databases are hidden coupling—flag them.
  • The network is not reliable—design for partial failure.

Handling Deviations

  • Small teams: strong bias toward modular monolith or few services.