My AI agent kept saying the job was done. So I made it prove it.

Reddit r/AI_Agents Tools

Summary

A developer describes building a Claude Code skill that verifies AI-generated CAD geometry before export, catching silent OpenCASCADE failures like un-shelled parts and misplaced cuts using volume, bounding box, and point classification checks.

I am using Claude Code to generate parts and export them as STEP files for SolidWorks — actual B-rep solids, not STL meshes. Most of the time, it works surprisingly well. The problem is the failures that look like successes. I was building a 94 × 65 × 26 mm enclosure with 2.5 mm walls. The script ran cleanly, printed `[OK]`, and the STL preview looked exactly like a hollow enclosure. It wasn't hollow. The part contained about 158,048 mm³ of material. Based on the dimensions, it should have been around 33,370 mm³. `IsValid()` still returned `True`. OpenCASCADE had silently failed to shell the part and handed back what was basically the original solid brick. That made me stop trusting “the script ran” as evidence that the CAD was actually right. So I built a Claude Code skill that adds verification before export. It checks things like: * **Expected volume** derived from the dimensions in the design, not from the generated geometry. In the enclosure case, the result was off by about 4.7×, so you don't need a tight tolerance to catch the failure. * **Bounding box** against the dimensions the part is supposed to occupy. * **Point classification** at coordinates that should contain material or empty space. This caught another case where a port was cut into the wrong wall. Validity, solid count, and overall volume all still looked reasonable because the cut itself was the right size — just in the wrong place. * **Known OpenCASCADE failure modes**, with repro cases checked against the current CadQuery/OCP version instead of assuming old behavior still applies. The workflow is basically: describe the part in plain English → Claude writes the CadQuery → it asks when important dimensions are missing instead of making them up → checks the resulting geometry → exports STEP only after the checks pass. I also tested a separate malformed STEP where the reported solid volume was physically larger than its own bounding box could contain. SolidWorks opened it without an error dialog or Import Diagnostics complaint. So “SolidWorks opened it” isn't much of a verification strategy either. One thing I wanted to avoid was fake verification where the script measures its own result and then asserts that the result matches what it just measured. The expected values here are derived from the design constraints you gave it. Otherwise you're just letting the model grade its own homework.
Original Article

Similar Articles

How do you know when an AI coding agent is actually done?

Reddit r/AI_Agents

The author built OpenPitStop, an open-source tool that independently checks and verifies the work of AI coding agents, demonstrated on a broken application, and invites discussion on how to trust AI changes.

AI agents still suck, so I built my own

Reddit r/AI_Agents

The author built a custom AI agent application wrapping Claude Code and upcoming Codex support, focusing on composable workflows and seeking community feedback.

When the AI agent builds the tool instead of doing the task

Reddit r/artificial

An AI agent automated CAD drafting by building a custom tool that converts design parameters into geometry, delivering a plugin and documentation. This case highlights a trend where AI constructs tools rather than executing tasks directly.