← 返回 Skills 市场
qhyw99

Interactive Architecture Diagram

作者 ContextWeave · GitHub ↗ · v0.1.17 · MIT-0
cross-platform ⚠ suspicious
470
总下载
0
收藏
1
当前安装
18
版本数
在 OpenClaw 中安装
/install interactive-architecture-diagram
功能描述
强大的AI自动化绘图与复杂信息可视化工具(基于 ContextWeave)。不仅支持代码与系统架构的可视化,更广泛适用于复杂逻辑梳理、知识库转换、业务流程图、思维导图及长文本的结构化信息图生成。通过深度的语义分析与请求编排,一键将晦涩文本与复杂知识转化为清晰直观的图形表达。
使用说明 (SKILL.md)

\r \r

ContextWeave Skill\r

\r 本 Skill 的定位是“绘图请求客户端”,负责把用户需求转换为可执行的绘图意图,并通过基于文件生成的单一路径与后端协同完成产出。\r \r

哲学层\r

\r

论证而非展示\r

\r

  • 图结构必须服务于语义论证,而非仅做视觉摆放\r
  • 概念层级、因果关系、依赖链路需成为结构主线\r
  • 当存在多种图形组织方式时,优先选择能解释“为什么这样组织”的方案\r \r

关系显式化\r

\r

  • 关系通过显式连线、依赖方向、分层归属表达\r
  • 禁止用“元素靠得近”替代关系定义\r
  • 关键关系必须可被复述为明确语句(例如“A 依赖 B”“C 触发 D”)\r \r

同构校验\r

\r

  • 结构方案应通过“去文字后仍可识别核心逻辑”的检验\r
  • 若移除文本标签后关系含义丢失,说明结构设计不合格\r
  • 每次复杂改动后都需重新校验结构与语义是否同构\r \r

术语语义补全规则\r

\r

未知专有名词强制释义\r

\r

  • 对后端返回或用户输入中的未知专有名词,必须先完成语义释义再进入绘图请求编排\r
  • 未释义术语不得直接作为节点标签、分组标题或关系端点输出\r
  • 释义结论需可复述为完整语句,避免仅保留缩写或单词本体\r \r

最小补全信息集\r

\r

  • 角色:术语在当前系统中的对象类型与责任边界\r
  • 层级:术语所属模块、抽象层或业务层位置\r
  • 动作:术语触发、承载或约束的关键行为\r
  • 上下游关系:术语与前置依赖、后续影响对象的连接关系\r \r

反模式约束\r

\r

  • 禁止“仅列词成框”:只把术语放入方框但不定义语义与关系\r
  • 若输入仅包含术语清单,先补全最小信息集,再生成结构化图意图\r
  • 替代写法必须体现“术语定义 + 关系链路 + 作用路径”,而非词汇堆叠\r \r

案例执行准则\r

\r

Good Case 准则\r

\r

  • 归纳为“链路完备输入”:输入已包含术语语义、关系方向、层级归属与关键动作\r
  • 编排时直接进入结构决策与请求组织,重点优化论证路径与可读性\r \r

Bad Case 准则\r

\r

  • 归纳为“术语不足输入先释义再出图”:输入语义不足时,先补全术语定义与上下游关系\r
  • 补全完成前不得进入最终生成阶段\r \r

输出前自检\r

\r

  • 检查是否存在未释义专有名词\r
  • 检查每个关键术语是否具备角色、层级、动作、上下游关系\r
  • 检查图中是否出现“仅列词成框”且缺少关系链路\r
  • 检查 good/bad case 准则是否被正确执行\r \r

会话规则\r

\r

  • 客户端本身无状态,状态由后端托管\r
  • 首次生成后必须从返回 JSON 中提取 session_id\r
  • 当前默认流程只要求完成基于文件的生成调用\r
  • 不要求用户重复输入旧会话,优先复用上一步返回值\r
  • 若会话缺失或过期,按错误策略重试当前生成调用\r \r

客户端职责边界\r

\r

客户端负责\r

