yhz5613813/cadflow/cadflow-realtime-preview
Claude Code and agent skill by yhz5613813/cadflow
- community
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-previewSKILL.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()orShape.export_preview_glb()for a direct native
model preview without Scene semantics or CAD edge assets.
- Use
agent_dsl.RealtimePreviewfor 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
- Apply or merge the DSL document through
ModelStore; never render an
uncommitted prospective model.
- 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.
- Schedule one background build per model. Replace pending work with the
newest build and check the build ID again before promotion.
- Compile draft Scenes with linear/angular tolerances
0.35/0.22; compile
final Scenes with 0.1/0.08.
- Write blobs first, write
scene.jsonlast, then atomically promote the
latest descriptor.
- Emit
revision_pending,revision_ready, orrevision_failed. Include
model, revision, build, quality, and the manifest URL where applicable.
- 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:
Run and Verify
Build and test with the requested project environment:
Start the workbench with:
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
- SKILL.md in the repositoryCheckingskills/cadflow-realtime-preview/SKILL.md
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
[](https://verified-skill.com/skills/yhz5613813/cadflow/cadflow-realtime-preview)