agentleFS
wonderslifewonderslife/pdd-skills-v3/skills/expert/expert-springcloud/SKILL.md

expert-springcloud

Skill15 starsChanged 27 days agoMITView on GitHub

Spring Cloud 微服务架构专家。当项目涉及服务注册与发现、配置中心、网关路由、熔断降级、链路追踪等微服务组件时自动触发。支持中文触发:微服务、网关配置、服务注册、熔断器、链路追踪。

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    All configurations managed by Nacos Config centrally

    line 81

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Spring Cloud 微服务专家 / Spring Cloud Microservice Expert

1. 技能概述 / Overview

🇨🇳 定位

为基于 Spring Cloud / Spring Cloud Alibaba 的微服务架构项目提供专家级指导,包括:服务治理、配置管理、API 网关、熔断降级、分布式事务、链路追踪等。

核心能力:

  • 服务注册与发现(Nacos/Eureka/Consul)
  • 配置中心管理(Nacos Config/Spring Cloud Config)
  • API 网关路由(Spring Cloud Gateway/Zuul)
  • 服务间调用(OpenFeign/RestTemplate)
  • 熔断与降级(Sentinel/Hystrix/Resilience4j)
  • 链路追踪(Sleuth + Zipkin/SkyWalking)
  • 分布式事务(Seata)

🇺🇸 Positioning

Provides expert-level guidance for Spring Cloud / Spring Cloud Alibaba microservice architecture projects, including: service governance, config management, API gateway, circuit breaking, distributed transactions, and distributed tracing.


2. 微服务架构规范 / Microservice Architecture Standards

🇨🇳

2.1 服务拆分原则

  • 按业务域拆分,每个服务对应一个限界上下文
  • 服务间禁止直接数据库访问,必须通过 API 调用
  • 共享代码通过公共模块(common)发布为 Maven 包

2.2 接口设计规范

  • 服务间调用统一使用 OpenFeign 客户端
  • Feign 接口定义放在独立的 xxx-api 模块中
  • 返回值统一使用 R<T> 包装类
  • 版本管理通过 URL 路径(/v1/, /v2/)实现

2.3 配置管理规范

  • 所有配置统一由 Nacos Config 管理
  • 配置文件按环境分离:xxx-dev.yml, xxx-prod.yml
  • 敏感配置(DB密码、密钥)必须加密存储
  • 配置变更必须记录变更日志

2.4 网关路由规范

  • 所有外部请求必须经过 Gateway 网关
  • 路由配置放在 Nacos Config 中,支持动态刷新
  • 网关层统一处理:鉴权、限流、日志、跨域

2.5 熔断与降级规范

  • 所有 Feign 调用必须配置 Sentinel 降级规则
  • 核心业务流必须有降级兜底方案
  • 慢调用/异常比例达到阈值时自动熔断

🇺🇸

2.1 Service Split Principles

  • Split by business domain, each service maps to a bounded context
  • Direct database access between services is forbidden; must use API calls
  • Shared code published as Maven packages through common modules

2.2 API Design Standards

  • Service-to-service calls use OpenFeign clients uniformly
  • Feign interface definitions in separate xxx-api modules
  • Return values wrapped uniformly in R<T> wrapper class
  • Version management through URL paths (/v1/, /v2/)

2.3 Config Management Standards

  • All configurations managed by Nacos Config centrally
  • Config files separated by environment: xxx-dev.yml, xxx-prod.yml
  • Sensitive configs (DB passwords, keys) must be encrypted
  • Config changes must have change logs

3. 常见问题模式 / Common Issue Patterns

🇨🇳

问题原因解决方案
Feign 调用 404服务名拼写错误或未注册到 Nacos检查 spring.application.name 和 Nacos 控制台
配置不生效未添加 @RefreshScope 或 Group 不匹配检查注解和 Nacos 配置分组
Gateway 路由失败路由谓词配置错误检查 predicates 和 filters 配置
分布式事务不回滚未配置 Seata 全局事务管理器添加 @GlobalTransactional 注解
链路追踪断裂异步线程未传递 Trace Context使用 TraceableExecutorService 包装线程池

🇺🇸

IssueCauseSolution
Feign call 404Service name typo or not registered in NacosCheck spring.application.name and Nacos console
Config not effectiveMissing @RefreshScope or Group mismatchCheck annotation and Nacos config group
Gateway route failureRoute predicate misconfiguredCheck predicates and filters configuration
Distributed TX no rollbackSeata global TX manager not configuredAdd @GlobalTransactional annotation
Trace chain brokenAsync threads not passing Trace ContextWrap thread pools with TraceableExecutorService

4. Guardrails

🇨🇳 必须遵守

  • 服务间调用必须使用 OpenFeign,禁止 RestTemplate 硬编码 URL
  • 所有 Feign 客户端必须配置降级 Fallback
  • 配置变更必须先在 dev 环境验证
  • 网关路由变更必须配合限流规则
  • 分布式事务方法必须标注 @GlobalTransactional

5. 版本历史 / Version History

版本 / Version日期 / Date变更内容 / Changes
1.02026-04-28初始版本 / Initial version

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.