agentleFS
MarcoPorcellatoMarcoPorcellato/matryca-plumber/.cursor/rules/02-python-standards.mdc

matryca-plumber / rules

Cursor rule99 starsChanged 4 months agoApache-2.0View on GitHub

Python coding standards, libraries, and concurrency safety

The file

We split this 02-python-standards.mdc into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    Always instruct the user to run make check to validate code (formatting, linting, mypy strict, pytest).

    line 8
  2. Distinctive:

    Validation: use Pydantic models for config, JSON payloads, and boundaries.

    line 13
  3. Distinctive:

    Zero-Byte / Ghost Files: Always implement early-exit guards for empty or whitespace-only files to prevent crashes.

    line 18
  4. Very specific:

    Use structured logging via loguru.

    line 21
  5. Distinctive:

    Do not log full note bodies to stdout.

    line 22

≈ “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
02-python-standards.mdc
---
description: Python coding standards, libraries, and concurrency safety
globs: "*.py"
---

## Dependency management and developer experience
- **Dependency Management & DX:** Strictly use **`uv`** (never `pip`). 
- Always instruct the user to run **`make check`** to validate code (formatting, linting, mypy strict, pytest). Code is not ready until all tests pass with zero warnings.

## Runtime and quality
- **Python:** target **3.12+**.
- **Types:** annotate public APIs; `mypy` must type-check the package on `--strict` mode.
- **Validation:** use **Pydantic** models for config, JSON payloads, and boundaries.
- **Architecture:** layer boundaries and Clean Code checklist — see [`12-clean-code-architecture.mdc`](12-clean-code-architecture.mdc) and [`docs/CLEAN_CODE_ARCHITECTURE.md`](../../docs/CLEAN_CODE_ARCHITECTURE.md).

## Concurrency and I/O (File System Safety)
- **Optimistic Concurrency:** Matryca runs in the background. Before overwriting any `.md` file, you MUST check if the file's `mtime` has changed since it was read. Use `atomic_write_bytes_if_unchanged` to prevent data loss if the user is typing in Logseq.
- **Zero-Byte / Ghost Files:** Always implement early-exit guards for empty or whitespace-only files to prevent crashes.

## Observability
- Use structured logging via **`loguru`**.
- Do not log full note bodies to stdout.

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.