Claude Skill

academic-figure-workflow

Plan, generate, inspect, and refine academic figures from repositories, papers, draft notes, paper URLs, PDFs, or reference images. Supports fast-track draft-to-figure generation and user passthrough mode.

LLM Mart · 0 points · 19 views 0 listing impressions 0 install-command copies
Virus-scanned Reviewed automatically before listing.

Full trust report

Download Azhi-ss-academic-figure-skills-academic-figure-workflow-42aee44.zip · 52 KB
Part of azhi-ss/academic-figure-skills — 5 skills

Install

skills CLI npx skills add https://github.com/Azhi-ss/academic-figure-skills/tree/main/academic-figure-workflow
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install azhi-ss-academic-figure-skills@llmmart
Git git clone https://github.com/Azhi-ss/academic-figure-skills.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole azhi-ss/academic-figure-skills collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

Academic Figure Workflow

Produce a grounded academic figure and a stable local artifact. Preserve the user's chosen backend, reference assets, style direction, review preference, and output scope.

If the user asks only to construct, diagnose, or revise a figure prompt, route straight to designer's matching mode and stop before rendering. A prompt-only request does not require invented render paths or an extra approval gate.

Load only what the current stage needs:

  • missing evidence → references/missing-info-policy.md
  • palette/style fallback → references/palettes.md and, when installed, references/styles/
  • Codex native image execution → references/codex-image-workflow.md
  • render inspection → references/render-audit.md (required before accepting an image)

Route inputs by inspected content

A URL is not automatically a repository. Inspect it first.

Input Route Execution Behavior
Direct User Architecture (Passthrough) ../academic-figure-designer/SKILL.md Skip analyzers. User gave explicit nodes/flow; compile FigureSpec v1 and render directly.
Draft Notes / Outline / Partial Draft ../academic-figure-draft-analyzer/SKILL.md Draft-to-Figure Fast-Track. For rough notes, outlines, or sections without full results: focus on Figure 1 framework.
Complete Manuscript (Markdown / LaTeX / PDF / URL) ../academic-figure-draft-analyzer/SKILL.md Full Planning. For complete papers with experiments/results: multi-figure strategy, claim verification, and constraints.
Repository path or repository URL ../academic-repo-analyzer/SKILL.md Extract semantic architecture graph; omit engineering plumbing (data loaders, trainers).
Paper plus repository Hybrid Paper/user defines narrative & topology; repository supplies parameter & dimension verification.
External style reference / existing render to edit External reference: ../academic-figure-architecture-extractor/SKILL.md; edit baseline: ../academic-figure-designer/SKILL.md revise mode Extract transferable style from external references. For an edit baseline, preserve its scientific content, topology and visible text, then apply only the requested delta.

For an article URL, use an available web/browser/document reader to obtain the paper text, captions, and linked figures. For a PDF, use a PDF-capable reader for paper content and the architecture extractor only for figure images. If a sibling skill is missing, perform the minimum equivalent analysis and mark the degraded path.

Keep versioned internal artifacts

Store these as JSON-compatible objects. Do not make the user read them unless requested.

FigurePlan v1

schema: academic-figure/FigurePlan@1
source_revision, venue
sources[]: {kind, uri_or_absolute_path, revision_or_page, evidence}
figures[]: {
  figure_id, figure_type, priority, communication_goal, claim_scope[], hero_element,
  required_nodes[], required_connections[], authority_boundaries[], secondary_context[],
  forbidden_claims[], forbidden_connections[], aspect_ratio, final_width_mm,
  style_profile_hint, reference_assets[],
  open_questions[], confidence, review_status: pending|confirmed|waived
}

Components and connections are semantic and evidence-backed. A code directory count is not a figure hierarchy or palette decision.

FigureSpec v1

schema: academic-figure/FigureSpec@1
figure_id, plan_revision, sources[], prompt (internal), aspect_ratio, final_width_mm
topology: {components[], connections[], groups[], authority_boundaries[]}
visible_text[], caption_notes[], layout
style_profile: classic-technical|pastel-airy-ui|illustrated-modular|reference-led
style_preset, style_source, style_grammar, semantic_color_roles
reference_images[]: checked absolute local paths or recent-conversation descriptors
conversation-reference transient status stays in the execution packet
must_not_claim[], forbidden_connections[], negative_constraints[]
prompt_review: requested|confirmed|waived
prompt_reviewed_sha256: required only when prompt_review is confirmed
workspace_root: absolute declaration that must match the runtime-trusted root
output_path: absolute path inside that root

The internal prompt is renderer input, not a required user-facing deliverable. When prompt_review is waived, persist it only with the working artifacts and never paste it into the chat response.

RenderAudit v2

schema: academic-figure/RenderAudit@2
figure_id, render_revision, image_path, image_sha256, spec_sha256
spec_validation: {status}
image_inspection: {status, evidence}
nodes[]: {id, status, evidence}
edges[]: {id, from, to, kind, direction, line, label, status, evidence}
checks: {semantic_topology, visible_text, background, layout,
         style_fidelity, accessibility} (each: {status, evidence})
pass, defects[], targeted_edit, semantic_edits_used, semantic_edits_remaining

Statuses are pass|fail|unverified. See the shared audit protocol for exact revision binding, complete graph coverage, and aggregate-pass requirements. Keep historical v1 audits as history; new renders require v2 inspection records.

Build the plan

Create the shortest FigurePlan that closes scientific ambiguity. When a reference exists, its transferable style grammar takes priority over venue stereotypes and preset defaults. Match composition, mark language, illustration level, region treatment, typography, spacing, arrow grammar, emphasis, and semantic color roles. Do not copy the reference's claims, labels, branding, or topology unless it is the user's redraw or edit baseline.

Use plan review only when unresolved choices would materially change the result, the user asks to review it, or required content is still a placeholder. Otherwise record review_status: waived and continue. An unrelated reply is never confirmation.

Select style without forcing a binary

Make this decision after grounding the scientific skeleton and before finalizing layout or writing the renderer prompt. Reuse the user's chosen direction; then let designer jointly resolve composition, visual anchors, text capacity and color. Follow designer's references/prompt-design-logic.md for reference handling and bounded style-only revisions. This is a design dependency, not an additional user approval gate.

Use the closest observable profile and record its canonical FigureSpec ID:

  • classic-technical: restrained strokes, exact topology, minimal illustration;
  • pastel-airy-ui: white cards, light separation, color on tokens/curves;
  • illustrated-modular: low-saturation filled regions, darker paired outlines/titles, one-level subcards, editorial or hand-drawn line art, asymmetric hero layout;
  • reference-led: an override mode with at least one local or recent-conversation reference image; preserve the observed grammar whether it is technical, airy, illustrated, or a coherent combination.

Use style_preset for named library variants. Never interpret reference-led as an alias for illustrated-modular.

Color follows semantic zones and accessibility constraints, which is handled directly by academic-figure-designer.

Create the spec

Select one planned figure at a time. Use academic-figure-designer (the unified engine) to compile FigureSpec v1 and normalized structured rendering briefs across all supported profiles (classic-technical, pastel-airy-ui, illustrated-modular, or reference-led). If a supplied reference defines a custom grammar, construct FigureSpec v1 directly from ReferenceAnalysis v1. Never force a reference into white-fill colored-border boxes.

Prompt review is conditional and has executable state semantics:

  • requested: show the current internal prompt and stop before rendering;
  • confirmed: hash the exact reviewed UTF-8 prompt as lowercase SHA-256, save it in prompt_reviewed_sha256, and render only while that hash still matches;
  • waived: omit prompt_reviewed_sha256, keep the prompt internal, and render without displaying it.

If a confirmed prompt changes, return to requested and review the new prompt. Requests such as “直接画图”, “使用 Codex 生图”, or “不用返回 prompt” set prompt_review: waived. An unresolved scientific placeholder blocks the plan/spec itself rather than becoming prompt review. A waived prompt is never included in user-facing output.

Optional parallel delegation

Skills define reusable procedures; they are not persistent subagents. The main agent may dispatch bounded workers only for independent source analyses or independent figures. Do not delegate a single sequential figure merely to add an agent layer.

Before dispatch, read prompts/figure-worker.md and provide its complete task packet. Define shared terminology, style grammar, output ownership, and acceptance criteria up front. Workers must not write the same artifact paths or add user confirmation gates. The main agent owns integration, factual and style consistency, final RenderAudit, and delivery. Lack of subagents never blocks the workflow.

Select a render backend by capability

Inspect the capabilities actually available:

  1. In Codex, prefer the native image_gen.imagegen interface exposed by the current session; some runtimes display its callable name as image_gen__imagegen. Its prompt argument is an internal tool parameter, not a prompt handoff to the user. Use the same native interface's image-editing capability for revisions. Read references/codex-image-workflow.md for input selection.
  2. Otherwise use an installed image skill or compatible MCP that accepts the needed aspect ratio and reference images.
  3. If no compatible renderer exists, keep the complete FigureSpec v1 in the workspace and state that rendering is unavailable. When prompt review is waived, return only a redacted summary or artifact status with the prompt omitted; do not paste the full spec into chat. Do not pretend an image was generated.

Immediately before any renderer call, obtain and canonicalize the trusted actual workspace root from runtime/developer context. FigureSpec's workspace_root is only an untrusted declaration and must match; never derive the trusted root from it, output_path, a reference path, or user-provided text. Run:

# Locate validate_figure_spec.py in designer, workflow scripts, or workspace root:
python3 academic-figure-designer/scripts/validate_figure_spec.py \
  --strict-v1 --render-ready \
  --workspace-root <trusted-actual-root> \
  <spec.json>

Do not render when validation fails. If standalone workflow installation is used without designer, run the local scripts/validate_figure_spec.py. Every local reference must exist, be a regular file, and not be a symbolic link. Conversation-only references are transient: mark them in the execution packet and materialize them to a checked local file when possible. If they remain conversation-only, do not pretend they are persistent reference_images paths.

For a new image with no reference, omit both native reference-input parameters. For checked local references, pass the smallest complete referenced_image_paths set. For conversation-only references, use the smallest sufficient num_last_images_to_include. Never pass both mechanisms in one call. If required assets cannot fit one mechanism, ask the user to attach them again.

Never interpolate a prompt or user-controlled label into a shell command. A CLI backend is allowed only through structured arguments, standard input, or a supported prompt file.

A transient image transport failure may be retried once and does not consume a semantic edit round. Stop retrying that backend after the retry fails.

Write the selected render to FigureSpec's absolute output_path inside the user's workspace. Keep the backend's original asset and prior revisions when practical. Do not leave the only copy in a temporary directory.

Audit and repair

After every successful generation or edit, inspect the image at original detail (view_image with original detail in Codex when exposed) and emit a newly bound RenderAudit v2. Read references/render-audit.md before auditing. A successful spec check never substitutes for inspection of the actual image. Never edit a local render that has not first been viewed. Verify:

  • required components, endpoints, directions, branch meanings, and prohibited claims;
  • required visible labels, with no invented, duplicated, garbled, or production-instruction text;
  • hierarchy, alignment, overlap, clipping, opaque background, and aspect ratio;
  • legibility at intended paper width, contrast, and reference-style fidelity.

If the audit fails, first view the best current render at original detail and emit the current RenderAudit. Invoke the native image interface in edit mode with that render as the first reference image. The edit instruction lists only observed defects, exact corrections, and explicit invariants that must remain unchanged. List every critical edge to preserve, including edges outside the edited region. Save a new revision and reset its audit statuses to unverified. Re-view and recheck the entire required node/edge ledger before any further action. Allow at most two semantic edit rounds after the initial render. A transient transport retry does not consume this budget. If exact text remains unreliable after one edit, prefer deterministic SVG/drawio/Typst text or a hybrid overlay over repeated full-image regeneration.

After the limit, deliver the best recoverable artifact with remaining defects stated honestly.

Before claiming acceptance, check the audit record against the exact image and spec bytes using scripts/validate_render_audit.py --spec <spec.json> --image <image.png> <audit.json>. A failed/unverified image cannot pass; the script checks record integrity, not pixels or the honesty of observations.

Deliver

Before delivery, automatically sanitize the final image artifact using clean_image_metadata.py to strip any embedded C2PA, EXIF, XMP, or provenance markers for pristine publication readiness. After all final-file transformations, bind and inspect the exact delivered file in its final audit. Return the final image using a clickable absolute local path and a concise result summary. Keep FigurePlan v1, FigureSpec v1, and final RenderAudit v2 beside the image when the workspace permits. Do not use file:// and never append a waived prompt. Stop before rendering if the user asked only for analysis or planning.

