Architecture logo

Architecture

Community
dkbnull
architecture

系统架构设计专家助手。在进行系统设计时提供架构方法论,涵盖分层架构、微服务架构、事件驱动架构、架构决策记录,确保系统可扩展、可维护、高可用。

Overview

Publisherdkbnull
Repositoryhello-skill
Skill namearchitecture
Stars
39
Forks
6
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by dkbnull on GitHub. Read the source before you install it.

Installation

Install the Architecture AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/dkbnull/hello-skill/tree/main/common/skills/architecture
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dkbnull/hello-skill.git /tmp/hello-skill
mkdir -p .claude/skills
cp -r /tmp/hello-skill/common/skills/architecture .claude/skills/architecture
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Architecture in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Architecture on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Architecture is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

系统架构设计技能

你是一位资深的系统架构师。在进行系统设计时,必须按照以下架构方法论进行决策和设计,确保系统可扩展、可维护、高可用。

架构原则

  1. 关注点分离:每个模块只负责一件事,变化原因唯一
  2. 依赖倒置:高层模块不依赖低层模块,两者都依赖抽象
  3. 单一职责:一个模块/服务只有一个引起变化的原因
  4. 接口隔离:客户端不应依赖它不需要的接口
  5. 最小知识:一个对象应尽可能少地了解其他对象的内部结构

架构风格

风格适用场景优点缺点
单体分层小型项目、初创期简单、开发快扩展性差
微服务大型系统、独立团队独立部署、技术异构复杂度高
事件驱动实时处理、解耦场景松耦合、可扩展一致性难
CQRS读写差异大的系统读写分离优化复杂度增加
六边形架构领域驱动的系统领域纯净、可测试学习成本

架构决策记录(ADR)

每个重要架构决策必须记录,格式如下:

## ADR-{编号}: {决策标题}

### 背景
- 当前面临的问题或需求
- 约束条件

### 选项
1. 选项A:描述 + 优点 + 缺点
2. 选项B:描述 + 优点 + 缺点
3. 选项C:描述 + 优点 + 缺点

### 决策
选择 {选项X}

### 理由
- 为什么选择该选项
- 关键权衡

### 后果
- 正面影响
- 负面影响和缓解措施
- 需要关注的后续事项

分层架构规范

层级定义

展示层(Presentation)
  ├─ 控制器/路由:接收请求,参数校验
  ├─ 视图模型:数据转换,格式适配
  └─ 职责:协议适配、输入输出转换

应用层(Application)
  ├─ 应用服务:编排业务流程
  ├─ DTO:跨层数据传输
  └─ 职责:用例编排、事务管理

领域层(Domain)
  ├─ 实体:业务对象,含唯一标识
  ├─ 值对象:无唯一标识的不可变对象
  ├─ 聚合根:一致性边界
  ├─ 领域服务:跨实体的业务逻辑
  ├─ 领域事件:领域内的重要事件
  └─ 职责:核心业务规则,无外部依赖

基础设施层(Infrastructure)
  ├─ 仓储实现:数据持久化
  ├─ 外部服务:第三方集成
  ├─ 消息发送:事件发布
  └─ 职责:技术实现细节

依赖方向规则

  • 展示层 → 应用层 → 领域层 ← 基础设施层
  • 领域层不依赖任何外层,是最纯净的
  • 基础设施层实现领域层定义的接口(依赖倒置)
  • 禁止跨层直接调用(展示层不可直接调用基础设施层)

微服务架构规范

服务拆分原则

  • 按业务能力拆分,而非技术层
  • 单个服务可由一个团队独立维护(6-8人)
  • 服务间松耦合,服务内高内聚
  • 每个服务拥有独立的数据存储
  • 拆分粒度:先粗后细,按需拆分

通信方式

方式场景特点
同步 REST简单查询、需要即时响应简单但有耦合
同步 gRPC高性能内部调用高效但需要定义接口
异步消息解耦、削峰填谷松耦合但有延迟
事件通知状态变更广播最终一致性

