agentleFS
NVIDIAKnown publisherNVIDIA/paidf-simulation/.cursor/rules/python_codestyle.mdc

paidf-simulation / rules

Cursor rule7 starsChanged 6 months agoApache-2.0View on GitHub

This repository is not an Isaac Sim extension tree. Python lives mainly under scripts/ (SDG, USD→ROI, procedural board, editors). There is no repo-wide formatter or ./repo.sh lint wrapper configured here. There is no automated formatter in this repo. Still follow these so edits resemble what Black and isort would do—small diffs, predictable layout, easier future adoption if you add Ruff/Black later.

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

The file

We split this python_codestyle.mdc into the rules it gives an agent

9 rules. About 0 are common, 5 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Prefer PEP 604 unions and builtins: X | Y, list[str], dict[str, int] (not typing.List, Optional unless needed for quirks).

    line 12
  2. Very specific:

    Use from __future__ import annotations in new modules when forward references or cleaner annotations help.

    line 13
  3. Very specific:

    Put types in signatures, not in docstrings (see python_docstrings.mdc).

    line 14
  4. Distinctive:

    Keep changes minimal: match naming, patterns, and error-handling style of the file.

    line 32
  5. Distinctive:

    Quotes: prefer double-quoted strings in new or heavily touched code.

    line 41
  6. Distinctive:

    Trailing commas: use in multi-line calls, literals, and collections so the next line is a one-line diff.

    line 42
  7. Distinctive:

    Dict / comprehensions: prefer breaking across lines with trailing commas when they would exceed the line-length target.

    line 45
  8. Distinctive:

    No project-enforced Black / Ruff / isort config is committed.

    line 49
  9. Very specific:

    If you add local checks, scope them to scripts/ (and any other Python roots you introduce).

    line 50

≈ “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
python_codestyle.mdc
---
alwaysApply: true
---

# Python codestyle (pcb-aoi)

This repository is **not** an Isaac Sim extension tree. Python lives mainly under `scripts/` (SDG, USD→ROI, procedural board, editors). There is **no** repo-wide formatter or `./repo.sh` lint wrapper configured here.

## Python version and typing

- Target **Python 3.10+** (`requires-python` in `pyproject.toml`).
- Prefer **PEP 604** unions and builtins: `X | Y`, `list[str]`, `dict[str, int]` (not `typing.List`, `Optional` unless needed for quirks).
- Use **`from __future__ import annotations`** in new modules when forward references or cleaner annotations help; match the style of the file you edit.
- Put **types in signatures**, not in docstrings (see `python_docstrings.mdc`).

## USD / Omniverse code

- For **USD stage and prim work**, prefer **`pxr`** types and APIs already used in this repo: `Usd`, `UsdGeom`, `UsdLux`, `UsdShade`, `Gf`, `Sdf`, `Vt`, etc. Use `str` for prim paths when that is clearer than `Sdf.Path`.
- In **Kit / Isaac Sim app** contexts, using **`omni.usd.get_context().get_stage()`** and other `omni.*` APIs is fine when the module already runs inside Kit.
- **Do not** introduce or require **`isaacsim.core.experimental`** (or other Isaac Sim high-level prim wrappers) for USD work unless the file **already** depends on that package. Prefer `pxr` plus explicit prim paths and `Usd.Prim` / schema helpers.

## Imports and structure

- **Import blocks** (same spirit as **isort** “profile black”, even though nothing runs it in CI):
  1. `from __future__ import annotations` when the file uses it, then a blank line
  2. stdlib
  3. blank line
  4. third party (`numpy`, `pxr`, `omni.*`, `carb`, …)
  5. blank line
  6. local / same-directory helpers (`from scan_grid_geometry import …`, etc.)
- Sort names alphabetically within each block when practical; avoid unused imports.
- Keep changes minimal: match naming, patterns, and error-handling style of the file.

## Formatting conventions (manual; no `repo format`)

There is **no** automated formatter in this repo. Still follow these so edits resemble what **Black**
and **isort** would do—small diffs, predictable layout, easier future adoption if you add Ruff/Black later.

- **Indentation:** 4 spaces; never tabs.
- **Line length:** wrap long lines around **88–100** columns when it stays readable; prefer parentheses for continuation over backslashes.
- **Quotes:** prefer **double-quoted** strings in new or heavily touched code; if a file is overwhelmingly single-quoted, match that file.
- **Trailing commas:** use in multi-line calls, literals, and collections so the next line is a one-line diff.
- **Blank lines (PEP 8):** two blank lines before top-level `def`/`class`; one blank line between methods; single blank line between logical sections inside a function when it helps.
- **Spacing:** single space after commas and around `=` in keyword/default arguments; no extra spaces inside `()`, `[]`, `{}` unless aligning a deliberate block (rare).
- **Dict / comprehensions:** prefer breaking across lines with trailing commas when they would exceed the line-length target.

## Lint and CI

- No project-enforced **Black / Ruff / isort** config is committed; do not assume a formatter runs in CI.
- If you add local checks, scope them to `scripts/` (and any other Python roots you introduce).

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.