Communitygithub.com

chuspeeism/doubaoplot

DoubaoPlot — 在豆包/豆包工作里用 Origin 画可编辑的科研图,也支持 Codex、Claude Code。基于 hang-jin/editaplot 的二次创作,增加 45 图可点选择器。

doubaoplot 是什麼?

DoubaoPlot(EditaPlot 的二次创作)是一个专为科研人员设计的 AI 智能体技能,它让用户能够通过对话,直接在豆包(包括豆包工作版)、Codex 和 Claude Code 等平台上,使用 Origin 绘制可编辑、可审计的科研图表。其核心优势在于能够将用户模糊的科学问题或原始数据,通过一个确定性的引擎引导至可复现的 Origin 图形,避免了繁琐的手动绘图过程。该技能新增的“选择器模式”是最大的亮点,它提供了一个包含 45 张真实 Origin 示例图的交互式页面,用户只需点击即可选择目标图表类型,系统会自动识别所需数据列,极大降低了非专业用户的选择门槛。此外,它严格遵循权限请求原则,仅在 Windows 10/11 x64 环境下运行,并确保对本地文件系统的操作最小化。整个工作流从拒绝不受支持的平台开始,通过设置、检查、理解数据、规划、预渲染烟雾测试到最终渲染,每一步都要求用户确认,保证了流程的严谨性和结果的可追溯性。

相容平台✓Claude Code✓Codex CLI~Cursor
npx skills add chuspeeism/doubaoplot

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

EditaPlot

將一個科學問題和一個唯讀表格轉換成可審計、可編輯的 Origin 圖形。保持初學者體驗的對話性;使用確定性引擎進行檢查、規劃、渲染、匯出和回讀。

先決定走哪條路(豆包工作版新增)

使用者一進來,先看他手上有什麼,再決定怎麼走。不要在用戶沒給方向的時候就開始猜圖型。

用戶給了什麼走哪條怎麼做
一張參考圖("照這個畫""復刻這個風格")參考圖模式走原有流程,從第 10 步 reference-inspect 進入。參考圖只影響已確認數據支撐得住的圖形語法與安全樣式,不新增證據、不隱藏必需元素。
點名了圖型("畫個雨雲圖""ROC 曲線")直接模式走原有流程。先對照 references/not-covered.md;如果用戶要的圖在那張表裡,直接說清楚沒有這條路線,別硬試。
只有數據,沒說要什麼圖,或明說"不知道該畫哪種"選擇器模式見下方。這是本版新增的路徑,也是最常見的情況。

選擇器模式

使用者不知道自己要什麼圖的時候,讓他看著選,比讓他描述準得多。

  1. 運行 python selector/selector.py。它會打開一個本地頁面:45 張真機跑出來的 Origin 示例圖鋪開, 按方向分好類;用戶點中一張,右側會顯示這張圖需要哪幾列數據,並自動拼好一段完整請求。
    • 宿主自己有內置瀏覽器面板時,改用 python selector/selector.py --print-path, 拿到路徑後用面板打開,不要另外彈窗口。
  2. 用戶在頁面上點「發送給豆包」,腳本會把拼好的請求收下來打到標準輸出; 點「複製」的話內容在他剪貼板裡,請他粘過來。兩條路都通,別只等一條。
  3. 拿到這段請求後,回到原有流程的第 6 步繼續(start → understand → 確認 → plan → 渲染 → 驗證)。 選擇器只負責把需求問清楚,它不改變任何繪圖行為,也不跳過任何確認環節。

選擇器給出的「需要哪幾列」是提示,不是結論。 用戶的數據到底有沒有這些列,仍然由第 7 步 understand 逐列核對;缺列就照常告訴用戶缺什麼,不要因為他在頁面上點過就默認數據齊了。

如果 selector.py 起不來(端口全被佔、沒有圖形界面),不要卡住:把頁面路徑給用戶, 讓他自己雙擊打開、點「複製」再粘回來,流程照舊。

Request only scoped Windows permissions

  • Read the complete repository, selected table, and optional local reference image.
  • Write only to the EditaPlot repository, the current user's skill directory (豆包工作 or Codex), and the selected source file's parent folder for source-adjacent deliverables.
  • Run the local launcher, PowerShell/Python subprocesses, and an EditaPlot-owned Origin instance in the same active interactive Windows user session.
  • A normal host command may first run under an isolated account. If the Origin worker returns origin_codex_sandbox_context, submit a formal, narrowly scoped local-execution request for that exact origin-smoke or render command. Rerun it only if that exact request is approved, either by the user when prompted or by the host's configured auto-reviewer. Approval is not guaranteed, and this handoff is not a sandbox bypass. Never ask the user to copy the command into a separate PowerShell window or broaden the request to administrator or system-configuration access.
  • Use network access only for repository download/update and locked dependency retrieval. Treat a user-scope winget Python installation as a separate system change that still requires explicit consent.
  • Do not request administrator rights, mouse control, whole-drive write access, cloud upload of private inputs, or DCOM, registry, firewall, user-group, or Origin-installation changes. When Controlled Folder Access, an organization policy, cloud sync, or a read-only location blocks writes, request access only to the affected folder or ask for an explicit alternate output folder.

