agentleFS
jaylampingjaylamping/solidworks-mcp/.cursor/rules/solidworks-confirm-and-save.mdc

solidworks-mcp / rules

Cursor rule4 starsChanged 4 months agoMITView on GitHub

SolidWorks MCP CAD edit/save confirmation workflow

  • Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.

    Of the Cursor rule files we read, the 1,531 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository2 other files it gives its agents.

The file

We split this solidworks-confirm-and-save.mdc into the rules it gives an agent

8 rules. About 0 are common, 1 is distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When editing assemblies/parts through SolidWorks MCP / the COM worker:

    line 8
  2. Very specific:

    If a change goes wrong, call solidworks_list_checkpoints then solidworks_restore_from_checkpoint with confirm: true (and path if needed) …

    line 11
  3. Very specific:

    After each meaningful CAD change cycle, capture a export PNG with keep_view: true (or describe the live viewport) and ask the user: "Does …

    line 12
  4. Very specific:

    Do not call save_document as the happy-path lock-in after pose/mate work.

    line 13
  5. Very specific:

    Only after the user explicitly says yes, call solidworks_confirm_and_save with:

    line 14
  6. Very specific:

    Treat confirm_and_save / assembly save_document ok: false as failure even if saved: true.

    line 19
  7. Very specific:

    Never tell the user something is "locked in" / PASS until confirm_and_save returns ok: true (and poseStable: true for assemblies).

    line 21
  8. Very specific:

    Prefer save_as_copy checkpoints when the doc is open (captures unsaved session state).

    line 32

≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
solidworks-confirm-and-save.mdc
---
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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.