engineering-principles

engineering-principles is a cursor rule for coding agents from adonai-labs/agent-runway. It costs 1,448 tokens per session, scanned A, original, MIT.

A set of language- and framework-independent guidelines for writing and reviewing software. It covers simplicity, code structure, naming, error handling, testing, and design.

In plain words
What is it for?
Use it while writing, reviewing, or reasoning about code in any programming language or project layer.
Why use it?
It helps avoid unnecessary complexity and code that is hard to understand, change, or test.

Cursor rule

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.

agentmods
npx agentmods add rules/adonai-labs/agent-runway/engineering-principles
Clone the repo
git clone --depth 1 https://github.com/adonai-labs/agent-runway

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 engineering-principles

README.md
[![agentmods](https://agentmods.dev/badge/rules/adonai-labs/agent-runway/engineering-principles.svg)](https://agentmods.dev/rules/adonai-labs/agent-runway/engineering-principles)
Your own site
<a href="https://agentmods.dev/rules/adonai-labs/agent-runway/engineering-principles"><img src="https://agentmods.dev/badge/rules/adonai-labs/agent-runway/engineering-principles.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,448 This file is loaded in full into every session.
When invoked 1,448 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.01448 $0.01448
Opus 5 $0.00724 $0.00724
Sonnet 5 $0.00290 $0.00290
Haiku 4.5 $0.00145 $0.00145

Measured 3d ago against content hash 9b19d1d2227b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

engineering-principles 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 3d 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.

src/core/rules/engineering-principles.mdc · 200 lines

How it starts

The opening of the file, as written. The whole thing — 200 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Engineering Principles

These principles apply to all code, regardless of language, framework, or layer.


Simplicity first

Write the simplest solution that correctly solves the current problem.

  • Do not design for hypothetical futures
  • Earn complexity before introducing it
  • Every abstraction must isolate real instability or real variation
  • If you cannot explain why a layer or pattern exists here, it probably should not

Single reason to change

Each module, class, or function should have one reason to change.

  • Group things that change together for the same reason
  • Separate things that change for different reasons
  • A class that mixes HTTP concerns, business rules, and persistence has too many reasons to change

Naming communicates intent

Names are the primary documentation.

  • Name variables, functions, and types for what they represent, not how they are implemented
  • Avoid abbreviations, single-letter variables (except loop counters), and generic names (Manager, Helper, Utils, Service without qualification)
  • A function named Process tells nothing; PlaceOrder or ValidatePayment communicates intent
  • If a name needs a comment to explain it, the name is not good enough

Keep files and classes maintainable

Large files are a design smell even when the code still works.

  • Prefer files and classes under 600 lines
  • Treat 600-800 lines as a warning zone that requires an explicit reason
  • Do not create or grow files/classes beyond 800 lines without a strong architectural justification
  • Split by responsibility, not by arbitrary line count
  • Generated files, migrations, snapshots, lockfiles, and vendor files are exempt

Functions do one thing

  • Functions should be short, focused, and at a single level of abstraction
  • Extract sub-steps into well-named helper functions rather than layering nested conditionals and logic in one place
  • A function doing more than one thing is a candidate for extraction
  • Side effects should be obvious from the name and placement

Read the full file on GitHub · 200 lines

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. 3d ago First seen · 200 lines · 1,448 tokens per session scan A 9b19d1d2227b

Subscribe to this mod's changes

engineering-principles is a cursor rule published in the GitHub repository adonai-labs/agent-runway (2 stars, last pushed 13d ago), licensed MIT. It adds 1,448 tokens to every session, about $0.0072 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.