agentleFS
Hugging FaceKnown publisherhuggingface/cadgenbench/.cursor/rules/project-context.mdc

cadgenbench / rules

Cursor rule138 starsChanged 6 months agoApache-2.0View on GitHub

Fixtures live in two HF dataset repos (cadgenbench-data public, cadgenbench-data-gt private) — resolved at runtime by cadgenbench.common.paths. There is no data/ directory in this repo any more. The set is still shifting (parts get added, removed, or replaced as authoring catches issues), so do not hardcode fixture names or counts anywhere; treat the inputs dataset as the source of truth. Fixtures (inputs + ground truth) and authoring/submitter sanity scripts live in two HF dataset repos (cadgenbench-data, cadgenbench-data-gt), resolved at runtime…

  • 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,533 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 repository4 other files it gives its agents.

The file

We split this project-context.mdc into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    The LLM layer is model-agnostic: All LLM calls go through LiteLLM.

    line 45
  2. Distinctive:

    Keep it simple: No abstractions until a second implementation demands one.

    line 47

≈ “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
project-context.mdc
# CADGenBench: project context

## what this is
A benchmark for **AI-driven CAD generation and editing**: given a
textual or visual description of a mechanical part (or an existing
STEP file plus an edit request), how well does a system produce a
valid, geometrically correct 3D model? The benchmark is
**system-agnostic** — a submission can come from an agent, a script,
or a human in a CAD tool; the contract is just `output.step` per
fixture. The repo contains the scoring engine + docs + a reference
baseline (an iterative LLM agent that writes build123d Python). Eval
itself runs on the leaderboard Space
(`HuggingAI4Engineering/cadgenbench-leaderboard`) — the GT is private,
so the Space is the only consumer.

Fixtures live in two HF dataset repos
([`cadgenbench-data`](https://huggingface.co/datasets/HuggingAI4Engineering/cadgenbench-data)
public,
[`cadgenbench-data-gt`](https://huggingface.co/datasets/HuggingAI4Engineering/cadgenbench-data-gt)
private) — resolved at runtime by `cadgenbench.common.paths`. There is
no `data/` directory in this repo any more. The set is still shifting
(parts get added, removed, or replaced as authoring catches issues),
so do not hardcode fixture names or counts anywhere; treat the inputs
dataset as the source of truth.

## scope (what to ship in v1)
- A small set of fixtures (mating-jig parts plus derived editing-task
  fixtures) under `data/inputs/` (public) + `data/gt/` (release TBD).
- Four metric axes: validity (gate), shape similarity, interface
  match, topology match. Combined as **CAD Score** = mean of
  applicable components, hard-zeroed by validity failure.
- One CLI entry point: `cadgenbench` (alias `cgb`) with subcommands
  `evaluate`, `baseline run`, `baseline package`, `report single`.
- One baseline: iterative build123d agent (no other strategies, no
  multi-library helper agents).

## critical design principles
- **CAD geometry is always loaded from BREP**, never from a
  pre-tessellated mesh. Measurements (volume, bbox, topology counts)
  come from OCCT on the BREP. Triangulation is only for the renderer
  and for mesh-pipeline sanity checks.
- **The evaluator takes a STEP file and returns a metrics dict.** It
  does not know which code (LLM, script, human) produced the geometry.
  This is what makes the benchmark generator-agnostic.
- **The LLM layer is model-agnostic.** All LLM calls go through
  LiteLLM. No Anthropic / OpenAI / Gemini SDK imports in core modules.
- **Keep it simple.** No abstractions until a second implementation
  demands one. Drop dead options aggressively (we already dropped the
  multi-strategy dispatcher, the multi-library helper agents, and the
  metadata-side-metric path because none of them had a real consumer).

## key libraries
| concern | library | notes |
|---|---|---|
| CAD geometry | build123d | Python wrapper over OCCT; pip-installable via the cadquery-ocp wheel |
| OCCT bindings | OCP | ships with build123d |
| Mesh / boolean ops | trimesh, manifold3d | mesh-side validity + interface IoU |
| LLM routing | LiteLLM | unified API across providers |
| Headless render | pyvista (VTK) | mesh-based; in-process; auto GPU OpenGL when present, software OpenGL otherwise |
| Config / yaml | PyYAML | fixture descriptions, AgentConfig defaults |

## repo layout (high level)
```
src/cadgenbench/        package source
  cli.py                unified `cadgenbench` entry
  common/               shared between eval and baseline
  eval/                 metrics, alignment, reports
  baseline/             reference LLM agent
tests/                  pytest, mirrors src/cadgenbench/
docs/                   metric specs + submission contract
```

Fixtures (inputs + ground truth) and authoring/submitter sanity scripts
live in two HF dataset repos
([`cadgenbench-data`](https://huggingface.co/datasets/HuggingAI4Engineering/cadgenbench-data),
[`cadgenbench-data-gt`](https://huggingface.co/datasets/HuggingAI4Engineering/cadgenbench-data-gt)),
resolved at runtime by `cadgenbench.common.paths`. See the top-level
README for env-var setup.

## what was removed (don't re-introduce)
Earlier iterations of this codebase tried to be many things at once;
most got cut. If you see references to any of these in old git
history, they are intentionally gone and should not come back without
explicit discussion:
- Browser-based opencascade.js WASM viewer + FastAPI/WebSocket server.
- Multi-strategy agent dispatcher (only one strategy ever existed).
- Multi-library cheat sheets (bd_warehouse, py_gearworks,
  gridfinity_build123d). The baseline uses build123d only.
- Free-text `--task` invocation of the baseline (no fixture).
- DINOv1 visual-similarity metric (a deleted `_render.py` under the
  old validator path).
- `gt_metadata` / `metadata_metrics` (weight-error side metric).
- Per-fixture `ground_truth.glb` previews.
- `gitpython` "commit per successful iteration" memory model.
- `docs/architecture.md`, `docs/agent_v0.md`, `docs/tasks/`,
  `docs/dataset_research/`, `docs/metrics_bundle.*`.

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.