agentleFS
Hugging FaceKnown publisherhuggingface/cadgenbench/.cursor/rules/code-audit.mdc

cadgenbench / rules

Cursor rule138 starsChanged 6 months agoApache-2.0View on GitHub

Pre-launch checklist for shipped code paths. Run before announcing the leaderboard publicly. Style basics (Python 3.12+, type hints, sync only, no fallbacks, no silent exception swallowing) live in style.mdc.

  • 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 code-audit.mdc into the rules it gives an agent

9 rules. About 0 are common, 6 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Default to the shape established by other HF benchmark code repos.

    line 10
  2. Distinctive:

    When something isn't otherwise pinned, do what they do.

    line 11
  3. Distinctive:

    No commented-out blocks of code.

    line 24
  4. Distinctive:

    No unreferenced functions, classes, or modules.

    line 25
  5. Very specific:

    No leftover XXX, HACK, or DEBUG markers.

    line 28
  6. Distinctive:

    No API keys, tokens, or webhook URLs in source.

    line 59
  7. Very specific:

    No absolute filesystem paths (/Users/, /home/, C:\).

    line 60
  8. Very specific:

    Every .py file under cadgenbench/src/, cadgenbench/cli.py, and AI4Engineering/ starts with the standard Apache-2.0 header (Copyright 2026 …

    line 76
  9. Distinctive:

    Run each greppable pattern above against the in-scope paths.

    line 103

≈ “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
code-audit.mdc
# CADGenBench: code audit

Pre-launch checklist for shipped code paths. Run before announcing
the leaderboard publicly.

Style basics (Python 3.12+, type hints, sync only, no fallbacks,
no silent exception swallowing) live in [style.mdc](./style.mdc).

## adhere to HF benchmark conventions
- Default to the shape established by other HF benchmark code repos.
  When something isn't otherwise pinned, do what they do.
- Reference repos:
  - [huggingface/lighteval](https://github.com/huggingface/lighteval),
    [bigcode-project/bigcodebench](https://github.com/bigcode-project/bigcodebench)
    (eval package layout, CLI shape)
  - [adyen/DABstep](https://huggingface.co/spaces/adyen/DABstep/tree/main)
    (leaderboard Space code, submit flow, dataset reader)
  - [huggingface/datasets](https://github.com/huggingface/datasets)
    (Apache-2.0 LICENSE + pyproject conventions)

## no leftover code
- No `print(` for diagnostics on shipped paths. CLI user-facing
  output stays; ad-hoc traces go.
- No commented-out blocks of code. Delete or extract.
- No unreferenced functions, classes, or modules. If nothing
  imports it and no CLI invokes it, delete it.
- No dead imports.
- No leftover `XXX`, `HACK`, or `DEBUG` markers. Resolve them or
  open an issue.
- Greppable tells:
  - `print(`, `breakpoint(`, `pdb.set_trace`, `# XXX`, `# HACK`,
    `# DEBUG`.
  - `ruff check --select F401,F811,F841` for unused imports,
    redefinitions, and locals.
  - `vulture src/ AI4Engineering/` for unreferenced symbols (manual
    triage; vulture is heuristic).

## no overengineering
- Match the surface area of comparable HF benchmarks. Lighteval and
  bigcodebench are the size targets; do not exceed without reason.
- Drop abstractions that have a single consumer: factories with one
  implementation, registries with one entry, base classes with one
  subclass, config systems for two flags.
- Drop dependencies that replace fewer than ~50 lines of correct
  code (see [style.mdc](./style.mdc)).
- Manual review: walk `src/` and ask "would lighteval do this?" for
  each module. If the answer is "no, they'd inline it", inline it.

## no pre-launch TODOs
- Any `TODO` or `FIXME` referencing "before launch", "before
  release", "before announcing", "pre-launch", or "pre-release"
  must be actioned or downgraded to a tracked post-launch item.
- Greppable:
  `rg -n -i '(TODO|FIXME).*(before|pre.?launch|pre.?release|announce)'`

## no hardcoded org / paths / secrets
- Org slug `HuggingAI4Engineering` comes from env (e.g.
  `CADGENBENCH_HF_ORG`); no literal in code paths.
- No API keys, tokens, or webhook URLs in source. Secrets via env.
- No absolute filesystem paths (`/Users/`, `/home/`, `C:\`). Use
  `Path(__file__)` or env-driven paths.
- Greppable (each should return zero hits in scope):
  - `rg -n 'HuggingAI4Engineering'`
  - `rg -n '/Users/|/home/|C:\\\\'`
  - `rg -n '(sk-|hf_|ghp_|xox[baprs]-)[A-Za-z0-9_-]{20,}'`

## license metadata matches LICENSE
- `cadgenbench/pyproject.toml`: `license = "Apache-2.0"` and
  `license-files = ["LICENSE"]` (PEP 639).
- `cadgenbench/LICENSE` is the full Apache-2.0 text.
- Cross-check: `rg -n '^license' cadgenbench/pyproject.toml` and
  `rg -n 'Apache License' cadgenbench/LICENSE` both return the
  expected lines.

## license headers on source files
- Every `.py` file under `cadgenbench/src/`, `cadgenbench/cli.py`,
  and `AI4Engineering/` starts with the standard Apache-2.0 header
  (`Copyright 2026 Hugging Face` plus the boilerplate). Matches
  `huggingface/datasets`, `lighteval`, `bigcodebench`.
- Greppable check (run from each repo root):
  `for f in $(git ls-files '*.py'); do head -15 "$f" | rg -q 'Apache License' || echo "missing: $f"; done`

## tests pass
- `pytest -q` clean across `cadgenbench/tests/`. Run the full suite
  yourself unsandboxed (`required_permissions: ["all"]`); the
  renderer-dependent tests (`tests/common/test_viewer.py`, baseline
  end-to-end) need a real GL context the sandbox lacks, so they pass
  only unsandboxed. The non-renderer tests also run in the sandbox.
  See style.mdc "VTK renderer".

## scope
- In scope:
  `cadgenbench/src/**/*.py`, `cadgenbench/cli.py`,
  `AI4Engineering/**/*.py`, sibling scripts in
  `cadgenbench-data{,-gt}/**/*.py`,
  `cadgenbench-submissions/**/*.py`.
- Out of scope:
  `cadgenbench/tests/**` (debug prints + TODOs allowed; tests
  must still pass per the section above),
  `space-setup/**`.

## audit recipe
- Run each greppable pattern above against the in-scope paths.
- For each hit: fix, delete, or document why it survives (env-var
  contract, intentional CLI output, etc.).

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.