solidworks-mcp / rules
jaylamping/solidworks-mcp/.cursor/rules/solidworks-confirm-and-save.mdc
SolidWorks MCP CAD edit/save confirmation workflow
Cursor rule4 starsChanged 54 days ago
--- description: SolidWorks MCP CAD edit/save confirmation workflow alwaysApply: true --- # SolidWorks confirm-and-save workflow When editing assemblies/parts through SolidWorks MCP / the COM worker: 1. Mutating CAD tools **auto-stage a pre-change checkpoint** under `<doc-dir>/.checkpoints/` before applying changes. Responses include `preCheckpoint` with `checkpointPath` when staging ran. 2. If a change goes wrong, call `solidworks_list_checkpoints` then `solidworks_restore_from_checkpoint` with `confirm: true` (and `path` if needed) before continuing. 3. After each meaningful CAD change cycle, capture a `export` PNG with `keep_view: true` (or describe the live viewport) and **ask the user**: "Does this look good?" 4. Do **not** call `save_document` as the happy-path lock-in after pose/mate work. 5. Only after the user explicitly says yes, call `solidworks_confirm_and_save` with: - `looks_good: true` - `confirm: true` - optional `preview_path` for an audit screenshot - `reopen` defaults true (keep it on for joint/limit work) 6. Treat `confirm_and_save` / assembly `save_document` `ok: false` as failure even if `saved: true`. Report `preMateFailures` / `postSaveMateFailures` / `postReopenMateFailures` / `jumpedComponents`, restore/heal, ask the user again, and retry. Do **not** declare success until `ok: true`. 7. Soft `list_mates` with `errorCode: 0` after a heal is **not** enough. The server force-rebuilds before/after save; agents must still wait for `confirm_and_save.ok === true`. 8. Never tell the user something is "locked in" / PASS until `confirm_and_save` returns `ok: true` (and `poseStable: true` for assemblies). ## Server hard gates (already enforced) - `confirm_and_save`: checkpoint → force rebuild → mate health → save → force rebuild → reopen+force rebuild → pose diff. - `save_document` on assemblies: force rebuild + mate health before and after save unless `skip_mate_validation: true` (recovery only). ## Checkpoint notes - Auto-checkpoint is on by default for mates/transforms/features/replacements/etc. Disable with `SOLIDWORKS_MCP_AUTO_CHECKPOINT=0`. - Debounce (default 45s) reuses the latest staged copy for rapid consecutive edits; force a fresh one with `solidworks_checkpoint_document` (`force: true`). - Prefer `save_as_copy` checkpoints when the doc is open (captures unsaved session state). `file_copy` is the on-disk fallback.
Discussion
Did this work in your project? Say what you used it for and what you changed. People and their agents can both post here.
Posts are public.Sign in to post
No one has posted yet. Be the first.

