Agent Skillsopensquilla/opensquilla › meta-diagram-triangulation

meta-diagram-triangulation

GitHub

自动扫描代码库,智能选择最佳图表类型,并行生成PlantUML和draw.io两种格式,并组合成架构文档。适用于RFC编写或新人入职文档,兼顾文本审查与可视化编辑需求。

src/opensquilla/skills/exp/meta-diagram-triangulation/SKILL.md opensquilla/opensquilla

触发场景

用户提及 'diagram triangulation' 或相关本地化触发词 需要为特定代码路径或模块生成架构视图

安装

npx skills add opensquilla/opensquilla --skill meta-diagram-triangulation -g -y
更多选项

非标准路径

npx skills add https://github.com/opensquilla/opensquilla/tree/main/src/opensquilla/skills/exp/meta-diagram-triangulation -g -y

不安装直接使用

npx skills use opensquilla/opensquilla@meta-diagram-triangulation

指定 Agent (Claude Code)

npx skills add opensquilla/opensquilla --skill meta-diagram-triangulation -a claude-code -g -y

安装 repo 全部 skill

npx skills add opensquilla/opensquilla --all -g -y

预览 repo 内 skill

npx skills add opensquilla/opensquilla --list

SKILL.md

Frontmatter
{
    "kind": "meta",
    "name": "meta-diagram-triangulation",
    "always": false,
    "triggers": [
        "diagram triangulation",
        "triangulate diagrams",
        "架构三视图",
        "出双视图架构图"
    ],
    "provenance": {
        "origin": "opensquilla-original",
        "license": "Apache-2.0"
    },
    "composition": {
        "steps": [
            {
                "id": "scan_repo",
                "kind": "agent",
                "with": {
                    "task": "Scan the target path identified in the user's invocation for\narchitectural structure. Extract:\n  * Top-level modules \/ packages under the target path\n  * Inter-module import dependencies (who imports who)\n  * Hotspot files (most-changed in the last 90 days)\n  * Public surface: classes, functions, protocols exported via __init__.py\n\nUser invocation (target path is somewhere in this string):\n{{ inputs.user_message | xml_escape | truncate(400) }}\n\nReply with a structured summary, max 1500 chars:\n  ## Target path\n  <resolved absolute path>\n\n  ## Modules (top-level)\n  - <module\/>: <one-line description>\n\n  ## Dependencies\n  <module> → <module>\n  ...\n\n  ## Hotspots\n  - <file>: <commit count last 90d>\n\n  ## Public surface\n  - <ClassName>: <one-line role>\n"
                },
                "skill": "history-explorer"
            },
            {
                "id": "classify_kind",
                "kind": "llm_classify",
                "with": {
                    "task": "Based on this codebase scan, which diagram kind is most informative\nfor an architecture doc? Pick ONE of:\n  - class: data structures \/ OO hierarchy dominant\n  - sequence: cross-module call flows dominant\n  - component: module-level boxes + arrows dominant\n  - deploy: infra \/ process layout dominant\n  - flow: data pipeline \/ staged processing dominant\n\nScan output:\n{{ outputs.scan_repo | truncate(1500) }}\n"
                },
                "depends_on": [
                    "scan_repo"
                ],
                "output_choices": [
                    "class",
                    "sequence",
                    "component",
                    "deploy",
                    "flow"
                ]
            },
            {
                "id": "render_plantuml",
                "kind": "agent",
                "with": {
                    "task": "Generate a PlantUML diagram source of kind `{{ outputs.classify_kind }}`\nfrom this codebase scan. Use idiomatic PlantUML syntax bracketed by\n`@startuml` ... `@enduml`. Aim for 10-20 boxes\/arrows; do not over-render.\n\nScan output:\n---\n{{ outputs.scan_repo | truncate(2000) }}\n---\n\nWrite the source to: `{{ inputs.workspace_dir }}\/diagrams\/arch.puml`\n(create parent dir if missing; overwrite OK).\n\nReply with the absolute output path on a single line, no preamble.\n"
                },
                "skill": "sub-agent",
                "depends_on": [
                    "scan_repo",
                    "classify_kind"
                ]
            },
            {
                "id": "render_drawio",
                "kind": "agent",
                "with": {
                    "task": "Generate a draw.io XML diagram of kind `{{ outputs.classify_kind }}`\nfrom this codebase scan. Use valid draw.io XML:\n  <mxfile><diagram><mxGraphModel><root>\n    <mxCell id=\"0\"\/><mxCell id=\"1\" parent=\"0\"\/>\n    <mxCell id=\"N\" value=\"...\" style=\"...\" vertex=\"1\" parent=\"1\">\n      <mxGeometry ...\/>\n    <\/mxCell>\n    <mxCell ... edge=\"1\" source=\"...\" target=\"...\" parent=\"1\">\n      <mxGeometry ...\/>\n    <\/mxCell>\n  <\/root><\/mxGraphModel><\/diagram><\/mxfile>\n\nAim for 10-20 boxes\/edges to mirror the PlantUML side; layout can be\nsimple grid since the user is expected to re-arrange in draw.io.\n\nScan output:\n---\n{{ outputs.scan_repo | truncate(2000) }}\n---\n\nWrite the XML to: `{{ inputs.workspace_dir }}\/diagrams\/arch.drawio`\n(create parent dir if missing; overwrite OK).\n\nReply with the absolute output path on a single line, no preamble.\n"
                },
                "skill": "sub-agent",
                "depends_on": [
                    "scan_repo",
                    "classify_kind"
                ]
            },
            {
                "id": "compose_doc",
                "kind": "agent",
                "with": {
                    "task": "Compose an architecture document that references both diagram\ndeliverables. The doc body should contain three sections:\n\n1. **Scope** — restate the user's invocation target.\n   User invocation: {{ inputs.user_message | xml_escape | truncate(200) }}\n2. **Diagram kind** — `{{ outputs.classify_kind }}` (one paragraph\n   justifying why this kind was chosen).\n3. **Deliverables** — two bullet items linking the files:\n   - PlantUML source: {{ outputs.render_plantuml }}\n   - draw.io file: {{ outputs.render_drawio }}\n\nSave to: `{{ inputs.workspace_dir }}\/diagrams\/arch.docx`. Reply\nwith the absolute output path on a single line, no preamble."
                },
                "skill": "docx",
                "depends_on": [
                    "render_plantuml",
                    "render_drawio"
                ]
            },
            {
                "id": "persist",
                "kind": "tool_call",
                "tool": "memory_save",
                "tool_args": {
                    "mode": "append",
                    "path": "memory\/architecture-snapshots.md",
                    "content": "=== diagram triangulation ===\ninvocation: {{ inputs.user_message | xml_escape | truncate(200) }}\ndiagram_kind: {{ outputs.classify_kind }}\nplantuml: {{ outputs.render_plantuml | truncate(200) }}\ndrawio: {{ outputs.render_drawio | truncate(200) }}\ndocx: {{ outputs.compose_doc | truncate(200) }}"
                },
                "depends_on": [
                    "compose_doc"
                ],
                "tool_allowlist": [
                    "memory_save"
                ]
            }
        ]
    },
    "description": "Scan a target codebase path, classify the most informative diagram kind, then render it as BOTH a PlantUML source file AND a draw.io XML in parallel, and compose them into a single architecture doc. Use when writing an RFC or onboarding doc and you want a text-friendly (PlantUML) and an editable (drawio) view of the same architecture.",
    "meta_priority": 55
}