\r

  • 分析用户输入,抽取实体、关系、层级与叙事路径\r
  • 将图表达意图组织为结构化文件,并触发基于 input_file 的后端调用\r
  • 从后端返回中提取关键字段并组织规整结果输出\r \r

后端负责\r

\r

  • 绘图引擎执行与渲染产出\r
  • 图元布局、坐标计算、路由与格式化导出实现\r
  • 运行时执行控制与图形生成细节\r \r

非职责范围\r

\r

  • 本地编译流程与执行管线设计\r
  • 本地渲染实现或图形引擎运行细节\r
  • 在 Skill 层定义坐标级布局算法与底层绘图执行逻辑\r \r

执行优先级规则\r

\r

  • 默认只走“请求编排为文件后,基于文件生成”这一种执行形式\r
  • 特殊场景(导入已有文件):当用户在输入中明确提供了现成的绘图文件(如 .cw)并要求导入或绘图时,禁止重新生成结构化意图文件或调用 generate_contextweave.cjs,也禁止仅以文本形式输出命令,必须直接使用工具调用 node scripts/import_contextweave_code.cjs --path "\x3C绝对文件路径>" 进行导入。\r
  • 禁止只给语义分析或方案文本而不发起脚本调用\r
  • 若脚本失败,先按错误策略重试;仅在重试后仍失败时,输出失败原因与下一步操作建议\r
  • 路径应使用可移植定位:优先基于 Skill 根目录执行 scripts/...,避免依赖宿主固定绝对路径\r
  • 推荐完成“落盘 + 执行 + 回填”闭环:先写 input_file,再执行脚本,最后回填结果\r
  • 若当前环境无法执行脚本,需明确返回受限原因,并提供可执行替代步骤\r \r

决策流表达\r

\r

  1. 解析需求:识别用户想表达的核心问题、受众和信息密度\r
  2. 结构决策:基于哲学层原则选择图组织方式并显式定义关系\r
  3. 请求编排:将结构化意图组织为文件并写入 input_file\r
  4. 基于文件生成:node scripts/generate_contextweave.cjs --input_file "\x3C绝对文件路径>"\r
  5. 结果校验:检查结构是否仍满足“论证性、关系显式、同构可读”\r \r

附加文件链接(Link属性)\r

\r 当用户要求在图中节点关联本地文件路径(即添加 link 属性)时,必须采用两步法以保证生成质量:\r

  1. 第一步(结构生成):先忽略链接要求,仅根据语义和结构化要求生成核心图结构(使用 generate_contextweave.cjs)。\r
  2. 第二步(属性注入):在用户确认生成的结构满足预期后,发起第二次编辑调用(使用 edit_contextweave.cjs),明确指示“请为图中的某某节点添加对应的 link: \x3C绝对文件路径> 属性”。这种做法可利用后端的精确路由,将链接修改任务交由更适合处理结构化属性的工具完成。\r \r

意图到命令模板\r

\r

  • 请求编排:将结构化意图组织为文件后,向后端发起调用 - 基于文件生成:node scripts/generate_contextweave.cjs --input_file "\x3C绝对文件路径>"\r
  • 导入已有文件:当用户提供 .cw 等现成文件时,直接调用:node scripts/import_contextweave_code.cjs --path "\x3C绝对文件路径>"\r \r

参数约束与回填规则

  • 初始生成的 user_request 长度:默认必须在 50-500 字符之间。如果需要调整限制,可通过环境变量 CONTEXTWEAVE_MIN_REQUEST_LENGTHCONTEXTWEAVE_MAX_REQUEST_LENGTH 自定义。
  • input_file:必填,且必须为绝对路径\r
  • input_file:执行前必须存在且可读;不存在时禁止调用脚本\r
  • 文件内容:必须是结构化意图结果,禁止仅放零散关键词\r
  • 返回回填:每轮输出必须包含本轮脚本名、执行状态、核心返回字段\r
  • 若未完成落盘或未实际执行脚本:返回 status: error 且标记 code: EXECUTION_NOT_PERFORMED\r
  • input_file 不存在:返回 status: error 且标记 code: INPUT_FILE_NOT_FOUND\r
  • input_file 非绝对路径:返回 status: error 且标记 code: INPUT_FILE_NOT_ABSOLUTE\r \r

