010-d4-yaml-config

010-d4-yaml-config is a cursor rule for Cursor from pblagoje/mcp-ollama-python. It costs 570 tokens per session, scanned A, original, MIT.

A project rule describing how d4-family YAML configuration is loaded and combined. Settings come from packaged defaults, an optional home configuration, and environment variables, with higher-priority values overriding lower-priority ones.

In plain words
What is it for?
Use it when adding, troubleshooting, or reviewing d4 YAML settings, including home overrides and environment-based changes.
Why use it?
It prevents configuration errors caused by using the wrong file location, merge order, or environment-variable format.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when adding, troubleshooting, or reviewing d4 YAML settings, including home overrides and environment-based changes.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/pblagoje/mcp-ollama-python/010-d4-yaml-config
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/pblagoje/mcp-ollama-python

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for 010-d4-yaml-config

README.md
[![agentmods](https://agentmods.dev/badge/rules/pblagoje/mcp-ollama-python/010-d4-yaml-config.svg)](https://agentmods.dev/rules/pblagoje/mcp-ollama-python/010-d4-yaml-config)
Your own site
<a href="https://agentmods.dev/rules/pblagoje/mcp-ollama-python/010-d4-yaml-config"><img src="https://agentmods.dev/badge/rules/pblagoje/mcp-ollama-python/010-d4-yaml-config.svg" alt="Measured on agentmods" height="20"></a>
Per session 570 This file is loaded in full into every session.
When invoked 570 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00570 $0.00570
Opus 5 $0.00285 $0.00285
Sonnet 5 $0.00114 $0.00114
Haiku 4.5 $0.00057 $0.00057

Measured 7d ago against content hash 3cb04b94f0b7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

010-d4-yaml-config scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/010-d4-yaml-config.mdc · 55 lines

What it actually says

d4 YAML configuration (YamlClass)

Canonical doc: docs/D4_YAML.md · implementation: src/d4/base/d4_yaml.py.

Precedence (highest wins)

  1. Environment variable — overrides an existing leaf only
  2. Home YAML — deep-merged when present
  3. Module YAML — packaged/repo default under config/
result = module_yaml
result = deep_merge(result, home_yaml)   # optional
result = apply_env_overrides(result)     # leaf keys only

Missing module YAML → FileNotFoundError. Missing home/env is OK.

Paths

Layer Location
Module config/<file>.yaml (cwd / package / class-adjacent); no absolutes, no ..
Home (get_yaml) ~/.{config_name}/config/{config_name}.yaml
d4-family seed ~/.d4/{module}/.../config/*.yamlcopy once, never overwrite user files

YamlClass does not create/copy home files; packages seed their own trees.

Env overrides

  • Dotted uppercase paths: SECTION.SUB.KEY (preferred) or {YAML_STEM}.SECTION.SUB.KEY
  • Not underscore-joined (PROVIDERS_REGISTRY_... is wrong)
  • Underscores inside key names are kept (AZURE_OPEN_AI)
  • Env cannot invent new keys; type-coerced to existing YAML type
  • Optional ${VAR} in YAML text via pyaml-env (fallback: yaml.safe_load)

Development rules

  • Load config with YamlClass().get_yaml(...) — not ad-hoc open + yaml.safe_load for app config
  • Prefer safe_load for raw strings; strip logger/stdout pollution if decrypting secrets
  • Secrets → env or ~/.d4/env/... / PGP — not committed module YAML
  • When adding config keys: put defaults in module YAML; document env dotted path; allow home override
  • Deep merge: nested dicts recurse; lists/scalars replaced wholesale
from d4.base.d4_yaml import YamlClass
cfg = YamlClass().get_yaml("myconfig.yaml")
# or YamlClass().get_yaml(SomeClass)  # → config/<ClassName>.yaml + ~/.SomeClass/...
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 55 lines · 570 tokens per session scan A 3cb04b94f0b7

Subscribe to this mod's changes

010-d4-yaml-config is a cursor rule published in the GitHub repository pblagoje/mcp-ollama-python (5 stars, last pushed 15d ago), licensed MIT. It adds 570 tokens to every session, about $0.0029 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.