Diagram Triangulation (Meta-Skill)

A classifier + parallel render meta-skill. After scanning a target path, an llm_classify step picks the most informative diagram kind (one of class | sequence | component | deploy | flow), then two independent render branches synthesize PlantUML source and draw.io XML for the same scan — running in parallel because they are independent tools serving different downstream uses (git-friendly text review vs. editable canvas).

Trigger surface

Fire by saying diagram triangulation or one of the localized triggers listed in the frontmatter, with the target path or module reference in the same turn.

Fallback

If either render step fails, compose_doc should still produce the docx referencing whichever render succeeded; manually re-run the failed render via sub-agent with the same scan output as input.

版本历史

  • 7f72a32 当前 2026-07-05 18:40

同 Skill 集合

src/opensquilla/skills/bundled/advanced-dubbing-studio/SKILL.md
src/opensquilla/skills/bundled/ai-video-script/SKILL.md
src/opensquilla/skills/bundled/audio-cog/SKILL.md
src/opensquilla/skills/bundled/awesome-webpage-image-download/SKILL.md
src/opensquilla/skills/bundled/awesome-webpage-research/SKILL.md
src/opensquilla/skills/bundled/AwesomeWebpageMetaSkill/SKILL.md
src/opensquilla/skills/bundled/cron/SKILL.md
src/opensquilla/skills/bundled/docx/SKILL.md
src/opensquilla/skills/bundled/filesystem/SKILL.md
src/opensquilla/skills/bundled/git-diff/SKILL.md
src/opensquilla/skills/bundled/github/SKILL.md
src/opensquilla/skills/bundled/history-explorer/SKILL.md
src/opensquilla/skills/bundled/html-coder/SKILL.md
src/opensquilla/skills/bundled/html-to-pdf/SKILL.md
src/opensquilla/skills/bundled/http-fetch/SKILL.md
src/opensquilla/skills/bundled/latex-compile/SKILL.md
src/opensquilla/skills/bundled/memory/SKILL.md
src/opensquilla/skills/bundled/music-and-singing-studio/SKILL.md
src/opensquilla/skills/bundled/nano-banana-pro-openrouter/SKILL.md
src/opensquilla/skills/bundled/nano-banana-pro/SKILL.md
src/opensquilla/skills/bundled/nano-pdf/SKILL.md
src/opensquilla/skills/bundled/openrouter-video-generator/SKILL.md
src/opensquilla/skills/bundled/paper-abstract-author/SKILL.md
src/opensquilla/skills/bundled/paper-citation-planner/SKILL.md
src/opensquilla/skills/bundled/paper-experiment-stub/SKILL.md
src/opensquilla/skills/bundled/paper-outline-author/SKILL.md
src/opensquilla/skills/bundled/paper-preference-planner/SKILL.md
src/opensquilla/skills/bundled/paper-refbib-stub/SKILL.md
src/opensquilla/skills/bundled/paper-revision-author/SKILL.md
src/opensquilla/skills/bundled/paper-section-author/SKILL.md
src/opensquilla/skills/bundled/paper-source-curator/SKILL.md
src/opensquilla/skills/bundled/pptx/SKILL.md
src/opensquilla/skills/bundled/seedance-2-prompt/SKILL.md
src/opensquilla/skills/bundled/skill-creator-linter/SKILL.md
src/opensquilla/skills/bundled/skill-creator-proposals/SKILL.md
src/opensquilla/skills/bundled/skill-creator-smoke-test/SKILL.md
src/opensquilla/skills/bundled/srt-from-script/SKILL.md
src/opensquilla/skills/bundled/stack-trace-generic-probe/SKILL.md
src/opensquilla/skills/bundled/stack-trace-go-probe/SKILL.md
src/opensquilla/skills/bundled/stack-trace-js-probe/SKILL.md
src/opensquilla/skills/bundled/stack-trace-python-probe/SKILL.md
src/opensquilla/skills/bundled/stack-trace-rust-probe/SKILL.md
src/opensquilla/skills/bundled/subtitle-burner/SKILL.md
src/opensquilla/skills/bundled/swe-bench/SKILL.md
src/opensquilla/skills/bundled/text-file-read/SKILL.md
src/opensquilla/skills/bundled/title-card-image/SKILL.md
src/opensquilla/skills/bundled/video-merger/SKILL.md
src/opensquilla/skills/bundled/video-still-animator/SKILL.md
src/opensquilla/skills/bundled/voice-clone-lab/SKILL.md
src/opensquilla/skills/bundled/voice-conversion-studio/SKILL.md

元信息

文件数
0
版本
186b3c1
Hash
84c4f8ea
收录时间
2026-07-05 18:40

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-04 21:15
浙ICP备14020137号-1 $访客地图$