Communitygithub.com

DoubaoPlot

Draw editable scientific figures using Origin in Doubao/Doubao Works, also supports Codex and Claude Code. A secondary creation based on hang-jin/editaplot, adding a 45-figure clickable selector.

What is DoubaoPlot?

DoubaoPlot is an AI agent skill that enables users to create editable, auditable scientific figures directly within the Doubao platform (and its workspace variant), as well as in Codex and Claude Code environments. It leverages OriginPro (2021 and later) on Windows to generate high-quality, customizable plots from tabular data. The skill is a derivative of the EditaPlot project (by hang-jin), enhanced with a 45-figure visual selector that helps users choose the most appropriate chart type by simply clicking on examples. This selector eliminates guesswork when users are unsure what visualization to use. The workflow begins with user intent or data input, proceeds through template selection, data column mapping confirmation, and automated rendering with full audit trails. On Doubao Works, a dedicated `selector.py` script displays 45 pre-rendered Origin examples, allowing users to pick one and automatically generate the required chart specifications. The skill strictly enforces Windows-only execution, validates data columns against the chosen template, and requires explicit user confirmation at each critical step before proceeding to final rendering. It also supports importing reference images to replicate stylistic elements.

Works with✓Claude Code✓Codex CLI~Cursor
npx skills add chuspeeism/doubaoplot

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

EditaPlot

Turn a scientific question and a read-only table into an auditable, editable Origin figure. Keep the beginner experience conversational; use the deterministic engine for inspection, planning, rendering, exporting, and readback.

Decide which path to take first (New for Doubao Works version)

When the user arrives, first assess what they have, then decide how to proceed. Do not start guessing chart types without a direction from the user.

What the user providedWhich path to takeHow to proceed
A reference image ("Draw it like this" / "Replicate this style")Reference image modeFollow the original workflow, starting from step 10 reference-inspect. The reference image only affects graphic grammar and safe styles that the confirmed data can support; it does not add new evidence or hide essential elements.
A specific chart type ("Draw a raincloud plot" / "ROC curve")Direct modeFollow the original workflow. First, check references/not-covered.md; if the user's requested chart type is in that table, clearly state that this route is not available, do not force it.
Data only, no chart type specified, or they explicitly say "I don't know which to draw"Selector modeSee below. This is the new path added in this version and the most common scenario.

Selector mode

When the user doesn't know which chart to use, letting them see and pick is far more accurate than making them describe it.

  1. Run python selector/selector.py. It opens a local page showing 45 real Origin example charts generated by genuine runs, categorized by direction. When the user clicks one, the right side displays which data columns that chart requires and automatically assembles a complete request.
    • If the host has a built-in browser panel, use python selector/selector.py --print-path instead, open the path using that panel, and avoid popping up a separate window.
  2. The user clicks "Send to Doubao" on the page; the script captures the assembled request and outputs it to stdout. If they click "Copy", the content goes to their clipboard; ask them to paste it. Both routes work, do not wait for only one.
  3. After receiving this request, return to step 6 of the original workflow and continue (start → understand → confirm → plan → render → verify). The selector is only responsible for clarifying the requirements; it does not change any plotting behavior or skip any confirmation steps.

The "which columns are needed" suggestion from the selector is a hint, not a conclusion. Whether the user's data actually has those columns is still verified by step 7 understand, which checks column by column. If columns are missing, inform the user as usual what is missing; do not assume the data is complete just because they clicked something on the page.

If selector.py cannot start (all ports occupied, no graphical interface), do not block: provide the page path to the user, let them double-click to open it, click "Copy", and paste back; the process continues as normal.

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 (Doubao Works 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]

Related Skills