Skip to content
Back to skills

Project Docs Diagram

ASecurity

Create technical diagrams from repository evidence or a system description, and validate/export Mermaid, PlantUML, draw.io, and Archify sources; not for endpoint API documentation.

  • 4 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 6, 2026
ai-agentspythonnodegitapidocumentation

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned December 4, 2026

npx -y skills add ainiaa/skills-project-docs --skill project-docs-diagram --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Project Docs Diagram?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Project Docs Diagram
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ainiaa-project-docs-diagram/badge)](https://www.skillsdirectory.com/skills/ainiaa-project-docs-diagram)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: project-docs-diagram
description: Create technical diagrams from repository evidence or a system description, and validate/export Mermaid, PlantUML, draw.io, and Archify sources; not for endpoint API documentation.
---

# Project Docs Diagram

Create architecture, workflow, sequence, state, and data diagrams from repository evidence or a system description. Deliver editable sources and validated exports using Mermaid, PlantUML, draw.io, or Archify, while distinguishing implemented behavior from proposed designs.

[中文文档 / Chinese documentation](https://github.com/ainiaa/skills-project-docs/blob/main/README.zh-CN.md)

若当前 Skill 目录下存在 `.bundle` 且其 `../../` 不是本集合的 Git 检出,先读取 `.bundle/skills/project-docs-diagram/GUIDE.md` 并以该目录为 Skill 真实目录;其中的共享脚本、资料和其他 Skill 均来自同一快照。通过 `npx skills update <已安装的本集合 Skill 名称>` 更新此类安装,按实际作用域加 `-g` 或 `-p`;不运行快照内依赖 Git 检出的更新命令。

按[读者与用途约定](.bundle/references/audience.md)选择讲解深度、图例与总览/细节视图;保留用户指定记法、必需标签、关系及证据,不因读者层次删改业务含义。

Keep generated files outside the analyzed repository unless the user asks to commit them. The draw.io landscape theme and GitHub template decision are documented in [the template research](.bundle/docs/ARCHITECTURE_TEMPLATE_RESEARCH.md).

Archify `explainer` 是独立的一页文档模式。用户要求项目说明页面时按[Overview 指南](https://github.com/ainiaa/skills-project-docs/blob/main/skills/project-docs-overview/SKILL.md)处理,优先读取当前快照附带的指南,或使用宿主已安装的 `project-docs-overview`。原生图脚本处理 typed JSON 图源。

## 选图与引擎

一句描述、已有图源或代码仓库都可以直接开始。根据描述和可用资料确定读者、范围及图要回答的问题。只有关键事实有冲突或缺失且会改变图义时,才向用户确认。方向、样式和常规导出由 Skill 决定。

先按用户指定的记法、引擎和交付格式执行。修订时默认沿用已有可编辑图源。根据读者的问题选图型,再结合发布平台的渲染能力、是否交互、是否需要固定端口或分页选引擎。未指定时使用下表。指定组合无法交付时,说明具体限制并取得用户对改用其他格式或引擎的同意。

| 读者要弄清什么 | 默认图型和引擎 |
| --- | --- |
| 一个局部流程有哪些步骤、分支或服务关系 | Mermaid 流程图或依赖图。需要 Markdown 内联渲染时,核对目标宿主是否支持所用语法和布局设置。 |
| 系统或模块由哪些部分构成、边界和主要依赖在哪 | draw.io 架构总览(`architecture-landscape`)或所需层级的 C4。要求固定端口、折点坐标或多页图源时优先 draw.io。 |
| 谁在何时调用谁、有哪些并行或异常返回 | PlantUML 时序图。交付明确要求在 Markdown 内联渲染且宿主支持时,简短时序可用 Mermaid。 |
| 同一个对象有哪些状态,什么事件或条件会让它切换状态 | Mermaid 状态图。在转换线上标出触发事件和必要条件。 |
| 跨岗位如何交接,何处审批、退回或汇合 | draw.io 泳道图。有事件、网关等正式记法要求时使用 BPMN 可视图。 |
| 实体怎样关联、基数是什么 | ERD。标识关系有依据时用 Mermaid,仅能确认基数时用 draw.io。 |
| 读者需要点开详情或分步浏览 | 对 Archify 已支持的图型,生成交互 HTML。 |

静态图默认交付可编辑图源与 PNG。对称分流等常见布局优先复用[已验证的出图示例](references/native-diagrams.md#对称分流示例)。

## 绘制与审图

写图源前按[绘图规范](.bundle/docs/DIAGRAM_STANDARD.md#绘图要求)定好阅读方向、主线、各层节点、分支、汇合和回流。把最长标签放进布局,按目标展示尺寸安排节点间距,沿每条关系确定源端、目标端和必要折点:箭头前留出可见线段,相同避障和端口条件下不增加无意义的折返。绘制时直接使用这些决定,不能等审图后才考虑。小图在工作中列出这些决定即可。按[美化规范](.bundle/docs/DIAGRAM_STANDARD.md#美化规范)设置主题、文字和留白。

先用选定的实际引擎导出到该图的工作目录,在目标展示尺寸打开成图。按[出图检查清单](references/diagram-checklist.md)先走主线与异常,再查判断框每个分支的出线顶点和去向、汇合、标签及裁切;自动布局尤其要检查左右分支是否挤在同一出口。几何检查通过或未报警不等于视觉审查通过。先查完整张图,按原因合并问题并在同一轮修正,再重新导出和复核。最多两轮修正。同类问题再次出现时,调整整图或使用兼容且已验证的布局。交付审过的成图、同版图源和相应回执。修订旧图时保留原交付,审图通过后再更新。仍有缺陷或无法审图时,标为草稿并说明缺口,不把渲染成功写成审图通过。审图状态见[工具说明](references/native-diagrams.md#出图检查)。

绘图诊断日志按[本地日志约定](references/native-diagrams.md#本地诊断日志)保留;模型、思考强度和版本没有可靠来源时标未知,不猜测。手工出图同样记录实际执行与审图状态。

## Workflow

先选定 Python 3.11 或更新版本。运行 `python3 --version`。若宿主的 `python3` 更旧,使用已安装的 `python3.11`、更新版本或它们的绝对路径。以下命令用同一个解释器,包含引擎安装和帮助命令。

```sh
PYTHON=python3  # 有需要时改为 python3.11 或已安装的解释器路径
"$PYTHON" --version
```

First distinguish a repository-current-state diagram from a concept/proposal diagram. For “根据代码/当前项目画图”, follow the source workflow below. For “按描述画 Mem0 架构/设计方案图”, use the supplied components and relationships to author a native diagram and follow the native export path below. Label it as a concept or proposal and state any assumptions. For mixed requests, verify current-state claims from source and label proposed additions.

1. Resolve this skill's real directory. The CLI is `../../scripts/generate_architecture.py` relative to that directory. Run `"$PYTHON" <cli> context --source <repo> --output <workdir>/context.json`. For a relevant symbol discovered in the first pass, repeat `--focus <qualified-method>` to include its CodeGraph callees. Do not create a CodeGraph index on the user's behalf.
2. Inspect the complete context. `files`, `symbols`, `routes`, `configKeys`, and `tables` are never capped; scans are candidates to verify. When `codeGraph` is present, start from its structured classes, routes, and focused calls; use `codegraph explore`/`node` to follow relevant paths. A freshness warning means graph data is only a lead: verify against current source. If `knowledgeGraph` or `domainGraph` exists, use its IDs/flows as navigation and semantic draft, with the same freshness caveat. Graph calls are code facts, not automatically architecture relationships. For a large context, inspect by module without silently discarding modules.
3. If [the view contract](references/diagram-view-ir.md) supports the selected view and engine, write its typed IR v2 profile. Cite source for every element and relation. Use `EXTRACTED` for labels literal on cited lines. Otherwise use the native path below and preserve the selected engine and source evidence.
4. For a new draw.io `architecture-landscape`, run `"$PYTHON" <cli> inventory --source <repo> --output <workdir>/candidates.json` (use `--scope-prefix` only for an explicit module scope). Review every generated candidate and its `members` against current source and CodeGraph, add source-backed `manualCandidates` for important relationships the scanner missed, and give each candidate one `overview`, `detail`, or reasoned `excluded` decision. A mapped element or relation must cite every member line of that candidate. Usage candidates require a relation and detail decisions require nearby detail IRs. See [the coverage schema](references/diagram-view-ir.md). Do not exclude an in-scope dependency merely to reduce density.
5. For a new draw.io `architecture-landscape`, run `"$PYTHON" <cli> validate --source <repo> --ir <workdir>/architecture-ir.json --strict-coverage`, then `"$PYTHON" <cli> deliver --source <repo> --ir <workdir>/architecture-ir.json --output <workdir>/bundle --format drawio --export-for drawio:png`. `deliver` renders every declared detail before publishing the bundle. `coverageCheck: pass` confirms the inventory and reviewed candidate mappings. For other IR profiles use `render` and the selected official engine. Supported exports remain Mermaid/PlantUML `svg|png|pdf`, draw.io `svg|png|jpg|pdf`, and Archify `svg|png|jpg|webp|webm|pdf`. Unsupported combinations fail rather than silently changing notation.
   If the selected official renderer is missing, retain the source and report the missing engine. Install or update a renderer only within the user's authorization and host rules; do not silently install dependencies or switch the requested engine or format. Honor an explicit `install.sh --no-engines`. Renderer setup and tests must also respect any restriction on launching desktop applications, including indirect child processes.
6. Inspect `drawioQuality` before treating a draw.io output as checked. Failures stop rendering. Resolve `layoutWarnings` in authored flows and inspect the geometry listed as `unchecked` in the export. Text measurements are estimates. `geometryCheck: pass` remains the landscape card-bounds check. The landscape limit is 12 elements and 12 relations per view, so split dense diagrams with traceable candidate decisions. Keep required labels and relationships in the delivered views.

## Official native diagrams outside IR v2

Read [the renderer capability audit](.bundle/docs/RENDERER_CAPABILITY_AUDIT.md) and [the native authoring contract](references/native-diagrams.md) when the user requests another diagram type supported by Mermaid, PlantUML, draw.io, or Archify. For an existing native `.mmd`, `.puml`, `.drawio`, or Archify `.json`, run `"$PYTHON" ../../scripts/render_native_diagram.py --engine <engine> --input <file> --output <dir> --export png` (repeat `--export` for desired formats). The command runs the actual official engine; Archify 3.2.0 accepts all ten official typed modes: architecture, workflow, sequence, dataflow, lifecycle, erd, tree, class, timeline, and waterfall. Follow the native authoring contract for material-item pointers and timing evidence.

For a **new** diagram outside IR v2, choose the notation, verify source, author official native syntax, and attach a [version 2 evidence manifest](references/native-diagrams.md) when it makes repository claims. Local PlantUML includes are inventoried and packaged. Standard-library or remote includes report `claimCoverage: partial`; disclose that limitation or use a self-contained source before claiming complete coverage. Review inferred claims and the exported image. `claimSemantics: not_proven` remains even when anchors and item coverage pass.

The source-line check proves that a cited snippet exists at that location. It does not prove a business interpretation, runtime route, or relationship. Review `INFERRED` and `AMBIGUOUS` claims against multiple code paths before presenting them as conclusions.

Files in this skill

  • .bundle/CHANGELOG.md38.5 KB
  • .bundle/LICENSE11.1 KB
  • .bundle/README.en.md483 B
  • .bundle/README.md10 KB
  • .bundle/README.zh-CN.md55.1 KB
  • .bundle/VERSION7 B
  • .bundle/audits/lifecycle/README.md1.2 KB
  • .bundle/audits/lifecycle/open-case-20261031.manifest.json9.8 KB
  • .bundle/docs/00_standards/test-commands.yml304 B
  • .bundle/docs/ARCHITECTURE_TEMPLATE_RESEARCH.md1.2 KB
  • .bundle/docs/DIAGRAM_STANDARD.md12.6 KB
  • .bundle/docs/RENDERER_CAPABILITY_AUDIT.md8.3 KB
  • .bundle/docs/SHARING.md6.3 KB
  • .bundle/docs/examples/petclinic/README.en.md5.6 KB
  • .bundle/docs/examples/petclinic/README.md4.9 KB
  • .bundle/docs/examples/petclinic/architecture.evidence.json4 KB
  • .bundle/docs/examples/petclinic/architecture.mmd288 B
  • .bundle/docs/examples/petclinic/architecture.png27 KB
  • .bundle/docs/examples/petclinic/controller-test-results.json3.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.