Start with the beginner path

  1. Reject unsupported platforms before installing anything. Support the CLI/dependency layer only on physical Windows 10/11 x64 with 64-bit CPython 3.10–3.12. Target Origin/OriginPro 2021 and later through external originpro; Origin 2020b and earlier are unsupported by this route. The fully verified live baseline is CPython 3.10 + Origin 2024b / 10.15. Treat another 2021+ version as capability-gated, not automatically verified, until its smoke and complete artifacts pass. State plainly that macOS (Intel/Apple Silicon), Linux, WSL, Wine/CrossOver, Parallels, and other VMs are unsupported in V1. doctor cannot reliably detect every VM, so ask the user to confirm a physical Windows host when that fact is unknown.
  2. Locate editaplot.cmd in the installed Skill directory; when working from a cloned repository, use the repository-root editaplot.cmd. Use an absolute launcher path in commands. Do not make beginners select a Python executable or invoke scripts/editaplot.py directly.
  3. Require the complete repository for first installation. Run repository-root editaplot.cmd setup; never instruct users to copy only skill/editaplot, because that omits the runtime. Read references/runtime.md for setup, discovery, and command details.
  4. Reuse an existing compatible Python. If none exists, explain in Chinese that installing Python is a system-level change. Run winget show first and explain the exact publisher, source, and agreements. Only explicit user confirmation permits a later non-interactive installation of Python.Python.3.12 with user scope and x64 architecture. If winget is unavailable, provide the official python.org Windows installation instructions and wait for the user; never use an untrusted mirror or silently install Python.
  5. Run editaplot.cmd doctor for each new workflow. Allow doctor --repair only for the reported project-local Python dependency repair. Keep all Python packages in .editaplot-venv. Treat Origin as a locally installed user-managed application; never install or modify it during repair.
  6. Run editaplot.cmd start <data-file> for a new table. Add --intent "<user intent>" when the user states a goal. Treat its inspection and recommendation payload as internal working state. Use the original local source path exposed by the attachment. If the host provides only a temporary copied attachment and the original folder cannot be recovered, ask once for the intended local source/output folder before rendering; never guess an unrelated workspace destination.
  7. After selecting a candidate template, run editaplot.cmd understand <data-file> --template-id <id> with the same confirmed mapping that will be used for planning. Group its result into a short checklist: data type; columns to draw; columns used only for support or validation; columns retained but not drawn; proposed figure elements; and calculations that will not be performed. Every source column must appear exactly once. If any item is uncertain, ask for a corrected mapping and run understand again; do not confirm or plan it.
  8. Tell a beginner only: what was recognized, the best one to three chart choices, why they fit, and the smallest scientific decision still required. Do not dump an inspect → recommend → understand → plan pipeline or raw JSON unless they ask for technical detail.
  9. Ask the user to confirm both a one-sentence scientific purpose and the concise element checklist. Freeze the exact proposal_hash, approved derived-item IDs, and resolved ambiguity choices in --semantic-confirmation-json. Never reuse a confirmation after the source, mapping, purpose, or proposal hash changes. When confidence is low, candidate margins are small, roles or units are ambiguous, or a display transformation is proposed, ask only the additional focused questions needed.
  10. If the user supplies a reference figure, first run reference-inspect. You may then describe only its panel/mark/encoding/layout/style grammar in the strict ReferenceFigureSpec JSON and run reference-review; the runtime performs no OCR or model inference. Show the adopted and rejected features, bind every essential mark to confirmed renderable user data, and obtain a separate hash-bound confirmation. Never copy reference values, labels, fits, phase assignments, author text, logos, watermarks, or the bitmap into the Origin project. Prefer verified template_adaptation; keep controlled_composition blocked until that exact composition has passed the full Origin evidence gate. A reference cannot add missing evidence or change the confirmed scientific element list. Treat style inferred from the reference as a suggestion, not as the user's instruction. Ask the user to choose one of three modes: keep the verified template default; use a confirmed, allow-listed approximation suggested by the reference; or provide exact custom values. For the exact mode, ask separately for colors, physical line width, fill transparency, page size, and legend visibility, frame, or position. An explicit user choice has precedence over a conflicting reference token. Freeze each reference suggestion as applied, retained_template_default, or rejected; never claim a request was applied unless the selected template has the same verified preview/Origin route and the required Origin object readback.
  11. When color is user-selectable, run editaplot.cmd palettes, show assets/palettes/palette-selector-public.zh-CN.png, and recommend no more than two compatible palette_id values. Read references/palettes.md before freezing one.
  12. Internally freeze the confirmed choice with editaplot.cmd plan; never hand-edit a plan or write a decision back to the source file. For an exact XPS request, write the confirmed values to a separate JSON object and pass its path with --visual-style-json. The supported exact fields are series_colors, line_width_pt, fill_transparency_percent, page_size_cm, legend_visible, legend_position, and legend_frame. Invalid explicit fields or values must fail fast and be corrected with the user; never silently discard them or fall back to a reference/default style. The render command copies this approved plan into the final output folder as render-plan.json.
  13. Treat Origin readiness as technical state only. Doctor performs read-only discovery of Origin.Application, Origin.ApplicationSI, installed candidates, Python, originpro, and OriginExt; it never launches Origin and ready_for_render never means a live connection succeeded. If the default launch registration is present, proceed to the real pre-render smoke without asking the user to open Origin or confirm it again. Keep beginner output to one to three plain-language sentences; leave CLSIDs, registry views, candidates, and stages in JSON. Read the redacted origin_execution_context separately from ready_for_render. A codex_sandbox status requires the exact-command approval handoff above before COM is called; only an approved request may be rerun. Auto-review evaluates that individual request and does not pre-grant Origin access. An unknown Windows execution context is fail-closed and is not an approval request: stop before COM and report that the current Windows identity could not be verified.
  14. Run editaplot.cmd origin-smoke --output-dir <unique-smoke-directory> with launch_isolated: start and own a dedicated Origin instance, perform the live smoke and version handshake, then apply the template capability decision. This command is mandatory after planning and before formal rendering. attach_existing is an explicit advanced mode only; never reset, overwrite, or close a user-owned project, and detach instead of exiting. Report failures by technical stage and next step without speculation. Never use mouse automation or provide application patches or bypass instructions. The runtime must attempt to clean a partial EditaPlot-owned activation and may try one fresh isolated instance for a retryable startup code only if cleanup succeeds. Cleanup failure returns origin_activation_cleanup_failed and stops. It must then wait with sec -poc 30 and confirm run.isOCready() before reading the version or creating a project. Never loop, switch to ApplicationSI, edit DCOM/registry permissions, or tell a beginner to run the whole workflow as administrator. After the automatic attempt is exhausted, request approval for at most one retry in the same active Windows-user context and use a fresh empty sibling smoke directory so the first report remains intact. origin_com_class_not_registered and origin_com_activation_access_denied stop without automatic retry. Do not force-terminate a Python worker merely because it has run for a long time: it may own a hidden Origin instance. Preserve diagnostics and report the last progress stage before proposing any user-controlled cancellation. Keep the sandbox approval handoff distinct from an activation retry: the former happens before COM, while the latter is available only after the bounded activation/cleanup policy has run. When primary activation and cleanup both fail, expose only primary_activation_code, primary_activation_stage, cleanup_error_code, and cleanup_error_stage. Never include a Windows account name, local path, raw HRESULT, or raw COM text in that structured diagnostic payload, and never retry because both pairs are present. Current EditaPlot workers serialize only their active origin-smoke / render Origin section within one signed-in Windows session; data inspection, recommendation, and planning may remain concurrent. Respect origin_job_queue progress, which is emitted immediately when waiting and then about every 30 seconds. Ordering is not guaranteed to be strict FIFO. The 30-minute limit applies only to the waiting job: it stops that waiter without killing or interrupting the active holder. Do not submit a duplicate while a queue message is visible. Manual scripts, older EditaPlot releases, and unrelated programs are outside this coordination boundary.
  15. Only after that smoke passes, render an allowed template route with editaplot.cmd render <plan>. Keep an EditaPlot-owned Origin instance open after success unless the user requests otherwise. By default, let the runtime create a direct sibling of the source file named <source_stem>_EditaPlot_YYYYMMDD_HHMMSS; keep all formal artifacts in that folder. Do not redirect ordinary runs to the repository, Skill directory, current working directory, or a shared global output folder. Use --output-dir only when the user explicitly requests another location.

…

[truncated for translation]

相關技能