yhz5613813/cadflow/cadflow-realtime-preview

Claude Code and agent skill by yhz5613813/cadflow

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Add, operate, or debug revision-driven real-time rendering for CadFlow native Shape objects and the stateful Agent DSL. Use when work involves preview mesh buffers, browser-ready GLB output, Scene 1.0 compilation, background tessellation, SSE revision events, the Three.js preview workbench, or stale-render and preview-latency problems in this repository.

Install

npx vskill@latest install yhz5613813/cadflow/cadflow-realtime-preview

SKILL.md

CadFlow Real-Time Preview

Overview

Build previews at committed revision boundaries. Keep native tessellation in C++, use public cadflow interfaces in Python, and publish only complete Scene artifacts to the browser.

Choose the Path

  • Use Shape.preview_mesh_buffer() for a custom renderer that needs compact

float32 positions/normals and uint16/uint32 indices.

  • Use Shape.preview_glb() or Shape.export_preview_glb() for a direct native

model preview without Scene semantics or CAD edge assets.

  • Use agent_dsl.RealtimePreview for stateful DSL revisions, Scene manifests,

edge GLBs, SSE delivery, and the bundled Three.js workbench.

Do not route user code through cadflow._engine, OCP objects, native handles, or direct shared-library loading. Import cadflow as cad and use the public frontend or Scene facade.

Implement a Revision Preview

  1. Apply or merge the DSL document through ModelStore; never render an

uncommitted prospective model.

  1. Obtain the committed live result through apply_with_model() and

AgentModel.result_value to avoid a second replay. When the document has a preview SHAPE QUALITY effect, resolve that committed target through AgentModel.named_value() instead of silently falling back to result.

  1. Schedule one background build per model. Replace pending work with the

newest build and check the build ID again before promotion.

  1. Compile draft Scenes with linear/angular tolerances 0.35/0.22; compile

final Scenes with 0.1/0.08.

  1. Write blobs first, write scene.json last, then atomically promote the

latest descriptor.

  1. Emit revision_pending, revision_ready, or revision_failed. Include

model, revision, build, quality, and the manifest URL where applicable.

  1. In the viewer, reject older revision/build pairs, swap the model root as one

operation, preserve OrbitControls state, and fit the camera only for the first successful scene.

Treat preview SHAPE [draft|final] as an effect. Keep it out of durable command history and do not increment the revision for an effect-only submission.

Preserve the Native Contract

Keep the CFMB buffer versioned and little-endian. Its header is <4sIIII6f>, followed by position float32 values, normal float32 values, and triangle indices. Convert CAD (x, y, z) millimeters to glTF (x, z, -y) / 1000. Correct reversed faces, normalize vertex normals, encode positive zero, rotate each triangle to its minimum cyclic ordering, and sort triangle records before wrapping the buffer as a closed-profile GLB.

Always validate native GLBs with:

python
cad.scene.preflight_glb(payload, expected_kind="triangle")

Run and Verify

Build and test with the requested project environment:

bash
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
-DPython3_EXECUTABLE=.venv/bin/python
cmake --build build --parallel 2
.venv/bin/python -m pip install \
--no-build-isolation --no-deps .
PYTHONPATH=.:python .venv/bin/python \
-m pytest -q agent_dsl/tests/test_realtime.py
PYTHONPATH=python \
CADFLOW_CORE_LIBRARY="$PWD/build/native/libcadflow_core.so" \
.venv/bin/python \
-m pytest -q tests/test_native_backend.py::test_native_preview_buffer_and_glb_profile

Start the workbench with:

bash
PYTHONPATH=.:python .venv/bin/python \
-m agent_dsl.realtime --host 127.0.0.1 --port 8765

Verify /, submit one revision through /models/{id}/apply, wait for revision_ready, fetch its manifest and GLBs, and inspect the workbench at a desktop and mobile viewport. Check the browser console and confirm the canvas contains non-background pixels before finishing frontend changes.

Diagnose Failures

  • If the C ABI symbol is missing, rebuild/install CadFlow and confirm

cadflow.__file__ and CADFLOW_CORE_LIBRARY point at the intended build.

  • If strict GLB preflight fails, fix canonical buffer ordering or padding; do

not weaken the validator.

  • If the browser shows stale geometry, compare both revision and build ID and

confirm only the current build promotes latest.json.

  • If the model is blank, inspect revision_failed, fetch the manifest and GLBs

directly, then check WebGL canvas pixels and the browser console.

  • If latency grows with history, ensure the preview uses the live model

returned by apply_with_model() rather than calling ModelStore.open() immediately after every apply.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
61
7-day trend score
21

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/yhz5613813/cadflow/cadflow-realtime-preview/badge)](https://verified-skill.com/skills/yhz5613813/cadflow/cadflow-realtime-preview)

Something wrong with this skill or its page? Tell us.