matryca-plumber / rules
Cursor rule99 starsChanged 4 months agoApache-2.0View on GitHub
Keep .env.example in sync when adding or changing environment variables (operator vs advanced tiers).
- Reads credentials
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 repository26 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/00-karpathy-agent-behavior.mdcCursor rule
- .cursor/rules/01-core-paradigm.mdcCursor rule
- .cursor/rules/02-python-standards.mdcCursor rule
- .cursor/rules/03-logseq-api.mdcCursor rule
- .cursor/rules/04-spatial-parser.mdcCursor rule
- .cursor/rules/05-release-preparation.mdcCursor rule
- .cursor/rules/06-auto-changelog.mdcCursor rule
- .cursor/rules/08-github-workflow-standards.mdcCursor rule
- .cursor/rules/09-github-identity-marco-porcellato.mdcCursor rule
- .cursor/rules/10-tooling-static-analysis-policy.mdcCursor rule
- .cursor/rules/11-prompt-maintainer.mdcCursor rule
- .cursor/rules/12-clean-code-architecture.mdcCursor rule
- llms.txtllms.txt
- .well-known/llms.txtllms.txt
- matryca-changelogSkill
- matryca-clean-architectureSkill
- matryca-envSkill
- matryca-githubSkill
- matryca-logseq-ioSkill
- matryca-logseq-paradigmSkill
- matryca-prompt-maintainerSkill
- matryca-python-standardsSkill
- matryca-releaseSkill
- matryca-spatial-parserSkill
The file
We split this 07-env-example.mdc into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
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
- Very specific: line 8
When you add, rename, or change the default of any environment variable read from os.environ / load_plumber_lint_config_from_environ / UI …
- Very specific: line 19
Do not edit the operator's local .env unless they explicitly ask.
- Very specific: line 42
Default (code): must match the actual fallback in code (plumber_config.py, module _DEFAULT_*, or _map_bool(..., True)).
- Very specific: line 60
If the env change is user-visible, also add a bullet under CHANGELOG.md ## [Unreleased] per .cursor/rules/06-auto-changelog.mdc.
≈ “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.
Files
---
description: Keep .env.example in sync when adding or changing environment variables (operator vs advanced tiers).
globs: src/**/*.py,.env.example
---
# `.env.example` maintenance (mandatory)
When you **add, rename, or change the default** of any environment variable read from `os.environ` / `load_plumber_lint_config_from_environ` / UI `_ENV_KEY_MAP`, update [`.env.example`](.env.example) in the **same task** — without waiting for the user to ask.
## When to update
| Trigger | Action |
|---------|--------|
| New `os.environ.get("MATRYCA_…")`, `_env_int`, `_map_bool(env, …)`, or `_*_ENV = "…"` in `src/` | Add key to `.env.example` in the correct tier |
| Changed Python default (e.g. `DEFAULT_*`, `_map_*` fallback, dataclass default) | Update **Default (code)** comment; adjust **Template** only if the safe install profile should change |
| New Settings field → `_ENV_KEY_MAP` in `ui_server.py` | Document under **Operator essentials** (UI-exposed keys) |
| Variable becomes **deprecated** or **reserved** (not read) | Move to deprecated block; add to `tests/test_env_example_coverage.py` `_ALLOWLIST_UNREAD` if still listed |
Do **not** edit the operator's local `.env` unless they explicitly ask.
## File structure (two tiers)
```text
[Header + legend]
=== OPERATOR ESSENTIALS === ← paths, LLM, thermal, map-reduce, low-priority, basic UI token
=== ADVANCED / HIGH IMPACT === ← explicit WARNING banner; mutating lint, compression, MCP, flock, limits, edge
```
- **Operator essentials:** settings mirrored in the Sovereign UI or needed on day one (`LOGSEQ_GRAPH_PATH`, LLM URL/model, thermal, map-reduce, `MATRYCA_PLUMBER_LOW_PRIORITY_MODE`, `MATRYCA_UI_TOKEN` / LAN basics).
- **Advanced / high impact:** mutating graph behavior, security surface expansion, diagnostics that leak data, or tuning that can corrupt prompts/cache — prefix section with a clear **do not change unless you understand the risk** banner.
## Per-key comment block (required)
```bash
# <What it does — one sentence>. <src/module.py>
# Default (code): <value when unset/empty in Python>
# Template: <value on the line below for new installs; omit line if same as Default (code)>
# Range / notes: <clamps, security, when to enable> (optional)
KEY=value
```
- **Default (code)** must match the actual fallback in code (`plumber_config.py`, module `_DEFAULT_*`, or `_map_bool(..., True)`).
- **Template** is the safe 16GB / test-vault profile (often `false` for mutating lint). If Template differs from Default (code), state both.
- Cite the resolving function or file path (e.g. `src/agent/llm_client.py`).
## LLM key precedence (document in header)
- `LLM_BASE_URL` / `LLM_MODEL_NAME` override `MATRYCA_LM_*` when non-empty; Settings UI persists `LLM_*`.
## Verification (same task)
```bash
uv run pytest tests/test_env_example_coverage.py -q --no-cov
```
Fix allowlist only for **reserved** (`MATRYCA_LLM_PROMPT_CACHE_MODE`) or **deprecated** (`MATRYCA_LM_INSTRUCTOR_*`) keys not read by runtime.
## Changelog
If the env change is user-visible, also add a bullet under `CHANGELOG.md` `## [Unreleased]` per [`.cursor/rules/06-auto-changelog.mdc`](06-auto-changelog.mdc).
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
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.

