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.
git clone --depth 1 https://github.com/pblagoje/mcp-ollama-pythonWrote 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.
[](https://agentmods.dev/rules/pblagoje/mcp-ollama-python/010-d4-yaml-config)<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>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.
| Model | Per session | Once 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 |
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.
What it actually says
d4 YAML configuration (YamlClass)
Canonical doc: docs/D4_YAML.md · implementation: src/d4/base/d4_yaml.py.
Precedence (highest wins)
- Environment variable — overrides an existing leaf only
- Home YAML — deep-merged when present
- 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/*.yaml — copy 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 viapyaml-env(fallback:yaml.safe_load)
Development rules
- Load config with
YamlClass().get_yaml(...)— not ad-hocopen+yaml.safe_loadfor app config - Prefer
safe_loadfor 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/...
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.
- 7d ago First seen · 55 lines · 570 tokens per session scan A 3cb04b94f0b7
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.
Other cursor rules, from other repositories
cursor
You are working on the checkout service. Preserve transaction integrity and auditability.
cursor-fable-rules
Fable coding lifecycle discipline and situational awareness for Cursor.
002-verify-before-act
Requires Claude to read before writing, verify before installing, and confirm before destructive operations.
swift-development
Swift development: SwiftUI, Combine, async/await, iOS patterns, and Apple platform conventions.
design-patterns
Design patterns (GoF) and file size conventions for sweagent TypeScript codebase.
database
Cursor rule "database" from ItamarZand88/awesome-agent-conventions, covering database best practices, prisma setup, prisma models, prisma queries and supabase setup.