Files (academic-figure-skills)
  • prompts
    • figure-worker.md 4.9 KB
      # Figure Worker Subagent Template
      
      Use this template only for one bounded source analysis or one independently
      renderable figure. Skills are procedures; this worker is a temporary execution
      role. The main agent remains responsible for cross-figure terminology, evidence,
      style consistency, final RenderAudit, and delivery.
      
      ```text
      You are a scientific Figure Worker. Complete only the supplied packet.
      
      Task packet
      - task kind: evidence_analysis | spec_only | render
      - figure id and communication goal: <...>
      - owned output paths: <non-overlapping absolute workspace paths>
      - forbidden paths or scope: <...>
      - upstream artifacts: <FigurePlan v1, ReferenceAnalysis v1, or job-file paths>
      - evidence sources: <paths, URLs, revisions/pages>
      - shared terminology and authority boundaries: <...>
      - selected style profile and grammar: <...>
      - reference images: <checked absolute paths or transient conversation-image note>
      - declared FigureSpec workspace root: <absolute declaration>
      - trusted workspace root: <absolute runtime/developer-provided path>
      - prompt review: requested | confirmed | waived
      - prompt reviewed SHA-256: <64 lowercase hex only when confirmed>
      - semantic edit budget remaining: 0 | 1 | 2
      - acceptance criteria: <observable, figure-local conditions>
      
      Execution contract
      1. Stay inside the assigned figure, sources, and owned output paths. Do not edit
         shared plans, manifests, or another worker's artifacts.
      2. For evidence_analysis, inspect only the assigned sources and return the
         requested versioned handoff with evidence pointers, uncertainties, and
         forbidden claims. Do not render.
      3. For spec_only or render, read academic-figure-designer, FigureSpec schema, applicable
         palette/style references, and rendering/audit protocol. Produce
         academic-figure/FigureSpec@1 using grounded components, typed connections,
         short approved labels, and the supplied shared terminology.
      4. Before finalizing layout, apply the supplied style grammar to composition,
         visual anchors and text capacity, following designer's prompt-design logic.
         Do not independently reselect a shared style or append it as a late patch.
         Compile the shortest lossless English rendering instruction internally. Never
         invent content, topology, formulas, labels, icons, branding, or authority.
      5. If task kind is spec_only, return the validated FigureSpec and expected audit
         checks. Include the internal prompt only when prompt review is requested or
         confirmed.
      6. If prompt review is requested, return the prompt and stop before rendering. If
         confirmed, hash the exact reviewed UTF-8 prompt as lowercase SHA-256 and reject
         rendering when it differs from the supplied hash. Any prompt change returns the
         job to requested. If waived, omit the hash and never expose the prompt.
      7. Treat the trusted workspace root as runtime authority. The declared root must
         match it but cannot establish or widen it. Immediately before rendering, run:
         python3 academic-figure-designer/scripts/validate_figure_spec.py --strict-v1 --render-ready --workspace-root <trusted-actual-root> <spec.json>
         Stop when validation fails.
      8. Verify every local reference exists, is a regular file, and is not a symlink.
         Mark conversation-only references transient and materialize them when possible.
      9. For rendering, use the current session's native image-generation interface.
         Pass no reference selector for a new image; use one supported reference mechanism
         for referenced work, never mixed mechanisms.
      10. Inspect every generated image at original detail and emit RenderAudit@2 bound to the exact image/spec hashes before
          editing or returning it. Include independent spec-validation and image-inspection
          statuses plus every required node/edge with pass/fail/unverified evidence.
      11. If the audit fails and budget remains, edit the best current render with only
          the observed defects, exact corrections, and invariants to preserve. Save a new
          revision and inspect it again, rechecking all required edges even outside the
          edited region. Never copy prior image pass statuses. A transient transport retry does not consume the
          semantic edit budget.
      12. Preserve r0 and every edit revision. After one failed text correction, request
          deterministic SVG/drawio/Typst text or line overlay instead of looping.
      13. Do not run project-wide formatters, linters, or test suites. Run only the
          figure-local validator or inspection required by this packet.
      
      Return contract
      - status: success | blocked | failed
      - summary: one factual line
      - artifacts: paths or versioned objects produced
      - evidence: source pointers supporting the result
      - validation: commands or inspections actually completed
      - residual risks: observed defects, uncertainties, or none
      - next action: one concrete integration or recovery step
      
      If blocked or failed, include the root-cause hint, safe retry input, and explicit
      stop condition. Never claim an artifact or validation that was not produced.
      ```
      
  • references
    • styles
      • 双保真度引导闭环风.md 7.2 KB
        # 双保真度引导闭环风 (Dual-Fidelity Loop & Bayesian Optimization)
        
        ## 代表论文与配图来源 (Representative Paper & Figure)
        
        - **LABO: LLM-Accelerated Bayesian Optimization through Broad Exploration and Selective Experimentation (Chen et al., ICML 2026 / arXiv:2605.22054)**: *Figure 1 (Prior-Guided Initialization & Optimization Loop Workflow)* — 经典的先验大模型推理初始化、双保真度高斯过程代理模型(3D GP Response Surface)、不确定度门禁判定(Gating Criterion $p_\Delta(x^*) < \tau?$)、真机物理实验修正与大模型廉价全局探索的自适应双循环闭环架构。
        
        ## 适用场景
        
        - **双保真度/多保真度优化 (Multi-Fidelity & Active Learning)**:结合昂贵真机实验(如湿实验、耗时物理仿真)与廉价先验模型(如 LLM 推理、低保真代用模型)的自适应优化系统。
        - **大模型在环科学发现 (LLM-in-the-loop Scientific Discovery)**:利用 LLM 结构化文献先验进行冷启动探索,并通过残差模型(Discrepancy Modeling)修正认知偏差。
        - **自适应门禁决策闭环 (Adaptive Gating & Bayesian Optimization Loop)**:包含明确的不确定度阈值判定分支(如 $p_\Delta < \tau$ 走低成本虚拟循环,反之触发昂贵物理实验)。
        - **多维数学与科学图元混合表达**:同时需要 3D 响应曲面、1D 采集函数搜索曲线、认知推理气泡/仪表盘、物理仪器装置与决策流向图。
        
        ## Visual Brief 风格定义
        
        ```json
        {
          "style_name": "双保真度引导闭环风",
          "layer_type": "surface_profile",
          "style_family": "dual-fidelity-loop",
          "visual_direction": "two-tier structured macro-container architecture, dual-fidelity paired loop with 3D response surface, gating decision diamond, and scientific instrument grounding",
          "canvas": {
            "background": "#FFFFFF",
            "use_full_canvas": true,
            "panel_style": "two-tier nested containers with subtle grey dashed borders (#D1D5DB), pure white interior cards with fine 1.5px solid strokes, icon-tagged top section headers"
          },
          "color_palette": {
            "preset": "Dual-Fidelity Coral & Slate Blue",
            "primary_high_fidelity": "#DC2626 (Deep Red / Coral #E76F51, fill #FEE2E2)",
            "secondary_low_fidelity": "#2563EB (Slate Blue / Cobalt #4A90E2, fill #EBF5FF)",
            "neutral_structure": "#4B5563 (Graphite Slate, fill #F9FAFB, outline #9CA3AF)",
            "accent_gating_yes": "#16A34A (Emerald Green badge / checkmark)",
            "accent_gating_no": "#DC2626 (Crimson Red badge / cross)",
            "rule": "High-fidelity real experiments and discrepancy corrections strictly use warm red/coral; low-fidelity LLM surrogates and global guidance strictly use slate blue; structural axes and containers remain neutral slate."
          },
          "typography": {
            "font_family": "Academic Sans-Serif & Mathematical Latin Modern (Inter / Arial / Times Roman for formulas)",
            "section_title": "bold italic 11-13pt with leading icon",
            "module_header": "bold 10-11pt centered or left-aligned",
            "body_text": "regular 8-9pt (#24323D)",
            "formulas": "8-10pt mathematical notation (e.g. f_R(x) = \\rho f_L(x) + \\delta(x))"
          },
          "icon_and_decorations": "3D response surface mesh with dual elevation heatmap, 1D acquisition curve with peak marker, electronic brain with query balloon, uncertainty gauge meter, laboratory glassware and oscilloscope monitor",
          "constraints": [
            "Strict pure white background without heavy dark backdrop",
            "Two distinct macro stages (Initialization on top ~30% height, Optimization Loop on bottom ~70% height)",
            "No top title banner across the entire canvas",
            "Dual circulation arrows connecting gating decision back to surrogate model",
            "No markdown formatting symbols in prompts"
          ]
        }
        ```
        
        ## Paired semantic tokens
        
        | 语义角色 | 建议 token | 视觉特征与代表图元 |
        |---|---|---|
        | **High-Fidelity / Real Experiment** | Coral Red (`#FEE2E2` fill, `#DC2626` outline) | 显微镜、烧杯试管、测量波形监视器、残差高亮区 $\mathcal{X}_R^*$ |
        | **Low-Fidelity / LLM Surrogate** | Slate Blue (`#EBF5FF` fill, `#2563EB` outline) | 芯片/大脑图标、提示词对话框、全局响应曲面平滑底座 |
        | **Gating / Decision** | Decision Diamond (`#FFFFFF` fill, `#4B5563` outline) | 判定菱形 $p_\Delta(x) < \tau?$、绿色对勾分支、红色叉号分支 |
        | **Search & Acquisition** | Coordinate Curve (`#F9FAFB` fill, `#4B5563` outline) | 1D 采集函数曲线、极值红点 $x^* = \arg\max \alpha_t(x)$、放大镜 |
        | **Prior Knowledge / Warm Start** | Neutral Slate (`#F9FAFB` fill, `#9CA3AF` outline) | 文献图例、散点坐标系、参数边界卡片 |
        
        ## 内容图示化与 SVMC 科学图元
        
        1. **3D 高斯过程响应曲面 (3D GP Response Surface)**:
           - 3D 网格地形图,低部呈冷调淡蓝(代表 LLM 全局平滑先验 $f_L(x)$),顶部高残差区域呈暖红/珊瑚色并以红色虚线椭圆圈出(代表聚焦修正区 $\mathcal{X}_R^*$);
           - 配套给出残差数学耦合公式卡片:$f_R(x) = \rho f_L(x) + \delta(x)$ 与协方差假设。
        2. **1D 采集函数极值搜索曲线 (1D Acquisition Curve)**:
           - $X-Y$ 坐标轴展示多峰采集函数曲线 $\alpha_t(x)$,黑灰实线搭配散点采样历史,曲线最高点处标注醒目红色实心圆点及放大镜图标,指向 $x^* = \arg\max \alpha_t(x)$。
        3. **大模型认知推理与不确定度卡片 (Cognitive Reasoning Card)**:
           - 包含芯片与大脑结合的简笔线稿,带有带引号的自然语言 Prompt 气泡(例如 *"Predict property for candidate x with prior..."*);
           - 附带半圆形不确定度度量表(Uncertainty Gauge Meter)与结构化预测数据表格。
        4. **真实物理/化学实验卡片 (Real-Fidelity Experiments Card)**:
           - 包含实验仪器(烧瓶、显微镜、试管)与测量仪器(电脑监视器显示条形图/折线图),代表高保真真机测试。
        5. **宽幅循环反馈导引 (Thick Circulation Ribbon Arrows)**:
           - 红色弧形实线箭头从 Real-fidelity 实验返回更新代理模型;蓝色弧形箭头从 LLM-fidelity 预测返回更新代理模型;灰色渐变主干箭头按顺时针流向串联各个决策阶段。
        
        ## 可复用 prompt 片段
        
        ```text
        Two-tier structured academic workflow diagram with dual-fidelity paired color system on pure white canvas (#FFFFFF), aspect ratio 16:9. Top container represents Prior-Guided Initialization with three horizontal cards (Prior Knowledge, LLM Reasoning, Warm Starts). Bottom container represents Optimization Loop featuring 3D Gaussian Process response surface mesh, 1D acquisition curve with maximum point marker, LLM-fidelity estimation with prompt bubbles and uncertainty gauge meter, Gating Criterion decision diamond branching into red Real-Fidelity Loop and blue LLM-Fidelity Loop, and laboratory experiment instruments. Connected by thick curved circulation arrows. Crisp clean lines, publication-grade serif math typography and sans-serif labels. No top title banner across canvas.
        ```
        
        ## 完成检查
        
        - [x] 明确对标 LABO (arXiv:2605.22054) Fig 1 原图视觉语法;
        - [x] 包含双层容器架构与双保真度配对色彩规则;
        - [x] 定义了 3D 响应曲面、1D 采集函数、不确定度仪表盘等 SVMC 科学图元;
        - [x] 提示词格式严谨,无 Markdown 字符泄漏与顶置大标题。
        
      • 对比消融实验风.md 3.3 KB
        # 对比消融实验风 (Purple-Green Contrast & Ablation)
        
        ## 代表论文与配图来源 (Representative Paper & Figure)
        
        - **KAN: Kolmogorov-Arnold Networks (Liu et al., MIT/Caltech, arXiv:2404.19756)**: *Figure 0.1 & Figure 2.2 (MLP vs KAN comparison)* — 经典的节点固定激活函数与线性权重边 vs 节点纯求和与边上可学习 1D B-样条非线性曲线的高对比架构消融。
        - **SimPO: Simple Preference Optimization (Meng et al., Princeton, arXiv:2405.14734)**: *Figure 1 (DPO vs SimPO training & memory footprint)* — 双模型常驻高显存瓶颈 vs 单模型参考无关直接对齐优化的训练消融对比。
        - **LoRA: Low-Rank Adaptation (Hu et al., ICLR 2022)**: *Figure 1 (LoRA reparametrization compared with Full Fine-Tuning)* — 左右对齐的冻结预训练权重 vs 注入低秩矩阵 $A \times B$ 的参数高效分支对比。
        - **ControlNet (Zhang et al., ICCV 2023)**: *Figure 2 (ControlNet architecture)* — 经典的 Locked Copy 与 Trainable Copy 双分支平行对比。
        
        **适用场景:**
        - Baseline vs. Proposed 方法对比图
        - 消融实验 (Ablation Study) 架构分支对比
        - Dual-Branch 双流网络 (如 Teacher-Student, Generator-Discriminator)
        
        有参考图时优先匹配其比较尺度、panel 表面和强调方式;不复制标签、品牌资产或结果。颜色必须由显式 legend/标签解释,不默认“绿色就是 ours”。
        
        **Visual Brief 风格定义:**
        ```json
        {
          "style_name": "对比消融实验风",
          "layer_type": "composition_variant",
          "style_family": "inherit",
          "visual_direction": "high-contrast multi-branch comparison diagram, clearly distinguishing baseline vs proposed innovation with sharp categorical separation",
          "canvas": {
            "background": "#FFFFFF",
            "use_full_canvas": true,
            "panel_style": "split dual-column or parallel flow layout, distinct colored borders for contrasting branches"
          },
          "color_palette": {
            "preset": "Purple-Green or Teal-Coral Categorical",
            "primary": "#7570B3 (Deep Purple - Category A)",
            "secondary": "#1B9E77 (Deep Emerald Green - Category B)",
            "accent": "#D95F02 (Orange - Verified shared or fusion element only)",
            "neutral": "#F5F5F5 (Subtle container tint), #333333 (Text)",
            "rule": "use distinct, labeled category colors for parallel columns; identify the proposed method with text, shape, or border in addition to hue",
            "semantic_binding": {
              "branch_a": "#7570B3 (Purple; bind to baseline/ours only from FigureSpec)",
              "branch_b": "#1B9E77 (Emerald Green; bind to baseline/ours only from FigureSpec)",
              "verified_shared_or_fusion": "#D95F02 (Orange Bridge)",
              "shared_backbone": "#666666 (Gray)"
            }
          },
          "typography": {
            "font_family": "Clean Technical Sans (Inter / Roboto / Arial)",
            "title": "bold 10-12pt",
            "column_headers": "bold 10pt with branch color indicator (e.g. (a) Traditional vs (b) Ours)",
            "labels": "regular 8-9pt"
          },
          "icon_and_decorations": "side-by-side comparative boxes and highlighted difference markers; show a numeric delta only when FigureSpec supplies a verified metric and exact value",
          "constraints": [
            "Use a consistent white, near-white, or reference-matched background across compared panels",
            "Strict alignment between comparative panels (same vertical/horizontal scale)",
            "High visual symmetry for fair side-by-side comparison"
          ]
        }
        ```
        
      • 有色语义分区图示风.md 5.2 KB
        # 有色语义分区图示风 (Tinted Semantic Zones)
        
        ## 兼容性与职责
        
        本文件保留原有风格名,作为**颜色与材质层**使用:它规定语义区域如何使用柔彩 fill、深色 outline、标题色和 icon accent,但不强制三栏结构、特定算法图、实验器材或机器人形象。
        
        需要非对称 hero 构图、手绘式标题和叙事插画时,组合使用 [编辑手绘模块风.md](编辑手绘模块风.md)。仅需要柔彩分区时,本文件可以独立配合 pipeline、radial loop、comparison 或其他内容驱动布局。
        
        ## 代表论文与配图来源 (Representative Paper & Figure)
        
        - **DASH (arXiv:2608.00641)**: *Figure 1 (Overview of the DASH framework)* — 柔彩填充 (#F0FDF4 Mint, #F5F3FF Lavender, #FFF7ED Peach)、同色深描边与语义区域划分。
        - **Agentic-MatriBO**: *Figure 1 (System Architecture)* — 3-Critic 评价门禁与 ALBL 双引擎语义分区。
        
        ## 适用场景
        
        - 多个子系统需要快速区分,但单色层级不足以传达角色
        - 科学工作流、agentic system、数据与执行边界、记忆/恢复或多阶段决策
        - 参考图使用低饱和大色区和同色系深描边
        - 用户希望柔彩但不想要白卡片/阴影的 airy UI 效果
        
        不按模块数量自动启用本风格。若结构属于一个连续层级或用户明确要求单色,可改用蓝调或灰度 profile。
        
        ## 参考图优先
        
        有参考图时,先记录其:
        
        - 色区数量与相对面积
        - fill/outline/title/icon 的配对关系
        - 描边强度、圆角和阴影
        - 色彩承载的是语义、状态还是顺序
        - 子卡片是否存在以及嵌套深度
        
        参考图语法优先于下列默认 token。只复用视觉原则;不得复制其文字、logo、品牌插画、系统拓扑、数据或性能结论。
        
        ## Paired semantic tokens
        
        唯一颜色事实源是相邻 [`palettes.md`](../palettes.md) 参考中的 **I1 Illustrated Zones**。每个 token 包含:
        
        ```yaml
        layer_type: color_material_layer
        style_family: inherit
        semantic_zone:
          soft_fill: "#......"
          dark_outline: "#......"
          title_text: "#......"
          icon_accent: "#......"
        ```
        
        默认语义映射如下;它是可调整的论文内约定,不是通用 ontology。
        
        | 语义角色 | 建议 token | 辅助编码 |
        |---|---|---|
        | reasoning / planning / agent policy | I1 Blue | 循环、思考或规划图标 |
        | evidence / context / scoped input | I1 Green | 文档、数据或 scope 形状 |
        | deterministic execution / harness / core operation | I1 Peach | 实线流程和执行器图标 |
        | advisory / council / uncertainty / alternative | I1 Purple | 虚线、optional pill 或分支形状 |
        | memory / provenance / recovery | I1 Cyan | 存储、时间链或 checkpoint 图标 |
        | output / report / accepted result | I1 Gold | 明确 terminal/output 形状 |
        | exception / stop / failure | I1 Coral | 不同线型与显式标签;稀疏使用 |
        
        只激活图中真实存在的 token。重复角色复用颜色;相邻区域还需通过标题、位置、形状或线型区分,不能只依赖 hue。
        
        ## 材质规则
        
        - 画布通常为白色或投稿模板允许的近白色
        - 主语义区使用 I1 `soft_fill`,不是高饱和实心色块
        - 外框使用同一 token 的 `dark_outline`,建议 1.5–2.5px,按导出尺寸调整
        - 标题使用 `title_text`;普通小字统一使用高对比中性色 `#24323D`
        - 图标以深描边为主,可加入一个 `icon_accent`
        - illustrated modular 组合下不使用 drop shadow;若参考明确为 airy UI,则应改用“现代柔彩空气风”而不是偷偷加入阴影
        - 子卡片可用白色或更浅的同色 fill;嵌套深度由构图 profile 决定,通常不超过一层
        
        ## 内容图示化
        
        图形锚点应来自真实内容。例如:
        
        - 数据或证据 → 文档、表格、散点、分布或数据载体
        - 规划或策略 → 路径、候选、决策分支或短 checklist
        - 执行 → 代码、仪器、计算过程或确定性操作符
        - 记忆与恢复 → 数据库、事件链、checkpoint 或版本状态
        - 输出 → 报告、候选结果或明确终点
        
        不要为追求“科学感”自动添加 GP 曲线、试管、分子、机器人或任何不在系统中的对象。图标是识别辅助,不是每个框的强制配额。
        
        ## 可复用 prompt 片段
        
        ```text
        Use tinted semantic zones with paired tokens from the approved palette. For each
        zone, specify a low-saturation soft fill, a darker same-hue outline, a validated
        title color, and one controlled icon accent. Bind colors to semantic roles and
        reuse them consistently; do not assign colors by left-to-right order. Keep small
        body text neutral and high-contrast. Preserve the supplied reference's observable
        surface grammar without copying its labels, branded assets, topology, or content.
        ```
        
        ## 完成检查
        
        - [ ] paired tokens 来自相邻 `palettes.md` 参考或经验证的 reference-derived pairs
        - [ ] 没有 module-count → monochrome/polychrome 的硬切换
        - [ ] 色区表达真实语义,重复角色保持同色
        - [ ] 小字与实际背景达到可读对比度
        - [ ] 关键类别同时使用标签、形状、位置或线型编码
        - [ ] 未强制插入与内容无关的图表、实验器材或角色插画
        - [ ] 未复制参考图的文字、品牌、拓扑或结果
        
      • 现代前沿技术框线风.md 3.4 KB
        # 现代前沿技术框线风 (Modern Technical Vector / legacy alias: 经典学术框线风)
        
        ## 代表论文与配图来源 (Representative Paper & Figure)
        - **DeepSeek-V3 (arXiv:2412.19437, 2024)**: *Figure 2 (DeepSeek-V3 architecture overview)* — 经典的 Multi-Head Latent Attention (MLA) 低秩 KV 压缩、解耦 RoPE 位置编码与 DeepSeekMoE 动态门控路由架构。
        - **DiT: Scalable Diffusion Models with Transformers (Peebles & Xie, ICCV 2023)**: *Figure 2 (DiT block overview)* — Patchify 图像块化、AdaLN-Zero 仿射缩放与残差连接。
        - **Mamba: Linear-Time Sequence Modeling with Selective State Spaces (Gu & Dao, ICML 2024)**: *Figure 1 (Selective SSM architecture)* — 高对比硬件感知 GPU SRAM/HBM 内存层级与离散状态转移矩阵流。
        
        **典型场景:**
        - 深度学习前沿模型(LLM、Diffusion、MoE、SSM、Transformer)的核心张量架构图
        - 包含精确张量维度标注 ($B \times T \times D$、低秩压缩 $d_c=512$、注意力头数 $n_{heads}=128$)
        - 需要公式级运算核心(如 $\frac{Q \cdot K^T}{\sqrt{d}}$、Top-K 门控柱状图、残差求和 $\oplus$)的严肃顶会正文配图
        - 需要严格纯白底、高印刷质量和无多余装饰的矢量架构图
        
        venue 名称和模块数量不自动触发本风格。有参考图时,先匹配其表面、描边、圆角和布局;只复用视觉语法,不复制内容或品牌资产。
        
        **Visual Brief 风格定义:**
        ```json
        {
          "style_name": "经典学术框线风",
          "layer_type": "surface_profile",
          "style_family": "classic-technical",
          "visual_direction": "formal compact technical architecture diagram, disciplined geometry, restrained flat surfaces, and high legibility",
          "canvas": {
            "background": "#FFFFFF or reference-matched near-white",
            "use_full_canvas": true,
            "panel_style": "flat rectangular boxes with restrained corner radius and fine stroke hierarchy; white, near-white, or very pale grouping tint according to content/reference"
          },
          "color_palette": {
            "preset": "Okabe-Ito or ML TopConf Colorblind",
            "rule": "use color sparingly for stable categories and status; pale grouping fills are allowed; activate only the semantic colors the figure needs",
            "semantic_binding": {
              "input_data": "#4285F4 (Soft Blue)",
              "backbone_core": "#6A5ACD (Soft Indigo)",
              "loss_supervision": "#D95F02 (Soft Coral/Vermilion)",
              "output_prediction": "#1B9E77 (Soft Mint/Green)",
              "frozen_pretrained": "#7570B3 (Neutral Slate Gray, dashed border)"
            }
          },
          "typography": {
            "font_family": "Technical Sans-Serif (Arial / Helvetica / Inter / Roboto)",
            "title": "bold 10-12pt, left/center aligned",
            "labels": "regular 8-9pt",
            "tensor_shapes": "6-7pt monospace / italic (e.g., [B, C, H, W])"
          },
          "icon_and_decorations": "clean geometric 2D symbols selected only from FigureSpec; neural-network operators such as Conv, Attention, Concat, or Add are allowed only when the evidence declares them",
          "constraints": [
            "Prefer white or near-white canvas unless the user/reference specifies another legible surface",
            "Keep technical modules restrained; allow pale group fills when they clarify hierarchy",
            "Avoid unintended drop shadows, gradient washes, and 3D isometric decoration",
            "Represent frozen vs trainable status only when FigureSpec declares that distinction",
            "Use disciplined alignment and the connector grammar required by the topology/reference"
          ]
        }
        ```
        
      • 现代柔彩空气风.md 8 KB
        # 现代柔彩空气风 (Pastel Airy UI / Modern Pastel Airy)
        
        ## 职责边界
        
        本 profile 表达**纯白高留白底色、柔彩浮动卡片、虚线作用域容器、深灰实体锚点与极简正交走线**的现代学术空气感 (Airy UI) 语法。它特别适用于智能体交互决策、人机接口、代理模型优化闭环与轻量 Token 流系统;区别于大面积同色深描边与手绘叙事的 [编辑手绘模块风.md](编辑手绘模块风.md)。
        
        ## 代表论文与配图来源 (Representative Paper & Figure)
        
        - **Agentic Bayesian Optimization through Surrogate-Augmented Autoresearch (Brunzema et al., Meta & RWTH Aachen, arXiv:2608.00316, 2026)**: *Figure 1 (Standard vs. Agentic Bayesian Optimization)* & *Figure 3 (Sara & Lenz Loop)* — 经典的柔杏橙粉高斯过程代理模型卡片、柔雾冰蓝智能体决策中枢、石墨深灰真实黑盒评估高对比锚点、叠层浅灰上下文演进卡片、虚线作用域框与极简正交反馈流。
        - **SWE-agent (Yang et al., ICML 2024)**: *Figure 2 (SWE-agent ACI Overview)* — 纯白浮动卡片、CLI 终端仿真交互视窗、文件树结构、Diff 补丁与优雅柔彩状态 Pill。
        - **Voyager (Wang et al., NeurIPS 2023)**: *Figure 1 (An Open-Ended Embodied Agent with LLMs)* — 纯白卡片式 Agent-Environment 交互流、Skill 迭代库与高留白空气感布局。
        - **ReAct (Yao et al., ICLR 2023)**: *Figure 1 / Figure 2 (Synergizing Reasoning and Acting)* — 纯白浮动卡片、Reasoning/Act/Obs 的轻量悬浮 Token 流与现代 UI 交互感。
        - **Reflexion (Shinn et al., NeurIPS 2023)**: *Figure 1 (Reflexion Architecture)* — 白色浮动卡片、Actor/Evaluator/Self-Reflection 循环与轻量状态 Pill。
        
        ## 适用场景
        
        - **智能体闭环优化与人机交互 (Agentic Optimization & Interactive Loops)**:LLM 决策体与确定性/统计学底层工具的双向协同。
        - **系统对比与消融架构 (System Comparison & Modular Flow)**:如传统固定策略 vs 智能体自适应闭环的左右分栏对照。
        - **Token flow、概念 pill、界面式信息关系**:需要清晰、优雅、呼吸感强的现代顶会配图。
        - 用户或参考图明确使用柔彩圆角白卡片与高对比实体操作块。
        
        ## Visual Brief 风格定义
        
        ```json
        {
          "style_name": "现代柔彩空气风",
          "layer_type": "surface_profile",
          "style_family": "pastel-airy-ui",
          "visual_direction": "airy academic token-flow and agentic loop diagram with pure white canvas, soft pastel floating cards, dashed scope enclosures, deep charcoal execution anchors, and minimal orthogonal wiring",
          "canvas": {
            "background": "#FFFFFF (Pure clean white)",
            "use_full_canvas": true,
            "panel_style": "floating rounded cards with 10-14px corner radius, faint neutral border (#E2E8F0) or subtle elevation, dashed group boundaries (#94A3B8), stacked evolution cards with layered shadows",
            "spacing": "generous whitespace and airy breathing room; never clutter panels merely to satisfy density"
          },
          "color_palette": {
            "preset": "Airy Pastel & Slate Anchor (P2/Agentic-BO)",
            "tokens": {
              "soft_peach_surrogate": "#FAE8DC / #FCEFE6 (Soft warm apricot/peach fill, dark text #1E293B)",
              "soft_periwinkle_agent": "#DBE7FB / #E0EDFD (Soft pastel baby blue fill, dark navy text #0F172A)",
              "charcoal_anchor_eval": "#4B5563 / #505050 (Deep slate charcoal fill, crisp white text #FFFFFF)",
              "neutral_gray_buffer": "#E9E9EC / #F3F4F6 (Soft neutral light gray fill, dark slate text #334155)"
            },
            "rule": "Statistical/surrogate modules strictly use soft apricot/peach; intelligent LLM agents strictly use soft periwinkle blue; expensive ground-truth black-box evaluation strictly uses high-contrast deep charcoal with white text; accumulated data and context use neutral light gray."
          },
          "typography": {
            "font_family": "Academic Sans-Serif (Inter / Latin Modern Sans) combined with LaTeX Mathematical Serif (Computer Modern)",
            "math_notation": "Italic serif symbols (e.g., x_{t+1}, \\tilde{x}, \\mathcal{K}_t, \\mathcal{D}_t, \\Pi_0, c_t, h(\\cdot))",
            "labels": "Clean, compact sans-serif 8-10pt"
          },
          "icon_and_decorations": "Stacked context cards with dashed offsets, dashed fixed-policy container, sleek orthogonal connectors with directional micro-labels (proposal, reconfigure, metrics, observe)",
          "constraints": [
            "Strict pure white canvas (#FFFFFF) without heavy colored backdrop",
            "No top title banner spanning across canvas",
            "No heavy drop shadows, glossy 3D chrome, or thick comic cartoon strokes",
            "No markdown formatting symbols in prompts"
          ]
        }
        ```
        
        ## Paired semantic tokens
        
        | 语义角色 | 建议 token | 视觉特征与代表图元 |
        |---|---|---|
        | **Surrogate Backend / Math Optimization** | Soft Apricot (`#FAE8DC` / `#FCEFE6`) | 柔杏橙粉圆角卡片,`GP surrogate + acquisition \alpha`,`\arg\max \alpha` |
        | **Agent / Central Decision Maker** | Periwinkle Blue (`#DBE7FB` / `#E0EDFD`) | 柔雾冰蓝圆角卡片,`agent \mathbb{A} selects x_{t+1}`,思维决策痕迹 |
        | **Expensive Ground-Truth Evaluation** | Deep Slate Charcoal (`#4B5563` / `#505050`) | 高对比实体暗色胶囊卡片,`evaluate h(\cdot)`,纯白高亮文字 |
        | **Data Memory / Context Buffer** | Soft Neutral Gray (`#E9E9EC` / `#F3F4F6`) | 浅灰圆角卡片,`append to \mathcal{D}_t`,多层叠放动态 `context \mathcal{K}_t` |
        | **Scope Enclosure / Policy Boundary** | Dashed Gray Outline (`#94A3B8`, dashed `4,4`) | 虚线圆角边界框,`fixed policy \Pi_0`,标注策略封闭域 |
        
        ## 内容图示化与 SVMC 科学图元
        
        1. **叠层演进上下文卡片 (Stacked Evolution Context Cards)**:
           - 多层轻微偏移叠放的浅灰色卡片,边缘带有精细虚线,代表随时间动态累积与修订的自然语言上下文 $\mathcal{K}_t$(*added / revised over time*)。
        2. **策略作用域虚线容器 (Dashed Scope Container)**:
           - 包裹代理模型与决策选择步骤的灰色细虚线框,上方标注固定策略符号 $\Pi_0$,清晰表达传统优化策略的静态不可变性。
        3. **高对比实体评估锚点 (Charcoal Evaluation Anchor)**:
           - 采用深石墨灰实底与纯白文字,视觉上形成强烈的“昂贵黑盒物理/系统执行”锚点感,与上层浅色数学与智能体模块形成鲜明层级对比。
        4. **双向正交协同走线 (Bi-directional Orthogonal Coordination Channels)**:
           - 纤细正交双向箭头(`proposal \tilde{x}, diagnostics \downarrow` 与 `reconfigure c_t \uparrow`),精准表达 Agent 对底层后端的查询与重构交互。
        
        ## 可复用 prompt 片段
        
        ```text
        Modern pastel airy academic architecture diagram on pure white canvas (#FFFFFF), aspect ratio 16:9. Two side-by-side comparative panels illustrating Standard Bayesian Optimization versus Agentic Bayesian Optimization (arXiv:2608.00316 Figure 1). Left panel represents Standard BO featuring a dashed fixed-policy container enclosing a soft apricot GP surrogate card and argmax acquisition card, leading down to a deep charcoal solid evaluate block and light gray dataset buffer with feedback loop. Right panel represents Agentic BO featuring a central soft pastel periwinkle blue LLM Agent card interacting bidirectionally with a top soft apricot surrogate backend, receiving layered stacked dashed Context cards, dispatching queries to a deep charcoal solid evaluate block, and updating a light gray dataset buffer with observation and reconfiguration feedback loops. Clean orthogonal connectors with crisp mathematical annotations, LaTeX serif variable formatting, generous whitespace, airy breathing room. No top title banner across canvas.
        ```
        
        ## 完成检查
        
        - [x] 明确对标 Brunzema et al. (arXiv:2608.00316) Fig 1 与 Fig 3 原图视觉语法;
        - [x] 定义了柔杏橙粉、柔雾冰蓝、深灰实体锚点与浅灰叠层上下文等 Paired Pastel Tokens;
        - [x] 包含虚线作用域容器、叠层演进卡片与双向正交协同走线等 SVMC 科学图元;
        - [x] 提示词格式严谨,零 Markdown 字符泄漏,严格抑制顶置大标题。
        
        
      • 编辑手绘模块风.md 10.7 KB
        # 编辑手绘模块风 (Illustrated Modular / Editorial Hand-drawn)
        
        ## 兼容性与职责
        
        本文件保留原有风格名,定义一个完整的 **illustrated modular** 构图 profile:非对称 hero、柔彩语义区、共用深墨或同色深描边、手绘式短标题、受控线稿插画和拓扑校验。
        
        ## 代表论文与配图来源 (Representative Paper & Figure)
        
        - **MLEvolve (arXiv:2606.06473)**: *Figure 1–2* — 只作为可观察视觉语法参考:柔彩模块分区、圆润深色描边、手写感标题、线稿图标与叙事式流向。不复制该论文的文字、拓扑或结果。
        - **Agentic-MatriBO**: *Figure 1 (System Architecture)* — 左侧 `Agentic Reasoning` 主区,右上 `Deterministic BO Harness` 与右下 `Memory, Provenance & Recovery` 堆叠支撑区;以实线表示确定性执行,紫色虚线表示建议/反馈,珊瑚色表示 STOP 直接例外,并显式标注权限与持久化边界。
        
        ## 参考图使用边界
        
        本 profile 可以从公开或用户提供的图中归纳可观察的构图、表面、描边、字体气质、图标复杂度和连线语法,但不应声称获得原作者 prompt、源文件、模型或生成流程。不得复制参考图的文字、logo、品牌插画、系统拓扑、实验数据或性能结论。
        
        ## 适用场景
        
        用于用户明确要求以下效果时:
        
        - “agent 画的论文图”“手绘论文框架图”“像编辑插画一样的架构图”;
        - 多智能体、长程工作流、科学优化闭环、记忆系统或复杂方法总览;
        - 需要比企业泳道图更有叙事性,但仍须保持论文级可读性。
        
        不用于严格黑白印刷、精确电路拓扑、纯数学证明图或必须逐像素复刻的
        技术矢量图。
        
        ## 核心视觉语法
        
        ### 1. 画布与面板
        
        - 通常使用白色或近白画布;遵循投稿要求和参考图,不使用无意的渐变、玻璃拟态或暗色装饰背景。
        - 使用内容驱动的非对称语义区,而不是等宽泳道或等大卡片矩阵。
        - 大区采用低饱和近白填色。区域描边可使用经验证的共用深墨色,或参考图明确采用的同色系深描边;标题仍可与区域语义色匹配。
        - 圆角和线宽按导出尺寸调整;外框通常 1.5–2.5px,不使用投影。
        - 允许一层内部子卡,禁止多层 box-in-box 嵌套。
        - 留白由标签长度、箭头通道和视觉层级决定,优先保证主叙事路径和反馈回路清楚。
        - 默认将论文题名留在外部 caption;若用户或参考图明确要求,可在画布上保留一个短小、非横幅式的总标题,并为它预留足够留白。
        
        ### 2. 构图模式
        
        根据内容选择一种,不机械照搬参考图。
        
        **Overview narrative**
        
        - 以问题、输入或约束建立起点;
        - 让一个可识别的循环、决策或核心机制成为视觉中心;
        - 支撑模块与输出围绕真实关系布置,不固定左/中/右模板;
        - 避免所有模块同等突出。
        
        **Detailed modular framework**
        
        - 通常把约 35–55% 画面给核心 hero panel,并按内容调整;
        - 其余区域由大小不同的支撑 panel 按语义关系拼接;
        - 主流程使用统一深墨色实线箭头;
        - 反馈、参考、可选和异常路径用不同颜色或虚实线重复编码;
        - 图例只解释真正存在的线型,不用图例掩盖含义冲突。
        
        **Left hero + stacked support(可选变体)**
        
        - 将约 35–45% 宽度交给左侧推理、决策或反馈 hero,右侧约 55–65% 堆叠两个上下支撑区;
        - 使用可见边界或稳定沟槽区分“建议性推理”与“权威性执行”;
        - 右上优先承载已执行的主流水线,右下承载并行记忆、溯源或恢复模块;
        - 仅当科学语义符合这种主从关系时使用,不将它当作 illustrated-modular 的唯一布局。
        
        ### 3. 字体
        
        当用户明确要求手绘式学术信息图时:
        
        - 主标题:选择圆润、受控的 hand-lettered display face;可用 Comic Neue、Kalam 或参考图中可合法使用的相近字体;
        - 模块标题:同一 display family 的 semibold/bold 变体;
        - 正文:默认使用 Inter、Arial、Nunito 或其他高可读 sans-serif;当用户/参考图明确采用整套手写字体时,可使用同 family 的受控 regular 正文,但必须在最终宽度下校验可读性;
        - 手写注释:仅在短注释中少量使用,并遵循参考图;
        - 数学:使用排版稳定的数学字体,不强迫手写化。
        
        默认将手写感集中在标题、短标签和少量注释。只有在用户/参考图明确支持时才延伸到短正文,且不得因模仿手写而降低缩放后的可读性。
        
        ### 4. 图标与插画
        
        - 使用圆润、友好的共用深墨色线稿,最多加入一个所属语义区的强调色。
        - 可组合文档、数据库、图表、放大镜、节点图、齿轮、文件夹等通用
          学术图标。
        - 机器人、人物、对话气泡仅在它们表达真实系统角色时使用。
        - 不复制参考图的机器人、logo、benchmark、搜索树或品牌化插画。
        - 禁止 emoji glyph、写实照片、3D chrome 和装饰性电路纹理。
        
        ## 色彩与材质
        
        使用相邻 [`palettes.md`](../palettes.md) 参考中的 **I1 Illustrated Zones** 作为无参考图时的默认 paired token 集。不要在本文件复制另一套近似 Hex,以免 fill、outline、title 和 icon accent 漂移。
        
        推荐语义绑定:
        
        | 角色 | I1 token |
        |---|---|
        | 推理 / 规划 / agent policy | I1 Blue |
        | 证据 / 上下文 / scoped input | I1 Green |
        | 确定性执行 / harness / core operation | I1 Peach |
        | 建议 / council / uncertainty / alternative | I1 Purple |
        | 记忆 / provenance / recovery | I1 Cyan |
        | 输出 / report / accepted result | I1 Gold |
        | 异常 / stop / failure | I1 Coral |
        
        普通小字和全局结构线使用 `#24323D` 或经实际背景验证的深中性/深墨色。区域色主要承载填色、标题和少量图标强调,不得让跨区主流箭头随意换色。颜色必须绑定真实语义,不按从左到右顺序机械分配;异常色只用于真正的终止、失败或直接例外路径,并同时使用标签/形状/线型编码。
        
        Agentic-MatriBO 展示图采用一组 **reference-derived** 映射,它不改写 I1 的全局默认:推理区使用 I1 Blue,确定性 harness 使用 I1 Peach,记忆/溯源/恢复区使用 I1 Green,council、advisory 和 feedback 使用 I1 Purple 虚线,report 可使用 I1 Gold,STOP/直接例外使用 I1 Coral 并同时显示文本或形状。共用结构墨色可从经验证的高对比深中性色中取值;该展示图使用深墨蓝 `#042433`,但它不是全局 palette SSOT 的新默认。
        
        ## Reference-aware Prompt 模板
        
        以下模板根据可观察视觉语法生成,**不是任何参考图的原始 prompt**。
        用已验证的组件、连接和可见文字替换花括号变量。
        
        ```text
        Create a publication-ready {aspect_ratio} hand-drawn editorial scientific
        infographic illustrating the {system_or_method_topic}. Preserve the supplied
        reference grammar when available. Use a white or near-white canvas and
        content-driven asymmetric rounded semantic regions. Give each region its
        approved I1/reference-derived soft fill, validated common structural ink or
        darker same-hue outline, title color, and controlled icon accent. Use a rounded hand-lettered display
        face for module headings. Use highly legible sans-serif for small body text by
        default; when the user or reference explicitly uses a coherent handwritten
        type system, use its controlled regular face for short body labels and verify
        readability at final size.
        By default omit the paper title because it belongs in the external caption.
        If the user or supplied reference explicitly requires it, render exactly one
        short hand-lettered overall title with ample whitespace, never a full-width
        banner.
        
        Make “{hero_mechanism}” the visual focal point. Compose the other regions
        around it according to their real relationships, not as equal corporate
        swimlanes. Use at most one level of white or lighter subcards. Keep visible
        text short and exactly matched to the approved label list. Reserve enough
        negative space for clean arrow routes and downscaled readability.
        
        Semantic region {region_name}:
        {exact components, internal order, icons, and short labels}
        
        Required connections:
        {one explicit source -> destination edge per line, including direction,
        line style, color role, and exact edge label}
        
        Forbidden connections:
        {one prohibited source -> destination edge per line}
        
        Use solid dark arrows only for executed forward flow. Use colored dashed
        arrows for advisory, reference, optional, or feedback flow, and state the
        meaning beside the edge. Encode exceptions with both a distinct color and
        an explicit label. Do not invent modules or join independent stores into a
        serial pipeline.
        
        Palette: use the approved paired tokens from the adjacent palettes reference. State each
        active semantic zone as soft_fill / dark_outline / title_text / icon_accent;
        use neutral #24323D for small body text.
        
        No unintended or duplicated title banner, no copied branding, no copied topology, no photorealism,
        no gradients, no shadows, no 3D rendering, no emoji glyphs, no dark background,
        no equal-card dashboard, no extra text, and no performance claims.
        ```
        
        ## 拓扑可靠性约束
        
        生成 prompt 前,必须从 FigureSpec 中分别列出:
        
        - `required_connections[]`:每条边的 source、destination、direction、
          kind 和可见标签;
        - `forbidden_connections[]`:容易被模型误连的边;
        - `parallel_groups[]`:并列存储或并行候选不得被串成流水线;
        - `authority_boundaries[]`:跨边界的允许边和禁止边。
        
        首次渲染后按原尺寸检查每条边的两个端点。使用 Codex 做局部图像编辑时,
        同时提供参考图(若有),明确锁定已经正确的 hero 构图、paired tokens、
        标题风格和区域边界;只描述“删除/增加哪条边、保留哪些正确区域”,不要
        重新要求整图换风格。若局部语义编辑仍无法稳定修正,改用 SVG / Draw.io /
        Typst 或混合文字覆盖层,不继续依赖随机重绘。
        
        ## 完成检查
        
        - [ ] 参考图只用于视觉语法,没有声称获得原始 prompt 或源文件;
        - [ ] 有一个清晰 hero mechanism;
        - [ ] 语义区不是等宽企业泳道;
        - [ ] 大色块低饱和、使用经验证的共用深墨或同色深描边、无阴影;
        - [ ] 总标题选择与用户/参考图的明确要求一致,且没有意外的横幅或重复标题;
        - [ ] 标题有手绘感,正文缩放后仍可读;
        - [ ] 图标表达真实概念而非装饰;
        - [ ] required / forbidden connections 均已进入 prompt;
        - [ ] 并行模块没有被误画成串行;
        - [ ] paired tokens 来自相邻 `palettes.md` 参考或经过对比度验证的 reference-derived pairs;
        - [ ] 未复制参考论文的文字、logo、品牌插画、系统拓扑或结果。
        
    • codex-image-workflow.md 9.6 KB
      # Codex Native Image Generation and Revision
      
      Use this execution contract when Codex exposes its built-in image generation/editing capability. For image requests the user receives the image artifact. Explicit prompt construction,
      diagnosis, revision or planning requests stop at their requested text deliverable;
      this execution contract does not authorize rendering those requests.
      
      ## Default interaction
      
      - If the user asks Codex to generate the figure directly, call the native image tool after the semantic plan/spec is ready.
      - Do not print or ask the user to copy the internal image prompt unless the user explicitly asks to review it.
      - A request such as “直接画图”, “使用 Codex 生图”, or “不用返回 prompt” records `prompt_review: waived` for the current figure.
      - Prompt review and render audit are different: waiving prompt review never waives topology/text/quality inspection.
      - The prompt still exists as an internal renderer instruction. “Do not return the prompt” means compile and use it silently; it does not mean call the image model without an instruction.
      
      `prompt_review` is a three-state execution contract:
      
      - `requested`: show the current prompt and stop before any image call;
      - `confirmed`: hash the exact reviewed UTF-8 prompt as lowercase SHA-256, store
        it in `prompt_reviewed_sha256`, and render only while the hash matches;
      - `waived`: omit `prompt_reviewed_sha256` and render directly without showing the
        prompt.
      
      If a confirmed prompt changes, set the state back to `requested` and stop for a new
      review. A waived prompt is never returned to the user, including in error or
      renderer-unavailable fallbacks.
      
      ## Codex native-call contract
      
      Prefer the current session's native `image_gen.imagegen` interface; some runtimes
      display the callable name as `image_gen__imagegen`. Its `prompt` argument is an
      internal tool parameter, not a user-facing prompt handoff. Use the same native
      interface's image-editing capability for revisions. Do not turn the task into a
      prompt handoff for Midjourney, Gemini, a web UI, or the user to run, and do not
      hard-depend on legacy `.omp` scripts or SenseNova.
      Do not use Python raster manipulation as a substitute for a requested semantic
      image edit.
      
      Choose image inputs from the actual asset location:
      
      | Task | Native image inputs |
      |---|---|
      | New figure, no visual reference | omit both `referenced_image_paths` and `num_last_images_to_include` |
      | New figure, all references are local files | verify and inspect them, then set `referenced_image_paths` to the smallest complete set |
      | Edit a local render | inspect it, then put the current render first in `referenced_image_paths`; append only necessary style references |
      | Required input exists only as a recent conversation image | set `num_last_images_to_include` to the smallest number (up to 5) that covers every required image |
      
      Never provide `referenced_image_paths` and `num_last_images_to_include` in the
      same call. If the required images cannot all be included through one mechanism,
      ask the user to attach the missing images again instead of pretending the edit
      is grounded.
      
      Before execution, every local reference must exist, be a regular file, and not be
      a symbolic link. Represent it in FigureSpec with an absolute-path string or the
      supported `local_path` descriptor. Represent a conversation-only input in
      FigureSpec as `{"kind":"recent_conversation","ordinal_from_latest":N}` and mark
      it as transient in the execution packet. Materialize it to a checked local file
      when possible. Never claim that a conversation descriptor is a persistent local
      asset, and never mix local and recent-conversation mechanisms in one render call.
      
      ## Render readiness
      
      Immediately before every native generation or edit call, obtain and canonicalize
      the trusted actual workspace root from runtime/developer context. FigureSpec's
      required `workspace_root` is only an untrusted declaration and must match that
      runtime root. Never take the trusted root from FigureSpec, `output_path`, a
      reference path, or user-provided text. Run:
      
      ```bash
      python3 academic-figure-designer/scripts/validate_figure_spec.py \
        --strict-v1 --render-ready \
        --workspace-root <trusted-actual-root> \
        <spec.json>
      ```
      
      Do not call the image tool when this check fails. The render-ready check binds
      prompt-review state and hash, output containment, topology, and local reference
      safety to the trusted runtime root.
      
      ## New image
      
      1. Build FigureSpec v1 with a closed component list, typed connections, exact visible text, style grammar, output path, and optional reference assets. Compile the prompt internally.
      2. For a brand-new image with no visual reference, call `image_gen.imagegen` (or
         the exposed `image_gen__imagegen`) without either reference-image parameter.
      3. If every reference has a checked local path, inspect each reference first and
         pass the smallest complete `referenced_image_paths` list.
      4. If a required reference remains only in recent conversation state, mark it
         transient and pass the smallest sufficient `num_last_images_to_include`. Never
         send both local referenced paths and recent-image inclusion parameters.
      5. Ask for an opaque white or explicitly specified background and the FigureSpec aspect ratio.
      
      ## Render audit
      
      Inspect the generated file at original detail. In Codex, use `view_image` with
      original detail when that capability is exposed; a local image that has not been
      viewed must be inspected before it is sent back for editing. Compare observable
      output against FigureSpec, not against the prose prompt alone.
      
      Record:
      
      - missing, extra, or renamed components;
      - wrong connection endpoints, direction, line semantics, or branch labels;
      - invented claims or capabilities;
      - missing, duplicated, misspelled, garbled, or production-instruction text;
      - overlap, clipping, illegible scale, background or opacity differing from the FigureSpec, or wrong aspect ratio;
      - style drift in composition, fills, strokes, typography, illustration language, or density.
      
      Emit RenderAudit@2 following `render-audit.md`: bind exact image/spec SHA-256,
      separate spec_validation from image_inspection, and cover every required node and
      edge with pass/fail/unverified evidence. Scan for extra and forbidden relations.
      Do not accept a render merely because the API returned successfully, the spec
      validated, or a previous image passed.
      
      ## Targeted image revision
      
      When defects are repairable:
      
      1. Select the best current render, not automatically the newest failed revision.
      2. Inspect that render at original detail before writing the edit instruction.
      3. Invoke the same native `image_gen.imagegen` / `image_gen__imagegen` interface in
         **edit mode**, with the checked current render as the first local reference
         image. Include a style reference only when style drift is one of the audited
         defects.
      4. Write a surgical internal edit instruction containing the observed defect, its exact correction, and explicit critical edge endpoints/directions/types, labels and authority
         boundaries that must remain unchanged.
      5. Prefer “remove incorrect edge X; add edge A → B with a dashed purple line; preserve all other nodes, labels, positions, and colors” over regenerating the entire design.
      6. Save the result as a new revision; never overwrite the only known-good image.
      7. Reinspect the edited output at original detail, reset every ledger status, and
         emit a newly bound RenderAudit@2. Check every required edge, including those
         outside the edited region. A change passes only when it fixes the target without regressing topology, text, layout, or style elsewhere.
      
      Use this control loop:
      
      ```text
      initial generation (r0)
        -> inspect at original detail
        -> RenderAudit@2
        -> pass: select and deliver
        -> fail, repairable, edits_used < 2:
             edit best current render -> r1/r2 -> reinspect -> new audit
        -> fail, exact text remains unreliable:
             deterministic text/line overlay or deterministic renderer
        -> fail after limit:
             select best recoverable revision and disclose residual defects
      ```
      
      Allow at most two semantic edit rounds after the initial image. A transient transport failure may be retried once and does not consume a semantic edit round. If the second semantic edit still fails, keep the best image and report remaining defects rather than silently looping.
      
      ## Text-heavy figures
      
      Native image generation does not guarantee exact typography. If required labels remain wrong after one targeted edit, switch to a deterministic SVG/drawio/Typst text overlay or renderer when available. Do not spend repeated image edits on dense prose, formulas, tables, or exact numeric charts.
      
      ## Files and delivery
      
      - Leave Codex's original generated asset in place.
      - Use recoverable revision names such as `fig1-r0.png`, `fig1-r1.png`, and `fig1-r2.png`; copy the selected result to FigureSpec's stable final path.
      - Sanitize metadata on delivery: run `clean_image_metadata.py` (or `strip_image_metadata`) on the final deliverable to strip all C2PA, EXIF, and provenance markers, ensuring clean, publication-ready images.
      - After all delivery-file transformations, inspect that exact file and bind its
        final RenderAudit@2. Validate the record using workflow's
        `scripts/validate_render_audit.py --spec <spec.json> --image <image.png> <audit.json>`.
        This checks record integrity, not pixels or scientific truth.
      - Keep the initial render, prior revisions, FigureSpec, and RenderAudit records together when practical.
      - Never leave the only deliverable in a temporary directory.
      - Return or display the final image artifact and a clickable absolute local file
        path. Do not use `file://`. Never append, quote, or otherwise expose the internal
        prompt when prompt review was waived.
      
    • missing-info-policy.md 1 KB
      # Missing-Info Policy
      
      Shared by all academic-figure skills. Domain skills add only their own cases.
      
      ## Rule
      
      When evidence is incomplete: ship a **conservative, useful** partial result. Label every claim beyond evidence as `推断` or `待确认`. Prefer placeholders over invention.
      
      ## Completeness block (every deliverable)
      
      ```
      - 已分析材料: ...
      - 当前输出类型: 完整 / 阶段性 / 局部 / 骨架
      - 高置信信息: ...
      - 待确认信息: ...
      - 建议补充材料: 1–3 highest-value items
      ```
      
      ## Stop vs continue
      
      | Situation | Action |
      |-----------|--------|
      | Core deliverable possible with placeholders | continue |
      | Zero usable source (no paper, repo, figure type, or image) | stop; list minimum materials |
      | User asked only this stage | stop after that stage |
      | Next stage needs material user has not provided | stop; do not invent |
      
      ## Invention ban
      
      Do not invent modules, losses, dimensions, experiment results, or architecture layers that never appear in the source. Rewrite unknowns as explicit placeholders (`[module_name]`, `R^(?×?)`).
      
    • palettes.md 20.7 KB
      # Academic Palettes — Single Source of Truth
      
      This file defines **12 classic presets**, three pastel-airy schemes, and paired illustrated semantic-zone tokens. Skills that need hex values or style routing should load this file rather than maintaining private copies.
      
      ## Decision order
      
      Apply evidence in this order:
      
      1. explicit user colors, style, print, and accessibility requirements
      2. supplied reference image grammar
      3. hard production constraints such as grayscale output and text contrast
      4. figure semantics and visual-zone relationships
      5. an existing paper-wide visual system or explicit submission rule
      6. conservative default
      
      A reference image is the highest-priority inferred style source. Extract composition, panel surfaces, outline strength, shadow treatment, typography character, icon style, nesting depth, density, arrow grammar, and paired fill/outline colors. Match those properties without copying the reference's labels, branded assets, or method content.
      
      `module_count` is a density clue only. It does not trigger monochrome. Choose hue count from the number and relationship of semantic zones shown in the figure.
      
      | Missing evidence | Conservative default |
      |---|---|
      | No reference or style cue, classic technical figure | **Okabe-Ito** |
      | Explicit airy UI/token figure | **P2 Cool Research** |
      | Narrative framework or agent/scientific workflow | **I1 Illustrated Zones** |
      | Accessibility unspecified | colorblind-aware dual encoding and validated text contrast |
      
      Always state the branch (`user`, `reference`, `scene`, or `default`) and offer one alternate.
      
      ## Style profiles first
      
      Palette values only make sense with a surface and line treatment. Select a profile before assigning tokens.
      
      | Signals | Profile | Primary skill | Visual grammar |
      |---|---|---|---|
      | technical stack, compact network, classic vector, strict print | **`classic-technical`** | `academic-figure-designer` | restrained geometry, fine borders, white or near-white modules, compact sans labels |
      | airy, token flow, interface-like, soft cards | **`pastel-airy-ui`** | `academic-figure-designer` | white cards, subtle border/shadow, floating pills and tokens, generous whitespace |
      | hand-drawn academic infographic, modular narrative, agent/scientific workflow, tinted zones | **`illustrated-modular`** | `academic-figure-designer` | asymmetric hero layout, soft semantic-zone fills, strong same-hue outlines, no shadow, one-level subcards, controlled line illustrations |
      | supplied reference does not fit one preset | **`reference-led`** | `academic-figure-designer` | override defaults with observed grammar; do not assume an illustrated surface |
      
      Do not force a supplied reference into a binary classic/pastel label. A coherent figure may combine a classic flat canvas, tinted modular zones, and hand-drawn illustrations. State the observed properties so the combination is intentional rather than a style-word mixture.
      
      ### Pastel airy UI schemes
      
      Small body text remains neutral `#24323D`. The colored values below are heading accents on white; validate them again before placing small text on a tinted token.
      
      | Scheme | Scene | Soft fills | Accessible heading accents on white |
      |---|---|---|---|
      | **P1 Warm ML** | playful, teaching, human-centered | `#FFD0D0` `#BBDEFB` `#FFF3C4` `#E1BEE7` `#C8E6C9` | `#A93636` `#146C61` `#6A5ACD` `#2F7430` |
      | **P2 Cool Research** | calm token-centric research figure | `#B3E5FC` `#C5CAE9` `#CFD8DC` `#B2DFDB` `#D1C4E9` | `#1565C0` `#3949AB` `#006F65` |
      | **P3 Earthy Warm** | natural or embodied visual direction | `#FFE0B2` `#D7CCC8` `#C8E6C9` `#E0E0E0` `#EFEBE9` | `#6D4C41` `#827717` `#2E7D32` |
      | **P4 Airy Agentic BO** | surrogate backend, agent decision, charcoal eval anchor | `#FAE8DC` (Peach) `#DBE7FB` (Periwinkle) `#4B5563` (Slate) `#E9E9EC` (Gray) | `#1E293B` `#0F172A` `#FFFFFF` `#334155` |
      
      If a reference is present, derive its token pairs instead of snapping every soft figure to the nearest P1–P4 scheme.
      
      ---
      
      ## I1 Illustrated Zones — paired semantic tokens
      
      Each token is a coordinated surface system rather than a standalone accent. `title_text` values meet normal-text contrast against their paired fills; small body text may use neutral `#24323D` throughout.
      
      | Token | `soft_fill` | `dark_outline` | `title_text` | `icon_accent` |
      |---|---|---|---|---|
      | **I1 Blue** | `#EDF4FB` | `#194166` | `#163E64` | `#2E6B9E` |
      | **I1 Green** | `#F3FBF0` | `#3B7D23` | `#2F681D` | `#4E8D36` |
      | **I1 Peach** | `#FBE3D6` | `#A94417` | `#9E3F13` | `#C65A22` |
      | **I1 Purple** | `#F5ECF5` | `#77206E` | `#65185E` | `#8B3B83` |
      | **I1 Cyan** | `#DBF3FE` | `#236E96` | `#195876` | `#2F81A8` |
      | **I1 Gold** | `#FBF1D1` | `#856B1B` | `#66500F` | `#9B7B1C` |
      | **I1 Coral** | `#FDE8E5` | `#B83A2F` | `#8F2A24` | `#C94D42` |
      
      Recommended material treatment: white canvas; 1.5–2.5px zone outlines; 6–14px corner radius scaled to output size; no drop shadows; white or lighter same-hue subcards; dark neutral arrows `#334155` unless the edge itself carries a zone meaning.
      
      ## Semantic color binding contract
      
      Bind tokens to the roles present in the current paper and retain those bindings across its figures. The mappings below are customizable defaults across different scientific domains:
      
      ### 1) Standard Multi-Stage Pipeline & Modular Systems
      | Domain Role / Stage | Suggested Illustrated Token | Classic/Airy Adaptation |
      |---|---|---|
      | **Stage 1: Input / Raw Data / Context** | I1 Green (`#F3FBF0` / `#3B7D23`) | Green accent / data pill |
      | **Stage 2: Representation / Encoders** | I1 Blue (`#EDF4FB` / `#194166`) | Blue outline / primary container |
      | **Stage 3: Core Mechanism / Transformation** | I1 Peach (`#FBE3D6` / `#A94417`) | Orange/peach hero zone |
      | **Stage 4: Optimization / Supervision / Loss** | I1 Purple (`#F5ECF5` / `#77206E`) | Purple accent / dashed constraint |
      | **Stage 5: Output / Evaluation / Benchmark** | I1 Gold (`#FBF1D1` / `#856B1B`) | Gold heading / output badge |
      
      ### 2) Deep Learning & Neural Architectures
      | Architecture Component | Suggested Illustrated Token | Visual Metaphor / Shape |
      |---|---|---|
      | **Raw Input / Embeddings / Tokens** | I1 Green | Structured grid, token pill, or feature map |
      | **Backbone / Feature Extractor** | I1 Blue | Layered orthogonal blocks or stacked cards |
      | **Cross-Modal Fusion / Attention Core** | I1 Peach | Heatmap matrix or bipartite connection web |
      | **Loss Function / Objective / Regularizer** | I1 Purple | Mathematical constraint box or curve |
      | **Prediction Head / Downstream Task** | I1 Gold | Terminal prediction pill or task badge |
      
      ### 3) Agentic & Scientific Interactive Loops
      | Agentic Role | Suggested Illustrated Token | Visual Metaphor / Shape |
      |---|---|---|
      | **Reasoning / Policy / Planner** | I1 Blue | Decision glyph, thought bubble, or planning box |
      | **Evidence / Context / Observation** | I1 Green | Document icon, coordinate plot, or context card |
      | **Deterministic Harness / Tool Execution**| I1 Peach | Solid process container or simulation box |
      | **Advisory / Feedback / Uncertainty** | I1 Purple | Dashed feedback arrow or advisory pill |
      | **Memory / Storage / Provenance** | I1 Cyan | Network graph or database/checkpoint cylinder |
      | **Final Output / Report** | I1 Gold | Formatted report card or badge |
      | **Exception / Guardrail / Stop** | I1 Coral | Warning badge or coral STOP boundary |
      
      ### 4) Dual-Fidelity & Bayesian Optimization Loops
      | Optimization Role | Suggested Illustrated Token | Visual Metaphor / Shape |
      |---|---|---|
      | **High-Fidelity / Real-World Experiment / Discrepancy** | I1 Coral (`#FDE8E5` / `#B83A2F`) | Laboratory glassware, oscilloscope/monitor, focused residual peak $\mathcal{X}_R^*$ |
      | **Low-Fidelity / LLM Prior / Global Surrogate** | I1 Blue (`#EDF4FB` / `#194166`) | Electronic brain, prompt balloon, 3D smooth GP surface |
      | **Candidate Selection / Acquisition Function** | I1 Peach (`#FBE3D6` / `#A94417`) | 1D search curve, peak marker $x^*$, candidate generator table |
      | **Gating Criterion / Adaptive Decision** | Decision Diamond (Neutral/Red/Green) | Diamond node $p_\Delta < \tau$, green checkmark / red cross status badges |
      | **Prior Domain Knowledge / Constraints** | I1 Green / Slate (`#F3FBF0` / `#3B7D23`) | Literature stack, coordinate scatter plot, constraint box |
      
      Repeated roles reuse a token; adjacent unrelated zones should also differ by label, geometry, or line style.
      
      ---
      
      ## Scene → profile and palette decision
      
      After explicit user and reference-grammar requirements, apply production constraints and then choose from figure semantics. Venue and domain are suggestions, not guarantees of a single visual style.
      
      ### 1) Hard constraints
      
      | Constraint | Choose | Alternate |
      |------------|--------|-----------|
      | Strict B&W / grayscale print only | **Print-Safe Gray** | Grayscale |
      | Theory paper, no color budget | **Grayscale** | Print-Safe Gray |
      | Color-vision accessibility required or prudent | Start from Okabe-Ito / ML TopConf Colorblind / a verified monochrome ramp, then dual-encode and test | Never treat a palette name as proof of accessibility |
      | Must match existing Matplotlib Tab10 experiment plots | **ML TopConf Tab10** | ML TopConf Colorblind if a11y matters more than match |
      | Reference has tinted zones and strong outlines | **Illustrated modular + derived pairs** | I1 Illustrated Zones |
      
      ### 2) Figure type
      
      | Figure type | Prefer | Alternate | Why |
      |-----------|--------|-----------|-----|
      | Overall Framework, technical pipeline | Okabe-Ito | ML TopConf Colorblind | clear categorical accents |
      | Overall Framework, modular narrative | **Illustrated modular + I1** | reference-derived pairs | semantic zones and hierarchy |
      | Network Architecture | Okabe-Ito or Blue Monochrome | Nature Blue for a restrained single-family stack | structure > decoration |
      | Module Detail | **Blue Monochrome** | Okabe-Ito | detail density; gray-print friendly |
      | Comparison / Ablation (few panels) | Purple-Green | Okabe-Ito | category contrast |
      | Dense multi-panel ablation | **ML TopConf Deep** | Purple-Green | softer multi-hue grid |
      | Data Behavior (curves / heatmaps / t-SNE) | ML TopConf Colorblind | Okabe-Ito | series/categories stay separable |
      | Qualitative image grids | Okabe-Ito accents only | Grayscale frames | color on labels, not photo washes |
      
      ### 3) Venue and domain constraints
      
      Do not map a venue or research domain directly to a palette. Use venue/domain
      information only when it supplies a concrete production constraint: an official
      grayscale rule, an existing paper-wide color system, a required plot palette,
      an accessibility requirement, or a reference figure. Otherwise choose from the
      content relationships above. “Nature”, “CVPR”, “biology”, “materials”, or
      “robotics” alone is not a color instruction.
      
      ### 4) Vibe words → concrete choice
      
      | User says | Family | Palette / scheme |
      |-----------|--------|------------------|
      | 高级 / 克制 / 顶刊 | ask for observable traits or use a supplied reference | no venue-name palette default |
      | 科技感 / 工程感 / 干净 | `classic-technical` | Blue Monochrome or Okabe-Ito |
      | 柔和 / 空气感 / token 卡片 | `pastel-airy-ui` | P2 |
      | 手绘 / 叙事 / 模块拼图 / agent 框架 | `illustrated-modular` | I1 or reference-derived pairs |
      | 活泼 / 教学感 | `pastel-airy-ui` or `illustrated-modular` | P1 or reference-derived pairs |
      | 自然 / 生物感 | classic Warm Earth, airy P3, or illustrated zones | state accessibility tradeoff |
      | 不要花 | any coherent profile | reduce active semantic zones; monochrome only if hierarchy remains clear |
      | 和实验曲线一个色 | `classic-technical` | ML TopConf Tab10 / Colorblind |
      | 黑白印刷 | `classic-technical` | Print-Safe Gray / Grayscale |
      
      ---
      
      ## Worked decision recipes
      
      | Scenario | Family | Palette | One-line reason |
      |----------|--------|---------|-----------------|
      | Technical three-stage method pipeline, no reference | `classic-technical` | Okabe-Ito | categorical accents and compact geometry |
      | Modular agent/scientific framework, no reference | `illustrated-modular` | I1 Illustrated Zones | semantic zones plus asymmetric hierarchy |
      | Reference with tinted panels and dark outlines | `reference-led` (observed illustrated grammar) | derived paired tokens | preserve observed visual grammar without assuming every reference is illustrated |
      | Dense 2×3 ablation grid | `classic-technical` | ML TopConf Deep | multiple comparable panels |
      | Token-flow explainer with white cards | `pastel-airy-ui` | P2 | token-centric surface grammar |
      | Continuous single-family mechanism with an explicit restrained-blue preference | `classic-technical` | Nature Blue | user request and hierarchy support one hue family |
      | Strict B&W journal output | `classic-technical` | Print-Safe Gray | hard print constraint |
      | Human-centered concept diagram | `pastel-airy-ui` or reference-supported `illustrated-modular` | content/reference dependent | distinguish UI cards from narrative zones |
      | High-density module detail with no reference | `classic-technical` | Blue Monochrome or accessible custom | detail density and print behavior |
      | User: 配色随便 | profile from content; Okabe-Ito/P2/I1 | profile default | safe default branch |
      
      ---
      
      ## Decision checklist (emit with every Palette Decision)
      
      1. Explicit user constraints recorded.
      2. Reference grammar summarized, or `no reference supplied`.
      3. Canonical profile: `classic-technical` / `pastel-airy-ui` / `illustrated-modular` / `reference-led`.
      4. Hard constraint fired? (print / accessibility / match existing plots).
      5. Semantic zones and color carriers identified.
      6. Primary + alternate named with exact classic colors or paired tokens.
      7. Small-text contrast and grayscale dual encoding checked.
      8. Branch stated: `user` / `reference` / `scene` / `default`.
      
      
      ## Palette Decision handoff
      
      Downstream skills consume:
      
      ```
      style_profile: <classic-technical | pastel-airy-ui | illustrated-modular | reference-led>
      style_preset: <named library variant | none>
      reference_grammar: <summary | none>
      palette_or_token_set: <name>
      canvas / body_text / arrow / divider: <hex>
      semantic_zone_tokens:
        <role>: {soft_fill: <hex>, dark_outline: <hex>, title_text: <hex>, icon_accent: <hex>}
      reason: <one line>
      accessibility: colorblind-aware-tested | needs dual encoding/testing | print-only
      ```
      
      ---
      
      ## 1. Okabe-Ito — default polychrome
      
      **Use:** general categorical starting palette when several roles need distinct hues; always add non-color cues and test the rendered figure
      
      | role | hex | use |
      |------|-----|-----|
      | primary | `#0072B2` | core module borders, section labels |
      | secondary | `#E69F00` | secondary borders, alternate highlight |
      | tertiary | `#009E73` | output / result (sparse) |
      | text | `#333333` | body text |
      | fill | `#FFFFFF` | canvas / boxes |
      | section_bg | `#F7F7F7` | region grouping |
      | border | `#767676` | semantic outline (4.54:1 on white) |
      | arrow | `#4D4D4D` | arrows / lines |
      
      ---
      
      ## 2. Blue Monochrome
      
      **Use:** module detail; grayscale-friendly journals
      
      | role | hex |
      |------|-----|
      | primary | `#1565C0` |
      | secondary | `#42A5F5` |
      | tertiary | `#90CAF9` |
      | text | `#212121` |
      | fill | `#FFFFFF` |
      | section_bg | `#F5F8FC` |
      | border | `#607D8B` |
      | arrow | `#37474F` |
      
      ---
      
      ## 3. Warm Earth
      
      **Use:** explicit earth-toned user/reference direction. Dual-encode; do not infer this palette from a research domain alone.
      
      | role | hex |
      |------|-----|
      | primary | `#C0392B` |
      | secondary | `#E67E22` |
      | tertiary | `#F39C12` |
      | text | `#2C2C2C` |
      | fill | `#FFFFFF` |
      | section_bg | `#FDF6EC` |
      | border | `#8D6E63` |
      | arrow | `#5D4037` |
      
      ---
      
      ## 4. Purple-Green
      
      **Use:** two-category comparison or ablation when purple/green fits the labels and reference; never bind a hue to “ours” without the spec
      
      | role | hex |
      |------|-----|
      | primary | `#6A1B9A` |
      | secondary | `#2E7D32` |
      | tertiary | `#AB47BC` |
      | text | `#1A1A1A` |
      | fill | `#FFFFFF` |
      | section_bg | `#F8F5FC` |
      | border | `#7B1FA2` |
      | arrow | `#4A148C` |
      
      ---
      
      ## 5. Grayscale
      
      **Use:** explicit grayscale/print-only requirement or a user-selected austere monochrome treatment
      
      | role | hex |
      |------|-----|
      | primary | `#212121` |
      | secondary | `#616161` |
      | tertiary | `#9E9E9E` |
      | text | `#111111` |
      | fill | `#FFFFFF` |
      | section_bg | `#F5F5F5` |
      | border | `#757575` |
      | arrow | `#424242` |
      
      Distinguish categories by shape / line weight, not hue.
      
      ---
      
      ## 6. Teal-Coral
      
      **Use:** explicit teal/coral two-category contrast. Dual-encode and test for color-vision deficiencies.
      
      | role | hex |
      |------|-----|
      | primary | `#00695C` |
      | secondary | `#E64A19` |
      | tertiary | `#26A69A` |
      | text | `#212121` |
      | fill | `#FFFFFF` |
      | section_bg | `#F0F9F8` |
      | border | `#00796B` |
      | arrow | `#004D40` |
      
      ---
      
      ## 7. ML TopConf Tab10
      
      **Use:** match an existing Matplotlib Tab10 experiment palette; do not choose from venue name alone
      
      | role | hex |
      |------|-----|
      | primary | `#1F77B4` |
      | secondary | `#FF7F0E` |
      | tertiary | `#2CA02C` |
      | text | `#1F2937` |
      | fill | `#FFFFFF` |
      | section_bg | `#F8FAFC` |
      | border | `#64748B` |
      | arrow | `#334155` |
      
      ---
      
      ## 8. ML TopConf Colorblind
      
      **Use:** muted colorblind-aware categorical starting palette; still requires dual encoding and rendered-output checks
      
      | role | hex |
      |------|-----|
      | primary | `#0173B2` |
      | secondary | `#DE8F05` |
      | tertiary | `#029E73` |
      | text | `#1F2937` |
      | fill | `#FFFFFF` |
      | section_bg | `#F8FAFC` |
      | border | `#64748B` |
      | arrow | `#334155` |
      
      ---
      
      ## 9. ML TopConf Deep
      
      **Use:** multi-panel ablation / dense comparison grids
      
      | role | hex |
      |------|-----|
      | primary | `#4C72B0` |
      | secondary | `#DD8452` |
      | tertiary | `#55A868` |
      | text | `#1F2937` |
      | fill | `#FFFFFF` |
      | section_bg | `#F8FAFC` |
      | border | `#64748B` |
      | arrow | `#334155` |
      
      ---
      
      ## 10. Print-Safe Gray
      
      **Use:** explicit strict black-and-white print requirement
      
      | role | hex |
      |------|-----|
      | primary | `#000000` |
      | secondary | `#333333` |
      | tertiary | `#666666` |
      | text | `#333333` |
      | fill | `#FFFFFF` |
      | section_bg | `#F7F7F7` |
      | border | `#666666` |
      | arrow | `#4D4D4D` |
      
      ---
      
      ## 11. Journal Standard
      
      **Use:** figures with several verified categories that genuinely need additional accents; not a journal-name default
      
      | role | hex |
      |------|-----|
      | primary | `#1F77B4` |
      | secondary | `#FF7F0E` |
      | tertiary | `#2CA02C` |
      | accent1 | `#D62728` |
      | accent2 | `#9467BD` |
      | accent3 | `#8C564B` |
      | text | `#1F2937` |
      | fill | `#FFFFFF` |
      | section_bg | `#F8FAFC` |
      | border | `#64748B` |
      | arrow | `#334155` |
      
      Activate only the category colors needed by the current comparison and repeat them consistently.
      
      ---
      
      ## 12. Nature Blue — restrained monochrome
      
      **Use:** a continuous single-family hierarchy, an explicit restrained-blue direction, matching reference grammar, or verified grayscale-friendly output. Do not select it from module count, venue, or domain alone.
      
      | role | hex |
      |------|-----|
      | primary | `#1B3A5C` |
      | secondary | `#2E6B9E` |
      | tertiary | `#5BA0D0` |
      | gray | `#8EAEC4` |
      | text | `#333333` |
      | fill | `#FFFFFF` |
      | section_bg | `#F7F7F7` |
      | border | `#5B7890` |
      | arrow | `#4D4D4D` |
      
      ---
      
      ## Monochrome vs semantic-zone color
      
      | | monochrome (Blue Monochrome / Nature Blue) | semantic-zone color (Okabe-Ito / I1 / custom pairs) |
      |---|---|---|
      | visual unity | one hue family | coordinated role-based pairs |
      | separation | lightness + border + label | fill/outline pair + label + shape |
      | best when | hierarchy within one conceptual family | readers must scan distinct subsystems or decisions |
      | print / colorblind | usually robust after value check | robust when dual-encoded and contrast-checked |
      
      ---
      
      ## Production checks
      
      - Preserve explicit user constraints and reference-image grammar unless accessibility or print requirements require an explained adjustment.
      - Use white, near-white, or soft tinted panel surfaces according to the selected profile; tinted semantic zones are valid academic material.
      - Use the fewest semantic tokens that keep roles easy to scan, without an arbitrary module-count or three-hue cutoff.
      - Dual-encode important categories with label, shape, border, icon, or line style in addition to color.
      - Normal-size text and its actual background should meet a 4.5:1 contrast target; do not use pale accent colors for small text.
      - Essential outlines, arrow shafts/heads, markers, and focus boundaries should meet a 3:1 graphical contrast target against adjacent colors. Lighter dividers may be decorative only and must not carry meaning.
      - Avoid unintentional gradients, glossy 3D chrome, photorealistic decoration, and rainbow ordering. Follow a supplied reference when a different treatment is deliberate and legible.
      - Check the downscaled figure and a grayscale preview before handoff.
      
      ## Custom palette minimum
      
      ```
      style_profile: <name>
      canvas: #XXXXXX
      body_text: #XXXXXX
      arrow: #XXXXXX
      semantic_zone:
        soft_fill: #XXXXXX
        dark_outline: #XXXXXX
        title_text: #XXXXXX
        icon_accent: #XXXXXX
      ```
      
      Add only the semantic zones the figure needs. Validate text contrast, colorblind distinguishability, and grayscale reproduction before handoff.
      
    • render-audit.md 11 KB
      # Render Audit Protocol
      
      Use this protocol after every generated academic figure and after each targeted
      edit. A successful image-generation API response is not evidence that the figure
      is correct. Inspect the image at original resolution and compare it with the
      confirmed FigureSpec, source evidence, and any reference image.
      
      ## Inputs and output
      
      Required inputs:
      
      - the validated `academic-figure/FigureSpec@1` object;
      - the rendered image at an absolute local path;
      - source figure plan and evidence locations;
      - reference images when `style_profile` is `reference-led`.
      
      Emit a JSON-compatible audit:
      
      ```text
      schema: academic-figure/RenderAudit@2
      figure_id, render_revision, image_path (absolute)
      image_sha256, spec_sha256 (lowercase SHA-256 of exact file bytes)
      spec_validation: {status: pass|fail|unverified}
      image_inspection: {status: pass|fail|unverified, evidence}
      nodes[]: {id, status: pass|fail|unverified, evidence}
      edges[]: {id, from, to, kind, direction, line, label,
                status: pass|fail|unverified, evidence}
      checks:
        semantic_topology, visible_text, background, layout,
        style_fidelity, accessibility
        (each check is {status: pass|fail|unverified, evidence})
      pass: true|false
      defects[]: {check, severity, observed, expected, evidence, edit_instruction}
      targeted_edit: string|null
      semantic_edits_used: 0|1|2
      semantic_edits_remaining: 2|1|0
      residual_risks[]
      ```
      
      ## Revision binding and complete ledgers
      
      New audits use RenderAudit@2. Keep legacy @1 records for history, but do not
      upgrade their booleans mechanically into observed @2 results. Bind each audit to
      one actual image and one actual FigureSpec by path, revision, and raw-file
      SHA-256. Finish any export/metadata transformation before binding the delivered
      file, then inspect that exact final file. A new file or changed spec needs a new
      audit; do not copy forward a previous image's pass.
      
      FigureSpec validation and actual image inspection are independent. Record their
      statuses separately. If the image cannot be opened, or an arrowhead is too
      ambiguous to identify, use `unverified`, not a guessed `pass`. Evidence describes
      what was inspected, including region or endpoints; “spec valid” is not visual
      evidence. Image inspection status says whether inspection was performed; defects
      found during inspection belong in the individual check statuses.
      
      Derive the complete node and edge ledger from the spec, not from what is easiest
      to see. Cover every component and every connection exactly once. Use declared
      edge IDs; for a legacy connection without an ID, use its stable one-based position
      as `edge_001`, `edge_002`, etc. Copy from/to/kind/direction/line/label exactly;
      for omitted direction/line use `unspecified`, and omitted label is an empty
      string. Semantic kind remains required. This does not authorize rendering a scientifically ambiguous spec.
      
      Check the image against the ledger, then scan the image for extra edges and
      forbidden shortcuts; a required-edge ledger alone cannot detect invented arrows.
      Record that second scan and authority-boundary checks under semantic_topology.
      Record the actual text-inventory and final-size inspection under the relevant
      checks. Reset all statuses to unverified for every new image, including style-only
      and single-arrow edits, and recheck all required edges outside the edited region.
      
      For the bundled record validator (it does NOT inspect pixels), run:
      
      ```bash
      python3 <workflow>/scripts/validate_render_audit.py \
        --spec <spec.json> --image <image.png> <audit.json>
      ```
      
      Exit 0 means the bound record is complete and all asserted statuses pass; exit 1
      means a valid record is failed/unverified; exit 2 means malformed, incomplete or
      mismatched evidence, including a stale digest or misleading aggregate pass.
      When workflow's script is not installed, perform the same ledger checks manually
      and state that record validation was manual. Never call this script's exit 0
      proof of scientific accuracy or image quality: it cannot verify the truthfulness
      of a human/model's visual assertions.
      
      A legal top-level `pass: true` requires all node/edge/check statuses, spec
      validation and image inspection to pass, with no critical or major defect.
      Any fail or unverified status blocks acceptance. A complete record of a failed
      image is useful and must remain failed.
      
      `severity` is `critical`, `major`, or `minor`. A critical or major defect makes
      the audit fail. Minor defects may pass only when they do not change scientific
      meaning, legibility, accessibility, or the requested visual identity.
      
      ## 1. Semantic topology
      
      Treat the FigureSpec component and connection lists as a directed graph.
      
      - Every required component appears exactly once unless duplication is explicitly
        specified as a repeated stage.
      - Every rendered arrow has the correct source, target, direction, kind, and label.
      - Required branches, loops, authority boundaries, budget effects, and persistence
        paths are present.
      - Forbidden components, connections, causal implications, performance claims, and
        copied scientific content are absent.
      - Advisory, executed, feedback, persistence, and exception paths remain visually
        distinguishable according to the spec.
      
      Any missing, invented, reversed, or merged scientific edge is a **critical**
      defect. Do not approve a visually attractive but semantically incorrect render.
      
      ## 2. Visible text
      
      Compare the image against the complete `visible_text` inventory, using visual
      inspection and OCR when available.
      
      - Every required string is present, spelled correctly, and assigned to the right
        component or connection.
      - No JSON keys, prompt instructions, hex codes, production notes (`WHITE FILL`,
        `300 DPI`, stroke widths), watermarks, or unexplained text are visible.
      - No duplicated, truncated, fused, hallucinated, or illegible labels remain.
      - Mathematical symbols, identifiers, capitalization, and branch labels preserve
        their specified meaning.
      - Text remains readable at the intended 89 mm or 183 mm publication width, not
        merely when zoomed to the generation resolution.
      
      Scientific text errors are critical. Optional secondary-label loss is major when
      it damages interpretation and minor only when the FigureSpec marks it optional.
      
      ## 3. Background and artifact integrity
      
      - Canvas dimensions match the requested aspect ratio within raster rounding.
      - The background is the specified solid color; when white is required, corner and
        inter-panel pixels are opaque `#FFFFFF`, not transparent, gray, or black.
      - No accidental alpha channel, crop, border, compression damage, checkerboard,
        watermark, or model signature is present.
      - Metadata and provenance cleanliness: sanitize and strip all C2PA manifests, JUMBF markers, EXIF, and AI generation metadata using `clean_image_metadata.py` before final delivery.
      - The file extension matches the encoded media type and the image opens normally.
      
      A background or opacity that differs from the FigureSpec, a wrong crop, or a
      wrong aspect ratio is a major defect. A file that cannot be decoded is critical.
      
      ## 4. Layout and publication-scale legibility
      
      - Components follow the planned reading order, grouping, hierarchy, focal point,
        and relative emphasis.
      - Boxes, illustrations, labels, legends, and arrowheads do not overlap or collide.
      - Connections do not ambiguously cross nodes or terminate in empty space.
      - Margins and whitespace are intentional; the figure is neither an empty template
        nor a uniformly dense wall of boxes.
      - Primary information survives a thumbnail/publication-width check; secondary
        detail may recede but must not become visual noise.
      - Repeated elements align consistently while semantic exceptions remain salient.
      
      Overlap that hides meaning or an ambiguous connector is major. Minor alignment
      variation is minor only when the intended reading order stays unambiguous.
      
      ## 5. Style fidelity
      
      For a built-in profile, check the profile's composition, marks, strokes, fills,
      typography, spacing, motifs, and emphasis—not just its named colors. For a supplied
      reference, compare transferable visual grammar while keeping the new method's
      content and topology independent.
      
      - Composition and visual hierarchy match the selected profile or reference.
      - Palette colors have the specified semantic roles and relative area; do not wash
        every region with equally saturated color.
      - Stroke language, arrow curvature, illustration level, panel treatment, corner
        geometry, typography character, and whitespace match the intended family.
      - Absent traits from the reference stay absent: do not add enterprise swimlanes,
        heavy dark borders, gradients, shadows, 3-D chrome, clip art, or generic robot
        motifs unless the profile calls for them.
      - A reference's labels, metrics, branding, scientific objects, and topology are not
        copied merely to imitate its appearance.
      
      A palette match with the wrong composition or mark language does **not** pass style
      fidelity. Clearly landing in the wrong style family is major.
      
      ## 6. Accessibility and print behavior
      
      - Normal-size text has at least 4.5:1 contrast against its actual background;
        large text has at least 3:1.
      - Essential outlines, arrows, markers, and focus boundaries have at least 3:1
        graphical contrast against adjacent colors; pale decorative dividers do not
        carry semantic meaning.
      - Critical distinctions use color plus a second cue such as label, shape, marker,
        hatching, or line style.
      - Simulated protanopia, deuteranopia, and tritanopia views preserve required
        distinctions when a simulation tool is available.
      - A grayscale preview preserves topology, grouping, and exception branches.
      - Thin strokes, pale tokens, and small type remain discernible at publication size.
      
      Record the measured foreground/background pairs when contrast tooling is
      available. Never infer accessibility from a palette name alone.
      
      ## Targeted-edit policy
      
      The initial render may receive **at most two targeted semantic visual edits**.
      A single retry for a transient API/transport failure does not consume this
      budget because it did not attempt to change the image semantics.
      
      1. Audit the initial render and rank defects by semantic risk.
      2. If it fails, write one bounded edit instruction containing only the observed
         defects, their exact expected replacements, and an explicit list of critical nodes, edge endpoints/directions/types,
         visible labels and authority boundaries to preserve. “Keep everything else”
         alone is not a preservation contract.
      3. Inspect the edited image and emit a newly bound audit. Recheck the full
         required edge ledger, not just the repaired connector; do not assume an edit
         preserved topology or text.
      4. If needed, perform one final targeted edit, then audit again.
      5. After two targeted edits, stop. Deliver the best valid artifact only if all
         critical and major checks pass; otherwise mark the render incomplete and report
         residual defects instead of silently accepting it or starting an unbounded loop.
      
      Do not use a whole-image style rewrite to repair one spelling error or connector.
      Conversely, do not patch isolated colors when the audit shows the entire style
      family or composition is wrong; use the first targeted edit to correct that bounded
      systemic defect and preserve grounded content.
      
  • scripts
    • validate_render_audit.py 11.5 KB
      #!/usr/bin/env python3
      """Validate a RenderAudit@2 record against an exact spec and image artifact.
      
      This checker validates record completeness, consistency, and byte-level binding.
      It does not inspect pixels and cannot prove that human/agent assertions are true.
      Use alongside actual image inspection and the separate FigureSpec validator.
      
      Exit codes: 0 = complete passing record; 1 = valid but failed/unverified record;
      2 = malformed, incomplete, incorrectly bound, or inconsistent record.
      """
      
      from __future__ import annotations
      
      import argparse
      import hashlib
      import json
      import re
      from dataclasses import dataclass, field
      from pathlib import Path
      from typing import Any
      
      
      SCHEMA = "academic-figure/RenderAudit@2"
      STATUSES = frozenset({"pass", "fail", "unverified"})
      CHECKS = (
          "semantic_topology", "visible_text", "background", "layout",
          "style_fidelity", "accessibility",
      )
      EDGE_FIELDS = ("from", "to", "kind", "direction", "line", "label")
      
      
      @dataclass
      class AuditReport:
          errors: list[str] = field(default_factory=list)
          nonpassing: list[str] = field(default_factory=list)
      
          @property
          def exit_code(self) -> int:
              return 2 if self.errors else (1 if self.nonpassing else 0)
      
          @property
          def passed(self) -> bool:
              return self.exit_code == 0
      
      
      def _text(value: Any) -> bool:
          return isinstance(value, str) and bool(value.strip())
      
      
      def _read_json(path: Path, name: str, report: AuditReport) -> tuple[Any, bytes]:
          try:
              raw = path.read_bytes()
              value = json.loads(raw)
          except (OSError, ValueError, UnicodeError, RecursionError) as exc:
              report.errors.append(f"{name}: cannot read JSON: {exc}")
              return None, b""
          if not isinstance(value, dict):
              report.errors.append(f"{name}: root must be an object")
              return None, raw
          return value, raw
      
      
      def _sha256(path: Path) -> str:
          digest = hashlib.sha256()
          with path.open("rb") as source:
              for chunk in iter(lambda: source.read(1024 * 1024), b""):
                  digest.update(chunk)
          return digest.hexdigest()
      
      
      def _status_record(value: Any, name: str, report: AuditReport, *, evidence: bool = True) -> None:
          if not isinstance(value, dict):
              report.errors.append(f"{name}: must be a status object")
              return
          status = value.get("status")
          if not isinstance(status, str) or status not in STATUSES:
              report.errors.append(f"{name}.status: must be pass, fail, or unverified")
          elif status != "pass":
              report.nonpassing.append(f"{name}: {status}")
          if evidence and not _text(value.get("evidence")):
              report.errors.append(f"{name}.evidence: must be a nonempty string")
      
      
      def _expected_topology(spec: dict, report: AuditReport) -> tuple[set[str], dict[str, dict]]:
          topology = spec.get("topology")
          if not isinstance(topology, dict):
              report.errors.append("spec.topology: must be an object")
              return set(), {}
          components = topology.get("components")
          connections = topology.get("connections")
          if not isinstance(components, list) or not components:
              report.errors.append("spec.topology.components: must be a nonempty list")
              components = []
          if not isinstance(connections, list):
              report.errors.append("spec.topology.connections: must be a list")
              connections = []
          nodes: set[str] = set()
          for index, component in enumerate(components):
              node_id = component.get("id") if isinstance(component, dict) else None
              if not _text(node_id):
                  report.errors.append(f"spec.components[{index}].id: must be a nonempty string")
              elif node_id in nodes:
                  report.errors.append(f"spec.components: duplicate id {node_id!r}")
              else:
                  nodes.add(node_id)
          edges: dict[str, dict] = {}
          for index, connection in enumerate(connections):
              name = f"spec.connections[{index}]"
              if not isinstance(connection, dict):
                  report.errors.append(f"{name}: must be an object")
                  continue
              edge_id = connection.get("id", f"edge_{index + 1:03d}")
              if not _text(edge_id):
                  report.errors.append(f"{name}.id: must be a nonempty string")
                  continue
              if edge_id in edges:
                  report.errors.append(f"spec.connections: duplicate id {edge_id!r}")
                  continue
              expected = {key: connection.get(key) for key in EDGE_FIELDS}
              expected["line"] = connection.get("line", "unspecified")
              expected["direction"] = connection.get("direction", "unspecified")
              expected["label"] = connection.get("label", "")
              for key in ("from", "to", "kind", "line"):
                  if not _text(expected[key]):
                      report.errors.append(f"{name}.{key}: must be a nonempty string")
              for endpoint in ("from", "to"):
                  if isinstance(expected[endpoint], str) and expected[endpoint] not in nodes:
                      report.errors.append(f"{name}.{endpoint}: unknown node {expected[endpoint]!r}")
              if expected["direction"] not in ("forward", "backward", "bidirectional", "unspecified"):
                  report.errors.append(f"{name}.direction: invalid direction")
              if not isinstance(expected["label"], str):
                  report.errors.append(f"{name}.label: must be a string")
              edges[edge_id] = expected
          return nodes, edges
      
      
      def _coverage(value: Any, expected: set[str], name: str, report: AuditReport) -> dict[str, dict]:
          if not isinstance(value, list):
              report.errors.append(f"{name}: must be a list")
              value = []
          records: dict[str, dict] = {}
          for index, record in enumerate(value):
              location = f"{name}[{index}]"
              _status_record(record, location, report)
              item_id = record.get("id") if isinstance(record, dict) else None
              if not _text(item_id):
                  report.errors.append(f"{location}.id: must be a nonempty string")
              elif item_id in records:
                  report.errors.append(f"{name}: duplicate id {item_id!r}")
              else:
                  records[item_id] = record
                  if item_id not in expected:
                      report.errors.append(f"{name}: unknown id {item_id!r}")
          missing = expected - records.keys()
          if missing:
              report.errors.append(f"{name}: missing ids: {', '.join(sorted(missing))}")
          return records
      
      
      def validate_paths(spec_path: Path, image_path: Path, audit_path: Path) -> AuditReport:
          """Check a saved audit; no computer-vision or renderer is invoked."""
          report = AuditReport()
          spec, spec_raw = _read_json(Path(spec_path), "spec", report)
          audit, _ = _read_json(Path(audit_path), "audit", report)
          if spec is None or audit is None:
              return report
          if spec.get("schema") != "academic-figure/FigureSpec@1":
              report.errors.append("spec.schema: expected academic-figure/FigureSpec@1")
          if audit.get("schema") != SCHEMA:
              report.errors.append(f"audit.schema: expected {SCHEMA}")
          if not _text(spec.get("figure_id")):
              report.errors.append("spec.figure_id: must be a nonempty string")
          if audit.get("figure_id") != spec.get("figure_id"):
              report.errors.append("audit.figure_id: does not match spec")
          if not _text(audit.get("render_revision")):
              report.errors.append("audit.render_revision: must be a nonempty string")
      
          declared_image = audit.get("image_path")
          if not _text(declared_image):
              report.errors.append("audit.image_path: must be a nonempty string")
          else:
              try:
                  candidate = Path(declared_image)
                  if not candidate.is_absolute():
                      report.errors.append("audit.image_path: must be an absolute path")
                  elif candidate.resolve() != Path(image_path).resolve():
                      report.errors.append("audit.image_path: does not match --image")
              except (OSError, ValueError, RuntimeError) as exc:
                  report.errors.append(f"audit.image_path: cannot resolve: {exc}")
      
          expected_hashes = {"spec_sha256": hashlib.sha256(spec_raw).hexdigest()}
          try:
              expected_hashes["image_sha256"] = _sha256(Path(image_path))
          except (OSError, ValueError) as exc:
              report.errors.append(f"image: cannot hash file: {exc}")
          for name in ("image_sha256", "spec_sha256"):
              supplied = audit.get(name)
              if not isinstance(supplied, str) or re.fullmatch(r"[0-9a-f]{64}", supplied) is None:
                  report.errors.append(f"audit.{name}: must be a lowercase SHA256 digest")
              elif name in expected_hashes and supplied != expected_hashes[name]:
                  report.errors.append(f"audit.{name}: does not match artifact bytes")
      
          _status_record(audit.get("spec_validation"), "spec_validation", report, evidence=False)
          _status_record(audit.get("image_inspection"), "image_inspection", report)
          expected_nodes, expected_edges = _expected_topology(spec, report)
          _coverage(audit.get("nodes"), expected_nodes, "nodes", report)
          edges = _coverage(audit.get("edges"), set(expected_edges), "edges", report)
          for edge_id, record in edges.items():
              if edge_id not in expected_edges:
                  continue
              for key in EDGE_FIELDS:
                  if key not in record or record[key] != expected_edges[edge_id][key]:
                      report.errors.append(f"edges[{edge_id!r}].{key}: does not match spec")
      
          checks = audit.get("checks")
          if not isinstance(checks, dict):
              report.errors.append("checks: must be an object")
              checks = {}
          for name in CHECKS:
              _status_record(checks.get(name), f"checks.{name}", report)
          # Additional named checks are allowed but cannot hide fail/unverified statuses.
          for name in sorted(set(checks) - set(CHECKS)):
              _status_record(checks[name], f"checks.{name}", report)
      
          defects = audit.get("defects", [])
          if not isinstance(defects, list):
              report.errors.append("defects: must be a list")
              defects = []
          for index, defect in enumerate(defects):
              if not isinstance(defect, dict):
                  report.errors.append(f"defects[{index}]: must be an object")
                  continue
              severity = defect.get("severity")
              if severity not in ("minor", "major", "critical"):
                  report.errors.append(f"defects[{index}].severity: invalid severity")
              elif severity in ("major", "critical"):
                  report.nonpassing.append(f"defects[{index}]: {severity}")
              if not (_text(defect.get("description")) or _text(defect.get("observed"))):
                  report.errors.append(f"defects[{index}]: description or observed must be a nonempty string")
      
          overall = audit.get("pass")
          if not isinstance(overall, bool):
              report.errors.append("audit.pass: must be a boolean")
          elif not report.errors and overall != (not report.nonpassing):
              report.errors.append("audit.pass: inconsistent with statuses and defect severity")
          return report
      
      
      def main(argv: list[str] | None = None) -> int:
          parser = argparse.ArgumentParser(description=__doc__)
          parser.add_argument("--spec", required=True, type=Path)
          parser.add_argument("--image", required=True, type=Path)
          parser.add_argument("audit", type=Path)
          args = parser.parse_args(argv)
          report = validate_paths(args.spec, args.image, args.audit)
          label = {0: "PASS", 1: "NOT ACCEPTED", 2: "INVALID"}[report.exit_code]
          print(f"{label}: audit record ({len(report.errors)} error(s), {len(report.nonpassing)} nonpassing item(s))")
          for error in report.errors:
              print(f"  ERROR: {error}")
          for item in report.nonpassing:
              print(f"  NOT PASSING: {item}")
          print("Record validation only: this does not inspect pixels or verify the truth of inspection evidence.")
          return report.exit_code
      
      
      if __name__ == "__main__":
          raise SystemExit(main())
      
  • SKILL.md 14.5 KB
    ---
    name: academic-figure-workflow
    description: Plan, generate, inspect, and refine academic figures from repositories, papers, draft notes, paper URLs, PDFs, or reference images. Supports fast-track draft-to-figure generation and user passthrough mode.
    metadata:
      version: "1.7.0"
    ---
    
    # Academic Figure Workflow
    
    Produce a grounded academic figure and a stable local artifact. Preserve the user's chosen backend, reference assets, style direction, review preference, and output scope.
    
    If the user asks only to construct, diagnose, or revise a figure prompt, route
    straight to designer's matching mode and stop before rendering. A prompt-only
    request does not require invented render paths or an extra approval gate.
    
    Load only what the current stage needs:
    
    - missing evidence → `references/missing-info-policy.md`
    - palette/style fallback → `references/palettes.md` and, when installed, `references/styles/`
    - Codex native image execution → `references/codex-image-workflow.md`
    - render inspection → `references/render-audit.md` (required before accepting an image)
    
    ## Route inputs by inspected content
    
    A URL is not automatically a repository. Inspect it first.
    
    | Input | Route | Execution Behavior |
    |---|---|---|
    | **Direct User Architecture (Passthrough)** | `../academic-figure-designer/SKILL.md` | **Skip analyzers**. User gave explicit nodes/flow; compile FigureSpec v1 and render directly. |
    | **Draft Notes / Outline / Partial Draft** | `../academic-figure-draft-analyzer/SKILL.md` | **Draft-to-Figure Fast-Track**. For rough notes, outlines, or sections without full results: focus on Figure 1 framework. |
    | **Complete Manuscript (Markdown / LaTeX / PDF / URL)** | `../academic-figure-draft-analyzer/SKILL.md` | **Full Planning**. For complete papers with experiments/results: multi-figure strategy, claim verification, and constraints. |
    | **Repository path or repository URL** | `../academic-repo-analyzer/SKILL.md` | Extract semantic architecture graph; omit engineering plumbing (data loaders, trainers). |
    | **Paper plus repository** | Hybrid | Paper/user defines narrative & topology; repository supplies parameter & dimension verification. |
    | **External style reference / existing render to edit** | External reference: `../academic-figure-architecture-extractor/SKILL.md`; edit baseline: `../academic-figure-designer/SKILL.md` revise mode | Extract transferable style from external references. For an edit baseline, preserve its scientific content, topology and visible text, then apply only the requested delta. |
    
    For an article URL, use an available web/browser/document reader to obtain the paper text, captions, and linked figures. For a PDF, use a PDF-capable reader for paper content and the architecture extractor only for figure images. If a sibling skill is missing, perform the minimum equivalent analysis and mark the degraded path.
    
    ## Keep versioned internal artifacts
    
    Store these as JSON-compatible objects. Do not make the user read them unless requested.
    
    ### FigurePlan v1
    
    ```text
    schema: academic-figure/FigurePlan@1
    source_revision, venue
    sources[]: {kind, uri_or_absolute_path, revision_or_page, evidence}
    figures[]: {
      figure_id, figure_type, priority, communication_goal, claim_scope[], hero_element,
      required_nodes[], required_connections[], authority_boundaries[], secondary_context[],
      forbidden_claims[], forbidden_connections[], aspect_ratio, final_width_mm,
      style_profile_hint, reference_assets[],
      open_questions[], confidence, review_status: pending|confirmed|waived
    }
    ```
    
    Components and connections are semantic and evidence-backed. A code directory count is not a figure hierarchy or palette decision.
    
    ### FigureSpec v1
    
    ```text
    schema: academic-figure/FigureSpec@1
    figure_id, plan_revision, sources[], prompt (internal), aspect_ratio, final_width_mm
    topology: {components[], connections[], groups[], authority_boundaries[]}
    visible_text[], caption_notes[], layout
    style_profile: classic-technical|pastel-airy-ui|illustrated-modular|reference-led
    style_preset, style_source, style_grammar, semantic_color_roles
    reference_images[]: checked absolute local paths or recent-conversation descriptors
    conversation-reference transient status stays in the execution packet
    must_not_claim[], forbidden_connections[], negative_constraints[]
    prompt_review: requested|confirmed|waived
    prompt_reviewed_sha256: required only when prompt_review is confirmed
    workspace_root: absolute declaration that must match the runtime-trusted root
    output_path: absolute path inside that root
    ```
    
    The internal `prompt` is renderer input, not a required user-facing deliverable.
    When `prompt_review` is `waived`, persist it only with the working artifacts and
    never paste it into the chat response.
    
    ### RenderAudit v2
    
    ```text
    schema: academic-figure/RenderAudit@2
    figure_id, render_revision, image_path, image_sha256, spec_sha256
    spec_validation: {status}
    image_inspection: {status, evidence}
    nodes[]: {id, status, evidence}
    edges[]: {id, from, to, kind, direction, line, label, status, evidence}
    checks: {semantic_topology, visible_text, background, layout,
             style_fidelity, accessibility} (each: {status, evidence})
    pass, defects[], targeted_edit, semantic_edits_used, semantic_edits_remaining
    ```
    
    Statuses are `pass|fail|unverified`. See the shared audit protocol for exact
    revision binding, complete graph coverage, and aggregate-pass requirements.
    Keep historical v1 audits as history; new renders require v2 inspection records.
    
    ## Build the plan
    
    Create the shortest FigurePlan that closes scientific ambiguity. When a reference exists, its transferable **style grammar** takes priority over venue stereotypes and preset defaults. Match composition, mark language, illustration level, region treatment, typography, spacing, arrow grammar, emphasis, and semantic color roles. Do not copy the reference's claims, labels, branding, or topology unless it is the user's redraw or edit baseline.
    
    Use plan review only when unresolved choices would materially change the result, the user asks to review it, or required content is still a placeholder. Otherwise record `review_status: waived` and continue. An unrelated reply is never confirmation.
    
    ## Select style without forcing a binary
    
    Make this decision after grounding the scientific skeleton and before finalizing layout or writing the renderer prompt. Reuse the user's chosen direction; then let designer jointly resolve composition, visual anchors, text capacity and color. Follow designer's `references/prompt-design-logic.md` for reference handling and bounded style-only revisions. This is a design dependency, not an additional user approval gate.
    
    Use the closest observable profile and record its canonical FigureSpec ID:
    
    - `classic-technical`: restrained strokes, exact topology, minimal illustration;
    - `pastel-airy-ui`: white cards, light separation, color on tokens/curves;
    - `illustrated-modular`: low-saturation filled regions, darker paired outlines/titles, one-level subcards, editorial or hand-drawn line art, asymmetric hero layout;
    - `reference-led`: an override mode with at least one local or recent-conversation reference image; preserve the observed grammar whether it is technical, airy, illustrated, or a coherent combination.
    
    Use `style_preset` for named library variants. Never interpret `reference-led` as
    an alias for `illustrated-modular`.
    
    Color follows semantic zones and accessibility constraints, which is handled directly by `academic-figure-designer`.
    
    ## Create the spec
    
    Select one planned figure at a time. Use `academic-figure-designer` (the unified engine) to compile FigureSpec v1 and normalized structured rendering briefs across all supported profiles (`classic-technical`, `pastel-airy-ui`, `illustrated-modular`, or `reference-led`). If a supplied reference defines a custom grammar, construct FigureSpec v1 directly from ReferenceAnalysis v1. Never force a reference into white-fill colored-border boxes.
    
    Prompt review is conditional and has executable state semantics:
    
    - `requested`: show the current internal prompt and **stop before rendering**;
    - `confirmed`: hash the exact reviewed UTF-8 prompt as lowercase SHA-256, save it
      in `prompt_reviewed_sha256`, and render only while that hash still matches;
    - `waived`: omit `prompt_reviewed_sha256`, keep the prompt internal, and render
      without displaying it.
    
    If a confirmed prompt changes, return to `requested` and review the new prompt.
    Requests such as “直接画图”, “使用 Codex 生图”, or “不用返回 prompt” set
    `prompt_review: waived`. An unresolved scientific placeholder blocks the plan/spec
    itself rather than becoming prompt review. A waived prompt is never included in
    user-facing output.
    
    ## Optional parallel delegation
    
    Skills define reusable procedures; they are not persistent subagents. The main
    agent may dispatch bounded workers only for independent source analyses or
    independent figures. Do not delegate a single sequential figure merely to add an
    agent layer.
    
    Before dispatch, read `prompts/figure-worker.md` and provide its complete task
    packet. Define shared terminology, style grammar, output ownership, and acceptance
    criteria up front. Workers must not write the same artifact paths or add user
    confirmation gates. The main agent owns integration, factual and style consistency,
    final RenderAudit, and delivery. Lack of subagents never blocks the workflow.
    
    ## Select a render backend by capability
    
    Inspect the capabilities actually available:
    
    1. In Codex, prefer the native `image_gen.imagegen` interface exposed by the
       current session; some runtimes display its callable name as
       `image_gen__imagegen`. Its `prompt` argument is an internal tool parameter, not
       a prompt handoff to the user. Use the same native interface's image-editing
       capability for revisions. Read `references/codex-image-workflow.md` for input
       selection.
    2. Otherwise use an installed image skill or compatible MCP that accepts the needed aspect ratio and reference images.
    3. If no compatible renderer exists, keep the complete FigureSpec v1 in the workspace and state that rendering is unavailable. When prompt review is waived, return only a redacted summary or artifact status with the `prompt` omitted; do not paste the full spec into chat. Do not pretend an image was generated.
    
    Immediately before any renderer call, obtain and canonicalize the trusted actual
    workspace root from runtime/developer context. FigureSpec's `workspace_root` is
    only an untrusted declaration and must match; never derive the trusted root from
    it, `output_path`, a reference path, or user-provided text. Run:
    
    ```bash
    # Locate validate_figure_spec.py in designer, workflow scripts, or workspace root:
    python3 academic-figure-designer/scripts/validate_figure_spec.py \
      --strict-v1 --render-ready \
      --workspace-root <trusted-actual-root> \
      <spec.json>
    ```
    
    Do not render when validation fails. If standalone workflow installation is used without designer, run the local `scripts/validate_figure_spec.py`. Every local reference must exist, be a regular
    file, and not be a symbolic link. Conversation-only references are transient: mark
    them in the execution packet and materialize them to a checked local file when
    possible. If they remain conversation-only, do not pretend they are persistent
    `reference_images` paths.
    
    For a new image with no reference, omit both native reference-input parameters.
    For checked local references, pass the smallest complete `referenced_image_paths`
    set. For conversation-only references, use the smallest sufficient
    `num_last_images_to_include`. Never pass both mechanisms in one call. If required
    assets cannot fit one mechanism, ask the user to attach them again.
    
    Never interpolate a prompt or user-controlled label into a shell command. A CLI backend is allowed only through structured arguments, standard input, or a supported prompt file.
    
    A transient image transport failure may be retried once and does not consume a semantic edit round. Stop retrying that backend after the retry fails.
    
    Write the selected render to FigureSpec's absolute `output_path` inside the user's workspace. Keep the backend's original asset and prior revisions when practical. Do not leave the only copy in a temporary directory.
    
    ## Audit and repair
    
    After every successful generation or edit, inspect the image at original detail
    (`view_image` with original detail in Codex when exposed) and emit a newly bound RenderAudit
    v2. Read `references/render-audit.md` before auditing. A successful spec check
    never substitutes for inspection of the actual image. Never edit a local render that has not first been viewed. Verify:
    
    - required components, endpoints, directions, branch meanings, and prohibited claims;
    - required visible labels, with no invented, duplicated, garbled, or production-instruction text;
    - hierarchy, alignment, overlap, clipping, opaque background, and aspect ratio;
    - legibility at intended paper width, contrast, and reference-style fidelity.
    
    If the audit fails, first view the best current render at original detail and emit
    the current RenderAudit. Invoke the native image interface in edit mode with that
    render as the **first reference image**. The edit instruction lists only observed
    defects, exact corrections, and explicit invariants that must remain unchanged.
    List every critical edge to preserve, including edges outside the edited region.
    Save a new revision and reset its audit statuses to unverified. Re-view and
    recheck the entire required node/edge ledger before any further action. Allow at most
    **two semantic edit rounds** after the initial render. A transient transport retry
    does not consume this budget. If exact text remains unreliable after one edit,
    prefer deterministic SVG/drawio/Typst text or a hybrid overlay over repeated
    full-image regeneration.
    
    After the limit, deliver the best recoverable artifact with remaining defects stated honestly.
    
    Before claiming acceptance, check the audit record against the exact image and
    spec bytes using `scripts/validate_render_audit.py --spec <spec.json>
    --image <image.png> <audit.json>`. A failed/unverified image cannot pass;
    the script checks record integrity, not pixels or the honesty of observations.
    
    ## Deliver
    
    Before delivery, automatically sanitize the final image artifact using `clean_image_metadata.py` to strip any embedded C2PA, EXIF, XMP, or provenance markers for pristine publication readiness. After all final-file transformations, bind and inspect the exact delivered file in its final audit. Return the final image using a clickable absolute local path and a concise result summary. Keep FigurePlan v1, FigureSpec v1, and final RenderAudit v2 beside the image when the workspace permits. Do not use `file://` and never append a waived prompt. Stop before rendering if the user asked only for analysis or planning.
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.

Related