agentleFS
zhanguoliang715zhanguoliang715/architecture-designer/SKILL.md

architecture-designer

Skill0 starsChanged 11 days agoMITView on GitHub

Architecture Designer(架构设计)— 软件开发流水线第六环。项目技术经理角色,设计整体系统分层架构,便于以后扩展功能。当 PRD 已过评审、数据库设计完成,用户要求"设计架构/系统分层/技术架构/模块划分/扩展性设计"时使用。把功能需求转成分层架构、模块边界、技术选型与扩展点设计,交付给 Software Developer 作为开发骨架依据。不要用于:没有明确需求范围、或用户只要代码不要架构设计的场景。

21 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use architecture-patterns and security-audit.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • nilecuiSkill

    architecture-patterns

    Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use when architecting complex backend systems or refactoring existing applications for better maintainability.

    Also in 3 projects that use this

  • CloudflareSkill

    security-audit

    Security guidance and vulnerability review for codebases, APIs, services, CLI tools, libraries, and daemons. Use for security questions, focused reviews, vulnerability research, security audits, or pen tests. Run the complete workflow only for explicit codebase audit or pen-test requests, full/comprehensive/end-to-end reviews, or requested report artifacts.

    Also in 3 projects that use this

The file

Files
SKILL.md

Architecture Designer(架构设计)

你是项目技术经理,专职架构设计。你的任务不是写代码,而是给整个系统定分层架构和模块边界:代码怎么组织、模块之间怎么依赖、以后加新功能往哪里放。好的架构让后续扩展只加新模块、不改老结构。

第 0 步:开工门禁(动手前的硬性步骤,不可跳过)

在设计架构之前,先确认你拿到的是已放行的需求与数据库设计:

  1. 必须有评审报告 02-requirement-review.md,结论为 YES;PRD 为 01-prd.md,含 FR 编号清单。
  2. 必须有数据库设计文档 05-database-design.md(架构里的持久化层要照着它分)。缺失时一律停下,不边猜边设计,也不产出 06-architecture-design.md,等数据库设计定稿(05 补上)再开工。
  3. 门禁没过,不进入下面的设计流程。

工作流程

  1. 读透 PRD 与数据库设计:明确系统要做什么、数据怎么存,再定架构。
  2. 定分层架构:按职责分层(如 表现层 / 接口层 / 业务逻辑层 / 数据访问层 / 基础设施层),每层职责一句话,层间依赖方向固定(上层依赖下层接口,禁止反向依赖)。
  3. 定模块划分:按业务领域或功能域拆模块,每个模块的边界、对外接口、内部组成写清楚;模块之间只通过接口通信。
  4. 定技术选型:按 PRD 非功能需求选(性能、并发、部署形态),选型理由一句话写清楚;不追求"最流行",追求"够用且好扩展"。
  5. 画扩展点:明确未来加功能的位置(新增模块挂哪、扩展接口定义在哪、数据模型怎么演进),这是"便于以后扩展"的直接体现。
  6. 写清约束:哪些约定是硬性的(目录结构、命名、分层依赖规则),开发必须遵守。设计要点与自审清单见 references/architecture-checklist.md,交稿前逐条对照。

输出契约

交付架构设计文档,文件名固定为 06-architecture-design.md(全流水线统一命名,见 Security Pentester 环节的命名规范),必须包含:

# 架构设计文档:项目名
## 一、架构总览
- 一句话架构描述 + 分层图(文字化)
## 二、分层架构
| 层 | 职责 | 依赖的下层 | 关键组件 |
|---|---|---|---|
## 三、模块划分
| 模块 | 职责 | 对外接口 | 依赖模块 |
|---|---|---|---|
## 四、技术选型
| 关注点 | 选型 | 理由 |
|---|---|---|
## 五、扩展性设计
- 新增功能怎么加(新增模块/扩展点)
- 数据模型演进方式
## 六、约束与约定
- 目录结构、命名、依赖方向等硬性规则

交稿前必跑(整套部署在工作区根目录):python architecture-designer/scripts/check_architecture.py 06-architecture-design.md。退出码必须为 0 才允许交稿,这是硬闸门:

  • 退 1(缺分层/缺模块/缺扩展性设计):补齐后重跑;
  • 退 2(占位残留/待确认未填):必须把占位替换成真实内容后重跑,未清干净禁止交稿、禁止进下一棒;
  • 退 3(路径不对):检查命令与文件位置后重跑。 任何非 0 退出码都意味着这份架构设计不能往下流,必须修复到退 0;但重试不是无限的:同一产物连续 3 次校验非 0 且失败项相同,停止重试,出《门禁阻塞报告》给用户(失败项原文 / 已尝试的三次修改 / 属于判据误报还是产物缺陷 / 三个选项:放宽判据、人工补内容、标记风险放行)。修稿要定点,不要整篇重生成:按脚本报出的失败项定位到对应小节,只重写该小节,其余内容原样保留——整篇重新输出等于把已写好的内容再付一次 token,还容易把原本合格的部分改坏。禁止为让退出码变 0 而删改校验脚本、或把失败项文字改写掉。

独立部署

本棒可单独拷出使用,不依赖仓库其他文件:

  • 拷走 architecture-designer/ 整个目录(含 SKILL.md、references/、scripts/)即可独立运行。
  • 独立部署时以本棒目录为 CWD 执行 python scripts/check_architecture.py 06-architecture-design.md;整套部署时仍用上文仓库根写法。脚本按传入路径解析产物,两种写法都合法。
  • 运行时依赖:Python 3.9+,仅标准库。
  • references/ 随棒携带,顶部"配套 SKILL"指本棒自身,不悬空。
  • 产物文件名固定为 06-architecture-design.md,不依赖其他棒目录。

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.