musedraw · diff

git:20261014.4904e15 to git:20261014.0344ebd

57 added, 202 removed. Audit A to A.

---
name: musedraw
- description: Create or refine software and data-platform architecture diagrams using reference-led composition, restrained visual hierarchy and readable labels. Use for capability maps, component/integration views and deployment views. This first MuseDraw workflow produces original SVG and PNG; it does not yet cover research workflows or statistical plots.
+ description: Draw and edit software component and integration diagrams from short natural-language briefs with the installed semantic graph renderer. Offers hand-drawn linework, light control/data fields, native SVG/PNG, stable identities and document replay. Requires a file/tool-capable agent; not statistical plots or a universal topology engine.
---
# MuseDraw
- Make the user's architecture legible: choose an appropriate view, preserve the
- facts, and use deliberate hierarchy, spacing and color. This is the first
- workflow of MuseDraw, a professional drawing assistant. It currently covers software
- architecture, not experimental pipelines, organization charts or statistical
- plots.
-
- ## Start from the user's words
-
- Accept a few ordinary sentences, for example:
-
- > 用 MuseDraw 画一张客户互动营销应用架构图,突出多渠道接入、活动、内容和消息服务。
- > 做成适合产品方案汇报的通用参考,简洁、层次清楚。
-
- Choose the view, composition, canvas, palette, typography and routing yourself.
- Do not ask the user for coordinates, hex colors, module IDs, a full node list or
- a production specification. Ask only for missing system facts that materially
- change a real-system diagram. For an explicitly generic reference, propose
- reasonable example content and identify that scope outside the artwork.
-
- When the user says only **“墨蓝风格”** or **“换成墨蓝”**, use the content
- already present in the conversation. A family name is enough; do not require
- “001”, a case URL or the internal style ID. Read
- [style-families](references/style-families.md) for the named families and their
- sub-styles. Choose a sub-style from the view and content density while keeping
- the family palette stable. “轻一点” and “紧凑一些” are ordinary visual edits,
- not requests for the user to produce a new technical brief.
-
- The 100 curated gallery cases are **design references, not an allowlist or a
- fixed-template engine**. New industries, modules and structures need original
- compositions. Do not reject an unfamiliar topic, force it into a gallery case,
- or copy the case's business modules into the user's system. Arbitrary supported
- architecture topics do not require a matching reference, case number or URL.
-
- When visual inspiration would help, optionally use
- [find_reference.py](scripts/find_reference.py) to discover a few cases, then read
- only a suitable case's design card. No match means proceed with the view and
- visual guides below—not ask the user to choose a template. The helper reads the
- bundled [index](references/gallery-index.json) without loading all 100 cases into
- the conversation. A case's example content is opt-in and is never evidence of
- the user's architecture. Exact reproduction is a separate, explicit request:
- use the selected source/production reference, not a thousand-word user prompt.
-
- ## Choose the view
-
- For component/integration requests in **手绘线稿** or **终端色域**, use
- [the semantic graph workflow](references/graph-workflow.md). The agent supplies
- components, groups, relationships and a composition choice; the installed code
- draws and checks the figure. On follow-up edits, return validated operations on
- the existing graph rather than regenerating coordinates or the whole document.
- This route is reusable across topics and is not backed by a case-specific script.
-
- - **What belongs where?** Read [capability-map](references/capability-map.md).
- Use layers, parallel domains and cross-cutting support. The bundled Python
- renderer implements one data-platform skeleton, not a general layout engine.
- Use it only when the user's brief fits; otherwise create an original SVG.
- - **Which components interact?** Read
- [architecture-views](references/architecture-views.md). Draw actual endpoints,
- interfaces and boundaries. A list of capabilities is not a sequence of calls.
- For a worked visual reference, optionally inspect the bundled
- [inspection example](references/inspection-example.md) and its native SVG/PNG.
- - **Where is it deployed?** Read the deployment section of the same guide. Show
- only supplied instances, environments and network boundaries. A database
- capability does not imply a server count or cloud provider.
+ The user describes the system; you prepare semantic content; the installed code
+ draws and checks it. Use the same renderer for examples and new topics.
- Deliver the view the user needs, not two alternatives by default. For style-only
- changes, read [visual-decisions](references/visual-decisions.md).
+ ## Start with ordinary words
- ## Make the diagram
+ A user can say “画一个采购系统架构图,手绘线稿,员工提采购,经过审批后
+ 生成订单,并对接财务”. Do not ask for coordinates, hex values, IDs or an example
+ number. For an actual system, use supplied facts and ask only about missing facts
+ that materially change the result. For an explicitly generic reference, propose
+ appropriate components without claiming they describe a deployed system.
- For exact replay or transferring a chosen style to different content, read
- [reproducibility](references/reproducibility.md). Keep source replay, new-content
- generation, cross-model tests and human visual acceptance as separate outcomes.
- Do not promise that a short prompt will reproduce a hand-finished gallery image
- pixel-for-pixel, or that a host without file/tool execution can run this Skill.
+ The two published styles are:
- 1. Extract the components or capabilities, groups, known relationships and scope
- from the brief. If a repository is supplied, inspect the relevant actual
- source/configuration before making architecture claims; a README or folder
- name alone is not evidence of runtime interactions. State what was inspected.
- A short brief is an input to design, not a request to reproduce every detail
- of a gallery screenshot. Preserve supplied constraints; design the rest.
- 2. When the user asks for a generic example without system facts, proceed with a
- clearly marked **reference architecture**. For their actual system, ask only
- about missing facts that materially change the diagram. Do not silently add
- protocols, vendors, performance claims or deployment instances.
- 3. Choose the composition from the reading task, then a deliberate visual
- family. Read [visual-decisions](references/visual-decisions.md). There is no
- compulsory blue-and-white skin. A supplied reference takes precedence:
- inspect its silhouette, density, nested structure, major color areas and
- typographic hierarchy before drawing. A color change alone is not reference
- fidelity. Study the visual grammar without importing third-party images,
- trademarks or unsupported system facts.
- 4. Create native SVG text and geometry, with meaningful stable element IDs and
- a title/description. For grouped content supported by the content-driven
- helper, pass semantic groups/items and actual relations; the helper applies
- the selected family and sub-style. Keep topology separate from style.
- The legacy capability helper remains available for its fixed data-platform
- skeleton. Uncovered compositions need original SVG and the same visual
- tokens, not a forced gallery template. Preserve all requested facts even if that requires a larger canvas or
- a separate detail view. Do not load the full study catalog into the prompt.
- 5. Render a PNG and inspect the full figure, a dense detail and the intended
- display size. Use the browser checker when available and read its JSON:
- `passed: null` means container bounds were not checked. Supply non-empty
- `layout-metadata.bounds` or disclose that gap. The checker does not assess
- architectural truth, connector routing or aesthetic quality; inspect those
- separately. Never describe an unrendered or uninspected result as verified.
- 6. For palette or typography changes, keep the content and relationships fixed.
- For content edits, preserve unaffected labels and objects. Return the PNG
- preview and source SVG, with a short scope note; do not require an editor or
- an account merely to view the result.
+ | User choice | Visual treatment | Useful when |
+ | --- | --- | --- |
+ | 手绘线稿 | White paper, repeatable ink/green outlines, open client figures, hatched storage | Explaining components and their connections |
+ | 终端色域 | Light canvas, warm control fields, cool data fields, clean role shapes | Separating supplied ownership domains and external endpoints |
- ## Helpers
+ If the user gives no style, use 手绘线稿. They may pick either style for a new
+ topic, not only the demonstration systems. Do not route to the retired
+ hundred-case catalog or offer old families as verified workflows.
- Paths below are relative to a repository checkout. When installed independently,
- use the scripts inside this skill folder and the host's existing render tools.
+ ## Draw with the installed tool
- For the semantic graph route above:
+ Read [graph-workflow](references/graph-workflow.md) for the semantic schema,
+ composition choices and edit operations. Prepare `{scene,presentation}` JSON:
+ nodes with stable IDs and supplied roles, optional flat ownership groups, and
+ explicit relationships. `flow` follows graph ranks; `planes` lays out actual
+ domains. Do not invent control/data groups solely to fit the visual style.
```sh
node <skill>/scripts/render_graph.mjs brief.json new-output --playwright <existing-module> --browser <existing-browser>
```
- Its small scene format, two composition strategies, styles, edit operations and
- limits are documented in [graph-workflow](references/graph-workflow.md).
-
- For a content-driven grouped view, the agent writes a small semantic scene,
- not coordinates: `title`, `view`, `sections` containing `title` and `groups`,
- each group containing `title` and `items` (strings or `{id,label}`). Optional
- `top`/`bottom` use the same group shape; `supports` adds `side: left|right`.
- Only supplied interactions become `edges: [{from,to}]`, referencing item IDs.
- Style changes reuse the same scene; no old-case text is loaded.
-
- ```sh
- python <skill>/scripts/render_style.py brief.json output/new-run --style 墨蓝
- python <skill>/scripts/render_style.py brief.json output/airy-run --style 墨蓝 --variant quiet
- ```
-
- This helper uses existing browser tools (or `--playwright` and `--browser`),
- measures the actual font, and writes SVG, PNG, content and checks together.
- Use a fresh output folder so previous results remain available. It handles
- grouped layers, optional side supports and explicitly supplied relations;
- complex graph topology still needs purpose-designed SVG. See
- `assets/semantic-procurement.json` for the input format, not compulsory content.
-
- Relations use facing node ports and separate obstacle-avoiding lanes, including
- return paths. Labels remain text, without a white patch over a colored domain.
- The helper routes an existing grouped layout; it does not choose the topology's
- composition. If it reports insufficient routing or label space, adjust the
- composition or draw native SVG while retaining every supplied relation. Do not
- drop a return path or leave a failed render described as a delivered diagram.
-
- ```sh
- python skills/musedraw/scripts/render_capability.py brief.json output/diagram.svg --theme blue
- python scripts/export_png.py output/diagram.svg output/diagram.png
- ```
-
- In an independently installed skill, the capability helper and its sample are
- still available:
-
- ```sh
- python <skill>/scripts/render_capability.py <skill>/assets/data-platform.json output/diagram.svg --theme blue
- ```
-
- Optional design-reference lookup, not a required step or a renderer:
+ Resolve the host's available Node.js 22+, Playwright, Chromium and language fonts;
+ do not require user coordinates or a separate model API key. If dependencies are
+ unavailable, explain the concrete runtime gap. A text-only chatbot cannot execute
+ this workflow; installing missing dependencies requires appropriate authorization.
- ```sh
- python <skill>/scripts/find_reference.py "客户互动营销"
- python <skill>/scripts/find_reference.py --id 97
- ```
+ Deliver PNG, SVG and `document.json`. Inspect the full figure and dense detail,
+ and read `checks.json`: technical checks do not establish architectural truth or
+ professional aesthetic acceptance. Native drawio export is not a verified
+ graph-route deliverable. Preserve facts if a layout is rejected; do not bypass
+ this route by hand-drawing SVG and claiming identical reproducibility.
- The first command returns a few design candidates; the second returns that
- case's composition and palette hints without its example modules. Only add
- `--include-content` for an explicit request to reuse the generic case content.
- Custom briefs remain supported when lookup returns no candidates.
+ ## Continue the conversation
- Optional named design tokens are available offline:
+ “把审批服务改成采购审批”, “增加供应商档案库”, or “让订单服务对接财务”
+ are ordinary edits. Read the current document and use the documented operation
+ list; do not regenerate unrelated facts, IDs or the full scene for a small edit.
```sh
- python <skill>/scripts/style_tokens.py --list
- python <skill>/scripts/style_tokens.py 墨蓝
- python <skill>/scripts/style_tokens.py 石墨 --view component --variant quiet
+ node <skill>/scripts/render_graph.mjs current/document.json next-output --operations edits.json --playwright <existing-module> --browser <existing-browser>
```
- The user-facing families are 墨蓝、石墨、青灰、暖砂、松绿、柔彩 and 夜幕.
- Each includes light-outline, header-band and compact sub-styles; they share
- one role palette but change density, border treatment and weights. See
- [style-families](references/style-families.md). The existing English IDs remain
- compatible tool arguments. Families are not case IDs or a limitation on topics.
- Use semantic color roles, font stacks, hierarchy and grid; a supplied reference
- may require an explicit custom palette or density. The resolver does not
- silently substitute a different style for an unknown name.
- The fixed capability renderer also accepts `--style technical-ink` (or another
- listed family). Its legacy `--theme` mode remains available. These tokens are
- not themselves a graph-layout or connector-routing engine; unsupported
- compositions still require original SVG geometry and actual visual inspection.
-
- This is a Chinese reference brief, not the user's system. Optional JSON fields
- `portalTitle` and `foundationTitle` override the helper's two default Chinese
- headings. Use short titles that fit their columns; use original SVG when the
- requested structure or text cannot fit the fixed skeleton.
-
- The renderer uses Python 3.10+ and the standard library. PNG export uses existing
- Node.js 22+, Playwright, a Chromium-compatible browser and fonts covering the
- figure's language. The repository wrapper discovers available tools or accepts
- explicit paths; it never silently installs anything. The direct preview command
- requires the existing Playwright module path explicitly.
- In an installed skill without the repository wrapper, run:
-
- ```sh
- node <skill>/scripts/preview.mjs diagram.svg diagram.png --playwright <playwright/index.mjs> --browser <browser-executable>
- ```
+ Operations are validated atomically. Retain the current document on failure.
+ Removing a node removes its incident relationships; unrelated nodes and edges
+ remain. Reflow may move objects without changing their facts. When changing
+ style only, reuse the scene and change presentation, not labels or relationships.
- If a rendering dependency is unavailable, deliver the SVG and state that PNG or
- layout verification is incomplete, rather than substituting a fake preview.
+ ## Repeat an example, or draw a new subject
- ## Reference study
+ For exact native-source replay, retrieve the selected published `document.json`
+ and use the same renderer version, presentation and fonts without reinterpreting
+ it. The page assets are at `docs/gallery/examples/sketch/document.json` and
+ `docs/gallery/examples/planes/document.json` in the repository. Fetch just the
+ selected document when installed independently; do not load old gallery content.
+ Generate into a fresh directory, not by copying the stored image.
- [Study provenance](references/study-provenance.md) describes the public references
- and their limits. Load it for provenance questions, not every drawing task.
- The package contains original rules, examples and helpers, not a downloaded
- community-template collection. Reference inspection is not model training.
- No fair model comparison has established token savings or superiority over
- other figure tools.
+ SVG geometry is repeatable under the tested conditions; PNG anti-aliasing and
+ fonts may change pixels. Read [reproducibility](references/reproducibility.md)
+ when evaluating this distinction. For a new topic use its components and
+ relationships with the chosen treatment, not the example business labels.
+ Model interpretation of new content is not a 100% or cross-model guarantee.
+ Supported scope: 80 nodes, 12 flat groups, 160 relations. Nested domains,
+ self-loops, repeated endpoint pairs and some dense layouts are rejected rather
+ than silently simplified. Capability matrices, scientific plots and arbitrary
+ deployment topology are not currently published as verified workflows.