agentleFS
ontology-of-everythingontology-of-everything/concept-skills/skills/zh-CN/architect-4r-cn/SKILL.md

architect-4r-cn

Skill14 starsChanged 23 days agoApache-2.0View on GitHub

仅在显式调用时使用。用李运华的 4R 方法从代码或上下文梳理现有架构。对齐视图、角色和关键场景,绘制架构图和场景图。

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

4R 系统建模框架

从代码或用户提供的上下文梳理现有架构。按李运华的 4R 方法,描述所选系统的顶层结构和运作规则。

要素要说清楚什么
Rank · 层级当前看系统分解中的哪一级。顶层相对于所选系统。上层的一个角色可以展开为下层系统。
Role · 角色这一级由哪些单元组成,各自承担什么职责。
Relation · 关系角色之间存在哪些联系,例如调用、通知、共享或依赖。
Rule · 运作规则角色如何协作完成系统功能,包括触发条件、顺序、结果和影响结果的异常。

视角决定你关注什么,层级决定你展开到哪一级。每张架构图用统一粒度。角色、关系和规则以代码、配置、文档或用户说明为依据。把推断和待核实项标在对应位置。缺失信息会改变角色边界或关键协作路径时,先问一个具体问题。

工作流程

  1. 选视图。 先说明要回答的问题。列出相关选项,例如业务、系统、应用、物理部署。为每项写清系统边界、观察粒度和它能回答的问题。推荐一到两项,让用户单选、多选、补充或备注。沿用用户已经明确的选择。
  2. 对齐角色。 视图选定后,逐个视图列出边界内该层全部有依据的角色,每个角色用一句话写明职责。有关键状态时,写明由谁负责。单列外部参与者,标出待核实项。如果证据支持不同划分,给出首选和一个备选,说明职责差异。请用户核对角色清单,接受补充、合并、拆分或备注。
  3. 画关系。 角色对齐后,每个视图画一张架构图。用标题和边界交代 Rank,用节点和有向边表达 Role 与 Relation。连线写明用途,按当前视图区分运行时通信和源码依赖。
  4. 选场景,画规则。 按视图列出有依据的关键场景。每项说明能讲清哪段协作,标出推荐项,让用户多选、补充或备注要看的分支。沿用用户已明确的场景。每个选中的场景画一张 Rule 图,由你选图型。用时序图讲角色间交互,用流程图讲条件分支,用状态图讲状态迁移。

开始画图时,读图示参考里的图例、选图规则和示例。交付前检查:架构图覆盖已对齐的角色,各图复用角色名,场景中的关键交互能对应架构图上的关系。

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.