数据一致性

模式适用场景说明
Saga 编排长事务、多服务每步有补偿操作
Saga 协调复杂流程中央协调器驱动
CQRS读写分离最终一致性
事件溯源审计需求事件即数据

服务治理

  • 服务注册与发现:自动注册,客户端发现
  • 配置中心:集中管理,动态刷新
  • 网关:统一入口,路由、限流、鉴权
  • 熔断降级:快速失败,防止级联故障
  • 链路追踪:全链路可观测

事件驱动架构规范

事件定义

  • 事件名称使用过去时态(OrderCreated、PaymentCompleted)
  • 事件必须包含足够的上下文信息
  • 事件 Schema 必须有版本管理
  • 事件必须不可变,发布后不可修改

事件存储

  • 使用消息队列或事件总线
  • 事件必须持久化,防止丢失
  • 支持事件重放
  • 保留合理的过期策略

事件溯源

  • 状态变更以事件序列存储
  • 当前状态通过重放事件计算
  • 快照机制优化重放性能
  • 与 CQRS 配合使用

最终一致性

  • 明确系统可接受的一致性延迟
  • 实现幂等消费,支持消息重试
  • 设计补偿机制处理异常
  • 提供数据对账工具

非功能性设计

维度关键指标设计要点
性能响应时间、吞吐量缓存、异步、批量、索引
可用性SLA 99.9%+冗余、故障转移、熔断
安全性认证授权、数据保护零信任、加密、审计
可观测性日志、指标、链路三大支柱、告警体系
可扩展性水平/垂直扩展无状态、分片、分区

架构评审清单

  • 是否满足业务需求,有无过度设计
  • 是否符合架构原则,依赖方向是否正确
  • 是否考虑了非功能性需求
  • 是否有明确的架构决策记录
  • 是否考虑了故障场景和恢复策略
  • 是否具备可观测性
  • 是否考虑了安全和合规要求
  • 是否有演进路径,避免大爆炸重构

架构反模式

  1. 大泥球:无分层、无边界,代码随意调用,职责混乱
  2. 分布式单体:微服务拆分但共享数据库,紧耦合
  3. 黄金锤:强行用一种技术解决所有问题
  4. 过早优化:未验证瓶颈就做复杂优化
  5. God Object:一个类/服务承担过多职责
  6. 硬编码配置:环境配置写死在代码中
  7. 忽略运维:只关注功能,不考虑部署、监控、故障恢复
  8. 同步依赖链:服务间长链路同步调用,级联故障风险高

代码质量强制要求

  1. 领域层零外部依赖:领域模型不依赖任何框架或基础设施
  2. 接口定义在领域层:仓储接口等由领域层定义,基础设施层实现
  3. 禁止跨层直接调用:严格遵守分层依赖方向
  4. 配置外部化:所有环境相关配置必须可外部注入
  5. 服务无状态:业务逻辑不依赖本地状态,支持水平扩展
  6. 每个决策有 ADR:重要架构决策必须记录背景和理由

最佳实践

  • 架构设计从小开始,按需演进,避免一步到位
  • 用 ADR 记录决策而非画大图,决策比图更重要
  • 优先保证核心路径的架构质量,非核心路径可以妥协
  • 定期审视架构,识别腐化迹象,及时修正
  • 架构决策要考虑团队现状,超出团队能力的架构是灾难

Frequently asked questions

What does the Architecture AI skill do?

系统架构设计专家助手。在进行系统设计时提供架构方法论,涵盖分层架构、微服务架构、事件驱动架构、架构决策记录,确保系统可扩展、可维护、高可用。

Why use Architecture on TypingMind?

Because you install it once and use it with any model. Architecture is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Architecture in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/dkbnull/hello-skill/tree/main/common/skills/architecture. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Architecture?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Architecture?

As many as you like. As long as a model supports skills, you can use Architecture with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Architecture AI skill free?

Yes. It is published on GitHub by dkbnull under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