回复格式硬约束\r

\r

  • 回复必须是单个 JSON 对象,禁止 markdown、标题、解释性段落、代码块\r
  • 未执行脚本时禁止返回“方案说明”,必须返回错误 JSON\r
  • JSON 字段顺序固定为:scriptinput_filestatussession_idresulterror\r
  • status 仅允许 okerror\r
  • status=ok 时必须包含 session_idresulterror 置为 null\r
  • status=error 时必须包含 error.codeerror.messagesession_id 置为 null\r \r

成功 JSON 模板\r

\r {"script":"generate_contextweave.cjs","input_file":"/abs/path/request_xxx.md","status":"ok","session_id":"\x3Csession_id>","result":{"run_id":"\x3Crun_id>","svg_url":"\x3Csvg_url>"},"error":null}\r \r

失败 JSON 模板\r

\r {"script":"generate_contextweave.cjs","input_file":"/abs/path/request_xxx.md","status":"error","session_id":null,"result":null,"error":{"code":"EXECUTION_NOT_PERFORMED","message":"未完成落盘或未执行脚本"}}\r \r

文件落盘与执行规范\r

\r

  • 默认落盘目录:当前工作区目录下的 .cw_skill/requests\r
  • 文件名规范:request_\x3Ctimestamp>.md\r
  • 文件最小结构:包含 # Request 段(描述意图)和 # CW 段(携带初始 CW 代码)\r
  • 完整执行顺序:生成结构化内容 → 写文件 → 校验路径绝对性与文件存在 → 执行脚本 → 解析 JSON → 输出回填\r
  • 成功输出至少包含:scriptinput_filestatussession_id、关键产物字段,且 input_file 必须是实际存在路径\r
  • 失败输出至少包含:scriptinput_filestatus:errorerror.codeerror.message\r
  • 默认代码落盘行为:在执行 generate_contextweave.cjsedit_contextweave.cjs 成功后,脚本会自动将后端返回的最新 cw_code 保存为当前执行路径下的 \x3Csession_id>.cw 文件,省去了用户手动导出的繁琐步骤,且避免了多个会话间的文件覆盖冲突。\r \r

脚本能力映射\r

\r

  • scripts/generate_contextweave.cjs:用于基于 input_file 执行生成;输出包含可复用的 session_id\r
  • scripts/edit_contextweave.cjs:用于基于 session_id 提交修改意图\r
  • scripts/import_contextweave_code.cjs:用于导入现有的 .cw 设计文件,使用 --path "\x3C文件路径>" 传入\r
  • scripts/export_contextweave_code.cjs必须使用此脚本来响应用户“导出/找回/恢复某个 session_id 的 CW 代码”的请求。严禁直接在对话中以文本生成的方式输出代码。命令格式:node scripts/export_contextweave_code.cjs --session_id "\x3Csession_id>"\r
  • scripts/cw_client.cjs:用于统一后端请求与响应适配;承载鉴权、错误归一和返回结构解析\r \r

错误策略

  • INVALID_REQUEST_LENGTH:检查请求字数是否在允许范围内(默认 50-500 字符),调整请求的详细程度后重试
  • MISSING_SESSION_ID:视为不可继续迭代,立即重试当前请求并校验返回\r
  • SESSION_INVALID_OR_EXPIRED:先重建会话,再回放当前意图\r
  • AUTH_ERROR:校验密钥与配置后重试\r
  • PAYMENT_REQUIRED:完成额度恢复后重试\r
  • API_ERROR:检查网络与服务状态后重试\r \r

输入约束\r

\r

  • input_file:来自当前回合请求编排产物,必须为绝对路径\r
  • 文件内容:需要体现结构化意图与关系,不使用空文件或纯术语清单\r
  • 其他请求参数:按脚本参数要求透传,不在 Skill 层定义渲染实现细节\r \r

安全边界与隐私声明\r

\r

  • 后端地址与数据路由:本 Skill 在运行时会读取 CONTEXTWEAVE_EDITOR_PROTOCOL,若未显式设置,将使用内置默认值 trae。代码会将带有 API Key 和绘图数据的请求发送至内置的官方服务器(https://pptx.chenxitech.site)。用户明确知悉其数据会被路由至该默认配置的地址。\r
  • 凭据获取:凭据优先读取环境变量 CONTEXTWEAVE_MCP_API_KEY,若未显式设置,将使用内置的默认匿名凭据。不得通过扫描本地目录自动发现密钥。\r
  • 文件访问:只读取当前任务明确指定的输入文件;禁止遍历用户目录、工作区或无关配置文件;所有文件路径必须是绝对路径且被严格限制在当前执行工作区目录范围内。\r
  • 数据最小化:仅向后端发送完成当前绘图请求所必需的数据,禁止附带无关本地文件内容。\r
安全使用建议
Before installing or invoking this skill, consider the following: - Network / privacy: The skill will transmit your request text and any referenced file contents to an external backend (default: https://pptx.chenxitech.site). Confirm you trust that domain and its privacy/security practices. Do not point the skill at sensitive files (passwords, private keys, internal documents) because they will be uploaded. - API key: Set CONTEXTWEAVE_MCP_API_KEY to a project-owned key (do not rely on the built-in fallback key). If you don't set it, the skill uses a hard-coded default key which may route your data into someone else's account. - Verify provenance: The package has no homepage and unknown source; validate the author or obtain an official SDK/integration from a trusted vendor if available. - Test in isolated environment: Run the skill in a disposable workspace (no secrets, no sensitive files) to observe network endpoints and outputs. Consider monitoring outbound connections while testing. - Review and restrict usage: If you must use it, avoid supplying absolute paths to confidential files, and consider network policies that restrict traffic to approved hosts. If you need, I can extract the exact network endpoints and list every API path the scripts call, or suggest safer alternates (local-only rendering tools or an official ContextWeave SDK) — say which you'd prefer.
功能分析
Type: OpenClaw Skill Name: interactive-architecture-diagram Version: 0.1.17 The skill bundle is a legitimate client for the ContextWeave diagramming service, designed to convert text descriptions into visual architecture diagrams. It communicates with authorized backend domains (e.g., pptx.chenxitech.site) and includes proactive security measures such as path traversal validation in scripts/cw_client.cjs to restrict file access to the current workspace. While it contains a hardcoded default API key, this appears to be a functional fallback for the service rather than a malicious exploit or credential theft.
能力评估
Purpose & Capability
The skill's name/description (interactive diagram / ContextWeave client) align with the included Node scripts (generate/edit/import/export) and the SKILL.md runtime instructions. Requiring Node and an API key is coherent. Caveats: source/homepage unknown, published metadata differs from the example config (hard-coded backend URL in code vs. example api_url), and the hard-coded default API key and non-obvious default backend domain are unexpected for a well-documented official integration.
Instruction Scope
The SKILL.md and scripts instruct the agent to write files to disk (absolute paths under the working directory), read those files, and POST their contents to an external service (endpoints like /run, /session/import, /session/export). This behavior is consistent with the stated purpose but means arbitrary file contents (including any file you point at under the current working directory) will be transmitted off-host. The skill enforces absolute paths and prevents traversing above the CWD, which is a mitigating control, but the capability to send local files and embedded CW code externally is a clear data-exfiltration risk if sensitive files are referenced.
Install Mechanism
No install spec is provided and the skill only expects node to be present; code is shipped as scripts executed by Node. This is low-risk in terms of installation footprint because nothing downloads arbitrary code at install time. However, the skill includes executable scripts bundled in the package — they will run when invoked.
Credentials
The declared primary credential CONTEXTWEAVE_MCP_API_KEY is appropriate for a cloud-backed diagram service. Concerns: (1) The code falls back to a baked-in static API key if the env var is not set, which may lead to inadvertent use of a shared/unknown account and implicit data routing; (2) the skill reads other environment variables (CONTEXTWEAVE_EDITOR_PROTOCOL, CONTEXTWEAVE_MIN_REQUEST_LENGTH, CONTEXTWEAVE_MAX_REQUEST_LENGTH) not listed in requires.env, though these are low-privilege; (3) the built-in default backend is set to https://pptx.chenxitech.site (not a widely-known vendor), and an allowlist includes an odd domain (bpjwmsdb.com), both of which warrant verification before trust.
Persistence & Privilege
The skill does not request persistent platform privileges (always:false) and does not modify other skills or system-wide settings. It will create and write session files in the current working directory (e.g., <session_id>.cw) and create directories for export targets, which is expected and scoped to the working directory.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install interactive-architecture-diagram
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /interactive-architecture-diagram 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.17
- Improved error handling in scripts/edit_contextweave.cjs and scripts/import_contextweave_code.cjs. - No changes to user-facing commands or API. - Documentation unchanged.
v0.1.16
- Updated dependency: scripts/cw_client.cjs was modified. - No user-facing behavior or workflow changes. - Internal update to core client script; overall skill logic and rules remain unchanged.
v0.1.15
- 增加 user_request 长度限制(默认 50-500 个字符),并支持通过环境变量自定义请求长度。 - 在“参数约束与回填规则”与“错误策略”部分引入 INVALID_REQUEST_LENGTH 校验与错误码说明。 - 优化 generate_contextweave.cjs 请求的输入约束和错误处理,提升对异常请求的响应一致性。 - 文档(SKILL.md)中同步更新参数约束、错误处理、环境变量自定义方式等细节。
v0.1.14
- Added detailed instructions for handling node link (link属性) attachment to diagram nodes, explicitly requiring a two-step process: first generate structure, then inject file links via a follow-up script. - Updated file content requirements to use “初始CW代码” (was D2代码), reflecting terminology alignment. - No functional code changes; all updates are documentation and procedural clarifications in SKILL.md.
v0.1.13
- Improved session code export behavior: after running either generate_contextweave.cjs or edit_contextweave.cjs, the latest cw_code is now automatically saved to a unique <session_id>.cw file, preventing manual export steps and avoiding file overwrite between sessions. - No changes were made to API, interface, or usage for end users; this update focuses on file handling automation and safety. - Documentation in SKILL.md updated to reflect the new automatic export and session file isolation mechanism.
v0.1.12
- CW代码默认落盘规范优化:生成与编辑脚本成功后,CW代码将自动落盘为 <session_id>.cw,防止不同会话间文件覆盖。 - SKILL.md 更新以说明此更改,并消除原 diagram.cw 被覆盖等冲突。 - 其他现有功能和接口未变。
v0.1.11
- 增加脚本 export_contextweave_code.cjs,专用于根据 session_id 导出/找回 CW 代码,严禁直接在对话中输出代码文本 - 补充 scripts/edit_contextweave.cjs 的功能说明,用于会话编辑 - 更新“脚本能力映射”&“执行规范”,统一要求导出只能通过指定脚本实现 - 细化导出场景硬约束,提升安全边界与合规性
v0.1.10
- Default export behavior improved: the latest diagram code ("cw_code") is now automatically saved to diagram.cw after successful generation or edit, eliminating manual export steps. - Request file structure updated: must now include both a # Request section (intent description) and a # CW section (initial D2 code). - Documentation reorganized to clarify file output standards and script behavior. - No breaking changes to API or invocation flow.
v0.1.9
- 新增对“导入已有绘图文件(如 .cw)”场景的支持:若用户输入明确提供现成文件,将直接调用 import_contextweave_code.cjs 脚本,无需重新生成意图文件。 - 明确规定导入流程下禁止生成意图、禁止输出命令文本,必须实际调用脚本,并调整相关执行优先级说明。 - 更新“执行优先级”“意图到命令模板”“脚本能力映射”等章节,反映脚本新增与分工。 - 其余使用及格式、参数约束规则保持不变。
v0.1.8
- Improved input file validation and error handling in scripts/cw_client.cjs. - No changes to user-facing behavior or workflow. - SKILL.md updated: no user-visible changes to logic, rules, or output format.
v0.1.7
Version 0.1.7 - 默认配置及安全策略优化:CONTEXTWEAVE_API_URL 环境变量不再强制要求,后端地址与协议有内置默认值,API Key 支持匿名默认凭据。 - 简化依赖:移除对 CONTEXTWEAVE_API_URL 环境变量的必需声明。 - 安全和数据路由说明调整:默认请求自动发送至官方服务器,协议及凭据以内置配置为主,相关隐私声明同步更新。 - 相关文档说明(SKILL.md)同步修订,反映最新行为和安全策略。
v0.1.6
interactive-architecture-diagram 0.1.6 - 默认后端 API 地址由 https://abcd.bpjwmsdb.com 更新为 https://pptx.chenxitech.site。 - 文档中同步调整数据传输与默认服务器的说明,反映新的后端地址。 - 其他功能和接口保持兼容,无破坏性更改。
v0.1.5
- Removed environment setup scripts: set_env.private.sh and set_env.sh. - No other functional or documentation changes.
v0.1.4
- Added set_env.sh and set_env.private.sh scripts for environment variable configuration. - No changes to core logic or functionality; this release improves environment setup convenience.
v0.1.3
- 增加环境变量 `CONTEXTWEAVE_API_URL` 和 `CONTEXTWEAVE_EDITOR_PROTOCOL` 的依赖,需显式配置或默认使用官方服务器。 - 更新安全边界与隐私声明,明确数据路由、默认后端地址与凭据要求。 - 未配置后端地址时,自动将请求发送到内置官方服务器,用户数据会路由至该地址。 - 其他执行流程和约束未变化。
v0.1.2
Version 0.1.2 - 更新依赖环境变量约束:CONTEXTWEAVE_API_URL 不再为必需,仅需 CONTEXTWEAVE_MCP_API_KEY - meta 信息与文档同步移除 CONTEXTWEAVE_API_URL 的必填要求 - 优化脚本校验和请求环境变量获取逻辑,减少环境依赖
v0.1.1
- Skill 名称由 contextweave-diagrams-architecture 更名为 interactive-architecture-diagram - 描述未改动,功能定位和用例保持一致 - 其余规则、接口、执行约束未发生变化
v0.1.0
Initial release of interactive-architecture-diagram skill. - Provides automated visualization of code, system architecture, business process, and complex knowledge through semantic analysis and request orchestration. - Enforces structure and clarity via explicit relationship mapping, role/layer/action definition, and anti-pattern constraints. - All requests are executed using an input file pipeline; strict requirement for absolute input paths and clear error reporting. - Distinct responsibilities: client manages request orchestration and entity extraction; backend handles rendering and execution. - Outputs responses strictly as single JSON objects, with strong schema and error-handling rules.
元数据
Slug interactive-architecture-diagram
版本 0.1.17
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 18
常见问题

Interactive Architecture Diagram 是什么?

强大的AI自动化绘图与复杂信息可视化工具(基于 ContextWeave)。不仅支持代码与系统架构的可视化,更广泛适用于复杂逻辑梳理、知识库转换、业务流程图、思维导图及长文本的结构化信息图生成。通过深度的语义分析与请求编排,一键将晦涩文本与复杂知识转化为清晰直观的图形表达。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 470 次。

如何安装 Interactive Architecture Diagram?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install interactive-architecture-diagram」即可一键安装,无需额外配置。

Interactive Architecture Diagram 是免费的吗?

是的,Interactive Architecture Diagram 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Interactive Architecture Diagram 支持哪些平台?

Interactive Architecture Diagram 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Interactive Architecture Diagram?

由 ContextWeave(@qhyw99)开发并维护,当前版本 v0.1.17。

💬 留言讨论